]>
Commit | Line | Data |
---|---|---|
7449af73 | 1 | # This file was created automatically by SWIG 1.3.27. |
d55e5bfc RD |
2 | # Don't modify this file, modify the SWIG interface instead. |
3 | ||
4 | import _core_ | |
5 | ||
093d3ff1 RD |
6 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1): |
7 | if (name == "this"): | |
8 | if isinstance(value, class_type): | |
9 | self.__dict__[name] = value.this | |
10 | if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown | |
11 | del value.thisown | |
12 | return | |
13 | method = class_type.__swig_setmethods__.get(name,None) | |
14 | if method: return method(self,value) | |
15 | if (not static) or hasattr(self,name) or (name == "thisown"): | |
16 | self.__dict__[name] = value | |
17 | else: | |
18 | raise AttributeError("You cannot add attributes to %s" % self) | |
19 | ||
20 | def _swig_setattr(self,class_type,name,value): | |
21 | return _swig_setattr_nondynamic(self,class_type,name,value,0) | |
22 | ||
23 | def _swig_getattr(self,class_type,name): | |
24 | method = class_type.__swig_getmethods__.get(name,None) | |
25 | if method: return method(self) | |
26 | raise AttributeError,name | |
27 | ||
28 | import types | |
29 | try: | |
30 | _object = types.ObjectType | |
31 | _newclass = 1 | |
32 | except AttributeError: | |
33 | class _object : pass | |
34 | _newclass = 0 | |
35 | del types | |
36 | ||
37 | ||
38 | def _swig_setattr_nondynamic_method(set): | |
39 | def set_attr(self,name,value): | |
40 | if hasattr(self,name) or (name in ("this", "thisown")): | |
41 | set(self,name,value) | |
42 | else: | |
43 | raise AttributeError("You cannot add attributes to %s" % self) | |
44 | return set_attr | |
45 | ||
46 | ||
d55e5bfc RD |
47 | #// Give a reference to the dictionary of this module to the C++ extension |
48 | #// code. | |
49 | _core_._wxPySetDictionary(vars()) | |
50 | ||
51 | #// A little trick to make 'wx' be a reference to this module so wx.Names can | |
52 | #// be used here. | |
53 | import sys as _sys | |
54 | wx = _sys.modules[__name__] | |
55 | ||
c24da6d6 RD |
56 | |
57 | #---------------------------------------------------------------------------- | |
58 | ||
59 | def _deprecated(callable, msg=None): | |
60 | """ | |
61 | Create a wrapper function that will raise a DeprecationWarning | |
62 | before calling the callable. | |
63 | """ | |
64 | if msg is None: | |
65 | msg = "%s is deprecated" % callable | |
66 | def deprecatedWrapper(*args, **kwargs): | |
67 | import warnings | |
68 | warnings.warn(msg, DeprecationWarning, stacklevel=2) | |
69 | return callable(*args, **kwargs) | |
70 | deprecatedWrapper.__doc__ = msg | |
71 | return deprecatedWrapper | |
72 | ||
73 | ||
74 | #---------------------------------------------------------------------------- | |
75 | ||
d55e5bfc RD |
76 | NOT_FOUND = _core_.NOT_FOUND |
77 | VSCROLL = _core_.VSCROLL | |
78 | HSCROLL = _core_.HSCROLL | |
79 | CAPTION = _core_.CAPTION | |
80 | DOUBLE_BORDER = _core_.DOUBLE_BORDER | |
81 | SUNKEN_BORDER = _core_.SUNKEN_BORDER | |
82 | RAISED_BORDER = _core_.RAISED_BORDER | |
83 | BORDER = _core_.BORDER | |
84 | SIMPLE_BORDER = _core_.SIMPLE_BORDER | |
85 | STATIC_BORDER = _core_.STATIC_BORDER | |
86 | TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW | |
87 | NO_BORDER = _core_.NO_BORDER | |
57133d5c | 88 | DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER |
6d88e192 | 89 | DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE |
d55e5bfc RD |
90 | TAB_TRAVERSAL = _core_.TAB_TRAVERSAL |
91 | WANTS_CHARS = _core_.WANTS_CHARS | |
92 | POPUP_WINDOW = _core_.POPUP_WINDOW | |
93 | CENTER_FRAME = _core_.CENTER_FRAME | |
94 | CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN | |
95 | CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN | |
d55e5bfc RD |
96 | CLIP_CHILDREN = _core_.CLIP_CHILDREN |
97 | CLIP_SIBLINGS = _core_.CLIP_SIBLINGS | |
98 | ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB | |
99 | RETAINED = _core_.RETAINED | |
100 | BACKINGSTORE = _core_.BACKINGSTORE | |
101 | COLOURED = _core_.COLOURED | |
102 | FIXED_LENGTH = _core_.FIXED_LENGTH | |
103 | LB_NEEDED_SB = _core_.LB_NEEDED_SB | |
104 | LB_ALWAYS_SB = _core_.LB_ALWAYS_SB | |
105 | LB_SORT = _core_.LB_SORT | |
106 | LB_SINGLE = _core_.LB_SINGLE | |
107 | LB_MULTIPLE = _core_.LB_MULTIPLE | |
108 | LB_EXTENDED = _core_.LB_EXTENDED | |
109 | LB_OWNERDRAW = _core_.LB_OWNERDRAW | |
110 | LB_HSCROLL = _core_.LB_HSCROLL | |
111 | PROCESS_ENTER = _core_.PROCESS_ENTER | |
112 | PASSWORD = _core_.PASSWORD | |
113 | CB_SIMPLE = _core_.CB_SIMPLE | |
114 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
115 | CB_SORT = _core_.CB_SORT | |
116 | CB_READONLY = _core_.CB_READONLY | |
117 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
118 | RA_VERTICAL = _core_.RA_VERTICAL | |
119 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
120 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
fef4c27a | 121 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX |
d55e5bfc RD |
122 | RB_GROUP = _core_.RB_GROUP |
123 | RB_SINGLE = _core_.RB_SINGLE | |
d55e5bfc RD |
124 | SB_HORIZONTAL = _core_.SB_HORIZONTAL |
125 | SB_VERTICAL = _core_.SB_VERTICAL | |
fef4c27a | 126 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX |
d55e5bfc RD |
127 | ST_SIZEGRIP = _core_.ST_SIZEGRIP |
128 | ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE | |
129 | FLOOD_SURFACE = _core_.FLOOD_SURFACE | |
130 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
131 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
132 | WINDING_RULE = _core_.WINDING_RULE | |
133 | TOOL_TOP = _core_.TOOL_TOP | |
134 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
135 | TOOL_LEFT = _core_.TOOL_LEFT | |
136 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
137 | OK = _core_.OK | |
138 | YES_NO = _core_.YES_NO | |
139 | CANCEL = _core_.CANCEL | |
140 | YES = _core_.YES | |
141 | NO = _core_.NO | |
142 | NO_DEFAULT = _core_.NO_DEFAULT | |
143 | YES_DEFAULT = _core_.YES_DEFAULT | |
144 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION | |
145 | ICON_HAND = _core_.ICON_HAND | |
146 | ICON_QUESTION = _core_.ICON_QUESTION | |
147 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
148 | ICON_STOP = _core_.ICON_STOP | |
149 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
150 | ICON_MASK = _core_.ICON_MASK | |
151 | ICON_WARNING = _core_.ICON_WARNING | |
152 | ICON_ERROR = _core_.ICON_ERROR | |
153 | FORWARD = _core_.FORWARD | |
154 | BACKWARD = _core_.BACKWARD | |
155 | RESET = _core_.RESET | |
156 | HELP = _core_.HELP | |
157 | MORE = _core_.MORE | |
158 | SETUP = _core_.SETUP | |
159 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
160 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
161 | SIZE_AUTO = _core_.SIZE_AUTO | |
162 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
163 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
9d7dfdff | 164 | SIZE_FORCE = _core_.SIZE_FORCE |
d55e5bfc RD |
165 | PORTRAIT = _core_.PORTRAIT |
166 | LANDSCAPE = _core_.LANDSCAPE | |
167 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
168 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
169 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
170 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
171 | ID_ANY = _core_.ID_ANY | |
172 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
9d7dfdff | 173 | ID_NONE = _core_.ID_NONE |
d55e5bfc RD |
174 | ID_LOWEST = _core_.ID_LOWEST |
175 | ID_OPEN = _core_.ID_OPEN | |
176 | ID_CLOSE = _core_.ID_CLOSE | |
177 | ID_NEW = _core_.ID_NEW | |
178 | ID_SAVE = _core_.ID_SAVE | |
179 | ID_SAVEAS = _core_.ID_SAVEAS | |
180 | ID_REVERT = _core_.ID_REVERT | |
181 | ID_EXIT = _core_.ID_EXIT | |
182 | ID_UNDO = _core_.ID_UNDO | |
183 | ID_REDO = _core_.ID_REDO | |
184 | ID_HELP = _core_.ID_HELP | |
185 | ID_PRINT = _core_.ID_PRINT | |
186 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
187 | ID_PREVIEW = _core_.ID_PREVIEW | |
188 | ID_ABOUT = _core_.ID_ABOUT | |
189 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
190 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
191 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
192 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
193 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL | |
194 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
195 | ID_CUT = _core_.ID_CUT | |
196 | ID_COPY = _core_.ID_COPY | |
197 | ID_PASTE = _core_.ID_PASTE | |
198 | ID_CLEAR = _core_.ID_CLEAR | |
199 | ID_FIND = _core_.ID_FIND | |
200 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
201 | ID_SELECTALL = _core_.ID_SELECTALL | |
202 | ID_DELETE = _core_.ID_DELETE | |
203 | ID_REPLACE = _core_.ID_REPLACE | |
204 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
205 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
206 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
207 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
208 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
209 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
210 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
211 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
212 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
213 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
214 | ID_FILE1 = _core_.ID_FILE1 | |
215 | ID_FILE2 = _core_.ID_FILE2 | |
216 | ID_FILE3 = _core_.ID_FILE3 | |
217 | ID_FILE4 = _core_.ID_FILE4 | |
218 | ID_FILE5 = _core_.ID_FILE5 | |
219 | ID_FILE6 = _core_.ID_FILE6 | |
220 | ID_FILE7 = _core_.ID_FILE7 | |
221 | ID_FILE8 = _core_.ID_FILE8 | |
222 | ID_FILE9 = _core_.ID_FILE9 | |
223 | ID_OK = _core_.ID_OK | |
224 | ID_CANCEL = _core_.ID_CANCEL | |
225 | ID_APPLY = _core_.ID_APPLY | |
226 | ID_YES = _core_.ID_YES | |
227 | ID_NO = _core_.ID_NO | |
228 | ID_STATIC = _core_.ID_STATIC | |
229 | ID_FORWARD = _core_.ID_FORWARD | |
230 | ID_BACKWARD = _core_.ID_BACKWARD | |
231 | ID_DEFAULT = _core_.ID_DEFAULT | |
232 | ID_MORE = _core_.ID_MORE | |
233 | ID_SETUP = _core_.ID_SETUP | |
234 | ID_RESET = _core_.ID_RESET | |
235 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
236 | ID_YESTOALL = _core_.ID_YESTOALL | |
237 | ID_NOTOALL = _core_.ID_NOTOALL | |
238 | ID_ABORT = _core_.ID_ABORT | |
239 | ID_RETRY = _core_.ID_RETRY | |
240 | ID_IGNORE = _core_.ID_IGNORE | |
0f63ec68 RD |
241 | ID_ADD = _core_.ID_ADD |
242 | ID_REMOVE = _core_.ID_REMOVE | |
243 | ID_UP = _core_.ID_UP | |
244 | ID_DOWN = _core_.ID_DOWN | |
245 | ID_HOME = _core_.ID_HOME | |
246 | ID_REFRESH = _core_.ID_REFRESH | |
247 | ID_STOP = _core_.ID_STOP | |
248 | ID_INDEX = _core_.ID_INDEX | |
249 | ID_BOLD = _core_.ID_BOLD | |
250 | ID_ITALIC = _core_.ID_ITALIC | |
251 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
252 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
253 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
254 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
255 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
256 | ID_INDENT = _core_.ID_INDENT | |
257 | ID_UNINDENT = _core_.ID_UNINDENT | |
258 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
259 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
260 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
261 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
262 | ID_UNDELETE = _core_.ID_UNDELETE | |
263 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
d55e5bfc RD |
264 | ID_HIGHEST = _core_.ID_HIGHEST |
265 | OPEN = _core_.OPEN | |
266 | SAVE = _core_.SAVE | |
267 | HIDE_READONLY = _core_.HIDE_READONLY | |
268 | OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT | |
269 | FILE_MUST_EXIST = _core_.FILE_MUST_EXIST | |
270 | MULTIPLE = _core_.MULTIPLE | |
271 | CHANGE_DIR = _core_.CHANGE_DIR | |
272 | ACCEL_ALT = _core_.ACCEL_ALT | |
273 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
274 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
275 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
276 | PD_AUTO_HIDE = _core_.PD_AUTO_HIDE | |
277 | PD_APP_MODAL = _core_.PD_APP_MODAL | |
278 | PD_CAN_ABORT = _core_.PD_CAN_ABORT | |
279 | PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME | |
280 | PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME | |
281 | PD_REMAINING_TIME = _core_.PD_REMAINING_TIME | |
62d32a5f RD |
282 | PD_SMOOTH = _core_.PD_SMOOTH |
283 | PD_CAN_SKIP = _core_.PD_CAN_SKIP | |
d55e5bfc RD |
284 | DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON |
285 | DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE | |
286 | MENU_TEAROFF = _core_.MENU_TEAROFF | |
287 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
288 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
289 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
290 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
291 | LI_VERTICAL = _core_.LI_VERTICAL | |
292 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
293 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
294 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
295 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
296 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
297 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
298 | MM_TEXT = _core_.MM_TEXT | |
299 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
300 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
301 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
302 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
303 | MM_TWIPS = _core_.MM_TWIPS | |
304 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
305 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
306 | MM_POINTS = _core_.MM_POINTS | |
307 | MM_METRIC = _core_.MM_METRIC | |
308 | CENTRE = _core_.CENTRE | |
309 | CENTER = _core_.CENTER | |
310 | HORIZONTAL = _core_.HORIZONTAL | |
311 | VERTICAL = _core_.VERTICAL | |
312 | BOTH = _core_.BOTH | |
313 | LEFT = _core_.LEFT | |
314 | RIGHT = _core_.RIGHT | |
315 | UP = _core_.UP | |
316 | DOWN = _core_.DOWN | |
317 | TOP = _core_.TOP | |
318 | BOTTOM = _core_.BOTTOM | |
319 | NORTH = _core_.NORTH | |
320 | SOUTH = _core_.SOUTH | |
321 | WEST = _core_.WEST | |
322 | EAST = _core_.EAST | |
323 | ALL = _core_.ALL | |
324 | ALIGN_NOT = _core_.ALIGN_NOT | |
325 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
326 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
327 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
328 | ALIGN_TOP = _core_.ALIGN_TOP | |
329 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
330 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
331 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
332 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
333 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
334 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
335 | ALIGN_MASK = _core_.ALIGN_MASK | |
336 | STRETCH_NOT = _core_.STRETCH_NOT | |
337 | SHRINK = _core_.SHRINK | |
338 | GROW = _core_.GROW | |
339 | EXPAND = _core_.EXPAND | |
340 | SHAPED = _core_.SHAPED | |
341 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
342 | TILE = _core_.TILE | |
343 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
344 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
345 | BORDER_NONE = _core_.BORDER_NONE | |
346 | BORDER_STATIC = _core_.BORDER_STATIC | |
347 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
348 | BORDER_RAISED = _core_.BORDER_RAISED | |
349 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
350 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
351 | BORDER_MASK = _core_.BORDER_MASK | |
0f63ec68 RD |
352 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM |
353 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
354 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
d55e5bfc RD |
355 | DEFAULT = _core_.DEFAULT |
356 | DECORATIVE = _core_.DECORATIVE | |
357 | ROMAN = _core_.ROMAN | |
358 | SCRIPT = _core_.SCRIPT | |
359 | SWISS = _core_.SWISS | |
360 | MODERN = _core_.MODERN | |
361 | TELETYPE = _core_.TELETYPE | |
362 | VARIABLE = _core_.VARIABLE | |
363 | FIXED = _core_.FIXED | |
364 | NORMAL = _core_.NORMAL | |
365 | LIGHT = _core_.LIGHT | |
366 | BOLD = _core_.BOLD | |
367 | ITALIC = _core_.ITALIC | |
368 | SLANT = _core_.SLANT | |
369 | SOLID = _core_.SOLID | |
370 | DOT = _core_.DOT | |
371 | LONG_DASH = _core_.LONG_DASH | |
372 | SHORT_DASH = _core_.SHORT_DASH | |
373 | DOT_DASH = _core_.DOT_DASH | |
374 | USER_DASH = _core_.USER_DASH | |
375 | TRANSPARENT = _core_.TRANSPARENT | |
376 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
377 | STIPPLE_MASK = _core_.STIPPLE_MASK |
378 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
d55e5bfc RD |
379 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH |
380 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
381 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
382 | CROSS_HATCH = _core_.CROSS_HATCH | |
383 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
384 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
385 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
386 | JOIN_MITER = _core_.JOIN_MITER | |
387 | JOIN_ROUND = _core_.JOIN_ROUND | |
388 | CAP_ROUND = _core_.CAP_ROUND | |
389 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
390 | CAP_BUTT = _core_.CAP_BUTT | |
391 | CLEAR = _core_.CLEAR | |
392 | XOR = _core_.XOR | |
393 | INVERT = _core_.INVERT | |
394 | OR_REVERSE = _core_.OR_REVERSE | |
395 | AND_REVERSE = _core_.AND_REVERSE | |
396 | COPY = _core_.COPY | |
397 | AND = _core_.AND | |
398 | AND_INVERT = _core_.AND_INVERT | |
399 | NO_OP = _core_.NO_OP | |
400 | NOR = _core_.NOR | |
401 | EQUIV = _core_.EQUIV | |
402 | SRC_INVERT = _core_.SRC_INVERT | |
403 | OR_INVERT = _core_.OR_INVERT | |
404 | NAND = _core_.NAND | |
405 | OR = _core_.OR | |
406 | SET = _core_.SET | |
407 | WXK_BACK = _core_.WXK_BACK | |
408 | WXK_TAB = _core_.WXK_TAB | |
409 | WXK_RETURN = _core_.WXK_RETURN | |
410 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
411 | WXK_SPACE = _core_.WXK_SPACE | |
412 | WXK_DELETE = _core_.WXK_DELETE | |
413 | WXK_START = _core_.WXK_START | |
414 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
415 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
416 | WXK_CANCEL = _core_.WXK_CANCEL | |
417 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
418 | WXK_CLEAR = _core_.WXK_CLEAR | |
419 | WXK_SHIFT = _core_.WXK_SHIFT | |
420 | WXK_ALT = _core_.WXK_ALT | |
421 | WXK_CONTROL = _core_.WXK_CONTROL | |
422 | WXK_MENU = _core_.WXK_MENU | |
423 | WXK_PAUSE = _core_.WXK_PAUSE | |
424 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
425 | WXK_PRIOR = _core_.WXK_PRIOR | |
426 | WXK_NEXT = _core_.WXK_NEXT | |
427 | WXK_END = _core_.WXK_END | |
428 | WXK_HOME = _core_.WXK_HOME | |
429 | WXK_LEFT = _core_.WXK_LEFT | |
430 | WXK_UP = _core_.WXK_UP | |
431 | WXK_RIGHT = _core_.WXK_RIGHT | |
432 | WXK_DOWN = _core_.WXK_DOWN | |
433 | WXK_SELECT = _core_.WXK_SELECT | |
434 | WXK_PRINT = _core_.WXK_PRINT | |
435 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
436 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
437 | WXK_INSERT = _core_.WXK_INSERT | |
438 | WXK_HELP = _core_.WXK_HELP | |
439 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
440 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
441 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
442 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
443 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
444 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
445 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
446 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
447 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
448 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
449 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
450 | WXK_ADD = _core_.WXK_ADD | |
451 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
452 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
453 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
454 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
455 | WXK_F1 = _core_.WXK_F1 | |
456 | WXK_F2 = _core_.WXK_F2 | |
457 | WXK_F3 = _core_.WXK_F3 | |
458 | WXK_F4 = _core_.WXK_F4 | |
459 | WXK_F5 = _core_.WXK_F5 | |
460 | WXK_F6 = _core_.WXK_F6 | |
461 | WXK_F7 = _core_.WXK_F7 | |
462 | WXK_F8 = _core_.WXK_F8 | |
463 | WXK_F9 = _core_.WXK_F9 | |
464 | WXK_F10 = _core_.WXK_F10 | |
465 | WXK_F11 = _core_.WXK_F11 | |
466 | WXK_F12 = _core_.WXK_F12 | |
467 | WXK_F13 = _core_.WXK_F13 | |
468 | WXK_F14 = _core_.WXK_F14 | |
469 | WXK_F15 = _core_.WXK_F15 | |
470 | WXK_F16 = _core_.WXK_F16 | |
471 | WXK_F17 = _core_.WXK_F17 | |
472 | WXK_F18 = _core_.WXK_F18 | |
473 | WXK_F19 = _core_.WXK_F19 | |
474 | WXK_F20 = _core_.WXK_F20 | |
475 | WXK_F21 = _core_.WXK_F21 | |
476 | WXK_F22 = _core_.WXK_F22 | |
477 | WXK_F23 = _core_.WXK_F23 | |
478 | WXK_F24 = _core_.WXK_F24 | |
479 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
480 | WXK_SCROLL = _core_.WXK_SCROLL | |
481 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
482 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
483 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
484 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
485 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
486 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
487 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
488 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
489 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
490 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
491 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
492 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
493 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
494 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
495 | WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR | |
496 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
497 | WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT | |
498 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
499 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
500 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
501 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
502 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
503 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
504 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
505 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
506 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
507 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
508 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
509 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
510 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
511 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
512 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
88c6b281 RD |
513 | WXK_COMMAND = _core_.WXK_COMMAND |
514 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
515 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
516 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
517 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
518 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
519 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
520 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
521 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
522 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
523 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
524 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
525 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
526 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
527 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
528 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
529 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
530 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
531 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
532 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
533 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
d55e5bfc RD |
534 | PAPER_NONE = _core_.PAPER_NONE |
535 | PAPER_LETTER = _core_.PAPER_LETTER | |
536 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
537 | PAPER_A4 = _core_.PAPER_A4 | |
538 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
539 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
540 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
541 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
542 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
543 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
544 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
545 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
546 | PAPER_A3 = _core_.PAPER_A3 | |
547 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
548 | PAPER_A5 = _core_.PAPER_A5 | |
549 | PAPER_B4 = _core_.PAPER_B4 | |
550 | PAPER_B5 = _core_.PAPER_B5 | |
551 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
552 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
553 | PAPER_10X14 = _core_.PAPER_10X14 | |
554 | PAPER_11X17 = _core_.PAPER_11X17 | |
555 | PAPER_NOTE = _core_.PAPER_NOTE | |
556 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
557 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
558 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
559 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
560 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
561 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
562 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
563 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
564 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
565 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
566 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
567 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
568 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
569 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
570 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
571 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
572 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
573 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
574 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
575 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
576 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
577 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
578 | PAPER_9X11 = _core_.PAPER_9X11 | |
579 | PAPER_10X11 = _core_.PAPER_10X11 | |
580 | PAPER_15X11 = _core_.PAPER_15X11 | |
581 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
582 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
583 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
584 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
585 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
586 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
587 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
588 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
589 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
590 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
591 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
592 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
593 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
594 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
595 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
596 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
597 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
598 | PAPER_A2 = _core_.PAPER_A2 | |
599 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
600 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
034e3677 RD |
601 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD |
602 | PAPER_A6 = _core_.PAPER_A6 | |
603 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
604 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
605 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
606 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
607 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
608 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
609 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
610 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
611 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
612 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
613 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
614 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
615 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
616 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
617 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
618 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
619 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
620 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
621 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
622 | PAPER_12X11 = _core_.PAPER_12X11 | |
623 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
624 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
625 | PAPER_P16K = _core_.PAPER_P16K | |
626 | PAPER_P32K = _core_.PAPER_P32K | |
627 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
628 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
629 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
630 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
631 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
632 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
633 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
634 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
635 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
636 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
637 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
638 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
639 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
640 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
641 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
642 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
643 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
644 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
645 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
646 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
647 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
648 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
649 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
650 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
d55e5bfc RD |
651 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX |
652 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
653 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
654 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
655 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
656 | ITEM_CHECK = _core_.ITEM_CHECK | |
657 | ITEM_RADIO = _core_.ITEM_RADIO | |
658 | ITEM_MAX = _core_.ITEM_MAX | |
659 | HT_NOWHERE = _core_.HT_NOWHERE | |
660 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
661 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
662 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
663 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
664 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
665 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
666 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
667 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
668 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
669 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
670 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
671 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
672 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
673 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
674 | HT_MAX = _core_.HT_MAX | |
675 | MOD_NONE = _core_.MOD_NONE | |
676 | MOD_ALT = _core_.MOD_ALT | |
677 | MOD_CONTROL = _core_.MOD_CONTROL | |
9d7dfdff | 678 | MOD_ALTGR = _core_.MOD_ALTGR |
d55e5bfc | 679 | MOD_SHIFT = _core_.MOD_SHIFT |
9d7dfdff | 680 | MOD_META = _core_.MOD_META |
d55e5bfc | 681 | MOD_WIN = _core_.MOD_WIN |
9d7dfdff RD |
682 | MOD_CMD = _core_.MOD_CMD |
683 | MOD_ALL = _core_.MOD_ALL | |
d55e5bfc RD |
684 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE |
685 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
686 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
687 | #--------------------------------------------------------------------------- | |
688 | ||
689 | class Object(object): | |
690 | """ | |
691 | The base class for most wx objects, although in wxPython not | |
692 | much functionality is needed nor exposed. | |
693 | """ | |
694 | def __init__(self): raise RuntimeError, "No constructor defined" | |
695 | def __repr__(self): | |
696 | return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
697 | def GetClassName(*args, **kwargs): | |
698 | """ | |
699 | GetClassName(self) -> String | |
700 | ||
701 | Returns the class name of the C++ class using wxRTTI. | |
702 | """ | |
703 | return _core_.Object_GetClassName(*args, **kwargs) | |
704 | ||
705 | def Destroy(*args, **kwargs): | |
706 | """ | |
707 | Destroy(self) | |
708 | ||
709 | Deletes the C++ object this Python object is a proxy for. | |
710 | """ | |
711 | return _core_.Object_Destroy(*args, **kwargs) | |
712 | ||
713 | ||
714 | class ObjectPtr(Object): | |
715 | def __init__(self, this): | |
716 | self.this = this | |
717 | if not hasattr(self,"thisown"): self.thisown = 0 | |
718 | self.__class__ = Object | |
719 | _core_.Object_swigregister(ObjectPtr) | |
720 | _wxPySetDictionary = _core_._wxPySetDictionary | |
721 | ||
722 | _wxPyFixStockObjects = _core_._wxPyFixStockObjects | |
723 | ||
724 | cvar = _core_.cvar | |
725 | EmptyString = cvar.EmptyString | |
726 | ||
727 | #--------------------------------------------------------------------------- | |
728 | ||
729 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID | |
730 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
731 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
732 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
733 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
734 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
735 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
736 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
737 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
738 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
739 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
740 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
741 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
742 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
743 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
744 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
745 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
746 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
747 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
748 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
749 | CURSOR_NONE = _core_.CURSOR_NONE | |
750 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
751 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
752 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
753 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
754 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
755 | CURSOR_HAND = _core_.CURSOR_HAND | |
756 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
757 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
758 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
759 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
760 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
761 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
762 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
763 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
764 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
765 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
766 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
767 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
768 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
769 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
770 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
771 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
772 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
773 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
774 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
775 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
776 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
777 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
778 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
779 | CURSOR_MAX = _core_.CURSOR_MAX | |
780 | #--------------------------------------------------------------------------- | |
781 | ||
782 | class Size(object): | |
783 | """ | |
79fccf9d | 784 | wx.Size is a useful data structure used to represent the size of |
093d3ff1 RD |
785 | something. It simply contians integer width and height |
786 | proprtites. In most places in wxPython where a wx.Size is | |
787 | expected a (width, height) tuple can be used instead. | |
d55e5bfc RD |
788 | """ |
789 | def __repr__(self): | |
790 | return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
791 | width = property(_core_.Size_width_get, _core_.Size_width_set) | |
792 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
793 | x = width; y = height | |
794 | def __init__(self, *args, **kwargs): | |
795 | """ | |
796 | __init__(self, int w=0, int h=0) -> Size | |
797 | ||
798 | Creates a size object. | |
799 | """ | |
800 | newobj = _core_.new_Size(*args, **kwargs) | |
801 | self.this = newobj.this | |
802 | self.thisown = 1 | |
803 | del newobj.thisown | |
804 | def __del__(self, destroy=_core_.delete_Size): | |
805 | """__del__(self)""" | |
806 | try: | |
807 | if self.thisown: destroy(self) | |
808 | except: pass | |
809 | ||
810 | def __eq__(*args, **kwargs): | |
811 | """ | |
812 | __eq__(self, Size sz) -> bool | |
813 | ||
814 | Test for equality of wx.Size objects. | |
815 | """ | |
816 | return _core_.Size___eq__(*args, **kwargs) | |
817 | ||
818 | def __ne__(*args, **kwargs): | |
819 | """ | |
820 | __ne__(self, Size sz) -> bool | |
821 | ||
822 | Test for inequality. | |
823 | """ | |
824 | return _core_.Size___ne__(*args, **kwargs) | |
825 | ||
826 | def __add__(*args, **kwargs): | |
827 | """ | |
828 | __add__(self, Size sz) -> Size | |
829 | ||
830 | Add sz's proprties to this and return the result. | |
831 | """ | |
832 | return _core_.Size___add__(*args, **kwargs) | |
833 | ||
834 | def __sub__(*args, **kwargs): | |
835 | """ | |
836 | __sub__(self, Size sz) -> Size | |
837 | ||
838 | Subtract sz's properties from this and return the result. | |
839 | """ | |
840 | return _core_.Size___sub__(*args, **kwargs) | |
841 | ||
842 | def IncTo(*args, **kwargs): | |
843 | """ | |
844 | IncTo(self, Size sz) | |
845 | ||
846 | Increments this object so that both of its dimensions are not less | |
847 | than the corresponding dimensions of the size. | |
848 | """ | |
849 | return _core_.Size_IncTo(*args, **kwargs) | |
850 | ||
851 | def DecTo(*args, **kwargs): | |
852 | """ | |
853 | DecTo(self, Size sz) | |
854 | ||
855 | Decrements this object so that both of its dimensions are not greater | |
856 | than the corresponding dimensions of the size. | |
857 | """ | |
858 | return _core_.Size_DecTo(*args, **kwargs) | |
859 | ||
860 | def Set(*args, **kwargs): | |
861 | """ | |
862 | Set(self, int w, int h) | |
863 | ||
864 | Set both width and height. | |
865 | """ | |
866 | return _core_.Size_Set(*args, **kwargs) | |
867 | ||
868 | def SetWidth(*args, **kwargs): | |
869 | """SetWidth(self, int w)""" | |
870 | return _core_.Size_SetWidth(*args, **kwargs) | |
871 | ||
872 | def SetHeight(*args, **kwargs): | |
873 | """SetHeight(self, int h)""" | |
874 | return _core_.Size_SetHeight(*args, **kwargs) | |
875 | ||
876 | def GetWidth(*args, **kwargs): | |
877 | """GetWidth(self) -> int""" | |
878 | return _core_.Size_GetWidth(*args, **kwargs) | |
879 | ||
880 | def GetHeight(*args, **kwargs): | |
881 | """GetHeight(self) -> int""" | |
882 | return _core_.Size_GetHeight(*args, **kwargs) | |
883 | ||
884 | def IsFullySpecified(*args, **kwargs): | |
885 | """ | |
886 | IsFullySpecified(self) -> bool | |
887 | ||
888 | Returns True if both components of the size are non-default values. | |
889 | """ | |
890 | return _core_.Size_IsFullySpecified(*args, **kwargs) | |
891 | ||
892 | def SetDefaults(*args, **kwargs): | |
893 | """ | |
894 | SetDefaults(self, Size size) | |
895 | ||
79fccf9d RD |
896 | Combine this size with the other one replacing the default components |
897 | of this object (i.e. equal to -1) with those of the other. | |
d55e5bfc RD |
898 | """ |
899 | return _core_.Size_SetDefaults(*args, **kwargs) | |
900 | ||
901 | def Get(*args, **kwargs): | |
902 | """ | |
903 | Get() -> (width,height) | |
904 | ||
905 | Returns the width and height properties as a tuple. | |
906 | """ | |
907 | return _core_.Size_Get(*args, **kwargs) | |
908 | ||
79fccf9d | 909 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
910 | def __str__(self): return str(self.Get()) |
911 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
912 | def __len__(self): return len(self.Get()) | |
913 | def __getitem__(self, index): return self.Get()[index] | |
914 | def __setitem__(self, index, val): | |
915 | if index == 0: self.width = val | |
916 | elif index == 1: self.height = val | |
917 | else: raise IndexError | |
918 | def __nonzero__(self): return self.Get() != (0,0) | |
919 | __safe_for_unpickling__ = True | |
920 | def __reduce__(self): return (wx.Size, self.Get()) | |
921 | ||
922 | ||
923 | class SizePtr(Size): | |
924 | def __init__(self, this): | |
925 | self.this = this | |
926 | if not hasattr(self,"thisown"): self.thisown = 0 | |
927 | self.__class__ = Size | |
928 | _core_.Size_swigregister(SizePtr) | |
929 | ||
930 | #--------------------------------------------------------------------------- | |
931 | ||
932 | class RealPoint(object): | |
933 | """ | |
79fccf9d RD |
934 | A data structure for representing a point or position with floating |
935 | point x and y properties. In wxPython most places that expect a | |
936 | wx.RealPoint can also accept a (x,y) tuple. | |
d55e5bfc RD |
937 | """ |
938 | def __repr__(self): | |
939 | return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
940 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) | |
941 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
942 | def __init__(self, *args, **kwargs): | |
943 | """ | |
944 | __init__(self, double x=0.0, double y=0.0) -> RealPoint | |
945 | ||
946 | Create a wx.RealPoint object | |
947 | """ | |
948 | newobj = _core_.new_RealPoint(*args, **kwargs) | |
949 | self.this = newobj.this | |
950 | self.thisown = 1 | |
951 | del newobj.thisown | |
952 | def __del__(self, destroy=_core_.delete_RealPoint): | |
953 | """__del__(self)""" | |
954 | try: | |
955 | if self.thisown: destroy(self) | |
956 | except: pass | |
957 | ||
958 | def __eq__(*args, **kwargs): | |
959 | """ | |
960 | __eq__(self, RealPoint pt) -> bool | |
961 | ||
962 | Test for equality of wx.RealPoint objects. | |
963 | """ | |
964 | return _core_.RealPoint___eq__(*args, **kwargs) | |
965 | ||
966 | def __ne__(*args, **kwargs): | |
967 | """ | |
968 | __ne__(self, RealPoint pt) -> bool | |
969 | ||
970 | Test for inequality of wx.RealPoint objects. | |
971 | """ | |
972 | return _core_.RealPoint___ne__(*args, **kwargs) | |
973 | ||
974 | def __add__(*args, **kwargs): | |
975 | """ | |
976 | __add__(self, RealPoint pt) -> RealPoint | |
977 | ||
978 | Add pt's proprties to this and return the result. | |
979 | """ | |
980 | return _core_.RealPoint___add__(*args, **kwargs) | |
981 | ||
982 | def __sub__(*args, **kwargs): | |
983 | """ | |
984 | __sub__(self, RealPoint pt) -> RealPoint | |
985 | ||
986 | Subtract pt's proprties from this and return the result | |
987 | """ | |
988 | return _core_.RealPoint___sub__(*args, **kwargs) | |
989 | ||
990 | def Set(*args, **kwargs): | |
991 | """ | |
992 | Set(self, double x, double y) | |
993 | ||
994 | Set both the x and y properties | |
995 | """ | |
996 | return _core_.RealPoint_Set(*args, **kwargs) | |
997 | ||
998 | def Get(*args, **kwargs): | |
999 | """ | |
1000 | Get() -> (x,y) | |
1001 | ||
1002 | Return the x and y properties as a tuple. | |
1003 | """ | |
1004 | return _core_.RealPoint_Get(*args, **kwargs) | |
1005 | ||
79fccf9d | 1006 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1007 | def __str__(self): return str(self.Get()) |
1008 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
1009 | def __len__(self): return len(self.Get()) | |
1010 | def __getitem__(self, index): return self.Get()[index] | |
1011 | def __setitem__(self, index, val): | |
1012 | if index == 0: self.x = val | |
1013 | elif index == 1: self.y = val | |
1014 | else: raise IndexError | |
1015 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1016 | __safe_for_unpickling__ = True | |
1017 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
1018 | ||
1019 | ||
1020 | class RealPointPtr(RealPoint): | |
1021 | def __init__(self, this): | |
1022 | self.this = this | |
1023 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1024 | self.__class__ = RealPoint | |
1025 | _core_.RealPoint_swigregister(RealPointPtr) | |
1026 | ||
1027 | #--------------------------------------------------------------------------- | |
1028 | ||
1029 | class Point(object): | |
1030 | """ | |
79fccf9d RD |
1031 | A data structure for representing a point or position with integer x |
1032 | and y properties. Most places in wxPython that expect a wx.Point can | |
1033 | also accept a (x,y) tuple. | |
d55e5bfc RD |
1034 | """ |
1035 | def __repr__(self): | |
1036 | return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1037 | x = property(_core_.Point_x_get, _core_.Point_x_set) | |
1038 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
1039 | def __init__(self, *args, **kwargs): | |
1040 | """ | |
1041 | __init__(self, int x=0, int y=0) -> Point | |
1042 | ||
1043 | Create a wx.Point object | |
1044 | """ | |
1045 | newobj = _core_.new_Point(*args, **kwargs) | |
1046 | self.this = newobj.this | |
1047 | self.thisown = 1 | |
1048 | del newobj.thisown | |
1049 | def __del__(self, destroy=_core_.delete_Point): | |
1050 | """__del__(self)""" | |
1051 | try: | |
1052 | if self.thisown: destroy(self) | |
1053 | except: pass | |
1054 | ||
1055 | def __eq__(*args, **kwargs): | |
1056 | """ | |
1057 | __eq__(self, Point pt) -> bool | |
1058 | ||
1059 | Test for equality of wx.Point objects. | |
1060 | """ | |
1061 | return _core_.Point___eq__(*args, **kwargs) | |
1062 | ||
1063 | def __ne__(*args, **kwargs): | |
1064 | """ | |
1065 | __ne__(self, Point pt) -> bool | |
1066 | ||
1067 | Test for inequality of wx.Point objects. | |
1068 | """ | |
1069 | return _core_.Point___ne__(*args, **kwargs) | |
1070 | ||
1071 | def __add__(*args, **kwargs): | |
1072 | """ | |
1073 | __add__(self, Point pt) -> Point | |
1074 | ||
1075 | Add pt's proprties to this and return the result. | |
1076 | """ | |
1077 | return _core_.Point___add__(*args, **kwargs) | |
1078 | ||
1079 | def __sub__(*args, **kwargs): | |
1080 | """ | |
1081 | __sub__(self, Point pt) -> Point | |
1082 | ||
1083 | Subtract pt's proprties from this and return the result | |
1084 | """ | |
1085 | return _core_.Point___sub__(*args, **kwargs) | |
1086 | ||
1087 | def __iadd__(*args, **kwargs): | |
1088 | """ | |
1089 | __iadd__(self, Point pt) -> Point | |
1090 | ||
1091 | Add pt to this object. | |
1092 | """ | |
1093 | return _core_.Point___iadd__(*args, **kwargs) | |
1094 | ||
1095 | def __isub__(*args, **kwargs): | |
1096 | """ | |
1097 | __isub__(self, Point pt) -> Point | |
1098 | ||
1099 | Subtract pt from this object. | |
1100 | """ | |
1101 | return _core_.Point___isub__(*args, **kwargs) | |
1102 | ||
1103 | def Set(*args, **kwargs): | |
1104 | """ | |
1105 | Set(self, long x, long y) | |
1106 | ||
1107 | Set both the x and y properties | |
1108 | """ | |
1109 | return _core_.Point_Set(*args, **kwargs) | |
1110 | ||
1111 | def Get(*args, **kwargs): | |
1112 | """ | |
1113 | Get() -> (x,y) | |
1114 | ||
1115 | Return the x and y properties as a tuple. | |
1116 | """ | |
1117 | return _core_.Point_Get(*args, **kwargs) | |
1118 | ||
79fccf9d | 1119 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1120 | def __str__(self): return str(self.Get()) |
1121 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1122 | def __len__(self): return len(self.Get()) | |
1123 | def __getitem__(self, index): return self.Get()[index] | |
1124 | def __setitem__(self, index, val): | |
1125 | if index == 0: self.x = val | |
1126 | elif index == 1: self.y = val | |
1127 | else: raise IndexError | |
1128 | def __nonzero__(self): return self.Get() != (0,0) | |
1129 | __safe_for_unpickling__ = True | |
1130 | def __reduce__(self): return (wx.Point, self.Get()) | |
1131 | ||
1132 | ||
1133 | class PointPtr(Point): | |
1134 | def __init__(self, this): | |
1135 | self.this = this | |
1136 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1137 | self.__class__ = Point | |
1138 | _core_.Point_swigregister(PointPtr) | |
1139 | ||
1140 | #--------------------------------------------------------------------------- | |
1141 | ||
1142 | class Rect(object): | |
1143 | """ | |
79fccf9d RD |
1144 | A class for representing and manipulating rectangles. It has x, y, |
1145 | width and height properties. In wxPython most palces that expect a | |
1146 | wx.Rect can also accept a (x,y,width,height) tuple. | |
d55e5bfc RD |
1147 | """ |
1148 | def __repr__(self): | |
1149 | return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1150 | def __init__(self, *args, **kwargs): | |
1151 | """ | |
1152 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect | |
1153 | ||
1154 | Create a new Rect object. | |
1155 | """ | |
1156 | newobj = _core_.new_Rect(*args, **kwargs) | |
1157 | self.this = newobj.this | |
1158 | self.thisown = 1 | |
1159 | del newobj.thisown | |
1160 | def __del__(self, destroy=_core_.delete_Rect): | |
1161 | """__del__(self)""" | |
1162 | try: | |
1163 | if self.thisown: destroy(self) | |
1164 | except: pass | |
1165 | ||
1166 | def GetX(*args, **kwargs): | |
1167 | """GetX(self) -> int""" | |
1168 | return _core_.Rect_GetX(*args, **kwargs) | |
1169 | ||
1170 | def SetX(*args, **kwargs): | |
1171 | """SetX(self, int x)""" | |
1172 | return _core_.Rect_SetX(*args, **kwargs) | |
1173 | ||
1174 | def GetY(*args, **kwargs): | |
1175 | """GetY(self) -> int""" | |
1176 | return _core_.Rect_GetY(*args, **kwargs) | |
1177 | ||
1178 | def SetY(*args, **kwargs): | |
1179 | """SetY(self, int y)""" | |
1180 | return _core_.Rect_SetY(*args, **kwargs) | |
1181 | ||
1182 | def GetWidth(*args, **kwargs): | |
1183 | """GetWidth(self) -> int""" | |
1184 | return _core_.Rect_GetWidth(*args, **kwargs) | |
1185 | ||
1186 | def SetWidth(*args, **kwargs): | |
1187 | """SetWidth(self, int w)""" | |
1188 | return _core_.Rect_SetWidth(*args, **kwargs) | |
1189 | ||
1190 | def GetHeight(*args, **kwargs): | |
1191 | """GetHeight(self) -> int""" | |
1192 | return _core_.Rect_GetHeight(*args, **kwargs) | |
1193 | ||
1194 | def SetHeight(*args, **kwargs): | |
1195 | """SetHeight(self, int h)""" | |
1196 | return _core_.Rect_SetHeight(*args, **kwargs) | |
1197 | ||
1198 | def GetPosition(*args, **kwargs): | |
1199 | """GetPosition(self) -> Point""" | |
1200 | return _core_.Rect_GetPosition(*args, **kwargs) | |
1201 | ||
1202 | def SetPosition(*args, **kwargs): | |
1203 | """SetPosition(self, Point p)""" | |
1204 | return _core_.Rect_SetPosition(*args, **kwargs) | |
1205 | ||
1206 | def GetSize(*args, **kwargs): | |
1207 | """GetSize(self) -> Size""" | |
1208 | return _core_.Rect_GetSize(*args, **kwargs) | |
1209 | ||
1210 | def SetSize(*args, **kwargs): | |
1211 | """SetSize(self, Size s)""" | |
1212 | return _core_.Rect_SetSize(*args, **kwargs) | |
1213 | ||
aff4cc5c RD |
1214 | def IsEmpty(*args, **kwargs): |
1215 | """IsEmpty(self) -> bool""" | |
1216 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1217 | ||
d55e5bfc RD |
1218 | def GetTopLeft(*args, **kwargs): |
1219 | """GetTopLeft(self) -> Point""" | |
1220 | return _core_.Rect_GetTopLeft(*args, **kwargs) | |
1221 | ||
1222 | def SetTopLeft(*args, **kwargs): | |
1223 | """SetTopLeft(self, Point p)""" | |
1224 | return _core_.Rect_SetTopLeft(*args, **kwargs) | |
1225 | ||
1226 | def GetBottomRight(*args, **kwargs): | |
1227 | """GetBottomRight(self) -> Point""" | |
1228 | return _core_.Rect_GetBottomRight(*args, **kwargs) | |
1229 | ||
1230 | def SetBottomRight(*args, **kwargs): | |
1231 | """SetBottomRight(self, Point p)""" | |
1232 | return _core_.Rect_SetBottomRight(*args, **kwargs) | |
1233 | ||
1234 | def GetLeft(*args, **kwargs): | |
1235 | """GetLeft(self) -> int""" | |
1236 | return _core_.Rect_GetLeft(*args, **kwargs) | |
1237 | ||
1238 | def GetTop(*args, **kwargs): | |
1239 | """GetTop(self) -> int""" | |
1240 | return _core_.Rect_GetTop(*args, **kwargs) | |
1241 | ||
1242 | def GetBottom(*args, **kwargs): | |
1243 | """GetBottom(self) -> int""" | |
1244 | return _core_.Rect_GetBottom(*args, **kwargs) | |
1245 | ||
1246 | def GetRight(*args, **kwargs): | |
1247 | """GetRight(self) -> int""" | |
1248 | return _core_.Rect_GetRight(*args, **kwargs) | |
1249 | ||
1250 | def SetLeft(*args, **kwargs): | |
1251 | """SetLeft(self, int left)""" | |
1252 | return _core_.Rect_SetLeft(*args, **kwargs) | |
1253 | ||
1254 | def SetRight(*args, **kwargs): | |
1255 | """SetRight(self, int right)""" | |
1256 | return _core_.Rect_SetRight(*args, **kwargs) | |
1257 | ||
1258 | def SetTop(*args, **kwargs): | |
1259 | """SetTop(self, int top)""" | |
1260 | return _core_.Rect_SetTop(*args, **kwargs) | |
1261 | ||
1262 | def SetBottom(*args, **kwargs): | |
1263 | """SetBottom(self, int bottom)""" | |
1264 | return _core_.Rect_SetBottom(*args, **kwargs) | |
1265 | ||
1266 | position = property(GetPosition, SetPosition) | |
1267 | size = property(GetSize, SetSize) | |
1268 | left = property(GetLeft, SetLeft) | |
1269 | right = property(GetRight, SetRight) | |
1270 | top = property(GetTop, SetTop) | |
1271 | bottom = property(GetBottom, SetBottom) | |
1272 | ||
1273 | def Inflate(*args, **kwargs): | |
1274 | """ | |
1275 | Inflate(self, int dx, int dy) -> Rect | |
1276 | ||
091fdbfa RD |
1277 | Increases the size of the rectangle. |
1278 | ||
1279 | The left border is moved farther left and the right border is moved | |
1280 | farther right by ``dx``. The upper border is moved farther up and the | |
1281 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1282 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1283 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1284 | opposite happens: the rectangle size decreases in the respective | |
1285 | direction. | |
1286 | ||
1287 | The change is made to the rectangle inplace, if instead you need a | |
1288 | copy that is inflated, preserving the original then make the copy | |
1289 | first:: | |
1290 | ||
1291 | copy = wx.Rect(*original) | |
1292 | copy.Inflate(10,15) | |
1293 | ||
1294 | ||
d55e5bfc RD |
1295 | """ |
1296 | return _core_.Rect_Inflate(*args, **kwargs) | |
1297 | ||
1298 | def Deflate(*args, **kwargs): | |
1299 | """ | |
1300 | Deflate(self, int dx, int dy) -> Rect | |
1301 | ||
091fdbfa RD |
1302 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1303 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1304 | `Inflate` for a full description. | |
d55e5bfc RD |
1305 | """ |
1306 | return _core_.Rect_Deflate(*args, **kwargs) | |
1307 | ||
1308 | def OffsetXY(*args, **kwargs): | |
1309 | """ | |
1310 | OffsetXY(self, int dx, int dy) | |
1311 | ||
79fccf9d RD |
1312 | Moves the rectangle by the specified offset. If dx is positive, the |
1313 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1314 | bottom, otherwise it is moved to the left or top respectively. | |
d55e5bfc RD |
1315 | """ |
1316 | return _core_.Rect_OffsetXY(*args, **kwargs) | |
1317 | ||
1318 | def Offset(*args, **kwargs): | |
1319 | """ | |
1320 | Offset(self, Point pt) | |
1321 | ||
1322 | Same as OffsetXY but uses dx,dy from Point | |
1323 | """ | |
1324 | return _core_.Rect_Offset(*args, **kwargs) | |
1325 | ||
1326 | def Intersect(*args, **kwargs): | |
1327 | """ | |
1328 | Intersect(self, Rect rect) -> Rect | |
1329 | ||
b519803b | 1330 | Returns the intersectsion of this rectangle and rect. |
d55e5bfc RD |
1331 | """ |
1332 | return _core_.Rect_Intersect(*args, **kwargs) | |
1333 | ||
b519803b RD |
1334 | def Union(*args, **kwargs): |
1335 | """ | |
1336 | Union(self, Rect rect) -> Rect | |
1337 | ||
1338 | Returns the union of this rectangle and rect. | |
1339 | """ | |
1340 | return _core_.Rect_Union(*args, **kwargs) | |
1341 | ||
d55e5bfc RD |
1342 | def __add__(*args, **kwargs): |
1343 | """ | |
1344 | __add__(self, Rect rect) -> Rect | |
1345 | ||
1346 | Add the properties of rect to this rectangle and return the result. | |
1347 | """ | |
1348 | return _core_.Rect___add__(*args, **kwargs) | |
1349 | ||
1350 | def __iadd__(*args, **kwargs): | |
1351 | """ | |
1352 | __iadd__(self, Rect rect) -> Rect | |
1353 | ||
1354 | Add the properties of rect to this rectangle, updating this rectangle. | |
1355 | """ | |
1356 | return _core_.Rect___iadd__(*args, **kwargs) | |
1357 | ||
1358 | def __eq__(*args, **kwargs): | |
1359 | """ | |
1360 | __eq__(self, Rect rect) -> bool | |
1361 | ||
1362 | Test for equality. | |
1363 | """ | |
1364 | return _core_.Rect___eq__(*args, **kwargs) | |
1365 | ||
1366 | def __ne__(*args, **kwargs): | |
1367 | """ | |
1368 | __ne__(self, Rect rect) -> bool | |
1369 | ||
1370 | Test for inequality. | |
1371 | """ | |
1372 | return _core_.Rect___ne__(*args, **kwargs) | |
1373 | ||
1374 | def InsideXY(*args, **kwargs): | |
1375 | """ | |
1376 | InsideXY(self, int x, int y) -> bool | |
1377 | ||
1378 | Return True if the point is (not strcitly) inside the rect. | |
1379 | """ | |
1380 | return _core_.Rect_InsideXY(*args, **kwargs) | |
1381 | ||
1382 | def Inside(*args, **kwargs): | |
1383 | """ | |
1384 | Inside(self, Point pt) -> bool | |
1385 | ||
1386 | Return True if the point is (not strcitly) inside the rect. | |
1387 | """ | |
1388 | return _core_.Rect_Inside(*args, **kwargs) | |
1389 | ||
1390 | def Intersects(*args, **kwargs): | |
1391 | """ | |
1392 | Intersects(self, Rect rect) -> bool | |
1393 | ||
1394 | Returns True if the rectangles have a non empty intersection. | |
1395 | """ | |
1396 | return _core_.Rect_Intersects(*args, **kwargs) | |
1397 | ||
1398 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) | |
1399 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1400 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1401 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
1402 | def Set(*args, **kwargs): | |
1403 | """ | |
1404 | Set(self, int x=0, int y=0, int width=0, int height=0) | |
1405 | ||
1406 | Set all rectangle properties. | |
1407 | """ | |
1408 | return _core_.Rect_Set(*args, **kwargs) | |
1409 | ||
1410 | def Get(*args, **kwargs): | |
1411 | """ | |
1412 | Get() -> (x,y,width,height) | |
1413 | ||
1414 | Return the rectangle properties as a tuple. | |
1415 | """ | |
1416 | return _core_.Rect_Get(*args, **kwargs) | |
1417 | ||
79fccf9d | 1418 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1419 | def __str__(self): return str(self.Get()) |
1420 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1421 | def __len__(self): return len(self.Get()) | |
1422 | def __getitem__(self, index): return self.Get()[index] | |
1423 | def __setitem__(self, index, val): | |
1424 | if index == 0: self.x = val | |
1425 | elif index == 1: self.y = val | |
1426 | elif index == 2: self.width = val | |
1427 | elif index == 3: self.height = val | |
1428 | else: raise IndexError | |
1429 | def __nonzero__(self): return self.Get() != (0,0,0,0) | |
1430 | __safe_for_unpickling__ = True | |
1431 | def __reduce__(self): return (wx.Rect, self.Get()) | |
1432 | ||
1433 | ||
1434 | class RectPtr(Rect): | |
1435 | def __init__(self, this): | |
1436 | self.this = this | |
1437 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1438 | self.__class__ = Rect | |
1439 | _core_.Rect_swigregister(RectPtr) | |
1440 | ||
1441 | def RectPP(*args, **kwargs): | |
1442 | """ | |
1443 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
1444 | ||
1445 | Create a new Rect object from Points representing two corners. | |
1446 | """ | |
1447 | val = _core_.new_RectPP(*args, **kwargs) | |
1448 | val.thisown = 1 | |
1449 | return val | |
1450 | ||
1451 | def RectPS(*args, **kwargs): | |
1452 | """ | |
1453 | RectPS(Point pos, Size size) -> Rect | |
1454 | ||
1455 | Create a new Rect from a position and size. | |
1456 | """ | |
1457 | val = _core_.new_RectPS(*args, **kwargs) | |
1458 | val.thisown = 1 | |
1459 | return val | |
1460 | ||
c1cb24a4 RD |
1461 | def RectS(*args, **kwargs): |
1462 | """ | |
1463 | RectS(Size size) -> Rect | |
1464 | ||
1465 | Create a new Rect from a size only. | |
1466 | """ | |
1467 | val = _core_.new_RectS(*args, **kwargs) | |
1468 | val.thisown = 1 | |
1469 | return val | |
1470 | ||
d55e5bfc RD |
1471 | |
1472 | def IntersectRect(*args, **kwargs): | |
1473 | """ | |
1474 | IntersectRect(Rect r1, Rect r2) -> Rect | |
1475 | ||
1476 | Calculate and return the intersection of r1 and r2. | |
1477 | """ | |
1478 | return _core_.IntersectRect(*args, **kwargs) | |
1479 | #--------------------------------------------------------------------------- | |
1480 | ||
1481 | class Point2D(object): | |
79fccf9d RD |
1482 | """ |
1483 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1484 | with floating point values. | |
1485 | """ | |
d55e5bfc RD |
1486 | def __repr__(self): |
1487 | return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1488 | def __init__(self, *args, **kwargs): | |
1489 | """ | |
1490 | __init__(self, double x=0.0, double y=0.0) -> Point2D | |
1491 | ||
1492 | Create a w.Point2D object. | |
1493 | """ | |
1494 | newobj = _core_.new_Point2D(*args, **kwargs) | |
1495 | self.this = newobj.this | |
1496 | self.thisown = 1 | |
1497 | del newobj.thisown | |
1498 | def GetFloor(*args, **kwargs): | |
a8eff060 RD |
1499 | """ |
1500 | GetFloor() -> (x,y) | |
1501 | ||
1502 | Convert to integer | |
1503 | """ | |
d55e5bfc RD |
1504 | return _core_.Point2D_GetFloor(*args, **kwargs) |
1505 | ||
1506 | def GetRounded(*args, **kwargs): | |
a8eff060 RD |
1507 | """ |
1508 | GetRounded() -> (x,y) | |
1509 | ||
1510 | Convert to integer | |
1511 | """ | |
d55e5bfc RD |
1512 | return _core_.Point2D_GetRounded(*args, **kwargs) |
1513 | ||
1514 | def GetVectorLength(*args, **kwargs): | |
1515 | """GetVectorLength(self) -> double""" | |
1516 | return _core_.Point2D_GetVectorLength(*args, **kwargs) | |
1517 | ||
1518 | def GetVectorAngle(*args, **kwargs): | |
1519 | """GetVectorAngle(self) -> double""" | |
1520 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) | |
1521 | ||
1522 | def SetVectorLength(*args, **kwargs): | |
1523 | """SetVectorLength(self, double length)""" | |
1524 | return _core_.Point2D_SetVectorLength(*args, **kwargs) | |
1525 | ||
1526 | def SetVectorAngle(*args, **kwargs): | |
1527 | """SetVectorAngle(self, double degrees)""" | |
1528 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) | |
1529 | ||
1530 | def SetPolarCoordinates(self, angle, length): | |
1531 | self.SetVectorLength(length) | |
1532 | self.SetVectorAngle(angle) | |
1533 | def Normalize(self): | |
1534 | self.SetVectorLength(1.0) | |
1535 | ||
1536 | def GetDistance(*args, **kwargs): | |
1537 | """GetDistance(self, Point2D pt) -> double""" | |
1538 | return _core_.Point2D_GetDistance(*args, **kwargs) | |
1539 | ||
1540 | def GetDistanceSquare(*args, **kwargs): | |
1541 | """GetDistanceSquare(self, Point2D pt) -> double""" | |
1542 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) | |
1543 | ||
1544 | def GetDotProduct(*args, **kwargs): | |
1545 | """GetDotProduct(self, Point2D vec) -> double""" | |
1546 | return _core_.Point2D_GetDotProduct(*args, **kwargs) | |
1547 | ||
1548 | def GetCrossProduct(*args, **kwargs): | |
1549 | """GetCrossProduct(self, Point2D vec) -> double""" | |
1550 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) | |
1551 | ||
1552 | def __neg__(*args, **kwargs): | |
1553 | """ | |
1554 | __neg__(self) -> Point2D | |
1555 | ||
1556 | the reflection of this point | |
1557 | """ | |
1558 | return _core_.Point2D___neg__(*args, **kwargs) | |
1559 | ||
1560 | def __iadd__(*args, **kwargs): | |
1561 | """__iadd__(self, Point2D pt) -> Point2D""" | |
1562 | return _core_.Point2D___iadd__(*args, **kwargs) | |
1563 | ||
1564 | def __isub__(*args, **kwargs): | |
1565 | """__isub__(self, Point2D pt) -> Point2D""" | |
1566 | return _core_.Point2D___isub__(*args, **kwargs) | |
1567 | ||
1568 | def __imul__(*args, **kwargs): | |
1569 | """__imul__(self, Point2D pt) -> Point2D""" | |
1570 | return _core_.Point2D___imul__(*args, **kwargs) | |
1571 | ||
1572 | def __idiv__(*args, **kwargs): | |
1573 | """__idiv__(self, Point2D pt) -> Point2D""" | |
1574 | return _core_.Point2D___idiv__(*args, **kwargs) | |
1575 | ||
1576 | def __eq__(*args, **kwargs): | |
1577 | """ | |
1578 | __eq__(self, Point2D pt) -> bool | |
1579 | ||
1580 | Test for equality | |
1581 | """ | |
1582 | return _core_.Point2D___eq__(*args, **kwargs) | |
1583 | ||
1584 | def __ne__(*args, **kwargs): | |
1585 | """ | |
1586 | __ne__(self, Point2D pt) -> bool | |
1587 | ||
1588 | Test for inequality | |
1589 | """ | |
1590 | return _core_.Point2D___ne__(*args, **kwargs) | |
1591 | ||
1592 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) | |
1593 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
1594 | def Set(*args, **kwargs): | |
1595 | """Set(self, double x=0, double y=0)""" | |
1596 | return _core_.Point2D_Set(*args, **kwargs) | |
1597 | ||
1598 | def Get(*args, **kwargs): | |
1599 | """ | |
1600 | Get() -> (x,y) | |
1601 | ||
1602 | Return x and y properties as a tuple. | |
1603 | """ | |
1604 | return _core_.Point2D_Get(*args, **kwargs) | |
1605 | ||
79fccf9d | 1606 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1607 | def __str__(self): return str(self.Get()) |
1608 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1609 | def __len__(self): return len(self.Get()) | |
1610 | def __getitem__(self, index): return self.Get()[index] | |
1611 | def __setitem__(self, index, val): | |
1612 | if index == 0: self.x = val | |
1613 | elif index == 1: self.y = val | |
1614 | else: raise IndexError | |
1615 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1616 | __safe_for_unpickling__ = True | |
1617 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
1618 | ||
1619 | ||
1620 | class Point2DPtr(Point2D): | |
1621 | def __init__(self, this): | |
1622 | self.this = this | |
1623 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1624 | self.__class__ = Point2D | |
1625 | _core_.Point2D_swigregister(Point2DPtr) | |
1626 | ||
1627 | def Point2DCopy(*args, **kwargs): | |
1628 | """ | |
1629 | Point2DCopy(Point2D pt) -> Point2D | |
1630 | ||
1631 | Create a w.Point2D object. | |
1632 | """ | |
1633 | val = _core_.new_Point2DCopy(*args, **kwargs) | |
1634 | val.thisown = 1 | |
1635 | return val | |
1636 | ||
1637 | def Point2DFromPoint(*args, **kwargs): | |
1638 | """ | |
1639 | Point2DFromPoint(Point pt) -> Point2D | |
1640 | ||
1641 | Create a w.Point2D object. | |
1642 | """ | |
1643 | val = _core_.new_Point2DFromPoint(*args, **kwargs) | |
1644 | val.thisown = 1 | |
1645 | return val | |
1646 | ||
1647 | #--------------------------------------------------------------------------- | |
1648 | ||
1649 | FromStart = _core_.FromStart | |
1650 | FromCurrent = _core_.FromCurrent | |
1651 | FromEnd = _core_.FromEnd | |
1652 | class InputStream(object): | |
093d3ff1 | 1653 | """Proxy of C++ InputStream class""" |
d55e5bfc RD |
1654 | def __repr__(self): |
1655 | return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1656 | def __init__(self, *args, **kwargs): | |
1657 | """__init__(self, PyObject p) -> InputStream""" | |
1658 | newobj = _core_.new_InputStream(*args, **kwargs) | |
1659 | self.this = newobj.this | |
1660 | self.thisown = 1 | |
1661 | del newobj.thisown | |
8fb0e70a RD |
1662 | def __del__(self, destroy=_core_.delete_InputStream): |
1663 | """__del__(self)""" | |
1664 | try: | |
1665 | if self.thisown: destroy(self) | |
1666 | except: pass | |
1667 | ||
d55e5bfc RD |
1668 | def close(*args, **kwargs): |
1669 | """close(self)""" | |
1670 | return _core_.InputStream_close(*args, **kwargs) | |
1671 | ||
1672 | def flush(*args, **kwargs): | |
1673 | """flush(self)""" | |
1674 | return _core_.InputStream_flush(*args, **kwargs) | |
1675 | ||
1676 | def eof(*args, **kwargs): | |
1677 | """eof(self) -> bool""" | |
1678 | return _core_.InputStream_eof(*args, **kwargs) | |
1679 | ||
1680 | def read(*args, **kwargs): | |
1681 | """read(self, int size=-1) -> PyObject""" | |
1682 | return _core_.InputStream_read(*args, **kwargs) | |
1683 | ||
1684 | def readline(*args, **kwargs): | |
1685 | """readline(self, int size=-1) -> PyObject""" | |
1686 | return _core_.InputStream_readline(*args, **kwargs) | |
1687 | ||
1688 | def readlines(*args, **kwargs): | |
1689 | """readlines(self, int sizehint=-1) -> PyObject""" | |
1690 | return _core_.InputStream_readlines(*args, **kwargs) | |
1691 | ||
1692 | def seek(*args, **kwargs): | |
1693 | """seek(self, int offset, int whence=0)""" | |
1694 | return _core_.InputStream_seek(*args, **kwargs) | |
1695 | ||
1696 | def tell(*args, **kwargs): | |
1697 | """tell(self) -> int""" | |
1698 | return _core_.InputStream_tell(*args, **kwargs) | |
1699 | ||
1700 | def Peek(*args, **kwargs): | |
1701 | """Peek(self) -> char""" | |
1702 | return _core_.InputStream_Peek(*args, **kwargs) | |
1703 | ||
1704 | def GetC(*args, **kwargs): | |
1705 | """GetC(self) -> char""" | |
1706 | return _core_.InputStream_GetC(*args, **kwargs) | |
1707 | ||
1708 | def LastRead(*args, **kwargs): | |
1709 | """LastRead(self) -> size_t""" | |
1710 | return _core_.InputStream_LastRead(*args, **kwargs) | |
1711 | ||
1712 | def CanRead(*args, **kwargs): | |
1713 | """CanRead(self) -> bool""" | |
1714 | return _core_.InputStream_CanRead(*args, **kwargs) | |
1715 | ||
1716 | def Eof(*args, **kwargs): | |
1717 | """Eof(self) -> bool""" | |
1718 | return _core_.InputStream_Eof(*args, **kwargs) | |
1719 | ||
1720 | def Ungetch(*args, **kwargs): | |
1721 | """Ungetch(self, char c) -> bool""" | |
1722 | return _core_.InputStream_Ungetch(*args, **kwargs) | |
1723 | ||
1724 | def SeekI(*args, **kwargs): | |
1725 | """SeekI(self, long pos, int mode=FromStart) -> long""" | |
1726 | return _core_.InputStream_SeekI(*args, **kwargs) | |
1727 | ||
1728 | def TellI(*args, **kwargs): | |
1729 | """TellI(self) -> long""" | |
1730 | return _core_.InputStream_TellI(*args, **kwargs) | |
1731 | ||
1732 | ||
1733 | class InputStreamPtr(InputStream): | |
1734 | def __init__(self, this): | |
1735 | self.this = this | |
1736 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1737 | self.__class__ = InputStream | |
1738 | _core_.InputStream_swigregister(InputStreamPtr) | |
1739 | DefaultPosition = cvar.DefaultPosition | |
1740 | DefaultSize = cvar.DefaultSize | |
1741 | ||
1742 | class OutputStream(object): | |
093d3ff1 | 1743 | """Proxy of C++ OutputStream class""" |
d55e5bfc RD |
1744 | def __init__(self): raise RuntimeError, "No constructor defined" |
1745 | def __repr__(self): | |
1746 | return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1747 | def write(*args, **kwargs): | |
1748 | """write(self, PyObject obj)""" | |
1749 | return _core_.OutputStream_write(*args, **kwargs) | |
1750 | ||
1751 | ||
1752 | class OutputStreamPtr(OutputStream): | |
1753 | def __init__(self, this): | |
1754 | self.this = this | |
1755 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1756 | self.__class__ = OutputStream | |
1757 | _core_.OutputStream_swigregister(OutputStreamPtr) | |
1758 | ||
1759 | #--------------------------------------------------------------------------- | |
1760 | ||
1761 | class FSFile(Object): | |
093d3ff1 | 1762 | """Proxy of C++ FSFile class""" |
d55e5bfc RD |
1763 | def __repr__(self): |
1764 | return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1765 | def __init__(self, *args, **kwargs): | |
1766 | """ | |
1767 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, | |
1768 | DateTime modif) -> FSFile | |
1769 | """ | |
1770 | newobj = _core_.new_FSFile(*args, **kwargs) | |
1771 | self.this = newobj.this | |
1772 | self.thisown = 1 | |
1773 | del newobj.thisown | |
e2950dbb | 1774 | self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem |
4cf4100f | 1775 | |
d55e5bfc RD |
1776 | def __del__(self, destroy=_core_.delete_FSFile): |
1777 | """__del__(self)""" | |
1778 | try: | |
1779 | if self.thisown: destroy(self) | |
1780 | except: pass | |
1781 | ||
1782 | def GetStream(*args, **kwargs): | |
1783 | """GetStream(self) -> InputStream""" | |
1784 | return _core_.FSFile_GetStream(*args, **kwargs) | |
1785 | ||
1786 | def GetMimeType(*args, **kwargs): | |
1787 | """GetMimeType(self) -> String""" | |
1788 | return _core_.FSFile_GetMimeType(*args, **kwargs) | |
1789 | ||
1790 | def GetLocation(*args, **kwargs): | |
1791 | """GetLocation(self) -> String""" | |
1792 | return _core_.FSFile_GetLocation(*args, **kwargs) | |
1793 | ||
1794 | def GetAnchor(*args, **kwargs): | |
1795 | """GetAnchor(self) -> String""" | |
1796 | return _core_.FSFile_GetAnchor(*args, **kwargs) | |
1797 | ||
1798 | def GetModificationTime(*args, **kwargs): | |
1799 | """GetModificationTime(self) -> DateTime""" | |
1800 | return _core_.FSFile_GetModificationTime(*args, **kwargs) | |
1801 | ||
1802 | ||
1803 | class FSFilePtr(FSFile): | |
1804 | def __init__(self, this): | |
1805 | self.this = this | |
1806 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1807 | self.__class__ = FSFile | |
1808 | _core_.FSFile_swigregister(FSFilePtr) | |
1809 | ||
1810 | class CPPFileSystemHandler(object): | |
093d3ff1 | 1811 | """Proxy of C++ CPPFileSystemHandler class""" |
d55e5bfc RD |
1812 | def __init__(self): raise RuntimeError, "No constructor defined" |
1813 | def __repr__(self): | |
1814 | return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1815 | ||
1816 | class CPPFileSystemHandlerPtr(CPPFileSystemHandler): | |
1817 | def __init__(self, this): | |
1818 | self.this = this | |
1819 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1820 | self.__class__ = CPPFileSystemHandler | |
1821 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr) | |
1822 | ||
1823 | class FileSystemHandler(CPPFileSystemHandler): | |
093d3ff1 | 1824 | """Proxy of C++ FileSystemHandler class""" |
d55e5bfc RD |
1825 | def __repr__(self): |
1826 | return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1827 | def __init__(self, *args, **kwargs): | |
1828 | """__init__(self) -> FileSystemHandler""" | |
1829 | newobj = _core_.new_FileSystemHandler(*args, **kwargs) | |
1830 | self.this = newobj.this | |
1831 | self.thisown = 1 | |
1832 | del newobj.thisown | |
1833 | self._setCallbackInfo(self, FileSystemHandler) | |
1834 | ||
1835 | def _setCallbackInfo(*args, **kwargs): | |
1836 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
1837 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) | |
1838 | ||
1839 | def CanOpen(*args, **kwargs): | |
1840 | """CanOpen(self, String location) -> bool""" | |
1841 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) | |
1842 | ||
1843 | def OpenFile(*args, **kwargs): | |
1844 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
1845 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) | |
1846 | ||
1847 | def FindFirst(*args, **kwargs): | |
1848 | """FindFirst(self, String spec, int flags=0) -> String""" | |
1849 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) | |
1850 | ||
1851 | def FindNext(*args, **kwargs): | |
1852 | """FindNext(self) -> String""" | |
1853 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) | |
1854 | ||
1855 | def GetProtocol(*args, **kwargs): | |
1856 | """GetProtocol(self, String location) -> String""" | |
1857 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) | |
1858 | ||
1859 | def GetLeftLocation(*args, **kwargs): | |
1860 | """GetLeftLocation(self, String location) -> String""" | |
1861 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | |
1862 | ||
1863 | def GetAnchor(*args, **kwargs): | |
1864 | """GetAnchor(self, String location) -> String""" | |
1865 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) | |
1866 | ||
1867 | def GetRightLocation(*args, **kwargs): | |
1868 | """GetRightLocation(self, String location) -> String""" | |
1869 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) | |
1870 | ||
1871 | def GetMimeTypeFromExt(*args, **kwargs): | |
1872 | """GetMimeTypeFromExt(self, String location) -> String""" | |
1873 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) | |
1874 | ||
1875 | ||
1876 | class FileSystemHandlerPtr(FileSystemHandler): | |
1877 | def __init__(self, this): | |
1878 | self.this = this | |
1879 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1880 | self.__class__ = FileSystemHandler | |
1881 | _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr) | |
1882 | ||
1883 | class FileSystem(Object): | |
093d3ff1 | 1884 | """Proxy of C++ FileSystem class""" |
d55e5bfc RD |
1885 | def __repr__(self): |
1886 | return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1887 | def __init__(self, *args, **kwargs): | |
1888 | """__init__(self) -> FileSystem""" | |
1889 | newobj = _core_.new_FileSystem(*args, **kwargs) | |
1890 | self.this = newobj.this | |
1891 | self.thisown = 1 | |
1892 | del newobj.thisown | |
1893 | def __del__(self, destroy=_core_.delete_FileSystem): | |
1894 | """__del__(self)""" | |
1895 | try: | |
1896 | if self.thisown: destroy(self) | |
1897 | except: pass | |
1898 | ||
1899 | def ChangePathTo(*args, **kwargs): | |
1900 | """ChangePathTo(self, String location, bool is_dir=False)""" | |
1901 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) | |
1902 | ||
1903 | def GetPath(*args, **kwargs): | |
1904 | """GetPath(self) -> String""" | |
1905 | return _core_.FileSystem_GetPath(*args, **kwargs) | |
1906 | ||
1907 | def OpenFile(*args, **kwargs): | |
1908 | """OpenFile(self, String location) -> FSFile""" | |
1909 | return _core_.FileSystem_OpenFile(*args, **kwargs) | |
1910 | ||
1911 | def FindFirst(*args, **kwargs): | |
1912 | """FindFirst(self, String spec, int flags=0) -> String""" | |
1913 | return _core_.FileSystem_FindFirst(*args, **kwargs) | |
1914 | ||
1915 | def FindNext(*args, **kwargs): | |
1916 | """FindNext(self) -> String""" | |
1917 | return _core_.FileSystem_FindNext(*args, **kwargs) | |
1918 | ||
1919 | def AddHandler(*args, **kwargs): | |
c24da6d6 | 1920 | """AddHandler(CPPFileSystemHandler handler)""" |
d55e5bfc RD |
1921 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
1922 | ||
1923 | AddHandler = staticmethod(AddHandler) | |
1924 | def CleanUpHandlers(*args, **kwargs): | |
c24da6d6 | 1925 | """CleanUpHandlers()""" |
d55e5bfc RD |
1926 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
1927 | ||
1928 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1929 | def FileNameToURL(*args, **kwargs): | |
c24da6d6 | 1930 | """FileNameToURL(String filename) -> String""" |
d55e5bfc RD |
1931 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
1932 | ||
1933 | FileNameToURL = staticmethod(FileNameToURL) | |
ae8162c8 RD |
1934 | def URLToFileName(*args, **kwargs): |
1935 | """URLToFileName(String url) -> String""" | |
1936 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
1937 | ||
1938 | URLToFileName = staticmethod(URLToFileName) | |
d55e5bfc RD |
1939 | |
1940 | class FileSystemPtr(FileSystem): | |
1941 | def __init__(self, this): | |
1942 | self.this = this | |
1943 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1944 | self.__class__ = FileSystem | |
1945 | _core_.FileSystem_swigregister(FileSystemPtr) | |
1946 | ||
1947 | def FileSystem_AddHandler(*args, **kwargs): | |
1948 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" | |
1949 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
1950 | ||
1951 | def FileSystem_CleanUpHandlers(*args, **kwargs): | |
1952 | """FileSystem_CleanUpHandlers()""" | |
1953 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) | |
1954 | ||
1955 | def FileSystem_FileNameToURL(*args, **kwargs): | |
1956 | """FileSystem_FileNameToURL(String filename) -> String""" | |
1957 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
1958 | ||
d55e5bfc RD |
1959 | def FileSystem_URLToFileName(*args, **kwargs): |
1960 | """FileSystem_URLToFileName(String url) -> String""" | |
1961 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
ae8162c8 | 1962 | |
d55e5bfc | 1963 | class InternetFSHandler(CPPFileSystemHandler): |
093d3ff1 | 1964 | """Proxy of C++ InternetFSHandler class""" |
d55e5bfc RD |
1965 | def __repr__(self): |
1966 | return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1967 | def __init__(self, *args, **kwargs): | |
1968 | """__init__(self) -> InternetFSHandler""" | |
1969 | newobj = _core_.new_InternetFSHandler(*args, **kwargs) | |
1970 | self.this = newobj.this | |
1971 | self.thisown = 1 | |
1972 | del newobj.thisown | |
1973 | def CanOpen(*args, **kwargs): | |
1974 | """CanOpen(self, String location) -> bool""" | |
1975 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) | |
1976 | ||
1977 | def OpenFile(*args, **kwargs): | |
1978 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
1979 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) | |
1980 | ||
1981 | ||
1982 | class InternetFSHandlerPtr(InternetFSHandler): | |
1983 | def __init__(self, this): | |
1984 | self.this = this | |
1985 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1986 | self.__class__ = InternetFSHandler | |
1987 | _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr) | |
1988 | ||
1989 | class ZipFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1990 | """Proxy of C++ ZipFSHandler class""" |
d55e5bfc RD |
1991 | def __repr__(self): |
1992 | return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1993 | def __init__(self, *args, **kwargs): | |
1994 | """__init__(self) -> ZipFSHandler""" | |
1995 | newobj = _core_.new_ZipFSHandler(*args, **kwargs) | |
1996 | self.this = newobj.this | |
1997 | self.thisown = 1 | |
1998 | del newobj.thisown | |
1999 | def CanOpen(*args, **kwargs): | |
2000 | """CanOpen(self, String location) -> bool""" | |
2001 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) | |
2002 | ||
2003 | def OpenFile(*args, **kwargs): | |
2004 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
2005 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) | |
2006 | ||
2007 | def FindFirst(*args, **kwargs): | |
2008 | """FindFirst(self, String spec, int flags=0) -> String""" | |
2009 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) | |
2010 | ||
2011 | def FindNext(*args, **kwargs): | |
2012 | """FindNext(self) -> String""" | |
2013 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) | |
2014 | ||
2015 | ||
2016 | class ZipFSHandlerPtr(ZipFSHandler): | |
2017 | def __init__(self, this): | |
2018 | self.this = this | |
2019 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2020 | self.__class__ = ZipFSHandler | |
2021 | _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr) | |
2022 | ||
2023 | ||
2024 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): | |
2025 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" | |
2026 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
2027 | ||
2028 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): | |
2029 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" | |
2030 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
2031 | ||
2032 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): | |
2033 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" | |
2034 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
ae8162c8 RD |
2035 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
2036 | """ | |
2037 | Add 'file' to the memory filesystem. The dataItem parameter can | |
2038 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
2039 | arbitrary data. If a bitmap or image is used then the imgType | |
2040 | parameter should specify what kind of image file it should be | |
2041 | written as, wx.BITMAP_TYPE_PNG, etc. | |
2042 | """ | |
2043 | if isinstance(dataItem, wx.Image): | |
2044 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
2045 | elif isinstance(dataItem, wx.Bitmap): | |
2046 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
2047 | elif type(dataItem) == str: | |
2048 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
2049 | else: | |
2050 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d55e5bfc RD |
2051 | |
2052 | class MemoryFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 2053 | """Proxy of C++ MemoryFSHandler class""" |
d55e5bfc RD |
2054 | def __repr__(self): |
2055 | return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2056 | def __init__(self, *args, **kwargs): | |
2057 | """__init__(self) -> MemoryFSHandler""" | |
2058 | newobj = _core_.new_MemoryFSHandler(*args, **kwargs) | |
2059 | self.this = newobj.this | |
2060 | self.thisown = 1 | |
2061 | del newobj.thisown | |
2062 | def RemoveFile(*args, **kwargs): | |
c24da6d6 | 2063 | """RemoveFile(String filename)""" |
d55e5bfc RD |
2064 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
2065 | ||
2066 | RemoveFile = staticmethod(RemoveFile) | |
2067 | AddFile = staticmethod(MemoryFSHandler_AddFile) | |
2068 | def CanOpen(*args, **kwargs): | |
2069 | """CanOpen(self, String location) -> bool""" | |
2070 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) | |
2071 | ||
2072 | def OpenFile(*args, **kwargs): | |
2073 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
2074 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) | |
2075 | ||
2076 | def FindFirst(*args, **kwargs): | |
2077 | """FindFirst(self, String spec, int flags=0) -> String""" | |
2078 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) | |
2079 | ||
2080 | def FindNext(*args, **kwargs): | |
2081 | """FindNext(self) -> String""" | |
2082 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) | |
2083 | ||
2084 | ||
2085 | class MemoryFSHandlerPtr(MemoryFSHandler): | |
2086 | def __init__(self, this): | |
2087 | self.this = this | |
2088 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2089 | self.__class__ = MemoryFSHandler | |
2090 | _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr) | |
2091 | ||
2092 | def MemoryFSHandler_RemoveFile(*args, **kwargs): | |
2093 | """MemoryFSHandler_RemoveFile(String filename)""" | |
2094 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
2095 | ||
57133d5c RD |
2096 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
2097 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
2098 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
d55e5bfc RD |
2099 | #--------------------------------------------------------------------------- |
2100 | ||
2101 | class ImageHandler(Object): | |
27fb7603 RD |
2102 | """ |
2103 | This is the base class for implementing image file loading/saving, and | |
2104 | image creation from data. It is used within `wx.Image` and is not | |
2105 | normally seen by the application. | |
2106 | """ | |
d55e5bfc RD |
2107 | def __init__(self): raise RuntimeError, "No constructor defined" |
2108 | def __repr__(self): | |
2109 | return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2110 | def GetName(*args, **kwargs): | |
2111 | """GetName(self) -> String""" | |
2112 | return _core_.ImageHandler_GetName(*args, **kwargs) | |
2113 | ||
2114 | def GetExtension(*args, **kwargs): | |
2115 | """GetExtension(self) -> String""" | |
2116 | return _core_.ImageHandler_GetExtension(*args, **kwargs) | |
2117 | ||
2118 | def GetType(*args, **kwargs): | |
2119 | """GetType(self) -> long""" | |
2120 | return _core_.ImageHandler_GetType(*args, **kwargs) | |
2121 | ||
2122 | def GetMimeType(*args, **kwargs): | |
2123 | """GetMimeType(self) -> String""" | |
2124 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) | |
2125 | ||
2126 | def CanRead(*args, **kwargs): | |
2127 | """CanRead(self, String name) -> bool""" | |
2128 | return _core_.ImageHandler_CanRead(*args, **kwargs) | |
2129 | ||
2130 | def SetName(*args, **kwargs): | |
2131 | """SetName(self, String name)""" | |
2132 | return _core_.ImageHandler_SetName(*args, **kwargs) | |
2133 | ||
2134 | def SetExtension(*args, **kwargs): | |
2135 | """SetExtension(self, String extension)""" | |
2136 | return _core_.ImageHandler_SetExtension(*args, **kwargs) | |
2137 | ||
2138 | def SetType(*args, **kwargs): | |
2139 | """SetType(self, long type)""" | |
2140 | return _core_.ImageHandler_SetType(*args, **kwargs) | |
2141 | ||
2142 | def SetMimeType(*args, **kwargs): | |
2143 | """SetMimeType(self, String mimetype)""" | |
2144 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) | |
2145 | ||
2146 | ||
2147 | class ImageHandlerPtr(ImageHandler): | |
2148 | def __init__(self, this): | |
2149 | self.this = this | |
2150 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2151 | self.__class__ = ImageHandler | |
2152 | _core_.ImageHandler_swigregister(ImageHandlerPtr) | |
2153 | ||
9d7dfdff RD |
2154 | class PyImageHandler(ImageHandler): |
2155 | """ | |
2156 | This is the base class for implementing image file loading/saving, and | |
2157 | image creation from data, all written in Python. To create a custom | |
2158 | image handler derive a new class from wx.PyImageHandler and provide | |
2159 | the following methods:: | |
2160 | ||
2161 | def DoCanRead(self, stream) --> bool | |
2162 | '''Check if this handler can read the image on the stream''' | |
2163 | ||
2164 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2165 | '''Load image data from the stream and load it into image.''' | |
2166 | ||
2167 | def SaveFile(self, image, stream, verbose) --> bool | |
2168 | '''Save the iamge data in image to the stream using | |
2169 | this handler's image file format.''' | |
2170 | ||
2171 | def GetImageCount(self, stream) --> int | |
2172 | '''If this image format can hold more than one image, | |
2173 | how many does the image on the stream have?''' | |
2174 | ||
2175 | To activate your handler create an instance of it and pass it to | |
2176 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2177 | `SetExtension` from your constructor. | |
2178 | ||
2179 | """ | |
2180 | def __repr__(self): | |
2181 | return "<%s.%s; proxy of C++ wxPyImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2182 | def __init__(self, *args, **kwargs): | |
2183 | """ | |
2184 | __init__(self) -> PyImageHandler | |
2185 | ||
2186 | This is the base class for implementing image file loading/saving, and | |
2187 | image creation from data, all written in Python. To create a custom | |
2188 | image handler derive a new class from wx.PyImageHandler and provide | |
2189 | the following methods:: | |
2190 | ||
2191 | def DoCanRead(self, stream) --> bool | |
2192 | '''Check if this handler can read the image on the stream''' | |
2193 | ||
2194 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2195 | '''Load image data from the stream and load it into image.''' | |
2196 | ||
2197 | def SaveFile(self, image, stream, verbose) --> bool | |
2198 | '''Save the iamge data in image to the stream using | |
2199 | this handler's image file format.''' | |
2200 | ||
2201 | def GetImageCount(self, stream) --> int | |
2202 | '''If this image format can hold more than one image, | |
2203 | how many does the image on the stream have?''' | |
2204 | ||
2205 | To activate your handler create an instance of it and pass it to | |
2206 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2207 | `SetExtension` from your constructor. | |
2208 | ||
2209 | """ | |
2210 | newobj = _core_.new_PyImageHandler(*args, **kwargs) | |
2211 | self.this = newobj.this | |
2212 | self.thisown = 1 | |
2213 | del newobj.thisown | |
2214 | self._SetSelf(self) | |
2215 | ||
2216 | def _SetSelf(*args, **kwargs): | |
2217 | """_SetSelf(self, PyObject self)""" | |
2218 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2219 | ||
2220 | ||
2221 | class PyImageHandlerPtr(PyImageHandler): | |
2222 | def __init__(self, this): | |
2223 | self.this = this | |
2224 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2225 | self.__class__ = PyImageHandler | |
2226 | _core_.PyImageHandler_swigregister(PyImageHandlerPtr) | |
2227 | ||
d55e5bfc | 2228 | class ImageHistogram(object): |
093d3ff1 | 2229 | """Proxy of C++ ImageHistogram class""" |
d55e5bfc RD |
2230 | def __repr__(self): |
2231 | return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2232 | def __init__(self, *args, **kwargs): | |
2233 | """__init__(self) -> ImageHistogram""" | |
2234 | newobj = _core_.new_ImageHistogram(*args, **kwargs) | |
2235 | self.this = newobj.this | |
2236 | self.thisown = 1 | |
2237 | del newobj.thisown | |
2238 | def MakeKey(*args, **kwargs): | |
2239 | """ | |
7a27cf7c | 2240 | MakeKey(byte r, byte g, byte b) -> unsigned long |
d55e5bfc RD |
2241 | |
2242 | Get the key in the histogram for the given RGB values | |
2243 | """ | |
2244 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) | |
2245 | ||
2246 | MakeKey = staticmethod(MakeKey) | |
2247 | def FindFirstUnusedColour(*args, **kwargs): | |
a8eff060 RD |
2248 | """ |
2249 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2250 | ||
2251 | Find first colour that is not used in the image and has higher RGB | |
2252 | values than startR, startG, startB. Returns a tuple consisting of a | |
2253 | success flag and rgb values. | |
2254 | """ | |
d55e5bfc RD |
2255 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
2256 | ||
f1cbd8fa RD |
2257 | def GetCount(*args, **kwargs): |
2258 | """ | |
2259 | GetCount(self, unsigned long key) -> unsigned long | |
2260 | ||
2261 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2262 | key value from a RGB tripple. | |
2263 | """ | |
2264 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
2265 | ||
2266 | def GetCountRGB(*args, **kwargs): | |
2267 | """ | |
7a27cf7c | 2268 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2269 | |
2270 | Returns the pixel count for the given RGB values. | |
2271 | """ | |
2272 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2273 | ||
2274 | def GetCountColour(*args, **kwargs): | |
2275 | """ | |
2276 | GetCountColour(self, Colour colour) -> unsigned long | |
2277 | ||
2278 | Returns the pixel count for the given `wx.Colour` value. | |
2279 | """ | |
2280 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2281 | ||
d55e5bfc RD |
2282 | |
2283 | class ImageHistogramPtr(ImageHistogram): | |
2284 | def __init__(self, this): | |
2285 | self.this = this | |
2286 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2287 | self.__class__ = ImageHistogram | |
2288 | _core_.ImageHistogram_swigregister(ImageHistogramPtr) | |
2289 | ||
2290 | def ImageHistogram_MakeKey(*args, **kwargs): | |
2291 | """ | |
7a27cf7c | 2292 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
d55e5bfc RD |
2293 | |
2294 | Get the key in the histogram for the given RGB values | |
2295 | """ | |
2296 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) | |
2297 | ||
2f91e3df | 2298 | class Image_RGBValue(object): |
9d7dfdff RD |
2299 | """ |
2300 | An object that contains values for red, green and blue which represent | |
2301 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2302 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2303 | color space. | |
2304 | """ | |
2f91e3df KO |
2305 | def __repr__(self): |
2306 | return "<%s.%s; proxy of C++ wxImage_RGBValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2307 | def __init__(self, *args, **kwargs): | |
9d7dfdff RD |
2308 | """ |
2309 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2310 | ||
2311 | Constructor. | |
2312 | """ | |
2f91e3df KO |
2313 | newobj = _core_.new_Image_RGBValue(*args, **kwargs) |
2314 | self.this = newobj.this | |
2315 | self.thisown = 1 | |
2316 | del newobj.thisown | |
2317 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) | |
2318 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2319 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2320 | ||
2321 | class Image_RGBValuePtr(Image_RGBValue): | |
2322 | def __init__(self, this): | |
2323 | self.this = this | |
2324 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2325 | self.__class__ = Image_RGBValue | |
2326 | _core_.Image_RGBValue_swigregister(Image_RGBValuePtr) | |
2327 | ||
2328 | class Image_HSVValue(object): | |
9d7dfdff RD |
2329 | """ |
2330 | An object that contains values for hue, saturation and value which | |
2331 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2332 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2333 | color space. | |
2334 | """ | |
2f91e3df KO |
2335 | def __repr__(self): |
2336 | return "<%s.%s; proxy of C++ wxImage_HSVValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2337 | def __init__(self, *args, **kwargs): | |
9d7dfdff RD |
2338 | """ |
2339 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2340 | ||
2341 | Constructor. | |
2342 | """ | |
2f91e3df KO |
2343 | newobj = _core_.new_Image_HSVValue(*args, **kwargs) |
2344 | self.this = newobj.this | |
2345 | self.thisown = 1 | |
2346 | del newobj.thisown | |
2347 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) | |
2348 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2349 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2350 | ||
2351 | class Image_HSVValuePtr(Image_HSVValue): | |
2352 | def __init__(self, this): | |
2353 | self.this = this | |
2354 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2355 | self.__class__ = Image_HSVValue | |
2356 | _core_.Image_HSVValue_swigregister(Image_HSVValuePtr) | |
2357 | ||
d55e5bfc | 2358 | class Image(Object): |
7a27cf7c RD |
2359 | """ |
2360 | A platform-independent image class. An image can be created from | |
2361 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2362 | variety of formats. Functions are available to set and get image | |
2363 | bits, so it can be used for basic image manipulation. | |
2364 | ||
2365 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2366 | platform-specific `wx.Bitmap` object must be created from it using the | |
2367 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2368 | device context, using `wx.DC.DrawBitmap`. | |
2369 | ||
2370 | One colour value of the image may be used as a mask colour which will | |
2371 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2372 | bitmap object. | |
2373 | ||
2374 | wx.Image supports alpha channel data, that is in addition to a byte | |
2375 | for the red, green and blue colour components for each pixel it also | |
2376 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2377 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2378 | means that the pixel is 100% opaque. | |
2379 | ||
2380 | Unlike RGB data, not all images have an alpha channel and before using | |
2381 | `GetAlpha` you should check if this image contains an alpha channel | |
2382 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2383 | with transparency information will have an alpha channel. | |
2384 | """ | |
d55e5bfc RD |
2385 | def __repr__(self): |
2386 | return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2387 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2388 | """ |
2389 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2390 | ||
2391 | Loads an image from a file. | |
2392 | """ | |
d55e5bfc RD |
2393 | newobj = _core_.new_Image(*args, **kwargs) |
2394 | self.this = newobj.this | |
2395 | self.thisown = 1 | |
2396 | del newobj.thisown | |
2397 | def __del__(self, destroy=_core_.delete_Image): | |
2398 | """__del__(self)""" | |
2399 | try: | |
2400 | if self.thisown: destroy(self) | |
2401 | except: pass | |
2402 | ||
2403 | def Create(*args, **kwargs): | |
7a27cf7c RD |
2404 | """ |
2405 | Create(self, int width, int height, bool clear=True) | |
2406 | ||
2407 | Creates a fresh image. If clear is ``True``, the new image will be | |
2408 | initialized to black. Otherwise, the image data will be uninitialized. | |
2409 | """ | |
d55e5bfc RD |
2410 | return _core_.Image_Create(*args, **kwargs) |
2411 | ||
2412 | def Destroy(*args, **kwargs): | |
2413 | """ | |
2414 | Destroy(self) | |
2415 | ||
7a27cf7c | 2416 | Destroys the image data. |
d55e5bfc RD |
2417 | """ |
2418 | return _core_.Image_Destroy(*args, **kwargs) | |
2419 | ||
2420 | def Scale(*args, **kwargs): | |
7a27cf7c RD |
2421 | """ |
2422 | Scale(self, int width, int height) -> Image | |
2423 | ||
2424 | Returns a scaled version of the image. This is also useful for scaling | |
2425 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
2426 | `wx.MemoryDC` into another `wx.MemoryDC`. | |
2427 | """ | |
d55e5bfc RD |
2428 | return _core_.Image_Scale(*args, **kwargs) |
2429 | ||
2430 | def ShrinkBy(*args, **kwargs): | |
7a27cf7c RD |
2431 | """ |
2432 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2433 | ||
2434 | Return a version of the image scaled smaller by the given factors. | |
2435 | """ | |
d55e5bfc RD |
2436 | return _core_.Image_ShrinkBy(*args, **kwargs) |
2437 | ||
2438 | def Rescale(*args, **kwargs): | |
7a27cf7c RD |
2439 | """ |
2440 | Rescale(self, int width, int height) -> Image | |
2441 | ||
2442 | Changes the size of the image in-place by scaling it: after a call to | |
2443 | this function, the image will have the given width and height. | |
2444 | ||
2445 | Returns the (modified) image itself. | |
2446 | """ | |
d55e5bfc RD |
2447 | return _core_.Image_Rescale(*args, **kwargs) |
2448 | ||
aff4cc5c | 2449 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2450 | """ |
2451 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2452 | ||
2453 | Changes the size of the image in-place without scaling it, by adding | |
2454 | either a border with the given colour or cropping as necessary. The | |
2455 | image is pasted into a new image with the given size and background | |
2456 | colour at the position pos relative to the upper left of the new | |
2457 | image. If red = green = blue = -1 then use either the current mask | |
2458 | colour if set or find, use, and set a suitable mask colour for any | |
2459 | newly exposed areas. | |
2460 | ||
2461 | Returns the (modified) image itself. | |
2462 | """ | |
aff4cc5c RD |
2463 | return _core_.Image_Resize(*args, **kwargs) |
2464 | ||
d55e5bfc | 2465 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2466 | """ |
2467 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2468 | ||
2469 | Sets the pixel at the given coordinate. This routine performs | |
2470 | bounds-checks for the coordinate so it can be considered a safe way to | |
2471 | manipulate the data, but in some cases this might be too slow so that | |
2472 | the data will have to be set directly. In that case you will have to | |
2473 | get access to the image data using the `GetData` method. | |
2474 | """ | |
d55e5bfc RD |
2475 | return _core_.Image_SetRGB(*args, **kwargs) |
2476 | ||
aff4cc5c | 2477 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2478 | """ |
2479 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2480 | ||
2481 | Sets the colour of the pixels within the given rectangle. This routine | |
2482 | performs bounds-checks for the rectangle so it can be considered a | |
2483 | safe way to manipulate the data. | |
2484 | """ | |
aff4cc5c RD |
2485 | return _core_.Image_SetRGBRect(*args, **kwargs) |
2486 | ||
d55e5bfc | 2487 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2488 | """ |
2489 | GetRed(self, int x, int y) -> byte | |
2490 | ||
2491 | Returns the red intensity at the given coordinate. | |
2492 | """ | |
d55e5bfc RD |
2493 | return _core_.Image_GetRed(*args, **kwargs) |
2494 | ||
2495 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2496 | """ |
2497 | GetGreen(self, int x, int y) -> byte | |
2498 | ||
2499 | Returns the green intensity at the given coordinate. | |
2500 | """ | |
d55e5bfc RD |
2501 | return _core_.Image_GetGreen(*args, **kwargs) |
2502 | ||
2503 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2504 | """ |
2505 | GetBlue(self, int x, int y) -> byte | |
2506 | ||
2507 | Returns the blue intensity at the given coordinate. | |
2508 | """ | |
d55e5bfc RD |
2509 | return _core_.Image_GetBlue(*args, **kwargs) |
2510 | ||
2511 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2512 | """ |
2513 | SetAlpha(self, int x, int y, byte alpha) | |
2514 | ||
2515 | Sets the alpha value for the given pixel. This function should only be | |
2516 | called if the image has alpha channel data, use `HasAlpha` to check | |
2517 | for this. | |
2518 | """ | |
d55e5bfc RD |
2519 | return _core_.Image_SetAlpha(*args, **kwargs) |
2520 | ||
2521 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2522 | """ |
2523 | GetAlpha(self, int x, int y) -> byte | |
2524 | ||
2525 | Returns the alpha value for the given pixel. This function may only be | |
2526 | called for the images with alpha channel, use `HasAlpha` to check for | |
2527 | this. | |
2528 | ||
2529 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2530 | corresponds to the fully transparent pixels while the value of 255 to | |
2531 | the fully opaque pixels. | |
2532 | """ | |
d55e5bfc RD |
2533 | return _core_.Image_GetAlpha(*args, **kwargs) |
2534 | ||
2535 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2536 | """ |
2537 | HasAlpha(self) -> bool | |
2538 | ||
2539 | Returns true if this image has alpha channel, false otherwise. | |
2540 | """ | |
d55e5bfc RD |
2541 | return _core_.Image_HasAlpha(*args, **kwargs) |
2542 | ||
68350608 RD |
2543 | def InitAlpha(*args, **kwargs): |
2544 | """ | |
2545 | InitAlpha(self) | |
2546 | ||
2547 | Initializes the image alpha channel data. It is an error to call it if | |
2548 | the image already has alpha data. If it doesn't, alpha data will be by | |
2549 | default initialized to all pixels being fully opaque. But if the image | |
2550 | has a a mask colour, all mask pixels will be completely transparent. | |
2551 | """ | |
2552 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2553 | ||
57133d5c RD |
2554 | def IsTransparent(*args, **kwargs): |
2555 | """ | |
7a27cf7c | 2556 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
57133d5c | 2557 | |
7a27cf7c RD |
2558 | Returns ``True`` if this pixel is masked or has an alpha value less |
2559 | than the spcified threshold. | |
57133d5c RD |
2560 | """ |
2561 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2562 | ||
d55e5bfc | 2563 | def FindFirstUnusedColour(*args, **kwargs): |
a8eff060 RD |
2564 | """ |
2565 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2566 | ||
2567 | Find first colour that is not used in the image and has higher RGB | |
2568 | values than startR, startG, startB. Returns a tuple consisting of a | |
2569 | success flag and rgb values. | |
2570 | """ | |
d55e5bfc RD |
2571 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
2572 | ||
4cf4100f RD |
2573 | def ConvertAlphaToMask(*args, **kwargs): |
2574 | """ | |
57133d5c | 2575 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2576 | |
7a27cf7c RD |
2577 | If the image has alpha channel, this method converts it to mask. All |
2578 | pixels with alpha value less than ``threshold`` are replaced with the | |
2579 | mask colour and the alpha channel is removed. The mask colour is | |
2580 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2581 | |
2582 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2583 | nothing. | |
2584 | """ | |
2585 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
2586 | ||
8fb0e70a RD |
2587 | def ConvertColourToAlpha(*args, **kwargs): |
2588 | """ | |
7a27cf7c | 2589 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2590 | |
2591 | This method converts an image where the original alpha information is | |
2592 | only available as a shades of a colour (actually shades of grey) | |
2593 | typically when you draw anti-aliased text into a bitmap. The DC | |
2594 | drawing routines draw grey values on the black background although | |
2595 | they actually mean to draw white with differnt alpha values. This | |
2596 | method reverses it, assuming a black (!) background and white text. | |
2597 | The method will then fill up the whole image with the colour given. | |
2598 | """ | |
2599 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2600 | ||
d55e5bfc | 2601 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2602 | """ |
2603 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2604 | ||
2605 | Sets the image's mask so that the pixels that have RGB value of | |
2606 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2607 | by first finding an unused colour in the image, setting this colour as | |
2608 | the mask colour and then using this colour to draw all pixels in the | |
2609 | image who corresponding pixel in mask has given RGB value. | |
2610 | ||
2611 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2612 | image or if there is no unused colour left. Returns ``True`` if the | |
2613 | mask was successfully applied. | |
2614 | ||
2615 | Note that this method involves computing the histogram, which is | |
2616 | computationally intensive operation. | |
2617 | """ | |
d55e5bfc RD |
2618 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
2619 | ||
2620 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2621 | """ |
2622 | CanRead(String filename) -> bool | |
2623 | ||
2624 | Returns True if the image handlers can read this file. | |
2625 | """ | |
d55e5bfc RD |
2626 | return _core_.Image_CanRead(*args, **kwargs) |
2627 | ||
2628 | CanRead = staticmethod(CanRead) | |
2629 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2630 | """ |
2631 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2632 | ||
2633 | If the image file contains more than one image and the image handler | |
2634 | is capable of retrieving these individually, this function will return | |
2635 | the number of available images. | |
2636 | """ | |
d55e5bfc RD |
2637 | return _core_.Image_GetImageCount(*args, **kwargs) |
2638 | ||
2639 | GetImageCount = staticmethod(GetImageCount) | |
2640 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2641 | """ |
2642 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2643 | ||
2644 | Loads an image from a file. If no handler type is provided, the | |
2645 | library will try to autodetect the format. | |
2646 | """ | |
d55e5bfc RD |
2647 | return _core_.Image_LoadFile(*args, **kwargs) |
2648 | ||
2649 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2650 | """ |
2651 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2652 | ||
2653 | Loads an image from a file, specifying the image type with a MIME type | |
2654 | string. | |
2655 | """ | |
d55e5bfc RD |
2656 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
2657 | ||
2658 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2659 | """ |
2660 | SaveFile(self, String name, int type) -> bool | |
2661 | ||
2662 | Saves an image in the named file. | |
2663 | """ | |
d55e5bfc RD |
2664 | return _core_.Image_SaveFile(*args, **kwargs) |
2665 | ||
2666 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2667 | """ |
2668 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2669 | ||
2670 | Saves an image in the named file. | |
2671 | """ | |
d55e5bfc RD |
2672 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
2673 | ||
2674 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2675 | """ |
2676 | CanReadStream(InputStream stream) -> bool | |
2677 | ||
2678 | Returns True if the image handlers can read an image file from the | |
2679 | data currently on the input stream, or a readable Python file-like | |
2680 | object. | |
2681 | """ | |
d55e5bfc RD |
2682 | return _core_.Image_CanReadStream(*args, **kwargs) |
2683 | ||
2684 | CanReadStream = staticmethod(CanReadStream) | |
2685 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2686 | """ |
2687 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2688 | ||
2689 | Loads an image from an input stream or a readable Python file-like | |
2690 | object. If no handler type is provided, the library will try to | |
2691 | autodetect the format. | |
2692 | """ | |
d55e5bfc RD |
2693 | return _core_.Image_LoadStream(*args, **kwargs) |
2694 | ||
2695 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2696 | """ |
2697 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2698 | ||
2699 | Loads an image from an input stream or a readable Python file-like | |
2700 | object, using a MIME type string to specify the image file format. | |
2701 | """ | |
d55e5bfc RD |
2702 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
2703 | ||
2704 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2705 | """ |
2706 | Ok(self) -> bool | |
2707 | ||
2708 | Returns true if image data is present. | |
2709 | """ | |
d55e5bfc RD |
2710 | return _core_.Image_Ok(*args, **kwargs) |
2711 | ||
2712 | def GetWidth(*args, **kwargs): | |
7a27cf7c RD |
2713 | """ |
2714 | GetWidth(self) -> int | |
2715 | ||
2716 | Gets the width of the image in pixels. | |
2717 | """ | |
d55e5bfc RD |
2718 | return _core_.Image_GetWidth(*args, **kwargs) |
2719 | ||
2720 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
2721 | """ |
2722 | GetHeight(self) -> int | |
2723 | ||
2724 | Gets the height of the image in pixels. | |
2725 | """ | |
d55e5bfc RD |
2726 | return _core_.Image_GetHeight(*args, **kwargs) |
2727 | ||
2728 | def GetSize(*args, **kwargs): | |
7a27cf7c RD |
2729 | """ |
2730 | GetSize(self) -> Size | |
2731 | ||
2732 | Returns the size of the image in pixels. | |
2733 | """ | |
d55e5bfc RD |
2734 | return _core_.Image_GetSize(*args, **kwargs) |
2735 | ||
2736 | def GetSubImage(*args, **kwargs): | |
7a27cf7c RD |
2737 | """ |
2738 | GetSubImage(self, Rect rect) -> Image | |
2739 | ||
2740 | Returns a sub image of the current one as long as the rect belongs | |
2741 | entirely to the image. | |
2742 | """ | |
d55e5bfc RD |
2743 | return _core_.Image_GetSubImage(*args, **kwargs) |
2744 | ||
aff4cc5c | 2745 | def Size(*args, **kwargs): |
7a27cf7c RD |
2746 | """ |
2747 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2748 | ||
2749 | Returns a resized version of this image without scaling it by adding | |
2750 | either a border with the given colour or cropping as necessary. The | |
2751 | image is pasted into a new image with the given size and background | |
2752 | colour at the position ``pos`` relative to the upper left of the new | |
2753 | image. If red = green = blue = -1 then use either the current mask | |
2754 | colour if set or find, use, and set a suitable mask colour for any | |
2755 | newly exposed areas. | |
2756 | """ | |
aff4cc5c RD |
2757 | return _core_.Image_Size(*args, **kwargs) |
2758 | ||
d55e5bfc | 2759 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2760 | """ |
2761 | Copy(self) -> Image | |
2762 | ||
2763 | Returns an identical copy of the image. | |
2764 | """ | |
d55e5bfc RD |
2765 | return _core_.Image_Copy(*args, **kwargs) |
2766 | ||
2767 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
2768 | """ |
2769 | Paste(self, Image image, int x, int y) | |
2770 | ||
2771 | Pastes ``image`` into this instance and takes care of the mask colour | |
2772 | and any out of bounds problems. | |
2773 | """ | |
d55e5bfc RD |
2774 | return _core_.Image_Paste(*args, **kwargs) |
2775 | ||
2776 | def GetData(*args, **kwargs): | |
ea939623 RD |
2777 | """ |
2778 | GetData(self) -> PyObject | |
2779 | ||
2780 | Returns a string containing a copy of the RGB bytes of the image. | |
2781 | """ | |
d55e5bfc RD |
2782 | return _core_.Image_GetData(*args, **kwargs) |
2783 | ||
2784 | def SetData(*args, **kwargs): | |
ea939623 RD |
2785 | """ |
2786 | SetData(self, buffer data) | |
2787 | ||
2788 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2789 | either a string or a buffer object holding the data and the length of | |
2790 | the data must be width*height*3. | |
2791 | """ | |
d55e5bfc RD |
2792 | return _core_.Image_SetData(*args, **kwargs) |
2793 | ||
2794 | def GetDataBuffer(*args, **kwargs): | |
ea939623 RD |
2795 | """ |
2796 | GetDataBuffer(self) -> PyObject | |
2797 | ||
2798 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
2799 | image data buffer inside the wx.Image. You need to ensure that you do |
2800 | not use this buffer object after the image has been destroyed. | |
ea939623 | 2801 | """ |
d55e5bfc RD |
2802 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
2803 | ||
2804 | def SetDataBuffer(*args, **kwargs): | |
ea939623 RD |
2805 | """ |
2806 | SetDataBuffer(self, buffer data) | |
2807 | ||
2808 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
2809 | object. This can save making an extra copy of the data but you must |
2810 | ensure that the buffer object lives longer than the wx.Image does. | |
ea939623 | 2811 | """ |
d55e5bfc RD |
2812 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
2813 | ||
2814 | def GetAlphaData(*args, **kwargs): | |
ea939623 RD |
2815 | """ |
2816 | GetAlphaData(self) -> PyObject | |
2817 | ||
2818 | Returns a string containing a copy of the alpha bytes of the image. | |
2819 | """ | |
d55e5bfc RD |
2820 | return _core_.Image_GetAlphaData(*args, **kwargs) |
2821 | ||
2822 | def SetAlphaData(*args, **kwargs): | |
ea939623 RD |
2823 | """ |
2824 | SetAlphaData(self, buffer alpha) | |
2825 | ||
2826 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2827 | a string or a buffer object holding the data and the length of the | |
2828 | data must be width*height. | |
2829 | """ | |
d55e5bfc RD |
2830 | return _core_.Image_SetAlphaData(*args, **kwargs) |
2831 | ||
2832 | def GetAlphaBuffer(*args, **kwargs): | |
2833 | """GetAlphaBuffer(self) -> PyObject""" | |
2834 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) | |
2835 | ||
2836 | def SetAlphaBuffer(*args, **kwargs): | |
ea939623 | 2837 | """SetAlphaBuffer(self, buffer alpha)""" |
d55e5bfc RD |
2838 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
2839 | ||
2840 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
2841 | """ |
2842 | SetMaskColour(self, byte r, byte g, byte b) | |
2843 | ||
2844 | Sets the mask colour for this image (and tells the image to use the | |
2845 | mask). | |
2846 | """ | |
d55e5bfc RD |
2847 | return _core_.Image_SetMaskColour(*args, **kwargs) |
2848 | ||
aff4cc5c RD |
2849 | def GetOrFindMaskColour(*args, **kwargs): |
2850 | """ | |
2851 | GetOrFindMaskColour() -> (r,g,b) | |
2852 | ||
2853 | Get the current mask colour or find a suitable colour. | |
2854 | """ | |
2855 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
2856 | ||
d55e5bfc | 2857 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2858 | """ |
2859 | GetMaskRed(self) -> byte | |
2860 | ||
2861 | Gets the red component of the mask colour. | |
2862 | """ | |
d55e5bfc RD |
2863 | return _core_.Image_GetMaskRed(*args, **kwargs) |
2864 | ||
2865 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
2866 | """ |
2867 | GetMaskGreen(self) -> byte | |
2868 | ||
2869 | Gets the green component of the mask colour. | |
2870 | """ | |
d55e5bfc RD |
2871 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
2872 | ||
2873 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
2874 | """ |
2875 | GetMaskBlue(self) -> byte | |
2876 | ||
2877 | Gets the blue component of the mask colour. | |
2878 | """ | |
d55e5bfc RD |
2879 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
2880 | ||
2881 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
2882 | """ |
2883 | SetMask(self, bool mask=True) | |
2884 | ||
2885 | Specifies whether there is a mask or not. The area of the mask is | |
2886 | determined by the current mask colour. | |
2887 | """ | |
d55e5bfc RD |
2888 | return _core_.Image_SetMask(*args, **kwargs) |
2889 | ||
2890 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
2891 | """ |
2892 | HasMask(self) -> bool | |
2893 | ||
2894 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
2895 | """ | |
d55e5bfc RD |
2896 | return _core_.Image_HasMask(*args, **kwargs) |
2897 | ||
2898 | def Rotate(*args, **kwargs): | |
2899 | """ | |
2900 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, | |
2901 | Point offset_after_rotation=None) -> Image | |
7a27cf7c RD |
2902 | |
2903 | Rotates the image about the given point, by ``angle`` radians. Passing | |
2904 | ``True`` to ``interpolating`` results in better image quality, but is | |
2905 | slower. If the image has a mask, then the mask colour is used for the | |
2906 | uncovered pixels in the rotated image background. Otherwise, black | |
2907 | will be used as the fill colour. | |
2908 | ||
2909 | Returns the rotated image, leaving this image intact. | |
d55e5bfc RD |
2910 | """ |
2911 | return _core_.Image_Rotate(*args, **kwargs) | |
2912 | ||
2913 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
2914 | """ |
2915 | Rotate90(self, bool clockwise=True) -> Image | |
2916 | ||
2917 | Returns a copy of the image rotated 90 degrees in the direction | |
2918 | indicated by ``clockwise``. | |
2919 | """ | |
d55e5bfc RD |
2920 | return _core_.Image_Rotate90(*args, **kwargs) |
2921 | ||
2922 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
2923 | """ |
2924 | Mirror(self, bool horizontally=True) -> Image | |
2925 | ||
2926 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
2927 | indicates the orientation. | |
2928 | """ | |
d55e5bfc RD |
2929 | return _core_.Image_Mirror(*args, **kwargs) |
2930 | ||
2931 | def Replace(*args, **kwargs): | |
2932 | """ | |
7a27cf7c RD |
2933 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
2934 | ||
2935 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
2936 | ``(r2,g2,b2)``. | |
d55e5bfc RD |
2937 | """ |
2938 | return _core_.Image_Replace(*args, **kwargs) | |
2939 | ||
7449af73 RD |
2940 | def ConvertToGreyscale(*args, **kwargs): |
2941 | """ | |
2942 | ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image | |
2943 | ||
2944 | Convert to greyscale image. Uses the luminance component (Y) of the | |
2945 | image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), | |
2946 | defaults to ITU-T BT.601 | |
2947 | """ | |
2948 | return _core_.Image_ConvertToGreyscale(*args, **kwargs) | |
2949 | ||
d55e5bfc | 2950 | def ConvertToMono(*args, **kwargs): |
7a27cf7c RD |
2951 | """ |
2952 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
2953 | ||
2954 | Returns monochromatic version of the image. The returned image has | |
2955 | white colour where the original has ``(r,g,b)`` colour and black | |
2956 | colour everywhere else. | |
2957 | """ | |
d55e5bfc RD |
2958 | return _core_.Image_ConvertToMono(*args, **kwargs) |
2959 | ||
2960 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
2961 | """ |
2962 | SetOption(self, String name, String value) | |
2963 | ||
2964 | Sets an image handler defined option. For example, when saving as a | |
2965 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
2966 | number between 0 and 100 (0 is terrible, 100 is very good). | |
2967 | """ | |
d55e5bfc RD |
2968 | return _core_.Image_SetOption(*args, **kwargs) |
2969 | ||
2970 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2971 | """ |
2972 | SetOptionInt(self, String name, int value) | |
2973 | ||
2974 | Sets an image option as an integer. | |
2975 | """ | |
d55e5bfc RD |
2976 | return _core_.Image_SetOptionInt(*args, **kwargs) |
2977 | ||
2978 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
2979 | """ |
2980 | GetOption(self, String name) -> String | |
2981 | ||
2982 | Gets the value of an image handler option. | |
2983 | """ | |
d55e5bfc RD |
2984 | return _core_.Image_GetOption(*args, **kwargs) |
2985 | ||
2986 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2987 | """ |
2988 | GetOptionInt(self, String name) -> int | |
2989 | ||
2990 | Gets the value of an image handler option as an integer. If the given | |
2991 | option is not present, the function returns 0. | |
2992 | """ | |
d55e5bfc RD |
2993 | return _core_.Image_GetOptionInt(*args, **kwargs) |
2994 | ||
2995 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
2996 | """ |
2997 | HasOption(self, String name) -> bool | |
2998 | ||
2999 | Returns true if the given option is present. | |
3000 | """ | |
d55e5bfc RD |
3001 | return _core_.Image_HasOption(*args, **kwargs) |
3002 | ||
3003 | def CountColours(*args, **kwargs): | |
3004 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" | |
3005 | return _core_.Image_CountColours(*args, **kwargs) | |
3006 | ||
3007 | def ComputeHistogram(*args, **kwargs): | |
3008 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" | |
3009 | return _core_.Image_ComputeHistogram(*args, **kwargs) | |
3010 | ||
3011 | def AddHandler(*args, **kwargs): | |
c24da6d6 | 3012 | """AddHandler(ImageHandler handler)""" |
d55e5bfc RD |
3013 | return _core_.Image_AddHandler(*args, **kwargs) |
3014 | ||
3015 | AddHandler = staticmethod(AddHandler) | |
3016 | def InsertHandler(*args, **kwargs): | |
c24da6d6 | 3017 | """InsertHandler(ImageHandler handler)""" |
d55e5bfc RD |
3018 | return _core_.Image_InsertHandler(*args, **kwargs) |
3019 | ||
3020 | InsertHandler = staticmethod(InsertHandler) | |
3021 | def RemoveHandler(*args, **kwargs): | |
c24da6d6 | 3022 | """RemoveHandler(String name) -> bool""" |
d55e5bfc RD |
3023 | return _core_.Image_RemoveHandler(*args, **kwargs) |
3024 | ||
3025 | RemoveHandler = staticmethod(RemoveHandler) | |
3026 | def GetImageExtWildcard(*args, **kwargs): | |
7a27cf7c RD |
3027 | """ |
3028 | GetImageExtWildcard() -> String | |
3029 | ||
3030 | Iterates all registered wxImageHandler objects, and returns a string | |
3031 | containing file extension masks suitable for passing to file open/save | |
3032 | dialog boxes. | |
3033 | """ | |
d55e5bfc RD |
3034 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
3035 | ||
3036 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
3037 | def ConvertToBitmap(*args, **kwargs): | |
1fbf26be | 3038 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
d55e5bfc RD |
3039 | return _core_.Image_ConvertToBitmap(*args, **kwargs) |
3040 | ||
3041 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 3042 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
d55e5bfc RD |
3043 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
3044 | ||
2f91e3df KO |
3045 | def RotateHue(*args, **kwargs): |
3046 | """ | |
3047 | RotateHue(self, double angle) | |
3048 | ||
3049 | Rotates the hue of each pixel of the image. Hue is a double in the | |
3050 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
3051 | """ | |
3052 | return _core_.Image_RotateHue(*args, **kwargs) | |
3053 | ||
3054 | def RGBtoHSV(*args, **kwargs): | |
9d7dfdff RD |
3055 | """ |
3056 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
3057 | ||
3058 | Converts a color in RGB color space to HSV color space. | |
3059 | """ | |
2f91e3df KO |
3060 | return _core_.Image_RGBtoHSV(*args, **kwargs) |
3061 | ||
3062 | RGBtoHSV = staticmethod(RGBtoHSV) | |
3063 | def HSVtoRGB(*args, **kwargs): | |
9d7dfdff RD |
3064 | """ |
3065 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
3066 | ||
3067 | Converts a color in HSV color space to RGB color space. | |
3068 | """ | |
2f91e3df KO |
3069 | return _core_.Image_HSVtoRGB(*args, **kwargs) |
3070 | ||
3071 | HSVtoRGB = staticmethod(HSVtoRGB) | |
d55e5bfc RD |
3072 | def __nonzero__(self): return self.Ok() |
3073 | ||
3074 | class ImagePtr(Image): | |
3075 | def __init__(self, this): | |
3076 | self.this = this | |
3077 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3078 | self.__class__ = Image | |
3079 | _core_.Image_swigregister(ImagePtr) | |
3080 | ||
3081 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
3082 | """ |
3083 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
3084 | ||
3085 | Loads an image from a file, using a MIME type string (such as | |
3086 | 'image/jpeg') to specify image type. | |
3087 | """ | |
d55e5bfc RD |
3088 | val = _core_.new_ImageFromMime(*args, **kwargs) |
3089 | val.thisown = 1 | |
3090 | return val | |
3091 | ||
3092 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
3093 | """ |
3094 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
3095 | ||
3096 | Loads an image from an input stream, or any readable Python file-like | |
3097 | object. | |
3098 | """ | |
d55e5bfc RD |
3099 | val = _core_.new_ImageFromStream(*args, **kwargs) |
3100 | val.thisown = 1 | |
3101 | return val | |
3102 | ||
3103 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
3104 | """ |
3105 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
3106 | ||
3107 | Loads an image from an input stream, or any readable Python file-like | |
3108 | object, specifying the image format with a MIME type string. | |
3109 | """ | |
d55e5bfc RD |
3110 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
3111 | val.thisown = 1 | |
3112 | return val | |
3113 | ||
c24da6d6 | 3114 | def EmptyImage(*args, **kwargs): |
ea939623 RD |
3115 | """ |
3116 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
3117 | ||
3118 | Construct an empty image of a given size, optionally setting all | |
3119 | pixels to black. | |
3120 | """ | |
c24da6d6 | 3121 | val = _core_.new_EmptyImage(*args, **kwargs) |
d55e5bfc RD |
3122 | val.thisown = 1 |
3123 | return val | |
3124 | ||
3125 | def ImageFromBitmap(*args, **kwargs): | |
ea939623 RD |
3126 | """ |
3127 | ImageFromBitmap(Bitmap bitmap) -> Image | |
3128 | ||
3129 | Construct an Image from a `wx.Bitmap`. | |
3130 | """ | |
d55e5bfc RD |
3131 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
3132 | val.thisown = 1 | |
3133 | return val | |
3134 | ||
3135 | def ImageFromData(*args, **kwargs): | |
ea939623 RD |
3136 | """ |
3137 | ImageFromData(int width, int height, buffer data) -> Image | |
3138 | ||
3139 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
3140 | string or a buffer object holding the data and the length of the data | |
3141 | must be width*height*3. | |
3142 | """ | |
d55e5bfc RD |
3143 | val = _core_.new_ImageFromData(*args, **kwargs) |
3144 | val.thisown = 1 | |
3145 | return val | |
3146 | ||
c9c2cf70 | 3147 | def ImageFromDataWithAlpha(*args, **kwargs): |
ea939623 RD |
3148 | """ |
3149 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
3150 | ||
3151 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
3152 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
3153 | length of the data must be width*height*3 bytes, and the length of the |
3154 | alpha data must be width*height bytes. | |
ea939623 | 3155 | """ |
c9c2cf70 RD |
3156 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
3157 | val.thisown = 1 | |
3158 | return val | |
3159 | ||
d55e5bfc | 3160 | def Image_CanRead(*args, **kwargs): |
7a27cf7c RD |
3161 | """ |
3162 | Image_CanRead(String filename) -> bool | |
3163 | ||
3164 | Returns True if the image handlers can read this file. | |
3165 | """ | |
d55e5bfc RD |
3166 | return _core_.Image_CanRead(*args, **kwargs) |
3167 | ||
3168 | def Image_GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
3169 | """ |
3170 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
3171 | ||
3172 | If the image file contains more than one image and the image handler | |
3173 | is capable of retrieving these individually, this function will return | |
3174 | the number of available images. | |
3175 | """ | |
d55e5bfc RD |
3176 | return _core_.Image_GetImageCount(*args, **kwargs) |
3177 | ||
3178 | def Image_CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
3179 | """ |
3180 | Image_CanReadStream(InputStream stream) -> bool | |
3181 | ||
3182 | Returns True if the image handlers can read an image file from the | |
3183 | data currently on the input stream, or a readable Python file-like | |
3184 | object. | |
3185 | """ | |
d55e5bfc RD |
3186 | return _core_.Image_CanReadStream(*args, **kwargs) |
3187 | ||
3188 | def Image_AddHandler(*args, **kwargs): | |
3189 | """Image_AddHandler(ImageHandler handler)""" | |
3190 | return _core_.Image_AddHandler(*args, **kwargs) | |
3191 | ||
3192 | def Image_InsertHandler(*args, **kwargs): | |
3193 | """Image_InsertHandler(ImageHandler handler)""" | |
3194 | return _core_.Image_InsertHandler(*args, **kwargs) | |
3195 | ||
3196 | def Image_RemoveHandler(*args, **kwargs): | |
3197 | """Image_RemoveHandler(String name) -> bool""" | |
3198 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
3199 | ||
3200 | def Image_GetImageExtWildcard(*args, **kwargs): | |
7a27cf7c RD |
3201 | """ |
3202 | Image_GetImageExtWildcard() -> String | |
3203 | ||
3204 | Iterates all registered wxImageHandler objects, and returns a string | |
3205 | containing file extension masks suitable for passing to file open/save | |
3206 | dialog boxes. | |
3207 | """ | |
d55e5bfc RD |
3208 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
3209 | ||
2f91e3df | 3210 | def Image_RGBtoHSV(*args, **kwargs): |
9d7dfdff RD |
3211 | """ |
3212 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
3213 | ||
3214 | Converts a color in RGB color space to HSV color space. | |
3215 | """ | |
2f91e3df KO |
3216 | return _core_.Image_RGBtoHSV(*args, **kwargs) |
3217 | ||
3218 | def Image_HSVtoRGB(*args, **kwargs): | |
9d7dfdff RD |
3219 | """ |
3220 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
3221 | ||
3222 | Converts a color in HSV color space to RGB color space. | |
3223 | """ | |
2f91e3df KO |
3224 | return _core_.Image_HSVtoRGB(*args, **kwargs) |
3225 | ||
a07a67e6 RD |
3226 | def InitAllImageHandlers(): |
3227 | """ | |
3228 | The former functionality of InitAllImageHanders is now done internal to | |
3229 | the _core_ extension module and so this function has become a simple NOP. | |
3230 | """ | |
3231 | pass | |
d55e5bfc | 3232 | |
d55e5bfc RD |
3233 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3234 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
b9d6a5f3 RD |
3235 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR |
3236 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3237 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
d55e5bfc RD |
3238 | BMP_24BPP = _core_.BMP_24BPP |
3239 | BMP_8BPP = _core_.BMP_8BPP | |
3240 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3241 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3242 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3243 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3244 | BMP_4BPP = _core_.BMP_4BPP | |
3245 | BMP_1BPP = _core_.BMP_1BPP | |
3246 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
3247 | class BMPHandler(ImageHandler): | |
27fb7603 | 3248 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
d55e5bfc RD |
3249 | def __repr__(self): |
3250 | return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3251 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3252 | """ |
3253 | __init__(self) -> BMPHandler | |
3254 | ||
3255 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3256 | """ | |
d55e5bfc RD |
3257 | newobj = _core_.new_BMPHandler(*args, **kwargs) |
3258 | self.this = newobj.this | |
3259 | self.thisown = 1 | |
3260 | del newobj.thisown | |
3261 | ||
3262 | class BMPHandlerPtr(BMPHandler): | |
3263 | def __init__(self, this): | |
3264 | self.this = this | |
3265 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3266 | self.__class__ = BMPHandler | |
3267 | _core_.BMPHandler_swigregister(BMPHandlerPtr) | |
3268 | NullImage = cvar.NullImage | |
68350608 | 3269 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d55e5bfc RD |
3270 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3271 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3272 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3273 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
68350608 RD |
3274 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3275 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d55e5bfc | 3276 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3277 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
68350608 RD |
3278 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3279 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3280 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3281 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
b9d6a5f3 RD |
3282 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3283 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d55e5bfc RD |
3284 | |
3285 | class ICOHandler(BMPHandler): | |
27fb7603 | 3286 | """A `wx.ImageHandler` for \*.ico icon files.""" |
d55e5bfc RD |
3287 | def __repr__(self): |
3288 | return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3289 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3290 | """ |
3291 | __init__(self) -> ICOHandler | |
3292 | ||
3293 | A `wx.ImageHandler` for \*.ico icon files. | |
3294 | """ | |
d55e5bfc RD |
3295 | newobj = _core_.new_ICOHandler(*args, **kwargs) |
3296 | self.this = newobj.this | |
3297 | self.thisown = 1 | |
3298 | del newobj.thisown | |
3299 | ||
3300 | class ICOHandlerPtr(ICOHandler): | |
3301 | def __init__(self, this): | |
3302 | self.this = this | |
3303 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3304 | self.__class__ = ICOHandler | |
3305 | _core_.ICOHandler_swigregister(ICOHandlerPtr) | |
3306 | ||
3307 | class CURHandler(ICOHandler): | |
27fb7603 | 3308 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
d55e5bfc RD |
3309 | def __repr__(self): |
3310 | return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3311 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3312 | """ |
3313 | __init__(self) -> CURHandler | |
3314 | ||
3315 | A `wx.ImageHandler` for \*.cur cursor files. | |
3316 | """ | |
d55e5bfc RD |
3317 | newobj = _core_.new_CURHandler(*args, **kwargs) |
3318 | self.this = newobj.this | |
3319 | self.thisown = 1 | |
3320 | del newobj.thisown | |
3321 | ||
3322 | class CURHandlerPtr(CURHandler): | |
3323 | def __init__(self, this): | |
3324 | self.this = this | |
3325 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3326 | self.__class__ = CURHandler | |
3327 | _core_.CURHandler_swigregister(CURHandlerPtr) | |
3328 | ||
3329 | class ANIHandler(CURHandler): | |
27fb7603 | 3330 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
d55e5bfc RD |
3331 | def __repr__(self): |
3332 | return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3333 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3334 | """ |
3335 | __init__(self) -> ANIHandler | |
3336 | ||
3337 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3338 | """ | |
d55e5bfc RD |
3339 | newobj = _core_.new_ANIHandler(*args, **kwargs) |
3340 | self.this = newobj.this | |
3341 | self.thisown = 1 | |
3342 | del newobj.thisown | |
3343 | ||
3344 | class ANIHandlerPtr(ANIHandler): | |
3345 | def __init__(self, this): | |
3346 | self.this = this | |
3347 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3348 | self.__class__ = ANIHandler | |
3349 | _core_.ANIHandler_swigregister(ANIHandlerPtr) | |
3350 | ||
3351 | class PNGHandler(ImageHandler): | |
27fb7603 | 3352 | """A `wx.ImageHandler` for PNG image files.""" |
d55e5bfc RD |
3353 | def __repr__(self): |
3354 | return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3355 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3356 | """ |
3357 | __init__(self) -> PNGHandler | |
3358 | ||
3359 | A `wx.ImageHandler` for PNG image files. | |
3360 | """ | |
d55e5bfc RD |
3361 | newobj = _core_.new_PNGHandler(*args, **kwargs) |
3362 | self.this = newobj.this | |
3363 | self.thisown = 1 | |
3364 | del newobj.thisown | |
3365 | ||
3366 | class PNGHandlerPtr(PNGHandler): | |
3367 | def __init__(self, this): | |
3368 | self.this = this | |
3369 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3370 | self.__class__ = PNGHandler | |
3371 | _core_.PNGHandler_swigregister(PNGHandlerPtr) | |
3372 | ||
3373 | class GIFHandler(ImageHandler): | |
27fb7603 | 3374 | """A `wx.ImageHandler` for GIF image files.""" |
d55e5bfc RD |
3375 | def __repr__(self): |
3376 | return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3377 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3378 | """ |
3379 | __init__(self) -> GIFHandler | |
3380 | ||
3381 | A `wx.ImageHandler` for GIF image files. | |
3382 | """ | |
d55e5bfc RD |
3383 | newobj = _core_.new_GIFHandler(*args, **kwargs) |
3384 | self.this = newobj.this | |
3385 | self.thisown = 1 | |
3386 | del newobj.thisown | |
3387 | ||
3388 | class GIFHandlerPtr(GIFHandler): | |
3389 | def __init__(self, this): | |
3390 | self.this = this | |
3391 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3392 | self.__class__ = GIFHandler | |
3393 | _core_.GIFHandler_swigregister(GIFHandlerPtr) | |
3394 | ||
3395 | class PCXHandler(ImageHandler): | |
27fb7603 | 3396 | """A `wx.ImageHandler` for PCX imager files.""" |
d55e5bfc RD |
3397 | def __repr__(self): |
3398 | return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3399 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3400 | """ |
3401 | __init__(self) -> PCXHandler | |
3402 | ||
3403 | A `wx.ImageHandler` for PCX imager files. | |
3404 | """ | |
d55e5bfc RD |
3405 | newobj = _core_.new_PCXHandler(*args, **kwargs) |
3406 | self.this = newobj.this | |
3407 | self.thisown = 1 | |
3408 | del newobj.thisown | |
3409 | ||
3410 | class PCXHandlerPtr(PCXHandler): | |
3411 | def __init__(self, this): | |
3412 | self.this = this | |
3413 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3414 | self.__class__ = PCXHandler | |
3415 | _core_.PCXHandler_swigregister(PCXHandlerPtr) | |
3416 | ||
3417 | class JPEGHandler(ImageHandler): | |
27fb7603 | 3418 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
d55e5bfc RD |
3419 | def __repr__(self): |
3420 | return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3421 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3422 | """ |
3423 | __init__(self) -> JPEGHandler | |
3424 | ||
3425 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3426 | """ | |
d55e5bfc RD |
3427 | newobj = _core_.new_JPEGHandler(*args, **kwargs) |
3428 | self.this = newobj.this | |
3429 | self.thisown = 1 | |
3430 | del newobj.thisown | |
3431 | ||
3432 | class JPEGHandlerPtr(JPEGHandler): | |
3433 | def __init__(self, this): | |
3434 | self.this = this | |
3435 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3436 | self.__class__ = JPEGHandler | |
3437 | _core_.JPEGHandler_swigregister(JPEGHandlerPtr) | |
3438 | ||
3439 | class PNMHandler(ImageHandler): | |
27fb7603 | 3440 | """A `wx.ImageHandler` for PNM image files.""" |
d55e5bfc RD |
3441 | def __repr__(self): |
3442 | return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3443 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3444 | """ |
3445 | __init__(self) -> PNMHandler | |
3446 | ||
3447 | A `wx.ImageHandler` for PNM image files. | |
3448 | """ | |
d55e5bfc RD |
3449 | newobj = _core_.new_PNMHandler(*args, **kwargs) |
3450 | self.this = newobj.this | |
3451 | self.thisown = 1 | |
3452 | del newobj.thisown | |
3453 | ||
3454 | class PNMHandlerPtr(PNMHandler): | |
3455 | def __init__(self, this): | |
3456 | self.this = this | |
3457 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3458 | self.__class__ = PNMHandler | |
3459 | _core_.PNMHandler_swigregister(PNMHandlerPtr) | |
3460 | ||
3461 | class XPMHandler(ImageHandler): | |
27fb7603 | 3462 | """A `wx.ImageHandler` for XPM image.""" |
d55e5bfc RD |
3463 | def __repr__(self): |
3464 | return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3465 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3466 | """ |
3467 | __init__(self) -> XPMHandler | |
3468 | ||
3469 | A `wx.ImageHandler` for XPM image. | |
3470 | """ | |
d55e5bfc RD |
3471 | newobj = _core_.new_XPMHandler(*args, **kwargs) |
3472 | self.this = newobj.this | |
3473 | self.thisown = 1 | |
3474 | del newobj.thisown | |
3475 | ||
3476 | class XPMHandlerPtr(XPMHandler): | |
3477 | def __init__(self, this): | |
3478 | self.this = this | |
3479 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3480 | self.__class__ = XPMHandler | |
3481 | _core_.XPMHandler_swigregister(XPMHandlerPtr) | |
3482 | ||
3483 | class TIFFHandler(ImageHandler): | |
27fb7603 | 3484 | """A `wx.ImageHandler` for TIFF image files.""" |
d55e5bfc RD |
3485 | def __repr__(self): |
3486 | return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3487 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3488 | """ |
3489 | __init__(self) -> TIFFHandler | |
3490 | ||
3491 | A `wx.ImageHandler` for TIFF image files. | |
3492 | """ | |
d55e5bfc RD |
3493 | newobj = _core_.new_TIFFHandler(*args, **kwargs) |
3494 | self.this = newobj.this | |
3495 | self.thisown = 1 | |
3496 | del newobj.thisown | |
3497 | ||
3498 | class TIFFHandlerPtr(TIFFHandler): | |
3499 | def __init__(self, this): | |
3500 | self.this = this | |
3501 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3502 | self.__class__ = TIFFHandler | |
3503 | _core_.TIFFHandler_swigregister(TIFFHandlerPtr) | |
3504 | ||
c0de73ae RD |
3505 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3506 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3507 | class Quantize(object): | |
3508 | """Performs quantization, or colour reduction, on a wxImage.""" | |
3509 | def __init__(self): raise RuntimeError, "No constructor defined" | |
3510 | def __repr__(self): | |
3511 | return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3512 | def Quantize(*args, **kwargs): | |
3513 | """ | |
3514 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3515 | ||
3516 | Reduce the colours in the source image and put the result into the | |
3517 | destination image, setting the palette in the destination if | |
3518 | needed. Both images may be the same, to overwrite the source image. | |
3519 | """ | |
3520 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3521 | ||
3522 | Quantize = staticmethod(Quantize) | |
3523 | ||
3524 | class QuantizePtr(Quantize): | |
3525 | def __init__(self, this): | |
3526 | self.this = this | |
3527 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3528 | self.__class__ = Quantize | |
3529 | _core_.Quantize_swigregister(QuantizePtr) | |
3530 | ||
3531 | def Quantize_Quantize(*args, **kwargs): | |
3532 | """ | |
3533 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3534 | ||
3535 | Reduce the colours in the source image and put the result into the | |
3536 | destination image, setting the palette in the destination if | |
3537 | needed. Both images may be the same, to overwrite the source image. | |
3538 | """ | |
3539 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3540 | ||
d55e5bfc RD |
3541 | #--------------------------------------------------------------------------- |
3542 | ||
3543 | class EvtHandler(Object): | |
093d3ff1 | 3544 | """Proxy of C++ EvtHandler class""" |
d55e5bfc RD |
3545 | def __repr__(self): |
3546 | return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3547 | def __init__(self, *args, **kwargs): | |
3548 | """__init__(self) -> EvtHandler""" | |
3549 | newobj = _core_.new_EvtHandler(*args, **kwargs) | |
3550 | self.this = newobj.this | |
3551 | self.thisown = 1 | |
3552 | del newobj.thisown | |
3553 | def GetNextHandler(*args, **kwargs): | |
3554 | """GetNextHandler(self) -> EvtHandler""" | |
3555 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) | |
3556 | ||
3557 | def GetPreviousHandler(*args, **kwargs): | |
3558 | """GetPreviousHandler(self) -> EvtHandler""" | |
3559 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) | |
3560 | ||
3561 | def SetNextHandler(*args, **kwargs): | |
3562 | """SetNextHandler(self, EvtHandler handler)""" | |
3563 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) | |
3564 | ||
3565 | def SetPreviousHandler(*args, **kwargs): | |
3566 | """SetPreviousHandler(self, EvtHandler handler)""" | |
3567 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) | |
3568 | ||
3569 | def GetEvtHandlerEnabled(*args, **kwargs): | |
3570 | """GetEvtHandlerEnabled(self) -> bool""" | |
3571 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) | |
3572 | ||
3573 | def SetEvtHandlerEnabled(*args, **kwargs): | |
3574 | """SetEvtHandlerEnabled(self, bool enabled)""" | |
3575 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) | |
3576 | ||
3577 | def ProcessEvent(*args, **kwargs): | |
3578 | """ProcessEvent(self, Event event) -> bool""" | |
3579 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) | |
3580 | ||
3581 | def AddPendingEvent(*args, **kwargs): | |
3582 | """AddPendingEvent(self, Event event)""" | |
3583 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) | |
3584 | ||
3585 | def ProcessPendingEvents(*args, **kwargs): | |
3586 | """ProcessPendingEvents(self)""" | |
3587 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) | |
3588 | ||
3589 | def Connect(*args, **kwargs): | |
3590 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" | |
3591 | return _core_.EvtHandler_Connect(*args, **kwargs) | |
3592 | ||
3593 | def Disconnect(*args, **kwargs): | |
3594 | """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool""" | |
3595 | return _core_.EvtHandler_Disconnect(*args, **kwargs) | |
3596 | ||
3597 | def _setOORInfo(*args, **kwargs): | |
093d3ff1 | 3598 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
d55e5bfc RD |
3599 | return _core_.EvtHandler__setOORInfo(*args, **kwargs) |
3600 | ||
3601 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): | |
3602 | """ | |
3603 | Bind an event to an event handler. | |
3604 | ||
caef1a4d RD |
3605 | :param event: One of the EVT_* objects that specifies the |
3606 | type of event to bind, | |
d55e5bfc | 3607 | |
caef1a4d RD |
3608 | :param handler: A callable object to be invoked when the |
3609 | event is delivered to self. Pass None to | |
3610 | disconnect an event handler. | |
d55e5bfc | 3611 | |
caef1a4d RD |
3612 | :param source: Sometimes the event originates from a |
3613 | different window than self, but you still | |
3614 | want to catch it in self. (For example, a | |
3615 | button event delivered to a frame.) By | |
3616 | passing the source of the event, the event | |
3617 | handling system is able to differentiate | |
3618 | between the same event type from different | |
3619 | controls. | |
d55e5bfc | 3620 | |
caef1a4d RD |
3621 | :param id: Used to spcify the event source by ID instead |
3622 | of instance. | |
3623 | ||
3624 | :param id2: Used when it is desirable to bind a handler | |
3625 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d55e5bfc RD |
3626 | """ |
3627 | if source is not None: | |
3628 | id = source.GetId() | |
3629 | event.Bind(self, id, id2, handler) | |
3630 | ||
c24da6d6 RD |
3631 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3632 | """ | |
3633 | Disconencts the event handler binding for event from self. | |
3634 | Returns True if successful. | |
3635 | """ | |
3636 | if source is not None: | |
3637 | id = source.GetId() | |
3638 | return event.Unbind(self, id, id2) | |
d55e5bfc RD |
3639 | |
3640 | ||
3641 | class EvtHandlerPtr(EvtHandler): | |
3642 | def __init__(self, this): | |
3643 | self.this = this | |
3644 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3645 | self.__class__ = EvtHandler | |
3646 | _core_.EvtHandler_swigregister(EvtHandlerPtr) | |
3647 | ||
3648 | #--------------------------------------------------------------------------- | |
3649 | ||
3650 | class PyEventBinder(object): | |
3651 | """ | |
3652 | Instances of this class are used to bind specific events to event | |
3653 | handlers. | |
3654 | """ | |
3655 | def __init__(self, evtType, expectedIDs=0): | |
3656 | if expectedIDs not in [0, 1, 2]: | |
3657 | raise ValueError, "Invalid number of expectedIDs" | |
3658 | self.expectedIDs = expectedIDs | |
3659 | ||
3660 | if type(evtType) == list or type(evtType) == tuple: | |
3661 | self.evtType = evtType | |
3662 | else: | |
3663 | self.evtType = [evtType] | |
3664 | ||
3665 | ||
3666 | def Bind(self, target, id1, id2, function): | |
3667 | """Bind this set of event types to target.""" | |
3668 | for et in self.evtType: | |
3669 | target.Connect(id1, id2, et, function) | |
3670 | ||
c24da6d6 RD |
3671 | |
3672 | def Unbind(self, target, id1, id2): | |
3673 | """Remove an event binding.""" | |
3674 | success = 0 | |
3675 | for et in self.evtType: | |
3676 | success += target.Disconnect(id1, id2, et) | |
3677 | return success != 0 | |
3678 | ||
d55e5bfc RD |
3679 | |
3680 | def __call__(self, *args): | |
3681 | """ | |
3682 | For backwards compatibility with the old EVT_* functions. | |
3683 | Should be called with either (window, func), (window, ID, | |
3684 | func) or (window, ID1, ID2, func) parameters depending on the | |
3685 | type of the event. | |
3686 | """ | |
3687 | assert len(args) == 2 + self.expectedIDs | |
3688 | id1 = wx.ID_ANY | |
3689 | id2 = wx.ID_ANY | |
3690 | target = args[0] | |
3691 | if self.expectedIDs == 0: | |
3692 | func = args[1] | |
3693 | elif self.expectedIDs == 1: | |
3694 | id1 = args[1] | |
3695 | func = args[2] | |
3696 | elif self.expectedIDs == 2: | |
3697 | id1 = args[1] | |
3698 | id2 = args[2] | |
3699 | func = args[3] | |
3700 | else: | |
3701 | raise ValueError, "Unexpected number of IDs" | |
3702 | ||
3703 | self.Bind(target, id1, id2, func) | |
3704 | ||
3705 | ||
3706 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3707 | def EVT_COMMAND(win, id, cmd, func): | |
3708 | win.Connect(id, -1, cmd, func) | |
3709 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3710 | win.Connect(id1, id2, cmd, func) | |
3711 | ||
3712 | ||
3713 | #--------------------------------------------------------------------------- | |
3714 | ||
3715 | #--------------------------------------------------------------------------- | |
3716 | ||
3717 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE | |
3718 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
3719 | ||
3720 | def NewEventType(*args, **kwargs): | |
3721 | """NewEventType() -> wxEventType""" | |
3722 | return _core_.NewEventType(*args, **kwargs) | |
3723 | wxEVT_NULL = _core_.wxEVT_NULL | |
3724 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3725 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3726 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3727 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3728 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3729 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3730 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3731 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3732 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3733 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3734 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3735 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3736 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3737 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3738 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3739 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3740 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3741 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3742 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3743 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3744 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3745 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3746 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3747 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3748 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3749 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3750 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3751 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3752 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3753 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3754 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3755 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3756 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3757 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3758 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3759 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3760 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3761 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3762 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3763 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3764 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3765 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3766 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3767 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3768 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3769 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3770 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3771 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3772 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3773 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3774 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3775 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3776 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3777 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3778 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3779 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3780 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3781 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3782 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3783 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3784 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
db67f999 RD |
3785 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
3786 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
d55e5bfc RD |
3787 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
3788 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3789 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3790 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3791 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3792 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3793 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3794 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3795 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3796 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3797 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3798 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3799 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3800 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
3801 | wxEVT_POWER = _core_.wxEVT_POWER | |
3802 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE | |
3803 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3804 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3805 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3806 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3807 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3808 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
3809 | wxEVT_PAINT = _core_.wxEVT_PAINT | |
3810 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3811 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3812 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3813 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3814 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3815 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3816 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3817 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3818 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3819 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3820 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3821 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3822 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3823 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3824 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3825 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3826 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3827 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3828 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3829 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3830 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
88c6b281 | 3831 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE |
d55e5bfc RD |
3832 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
3833 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3834 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3835 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3836 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3837 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3838 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
3839 | # | |
3840 | # Create some event binders | |
3841 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3842 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3843 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3844 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3845 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3846 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3847 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3848 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3849 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3850 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3851 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3852 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3853 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
3854 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) | |
3855 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) | |
3856 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3857 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3858 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3859 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3860 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3861 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3862 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3863 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3864 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
88c6b281 | 3865 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d55e5bfc RD |
3866 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3867 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3868 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3869 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3870 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3871 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3872 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3873 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3874 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3875 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3876 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3877 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3878 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3879 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3880 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3881 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
3882 | ||
3883 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3884 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3885 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3886 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3887 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3888 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3889 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3890 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3891 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3892 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3893 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3894 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3895 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3896 | ||
3897 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3898 | wxEVT_LEFT_UP, | |
3899 | wxEVT_MIDDLE_DOWN, | |
3900 | wxEVT_MIDDLE_UP, | |
3901 | wxEVT_RIGHT_DOWN, | |
3902 | wxEVT_RIGHT_UP, | |
3903 | wxEVT_MOTION, | |
3904 | wxEVT_LEFT_DCLICK, | |
3905 | wxEVT_MIDDLE_DCLICK, | |
3906 | wxEVT_RIGHT_DCLICK, | |
3907 | wxEVT_ENTER_WINDOW, | |
3908 | wxEVT_LEAVE_WINDOW, | |
3909 | wxEVT_MOUSEWHEEL | |
3910 | ]) | |
3911 | ||
3912 | ||
3913 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
3914 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, | |
3915 | wxEVT_SCROLLWIN_BOTTOM, | |
3916 | wxEVT_SCROLLWIN_LINEUP, | |
3917 | wxEVT_SCROLLWIN_LINEDOWN, | |
3918 | wxEVT_SCROLLWIN_PAGEUP, | |
3919 | wxEVT_SCROLLWIN_PAGEDOWN, | |
3920 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3921 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3922 | ]) | |
3923 | ||
3924 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3925 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3926 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3927 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3928 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3929 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3930 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3931 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3932 | ||
27fb7603 | 3933 | # Scrolling from wx.Slider and wx.ScrollBar |
d55e5bfc RD |
3934 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3935 | wxEVT_SCROLL_BOTTOM, | |
3936 | wxEVT_SCROLL_LINEUP, | |
3937 | wxEVT_SCROLL_LINEDOWN, | |
3938 | wxEVT_SCROLL_PAGEUP, | |
3939 | wxEVT_SCROLL_PAGEDOWN, | |
3940 | wxEVT_SCROLL_THUMBTRACK, | |
3941 | wxEVT_SCROLL_THUMBRELEASE, | |
db67f999 | 3942 | wxEVT_SCROLL_CHANGED, |
d55e5bfc RD |
3943 | ]) |
3944 | ||
3945 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3946 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3947 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3948 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3949 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3950 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3951 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3952 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
db67f999 RD |
3953 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
3954 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
3955 | ||
27fb7603 | 3956 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
d55e5bfc RD |
3957 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3958 | wxEVT_SCROLL_BOTTOM, | |
3959 | wxEVT_SCROLL_LINEUP, | |
3960 | wxEVT_SCROLL_LINEDOWN, | |
3961 | wxEVT_SCROLL_PAGEUP, | |
3962 | wxEVT_SCROLL_PAGEDOWN, | |
3963 | wxEVT_SCROLL_THUMBTRACK, | |
3964 | wxEVT_SCROLL_THUMBRELEASE, | |
db67f999 | 3965 | wxEVT_SCROLL_CHANGED, |
d55e5bfc RD |
3966 | ], 1) |
3967 | ||
3968 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3969 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3970 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3971 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3972 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3973 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3974 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3975 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
db67f999 RD |
3976 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
3977 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d55e5bfc RD |
3978 | |
3979 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) | |
3980 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3981 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3982 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3983 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3984 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3985 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3986 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3987 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3988 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3989 | ||
3990 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3991 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3992 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3993 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3994 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3995 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3996 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3997 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3998 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3999 | ||
4000 | ||
4001 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
4002 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
4003 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
4004 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
4005 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
4006 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
4007 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
4008 | ||
4009 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
4010 | ||
4011 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
4012 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
4013 | ||
4014 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
4015 | ||
4016 | ||
4017 | ||
4018 | #--------------------------------------------------------------------------- | |
4019 | ||
4020 | class Event(Object): | |
27fb7603 RD |
4021 | """ |
4022 | An event is a structure holding information about an event passed to a | |
4023 | callback or member function. wx.Event is an abstract base class for | |
4024 | other event classes | |
4025 | """ | |
d55e5bfc RD |
4026 | def __init__(self): raise RuntimeError, "No constructor defined" |
4027 | def __repr__(self): | |
4028 | return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4029 | def __del__(self, destroy=_core_.delete_Event): | |
4030 | """__del__(self)""" | |
4031 | try: | |
4032 | if self.thisown: destroy(self) | |
4033 | except: pass | |
4034 | ||
4035 | def SetEventType(*args, **kwargs): | |
27fb7603 RD |
4036 | """ |
4037 | SetEventType(self, wxEventType typ) | |
4038 | ||
4039 | Sets the specific type of the event. | |
4040 | """ | |
d55e5bfc RD |
4041 | return _core_.Event_SetEventType(*args, **kwargs) |
4042 | ||
4043 | def GetEventType(*args, **kwargs): | |
27fb7603 RD |
4044 | """ |
4045 | GetEventType(self) -> wxEventType | |
4046 | ||
4047 | Returns the identifier of the given event type, such as | |
4048 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
4049 | """ | |
d55e5bfc RD |
4050 | return _core_.Event_GetEventType(*args, **kwargs) |
4051 | ||
4052 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
4053 | """ |
4054 | GetEventObject(self) -> Object | |
4055 | ||
4056 | Returns the object (usually a window) associated with the event, if | |
4057 | any. | |
4058 | """ | |
d55e5bfc RD |
4059 | return _core_.Event_GetEventObject(*args, **kwargs) |
4060 | ||
4061 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
4062 | """ |
4063 | SetEventObject(self, Object obj) | |
4064 | ||
4065 | Sets the originating object, or in other words, obj is normally the | |
4066 | object that is sending the event. | |
4067 | """ | |
d55e5bfc RD |
4068 | return _core_.Event_SetEventObject(*args, **kwargs) |
4069 | ||
4070 | def GetTimestamp(*args, **kwargs): | |
4071 | """GetTimestamp(self) -> long""" | |
4072 | return _core_.Event_GetTimestamp(*args, **kwargs) | |
4073 | ||
4074 | def SetTimestamp(*args, **kwargs): | |
4075 | """SetTimestamp(self, long ts=0)""" | |
4076 | return _core_.Event_SetTimestamp(*args, **kwargs) | |
4077 | ||
4078 | def GetId(*args, **kwargs): | |
27fb7603 RD |
4079 | """ |
4080 | GetId(self) -> int | |
4081 | ||
4082 | Returns the identifier associated with this event, such as a button | |
4083 | command id. | |
4084 | """ | |
d55e5bfc RD |
4085 | return _core_.Event_GetId(*args, **kwargs) |
4086 | ||
4087 | def SetId(*args, **kwargs): | |
27fb7603 RD |
4088 | """ |
4089 | SetId(self, int Id) | |
4090 | ||
4091 | Set's the ID for the event. This is usually the ID of the window that | |
4092 | is sending the event, but it can also be a command id from a menu | |
4093 | item, etc. | |
4094 | """ | |
d55e5bfc RD |
4095 | return _core_.Event_SetId(*args, **kwargs) |
4096 | ||
4097 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
4098 | """ |
4099 | IsCommandEvent(self) -> bool | |
4100 | ||
4101 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
4102 | it returns false. Note: Exists only for optimization purposes. | |
4103 | """ | |
d55e5bfc RD |
4104 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
4105 | ||
4106 | def Skip(*args, **kwargs): | |
51b83b37 RD |
4107 | """ |
4108 | Skip(self, bool skip=True) | |
4109 | ||
4110 | Called by an event handler, it controls whether additional event | |
4111 | handlers bound to this event will be called after the current event | |
4112 | handler returns. Skip(false) (the default setting) will prevent | |
4113 | additional event handlers from being called and control will be | |
4114 | returned to the sender of the event immediately after the current | |
4115 | handler has finished. Skip(True) will cause the event processing | |
4116 | system to continue searching for a handler function for this event. | |
4117 | ||
4118 | """ | |
d55e5bfc RD |
4119 | return _core_.Event_Skip(*args, **kwargs) |
4120 | ||
4121 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
4122 | """ |
4123 | GetSkipped(self) -> bool | |
4124 | ||
4125 | Returns true if the event handler should be skipped, false otherwise. | |
4126 | :see: `Skip` | |
4127 | """ | |
d55e5bfc RD |
4128 | return _core_.Event_GetSkipped(*args, **kwargs) |
4129 | ||
4130 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
4131 | """ |
4132 | ShouldPropagate(self) -> bool | |
4133 | ||
4134 | Test if this event should be propagated to the parent window or not, | |
4135 | i.e. if the propagation level is currently greater than 0. | |
4136 | """ | |
d55e5bfc RD |
4137 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
4138 | ||
4139 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
4140 | """ |
4141 | StopPropagation(self) -> int | |
4142 | ||
4143 | Stop the event from propagating to its parent window. Returns the old | |
4144 | propagation level value which may be later passed to | |
4145 | `ResumePropagation` to allow propagating the event again. | |
4146 | """ | |
d55e5bfc RD |
4147 | return _core_.Event_StopPropagation(*args, **kwargs) |
4148 | ||
4149 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
4150 | """ |
4151 | ResumePropagation(self, int propagationLevel) | |
4152 | ||
4153 | Resume the event propagation by restoring the propagation level. (For | |
4154 | example, you can use the value returned by an earlier call to | |
4155 | `StopPropagation`.) | |
4156 | ||
4157 | """ | |
d55e5bfc RD |
4158 | return _core_.Event_ResumePropagation(*args, **kwargs) |
4159 | ||
4160 | def Clone(*args, **kwargs): | |
4161 | """Clone(self) -> Event""" | |
4162 | return _core_.Event_Clone(*args, **kwargs) | |
4163 | ||
4164 | ||
4165 | class EventPtr(Event): | |
4166 | def __init__(self, this): | |
4167 | self.this = this | |
4168 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4169 | self.__class__ = Event | |
4170 | _core_.Event_swigregister(EventPtr) | |
4171 | ||
4172 | #--------------------------------------------------------------------------- | |
4173 | ||
4174 | class PropagationDisabler(object): | |
27fb7603 RD |
4175 | """ |
4176 | Helper class to temporarily change an event not to propagate. Simply | |
4177 | create an instance of this class and then whe it is destroyed the | |
4178 | propogation of the event will be restored. | |
4179 | """ | |
d55e5bfc RD |
4180 | def __repr__(self): |
4181 | return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4182 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4183 | """ |
4184 | __init__(self, Event event) -> PropagationDisabler | |
4185 | ||
4186 | Helper class to temporarily change an event not to propagate. Simply | |
4187 | create an instance of this class and then whe it is destroyed the | |
4188 | propogation of the event will be restored. | |
4189 | """ | |
d55e5bfc RD |
4190 | newobj = _core_.new_PropagationDisabler(*args, **kwargs) |
4191 | self.this = newobj.this | |
4192 | self.thisown = 1 | |
4193 | del newobj.thisown | |
4194 | def __del__(self, destroy=_core_.delete_PropagationDisabler): | |
4195 | """__del__(self)""" | |
4196 | try: | |
4197 | if self.thisown: destroy(self) | |
4198 | except: pass | |
4199 | ||
4200 | ||
4201 | class PropagationDisablerPtr(PropagationDisabler): | |
4202 | def __init__(self, this): | |
4203 | self.this = this | |
4204 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4205 | self.__class__ = PropagationDisabler | |
4206 | _core_.PropagationDisabler_swigregister(PropagationDisablerPtr) | |
4207 | ||
4208 | class PropagateOnce(object): | |
27fb7603 RD |
4209 | """ |
4210 | A helper class that will temporarily lower propagation level of an | |
4211 | event. Simply create an instance of this class and then whe it is | |
4212 | destroyed the propogation of the event will be restored. | |
4213 | """ | |
d55e5bfc RD |
4214 | def __repr__(self): |
4215 | return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4216 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4217 | """ |
4218 | __init__(self, Event event) -> PropagateOnce | |
4219 | ||
4220 | A helper class that will temporarily lower propagation level of an | |
4221 | event. Simply create an instance of this class and then whe it is | |
4222 | destroyed the propogation of the event will be restored. | |
4223 | """ | |
d55e5bfc RD |
4224 | newobj = _core_.new_PropagateOnce(*args, **kwargs) |
4225 | self.this = newobj.this | |
4226 | self.thisown = 1 | |
4227 | del newobj.thisown | |
4228 | def __del__(self, destroy=_core_.delete_PropagateOnce): | |
4229 | """__del__(self)""" | |
4230 | try: | |
4231 | if self.thisown: destroy(self) | |
4232 | except: pass | |
4233 | ||
4234 | ||
4235 | class PropagateOncePtr(PropagateOnce): | |
4236 | def __init__(self, this): | |
4237 | self.this = this | |
4238 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4239 | self.__class__ = PropagateOnce | |
4240 | _core_.PropagateOnce_swigregister(PropagateOncePtr) | |
4241 | ||
4242 | #--------------------------------------------------------------------------- | |
4243 | ||
4244 | class CommandEvent(Event): | |
27fb7603 RD |
4245 | """ |
4246 | This event class contains information about command events, which | |
4247 | originate from a variety of simple controls, as well as menus and | |
4248 | toolbars. | |
4249 | """ | |
d55e5bfc RD |
4250 | def __repr__(self): |
4251 | return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4252 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4253 | """ |
4254 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent | |
4255 | ||
4256 | This event class contains information about command events, which | |
4257 | originate from a variety of simple controls, as well as menus and | |
4258 | toolbars. | |
4259 | """ | |
d55e5bfc RD |
4260 | newobj = _core_.new_CommandEvent(*args, **kwargs) |
4261 | self.this = newobj.this | |
4262 | self.thisown = 1 | |
4263 | del newobj.thisown | |
4264 | def GetSelection(*args, **kwargs): | |
27fb7603 RD |
4265 | """ |
4266 | GetSelection(self) -> int | |
4267 | ||
4268 | Returns item index for a listbox or choice selection event (not valid | |
4269 | for a deselection). | |
4270 | """ | |
d55e5bfc RD |
4271 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
4272 | ||
4273 | def SetString(*args, **kwargs): | |
4274 | """SetString(self, String s)""" | |
4275 | return _core_.CommandEvent_SetString(*args, **kwargs) | |
4276 | ||
4277 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4278 | """ |
4279 | GetString(self) -> String | |
4280 | ||
4281 | Returns item string for a listbox or choice selection event (not valid | |
4282 | for a deselection). | |
4283 | """ | |
d55e5bfc RD |
4284 | return _core_.CommandEvent_GetString(*args, **kwargs) |
4285 | ||
4286 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4287 | """ |
4288 | IsChecked(self) -> bool | |
4289 | ||
4290 | This method can be used with checkbox and menu events: for the | |
4291 | checkboxes, the method returns true for a selection event and false | |
4292 | for a deselection one. For the menu events, this method indicates if | |
4293 | the menu item just has become checked or unchecked (and thus only | |
4294 | makes sense for checkable menu items). | |
4295 | """ | |
d55e5bfc RD |
4296 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
4297 | ||
4298 | Checked = IsChecked | |
4299 | def IsSelection(*args, **kwargs): | |
27fb7603 RD |
4300 | """ |
4301 | IsSelection(self) -> bool | |
4302 | ||
4303 | For a listbox or similar event, returns true if it is a selection, | |
4304 | false if it is a deselection. | |
4305 | """ | |
d55e5bfc RD |
4306 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
4307 | ||
4308 | def SetExtraLong(*args, **kwargs): | |
4309 | """SetExtraLong(self, long extraLong)""" | |
4310 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) | |
4311 | ||
4312 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4313 | """ |
4314 | GetExtraLong(self) -> long | |
4315 | ||
5ba5649b RD |
4316 | Returns extra information dependant on the event objects type. If the |
4317 | event comes from a listbox selection, it is a boolean determining | |
4318 | whether the event was a selection (true) or a deselection (false). A | |
4319 | listbox deselection only occurs for multiple-selection boxes, and in | |
4320 | this case the index and string values are indeterminate and the | |
4321 | listbox must be examined by the application. | |
27fb7603 | 4322 | """ |
d55e5bfc RD |
4323 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
4324 | ||
4325 | def SetInt(*args, **kwargs): | |
4326 | """SetInt(self, int i)""" | |
4327 | return _core_.CommandEvent_SetInt(*args, **kwargs) | |
4328 | ||
4329 | def GetInt(*args, **kwargs): | |
27fb7603 RD |
4330 | """ |
4331 | GetInt(self) -> long | |
4332 | ||
5ba5649b RD |
4333 | Returns the integer identifier corresponding to a listbox, choice or |
4334 | radiobox selection (only if the event was a selection, not a | |
4335 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4336 | """ |
d55e5bfc RD |
4337 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
4338 | ||
4339 | def Clone(*args, **kwargs): | |
4340 | """Clone(self) -> Event""" | |
4341 | return _core_.CommandEvent_Clone(*args, **kwargs) | |
4342 | ||
4343 | ||
4344 | class CommandEventPtr(CommandEvent): | |
4345 | def __init__(self, this): | |
4346 | self.this = this | |
4347 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4348 | self.__class__ = CommandEvent | |
4349 | _core_.CommandEvent_swigregister(CommandEventPtr) | |
4350 | ||
4351 | #--------------------------------------------------------------------------- | |
4352 | ||
4353 | class NotifyEvent(CommandEvent): | |
27fb7603 RD |
4354 | """ |
4355 | An instance of this class (or one of its derived classes) is sent from | |
4356 | a control when the control's state is being changed and the control | |
4357 | allows that change to be prevented from happening. The event handler | |
4358 | can call `Veto` or `Allow` to tell the control what to do. | |
4359 | """ | |
d55e5bfc RD |
4360 | def __repr__(self): |
4361 | return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4362 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4363 | """ |
4364 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent | |
4365 | ||
4366 | An instance of this class (or one of its derived classes) is sent from | |
4367 | a control when the control's state is being changed and the control | |
4368 | allows that change to be prevented from happening. The event handler | |
4369 | can call `Veto` or `Allow` to tell the control what to do. | |
4370 | """ | |
d55e5bfc RD |
4371 | newobj = _core_.new_NotifyEvent(*args, **kwargs) |
4372 | self.this = newobj.this | |
4373 | self.thisown = 1 | |
4374 | del newobj.thisown | |
4375 | def Veto(*args, **kwargs): | |
27fb7603 RD |
4376 | """ |
4377 | Veto(self) | |
4378 | ||
4379 | Prevents the change announced by this event from happening. | |
4380 | ||
4381 | It is in general a good idea to notify the user about the reasons for | |
4382 | vetoing the change because otherwise the applications behaviour (which | |
4383 | just refuses to do what the user wants) might be quite surprising. | |
4384 | """ | |
d55e5bfc RD |
4385 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
4386 | ||
4387 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4388 | """ |
4389 | Allow(self) | |
4390 | ||
4391 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4392 | processed. For most events it is not necessary to call this method as | |
4393 | the events are allowed anyhow but some are forbidden by default (this | |
4394 | will be mentioned in the corresponding event description). | |
4395 | """ | |
d55e5bfc RD |
4396 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
4397 | ||
4398 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4399 | """ |
4400 | IsAllowed(self) -> bool | |
4401 | ||
4402 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4403 | false otherwise (if it was). | |
4404 | """ | |
d55e5bfc RD |
4405 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
4406 | ||
4407 | ||
4408 | class NotifyEventPtr(NotifyEvent): | |
4409 | def __init__(self, this): | |
4410 | self.this = this | |
4411 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4412 | self.__class__ = NotifyEvent | |
4413 | _core_.NotifyEvent_swigregister(NotifyEventPtr) | |
4414 | ||
4415 | #--------------------------------------------------------------------------- | |
4416 | ||
4417 | class ScrollEvent(CommandEvent): | |
27fb7603 RD |
4418 | """ |
4419 | A scroll event holds information about events sent from stand-alone | |
4420 | scrollbars and sliders. Note that scrolled windows do not send | |
4421 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4422 | instead. | |
4423 | """ | |
d55e5bfc RD |
4424 | def __repr__(self): |
4425 | return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4426 | def __init__(self, *args, **kwargs): | |
4427 | """ | |
4428 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0, | |
4429 | int orient=0) -> ScrollEvent | |
4430 | """ | |
4431 | newobj = _core_.new_ScrollEvent(*args, **kwargs) | |
4432 | self.this = newobj.this | |
4433 | self.thisown = 1 | |
4434 | del newobj.thisown | |
4435 | def GetOrientation(*args, **kwargs): | |
27fb7603 RD |
4436 | """ |
4437 | GetOrientation(self) -> int | |
4438 | ||
4439 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4440 | the scrollbar. | |
4441 | """ | |
d55e5bfc RD |
4442 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
4443 | ||
4444 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4445 | """ |
4446 | GetPosition(self) -> int | |
4447 | ||
4448 | Returns the position of the scrollbar. | |
4449 | """ | |
d55e5bfc RD |
4450 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
4451 | ||
4452 | def SetOrientation(*args, **kwargs): | |
4453 | """SetOrientation(self, int orient)""" | |
4454 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) | |
4455 | ||
4456 | def SetPosition(*args, **kwargs): | |
4457 | """SetPosition(self, int pos)""" | |
4458 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) | |
4459 | ||
4460 | ||
4461 | class ScrollEventPtr(ScrollEvent): | |
4462 | def __init__(self, this): | |
4463 | self.this = this | |
4464 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4465 | self.__class__ = ScrollEvent | |
4466 | _core_.ScrollEvent_swigregister(ScrollEventPtr) | |
4467 | ||
4468 | #--------------------------------------------------------------------------- | |
4469 | ||
4470 | class ScrollWinEvent(Event): | |
27fb7603 RD |
4471 | """ |
4472 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4473 | scrolling windows. | |
4474 | """ | |
d55e5bfc RD |
4475 | def __repr__(self): |
4476 | return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4477 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4478 | """ |
4479 | __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent | |
4480 | ||
4481 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4482 | scrolling windows. | |
4483 | """ | |
d55e5bfc RD |
4484 | newobj = _core_.new_ScrollWinEvent(*args, **kwargs) |
4485 | self.this = newobj.this | |
4486 | self.thisown = 1 | |
4487 | del newobj.thisown | |
4488 | def GetOrientation(*args, **kwargs): | |
27fb7603 RD |
4489 | """ |
4490 | GetOrientation(self) -> int | |
4491 | ||
4492 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4493 | the scrollbar. | |
4494 | """ | |
d55e5bfc RD |
4495 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
4496 | ||
4497 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4498 | """ |
4499 | GetPosition(self) -> int | |
4500 | ||
4501 | Returns the position of the scrollbar for the thumb track and release | |
4502 | events. Note that this field can't be used for the other events, you | |
4503 | need to query the window itself for the current position in that case. | |
4504 | """ | |
d55e5bfc RD |
4505 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
4506 | ||
4507 | def SetOrientation(*args, **kwargs): | |
4508 | """SetOrientation(self, int orient)""" | |
4509 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) | |
4510 | ||
4511 | def SetPosition(*args, **kwargs): | |
4512 | """SetPosition(self, int pos)""" | |
4513 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) | |
4514 | ||
4515 | ||
4516 | class ScrollWinEventPtr(ScrollWinEvent): | |
4517 | def __init__(self, this): | |
4518 | self.this = this | |
4519 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4520 | self.__class__ = ScrollWinEvent | |
4521 | _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr) | |
4522 | ||
4523 | #--------------------------------------------------------------------------- | |
4524 | ||
4525 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY | |
4526 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4527 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4528 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4529 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
4530 | class MouseEvent(Event): | |
27fb7603 RD |
4531 | """ |
4532 | This event class contains information about the events generated by | |
4533 | the mouse: they include mouse buttons press and release events and | |
4534 | mouse move events. | |
4535 | ||
4536 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4537 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4538 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4539 | a middle button so a portable application should avoid relying on the | |
4540 | events from it. | |
4541 | ||
4542 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4543 | the former returns true when the event corresponds to the left mouse | |
4544 | button click while the latter returns true if the left mouse button is | |
4545 | currently being pressed. For example, when the user is dragging the | |
4546 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4547 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4548 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4549 | underlying GUI behaviour is (which is platform-dependent). The same | |
4550 | applies, of course, to other mouse buttons as well. | |
4551 | """ | |
d55e5bfc RD |
4552 | def __repr__(self): |
4553 | return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4554 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4555 | """ |
4556 | __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent | |
4557 | ||
4558 | Constructs a wx.MouseEvent. Valid event types are: | |
4559 | ||
4560 | * wxEVT_ENTER_WINDOW | |
4561 | * wxEVT_LEAVE_WINDOW | |
4562 | * wxEVT_LEFT_DOWN | |
4563 | * wxEVT_LEFT_UP | |
4564 | * wxEVT_LEFT_DCLICK | |
4565 | * wxEVT_MIDDLE_DOWN | |
4566 | * wxEVT_MIDDLE_UP | |
4567 | * wxEVT_MIDDLE_DCLICK | |
4568 | * wxEVT_RIGHT_DOWN | |
4569 | * wxEVT_RIGHT_UP | |
4570 | * wxEVT_RIGHT_DCLICK | |
4571 | * wxEVT_MOTION | |
4572 | * wxEVT_MOUSEWHEEL | |
4573 | """ | |
d55e5bfc RD |
4574 | newobj = _core_.new_MouseEvent(*args, **kwargs) |
4575 | self.this = newobj.this | |
4576 | self.thisown = 1 | |
4577 | del newobj.thisown | |
4578 | def IsButton(*args, **kwargs): | |
27fb7603 RD |
4579 | """ |
4580 | IsButton(self) -> bool | |
4581 | ||
4582 | Returns true if the event was a mouse button event (not necessarily a | |
4583 | button down event - that may be tested using `ButtonDown`). | |
4584 | """ | |
d55e5bfc RD |
4585 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
4586 | ||
4587 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4588 | """ |
4589 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4590 | ||
5ba5649b RD |
4591 | If the argument is omitted, this returns true if the event was any |
4592 | mouse button down event. Otherwise the argument specifies which | |
4593 | button-down event shold be checked for (see `Button` for the possible | |
4594 | values). | |
27fb7603 | 4595 | """ |
d55e5bfc RD |
4596 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
4597 | ||
4598 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4599 | """ |
4600 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4601 | ||
4602 | If the argument is omitted, this returns true if the event was any | |
4603 | mouse double click event. Otherwise the argument specifies which | |
4604 | double click event to check for (see `Button` for the possible | |
4605 | values). | |
4606 | """ | |
d55e5bfc RD |
4607 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
4608 | ||
4609 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4610 | """ |
4611 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4612 | ||
4613 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4614 | mouse button up event. Otherwise the argument specifies which button |
4615 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4616 | """ |
d55e5bfc RD |
4617 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
4618 | ||
4619 | def Button(*args, **kwargs): | |
27fb7603 RD |
4620 | """ |
4621 | Button(self, int button) -> bool | |
4622 | ||
4623 | Returns true if the identified mouse button is changing state. Valid | |
4624 | values of button are: | |
4625 | ||
4626 | ==================== ===================================== | |
4627 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4628 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4629 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4630 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4631 | ==================== ===================================== | |
4632 | ||
4633 | """ | |
d55e5bfc RD |
4634 | return _core_.MouseEvent_Button(*args, **kwargs) |
4635 | ||
4636 | def ButtonIsDown(*args, **kwargs): | |
4637 | """ButtonIsDown(self, int but) -> bool""" | |
4638 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) | |
4639 | ||
4640 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4641 | """ |
4642 | GetButton(self) -> int | |
4643 | ||
4644 | Returns the mouse button which generated this event or | |
4645 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4646 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4647 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4648 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4649 | right buttons respectively. | |
4650 | """ | |
d55e5bfc RD |
4651 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
4652 | ||
4653 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4654 | """ |
4655 | ControlDown(self) -> bool | |
4656 | ||
4657 | Returns true if the control key was down at the time of the event. | |
4658 | """ | |
d55e5bfc RD |
4659 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
4660 | ||
4661 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4662 | """ |
4663 | MetaDown(self) -> bool | |
4664 | ||
4665 | Returns true if the Meta key was down at the time of the event. | |
4666 | """ | |
d55e5bfc RD |
4667 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
4668 | ||
4669 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4670 | """ |
4671 | AltDown(self) -> bool | |
4672 | ||
4673 | Returns true if the Alt key was down at the time of the event. | |
4674 | """ | |
d55e5bfc RD |
4675 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
4676 | ||
4677 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4678 | """ |
4679 | ShiftDown(self) -> bool | |
4680 | ||
4681 | Returns true if the Shift key was down at the time of the event. | |
4682 | """ | |
d55e5bfc RD |
4683 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
4684 | ||
412d302d RD |
4685 | def CmdDown(*args, **kwargs): |
4686 | """ | |
4687 | CmdDown(self) -> bool | |
4688 | ||
4689 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4690 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4691 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4692 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4693 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4694 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4695 | and Macs this is the same as `MetaDown`. | |
4696 | """ | |
4697 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4698 | ||
d55e5bfc | 4699 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4700 | """ |
4701 | LeftDown(self) -> bool | |
4702 | ||
4703 | Returns true if the left mouse button state changed to down. | |
4704 | """ | |
d55e5bfc RD |
4705 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
4706 | ||
4707 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4708 | """ |
4709 | MiddleDown(self) -> bool | |
4710 | ||
4711 | Returns true if the middle mouse button state changed to down. | |
4712 | """ | |
d55e5bfc RD |
4713 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
4714 | ||
4715 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4716 | """ |
4717 | RightDown(self) -> bool | |
4718 | ||
4719 | Returns true if the right mouse button state changed to down. | |
4720 | """ | |
d55e5bfc RD |
4721 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
4722 | ||
4723 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4724 | """ |
4725 | LeftUp(self) -> bool | |
4726 | ||
4727 | Returns true if the left mouse button state changed to up. | |
4728 | """ | |
d55e5bfc RD |
4729 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
4730 | ||
4731 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4732 | """ |
4733 | MiddleUp(self) -> bool | |
4734 | ||
4735 | Returns true if the middle mouse button state changed to up. | |
4736 | """ | |
d55e5bfc RD |
4737 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
4738 | ||
4739 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4740 | """ |
4741 | RightUp(self) -> bool | |
4742 | ||
4743 | Returns true if the right mouse button state changed to up. | |
4744 | """ | |
d55e5bfc RD |
4745 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
4746 | ||
4747 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4748 | """ |
4749 | LeftDClick(self) -> bool | |
4750 | ||
4751 | Returns true if the event was a left button double click. | |
4752 | """ | |
d55e5bfc RD |
4753 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
4754 | ||
4755 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4756 | """ |
4757 | MiddleDClick(self) -> bool | |
4758 | ||
4759 | Returns true if the event was a middle button double click. | |
4760 | """ | |
d55e5bfc RD |
4761 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
4762 | ||
4763 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4764 | """ |
4765 | RightDClick(self) -> bool | |
4766 | ||
4767 | Returns true if the event was a right button double click. | |
4768 | """ | |
d55e5bfc RD |
4769 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
4770 | ||
4771 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4772 | """ |
4773 | LeftIsDown(self) -> bool | |
4774 | ||
4775 | Returns true if the left mouse button is currently down, independent | |
4776 | of the current event type. | |
4777 | ||
4778 | Please notice that it is not the same as LeftDown which returns true | |
4779 | if the left mouse button was just pressed. Rather, it describes the | |
4780 | state of the mouse button before the event happened. | |
4781 | ||
4782 | This event is usually used in the mouse event handlers which process | |
4783 | "move mouse" messages to determine whether the user is (still) | |
4784 | dragging the mouse. | |
4785 | """ | |
d55e5bfc RD |
4786 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
4787 | ||
4788 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4789 | """ |
4790 | MiddleIsDown(self) -> bool | |
4791 | ||
4792 | Returns true if the middle mouse button is currently down, independent | |
4793 | of the current event type. | |
4794 | """ | |
d55e5bfc RD |
4795 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
4796 | ||
4797 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4798 | """ |
4799 | RightIsDown(self) -> bool | |
4800 | ||
4801 | Returns true if the right mouse button is currently down, independent | |
4802 | of the current event type. | |
4803 | """ | |
d55e5bfc RD |
4804 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
4805 | ||
4806 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4807 | """ |
4808 | Dragging(self) -> bool | |
4809 | ||
4810 | Returns true if this was a dragging event (motion while a button is | |
4811 | depressed). | |
4812 | """ | |
d55e5bfc RD |
4813 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
4814 | ||
4815 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4816 | """ |
4817 | Moving(self) -> bool | |
4818 | ||
4819 | Returns true if this was a motion event and no mouse buttons were | |
4820 | pressed. If any mouse button is held pressed, then this method returns | |
4821 | false and Dragging returns true. | |
4822 | """ | |
d55e5bfc RD |
4823 | return _core_.MouseEvent_Moving(*args, **kwargs) |
4824 | ||
4825 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4826 | """ |
4827 | Entering(self) -> bool | |
4828 | ||
4829 | Returns true if the mouse was entering the window. | |
4830 | """ | |
d55e5bfc RD |
4831 | return _core_.MouseEvent_Entering(*args, **kwargs) |
4832 | ||
4833 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4834 | """ |
4835 | Leaving(self) -> bool | |
4836 | ||
4837 | Returns true if the mouse was leaving the window. | |
4838 | """ | |
d55e5bfc RD |
4839 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
4840 | ||
4841 | def GetPosition(*args, **kwargs): | |
4842 | """ | |
4843 | GetPosition(self) -> Point | |
4844 | ||
27fb7603 RD |
4845 | Returns the pixel position of the mouse in window coordinates when the |
4846 | event happened. | |
d55e5bfc RD |
4847 | """ |
4848 | return _core_.MouseEvent_GetPosition(*args, **kwargs) | |
4849 | ||
4850 | def GetPositionTuple(*args, **kwargs): | |
4851 | """ | |
4852 | GetPositionTuple() -> (x,y) | |
4853 | ||
27fb7603 RD |
4854 | Returns the pixel position of the mouse in window coordinates when the |
4855 | event happened. | |
d55e5bfc RD |
4856 | """ |
4857 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) | |
4858 | ||
4859 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4860 | """ |
4861 | GetLogicalPosition(self, DC dc) -> Point | |
4862 | ||
4863 | Returns the logical mouse position in pixels (i.e. translated | |
4864 | according to the translation set for the DC, which usually indicates | |
4865 | that the window has been scrolled). | |
4866 | """ | |
d55e5bfc RD |
4867 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
4868 | ||
4869 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4870 | """ |
4871 | GetX(self) -> int | |
4872 | ||
4873 | Returns X coordinate of the physical mouse event position. | |
4874 | """ | |
d55e5bfc RD |
4875 | return _core_.MouseEvent_GetX(*args, **kwargs) |
4876 | ||
4877 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4878 | """ |
4879 | GetY(self) -> int | |
4880 | ||
4881 | Returns Y coordinate of the physical mouse event position. | |
4882 | """ | |
d55e5bfc RD |
4883 | return _core_.MouseEvent_GetY(*args, **kwargs) |
4884 | ||
4885 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4886 | """ |
4887 | GetWheelRotation(self) -> int | |
4888 | ||
4889 | Get wheel rotation, positive or negative indicates direction of | |
4890 | rotation. Current devices all send an event when rotation is equal to | |
4891 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4892 | created in the future. Because of this you shouldn't assume that one | |
4893 | event is equal to 1 line or whatever, but you should be able to either | |
4894 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4895 | have been accumulated before scrolling. | |
4896 | """ | |
d55e5bfc RD |
4897 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
4898 | ||
4899 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4900 | """ |
4901 | GetWheelDelta(self) -> int | |
4902 | ||
4903 | Get wheel delta, normally 120. This is the threshold for action to be | |
4904 | taken, and one such action (for example, scrolling one increment) | |
4905 | should occur for each delta. | |
4906 | """ | |
d55e5bfc RD |
4907 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
4908 | ||
4909 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4910 | """ |
4911 | GetLinesPerAction(self) -> int | |
4912 | ||
4913 | Returns the configured number of lines (or whatever) to be scrolled | |
4914 | per wheel action. Defaults to three. | |
4915 | """ | |
d55e5bfc RD |
4916 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
4917 | ||
4918 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4919 | """ |
4920 | IsPageScroll(self) -> bool | |
4921 | ||
4922 | Returns true if the system has been setup to do page scrolling with | |
4923 | the mouse wheel instead of line scrolling. | |
4924 | """ | |
d55e5bfc RD |
4925 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4926 | ||
4927 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4928 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4929 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4930 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4931 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4932 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4933 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4934 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4935 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4936 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4937 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4938 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
4939 | ||
4940 | class MouseEventPtr(MouseEvent): | |
4941 | def __init__(self, this): | |
4942 | self.this = this | |
4943 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4944 | self.__class__ = MouseEvent | |
4945 | _core_.MouseEvent_swigregister(MouseEventPtr) | |
4946 | ||
4947 | #--------------------------------------------------------------------------- | |
4948 | ||
4949 | class SetCursorEvent(Event): | |
5ba5649b RD |
4950 | """ |
4951 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4952 | as a result of mouse motion. This event gives the application the | |
4953 | chance to perform specific mouse cursor processing based on the | |
4954 | current position of the mouse within the window. Use the `SetCursor` | |
4955 | method to specify the cursor you want to be displayed. | |
4956 | """ | |
d55e5bfc RD |
4957 | def __repr__(self): |
4958 | return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4959 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4960 | """ |
4961 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4962 | ||
4963 | Construct a new `wx.SetCursorEvent`. | |
4964 | """ | |
d55e5bfc RD |
4965 | newobj = _core_.new_SetCursorEvent(*args, **kwargs) |
4966 | self.this = newobj.this | |
4967 | self.thisown = 1 | |
4968 | del newobj.thisown | |
4969 | def GetX(*args, **kwargs): | |
5ba5649b RD |
4970 | """ |
4971 | GetX(self) -> int | |
4972 | ||
4973 | Returns the X coordinate of the mouse in client coordinates. | |
4974 | """ | |
d55e5bfc RD |
4975 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
4976 | ||
4977 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4978 | """ |
4979 | GetY(self) -> int | |
4980 | ||
4981 | Returns the Y coordinate of the mouse in client coordinates. | |
4982 | """ | |
d55e5bfc RD |
4983 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
4984 | ||
4985 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4986 | """ |
4987 | SetCursor(self, Cursor cursor) | |
4988 | ||
4989 | Sets the cursor associated with this event. | |
4990 | """ | |
d55e5bfc RD |
4991 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
4992 | ||
4993 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4994 | """ |
4995 | GetCursor(self) -> Cursor | |
4996 | ||
4997 | Returns a reference to the cursor specified by this event. | |
4998 | """ | |
d55e5bfc RD |
4999 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
5000 | ||
5001 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
5002 | """ |
5003 | HasCursor(self) -> bool | |
5004 | ||
5005 | Returns true if the cursor specified by this event is a valid cursor. | |
5006 | """ | |
d55e5bfc RD |
5007 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
5008 | ||
5009 | ||
5010 | class SetCursorEventPtr(SetCursorEvent): | |
5011 | def __init__(self, this): | |
5012 | self.this = this | |
5013 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5014 | self.__class__ = SetCursorEvent | |
5015 | _core_.SetCursorEvent_swigregister(SetCursorEventPtr) | |
5016 | ||
5017 | #--------------------------------------------------------------------------- | |
5018 | ||
5019 | class KeyEvent(Event): | |
5ba5649b RD |
5020 | """ |
5021 | This event class contains information about keypress and character | |
5022 | events. These events are only sent to the widget that currently has | |
5023 | the keyboard focus. | |
5024 | ||
5025 | Notice that there are three different kinds of keyboard events in | |
5026 | wxWidgets: key down and up events and char events. The difference | |
5027 | between the first two is clear - the first corresponds to a key press | |
5028 | and the second to a key release - otherwise they are identical. Just | |
5029 | note that if the key is maintained in a pressed state you will | |
5030 | typically get a lot of (automatically generated) down events but only | |
5031 | one up so it is wrong to assume that there is one up event | |
5032 | corresponding to each down one. | |
5033 | ||
5034 | Both key events provide untranslated key codes while the char event | |
5035 | carries the translated one. The untranslated code for alphanumeric | |
5036 | keys is always an upper case value. For the other keys it is one of | |
5037 | WXK_XXX values from the keycodes table. The translated key is, in | |
5038 | general, the character the user expects to appear as the result of the | |
5039 | key combination when typing the text into a text entry zone, for | |
5040 | example. | |
5041 | ||
5042 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
5043 | and the standard US keyboard): when the 'A' key is pressed, the key | |
5044 | down event key code is equal to ASCII A == 65. But the char event key | |
5045 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
5046 | 'A' keys simultaneously , the key code in key down event will still be | |
5047 | just 'A' while the char event key code parameter will now be 'A' as | |
5048 | well. | |
5049 | ||
5050 | Although in this simple case it is clear that the correct key code | |
5051 | could be found in the key down event handler by checking the value | |
5052 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
5053 | as for non alphanumeric keys or non-US keyboard layouts the | |
5054 | translation is keyboard-layout dependent and can only be done properly | |
5055 | by the system itself. | |
5056 | ||
5057 | Another kind of translation is done when the control key is pressed: | |
5058 | for example, for CTRL-A key press the key down event still carries the | |
5059 | same key code 'A' as usual but the char event will have key code of 1, | |
5060 | the ASCII value of this key combination. | |
5061 | ||
5062 | You may discover how the other keys on your system behave | |
5063 | interactively by running the KeyEvents sample in the wxPython demo and | |
5064 | pressing some keys while the blue box at the top has the keyboard | |
5065 | focus. | |
5066 | ||
5067 | **Note**: If a key down event is caught and the event handler does not | |
5068 | call event.Skip() then the coresponding char event will not | |
5069 | happen. This is by design and enables the programs that handle both | |
5070 | types of events to be a bit simpler. | |
5071 | ||
5072 | **Note for Windows programmers**: The key and char events in wxWidgets | |
5073 | are similar to but slightly different from Windows WM_KEYDOWN and | |
5074 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
5075 | event in wxWidgets (unless it is used as an accelerator). | |
5076 | ||
5077 | **Tip**: be sure to call event.Skip() for events that you don't | |
5078 | process in key event function, otherwise menu shortcuts may cease to | |
5079 | work under Windows. | |
5080 | ||
5081 | """ | |
d55e5bfc RD |
5082 | def __repr__(self): |
5083 | return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5084 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5085 | """ |
5086 | __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent | |
5087 | ||
5088 | Construct a new `wx.KeyEvent`. Valid event types are: | |
5089 | * | |
5090 | """ | |
d55e5bfc RD |
5091 | newobj = _core_.new_KeyEvent(*args, **kwargs) |
5092 | self.this = newobj.this | |
5093 | self.thisown = 1 | |
5094 | del newobj.thisown | |
5095 | def ControlDown(*args, **kwargs): | |
5ba5649b RD |
5096 | """ |
5097 | ControlDown(self) -> bool | |
5098 | ||
5099 | Returns ``True`` if the Control key was down at the time of the event. | |
5100 | """ | |
d55e5bfc RD |
5101 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
5102 | ||
5103 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
5104 | """ |
5105 | MetaDown(self) -> bool | |
5106 | ||
5107 | Returns ``True`` if the Meta key was down at the time of the event. | |
5108 | """ | |
d55e5bfc RD |
5109 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
5110 | ||
5111 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
5112 | """ |
5113 | AltDown(self) -> bool | |
5114 | ||
5115 | Returns ``True`` if the Alt key was down at the time of the event. | |
5116 | """ | |
d55e5bfc RD |
5117 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
5118 | ||
5119 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
5120 | """ |
5121 | ShiftDown(self) -> bool | |
5122 | ||
5123 | Returns ``True`` if the Shift key was down at the time of the event. | |
5124 | """ | |
d55e5bfc RD |
5125 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
5126 | ||
412d302d RD |
5127 | def CmdDown(*args, **kwargs): |
5128 | """ | |
5129 | CmdDown(self) -> bool | |
5130 | ||
5131 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
5132 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 5133 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
5134 | because Cmd key is used for the same thing under Mac as Ctrl |
5135 | elsewhere. The Ctrl still exists, it's just not used for this | |
5136 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
5137 | and Macs this is the same as `MetaDown`. | |
5138 | """ | |
5139 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
5140 | ||
d55e5bfc | 5141 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
5142 | """ |
5143 | HasModifiers(self) -> bool | |
5144 | ||
5145 | Returns true if either CTRL or ALT keys was down at the time of the | |
5146 | key event. Note that this function does not take into account neither | |
5147 | SHIFT nor META key states (the reason for ignoring the latter is that | |
5148 | it is common for NUMLOCK key to be configured as META under X but the | |
5149 | key presses even while NUMLOCK is on should be still processed | |
5150 | normally). | |
5151 | """ | |
d55e5bfc RD |
5152 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
5153 | ||
5154 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
5155 | """ |
5156 | GetKeyCode(self) -> int | |
5157 | ||
5158 | Returns the virtual key code. ASCII events return normal ASCII values, | |
5159 | while non-ASCII events return values such as WXK_LEFT for the left | |
5160 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
5161 | codes. | |
5162 | ||
5163 | Note that in Unicode build, the returned value is meaningful only if | |
5164 | the user entered a character that can be represented in current | |
5165 | locale's default charset. You can obtain the corresponding Unicode | |
5166 | character using `GetUnicodeKey`. | |
5167 | """ | |
d55e5bfc RD |
5168 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
5169 | ||
5170 | KeyCode = GetKeyCode | |
19272049 | 5171 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
5172 | """ |
5173 | GetUnicodeKey(self) -> int | |
5174 | ||
5175 | Returns the Unicode character corresponding to this key event. This | |
5176 | function is only meaningfule in a Unicode build of wxPython. | |
5177 | """ | |
19272049 | 5178 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
d55e5bfc | 5179 | |
19272049 | 5180 | GetUniChar = GetUnicodeKey |
d55e5bfc | 5181 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
5182 | """ |
5183 | GetRawKeyCode(self) -> unsigned int | |
5184 | ||
5185 | Returns the raw key code for this event. This is a platform-dependent | |
5186 | scan code which should only be used in advanced | |
5187 | applications. Currently the raw key codes are not supported by all | |
5188 | ports. | |
5189 | """ | |
d55e5bfc RD |
5190 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
5191 | ||
5192 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
5193 | """ |
5194 | GetRawKeyFlags(self) -> unsigned int | |
5195 | ||
5196 | Returns the low level key flags for this event. The flags are | |
5197 | platform-dependent and should only be used in advanced applications. | |
5198 | Currently the raw key flags are not supported by all ports. | |
5199 | """ | |
d55e5bfc RD |
5200 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
5201 | ||
5202 | def GetPosition(*args, **kwargs): | |
5203 | """ | |
5204 | GetPosition(self) -> Point | |
5205 | ||
5ba5649b | 5206 | Find the position of the event, if applicable. |
d55e5bfc RD |
5207 | """ |
5208 | return _core_.KeyEvent_GetPosition(*args, **kwargs) | |
5209 | ||
5210 | def GetPositionTuple(*args, **kwargs): | |
5211 | """ | |
5212 | GetPositionTuple() -> (x,y) | |
5213 | ||
5ba5649b | 5214 | Find the position of the event, if applicable. |
d55e5bfc RD |
5215 | """ |
5216 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) | |
5217 | ||
5218 | def GetX(*args, **kwargs): | |
5ba5649b RD |
5219 | """ |
5220 | GetX(self) -> int | |
5221 | ||
5222 | Returns the X position (in client coordinates) of the event, if | |
5223 | applicable. | |
5224 | """ | |
d55e5bfc RD |
5225 | return _core_.KeyEvent_GetX(*args, **kwargs) |
5226 | ||
5227 | def GetY(*args, **kwargs): | |
5ba5649b RD |
5228 | """ |
5229 | GetY(self) -> int | |
5230 | ||
5231 | Returns the Y position (in client coordinates) of the event, if | |
5232 | applicable. | |
5233 | """ | |
d55e5bfc RD |
5234 | return _core_.KeyEvent_GetY(*args, **kwargs) |
5235 | ||
5236 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
5237 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
5238 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
5239 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
5240 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
5241 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
5242 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
5243 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
5244 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
5245 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
5246 | ||
5247 | class KeyEventPtr(KeyEvent): | |
5248 | def __init__(self, this): | |
5249 | self.this = this | |
5250 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5251 | self.__class__ = KeyEvent | |
5252 | _core_.KeyEvent_swigregister(KeyEventPtr) | |
5253 | ||
5254 | #--------------------------------------------------------------------------- | |
5255 | ||
5256 | class SizeEvent(Event): | |
5ba5649b RD |
5257 | """ |
5258 | A size event holds information about size change events. The EVT_SIZE | |
5259 | handler function will be called when the window it is bound to has | |
5260 | been resized. | |
5261 | ||
5262 | Note that the size passed is of the whole window: call | |
5263 | `wx.Window.GetClientSize` for the area which may be used by the | |
5264 | application. | |
5265 | ||
5266 | When a window is resized, usually only a small part of the window is | |
5267 | damaged and and that area is all that is in the update region for the | |
5268 | next paint event. However, if your drawing depends on the size of the | |
5269 | window, you may need to clear the DC explicitly and repaint the whole | |
5270 | window. In which case, you may need to call `wx.Window.Refresh` to | |
5271 | invalidate the entire window. | |
5272 | ||
5273 | """ | |
d55e5bfc RD |
5274 | def __repr__(self): |
5275 | return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5276 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5277 | """ |
5278 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
5279 | ||
5280 | Construct a new ``wx.SizeEvent``. | |
5281 | """ | |
d55e5bfc RD |
5282 | newobj = _core_.new_SizeEvent(*args, **kwargs) |
5283 | self.this = newobj.this | |
5284 | self.thisown = 1 | |
5285 | del newobj.thisown | |
5286 | def GetSize(*args, **kwargs): | |
5ba5649b RD |
5287 | """ |
5288 | GetSize(self) -> Size | |
5289 | ||
5290 | Returns the entire size of the window generating the size change | |
5291 | event. | |
5292 | """ | |
d55e5bfc RD |
5293 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
5294 | ||
5295 | def GetRect(*args, **kwargs): | |
5296 | """GetRect(self) -> Rect""" | |
5297 | return _core_.SizeEvent_GetRect(*args, **kwargs) | |
5298 | ||
5299 | def SetRect(*args, **kwargs): | |
5300 | """SetRect(self, Rect rect)""" | |
5301 | return _core_.SizeEvent_SetRect(*args, **kwargs) | |
5302 | ||
5303 | def SetSize(*args, **kwargs): | |
5304 | """SetSize(self, Size size)""" | |
5305 | return _core_.SizeEvent_SetSize(*args, **kwargs) | |
5306 | ||
5307 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) | |
5308 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
5309 | ||
5310 | class SizeEventPtr(SizeEvent): | |
5311 | def __init__(self, this): | |
5312 | self.this = this | |
5313 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5314 | self.__class__ = SizeEvent | |
5315 | _core_.SizeEvent_swigregister(SizeEventPtr) | |
5316 | ||
5317 | #--------------------------------------------------------------------------- | |
5318 | ||
5319 | class MoveEvent(Event): | |
5ba5649b RD |
5320 | """ |
5321 | This event object is sent for EVT_MOVE event bindings when a window is | |
5322 | moved to a new position. | |
5323 | """ | |
d55e5bfc RD |
5324 | def __repr__(self): |
5325 | return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5326 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5327 | """ |
5328 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5329 | ||
5330 | Constructor. | |
5331 | """ | |
d55e5bfc RD |
5332 | newobj = _core_.new_MoveEvent(*args, **kwargs) |
5333 | self.this = newobj.this | |
5334 | self.thisown = 1 | |
5335 | del newobj.thisown | |
5336 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
5337 | """ |
5338 | GetPosition(self) -> Point | |
5339 | ||
5340 | Returns the position of the window generating the move change event. | |
5341 | """ | |
d55e5bfc RD |
5342 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
5343 | ||
5344 | def GetRect(*args, **kwargs): | |
5345 | """GetRect(self) -> Rect""" | |
5346 | return _core_.MoveEvent_GetRect(*args, **kwargs) | |
5347 | ||
5348 | def SetRect(*args, **kwargs): | |
5349 | """SetRect(self, Rect rect)""" | |
5350 | return _core_.MoveEvent_SetRect(*args, **kwargs) | |
5351 | ||
5352 | def SetPosition(*args, **kwargs): | |
5353 | """SetPosition(self, Point pos)""" | |
5354 | return _core_.MoveEvent_SetPosition(*args, **kwargs) | |
5355 | ||
fef4c27a RD |
5356 | m_pos = property(GetPosition, SetPosition) |
5357 | m_rect = property(GetRect, SetRect) | |
5358 | ||
d55e5bfc RD |
5359 | |
5360 | class MoveEventPtr(MoveEvent): | |
5361 | def __init__(self, this): | |
5362 | self.this = this | |
5363 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5364 | self.__class__ = MoveEvent | |
5365 | _core_.MoveEvent_swigregister(MoveEventPtr) | |
5366 | ||
5367 | #--------------------------------------------------------------------------- | |
5368 | ||
5369 | class PaintEvent(Event): | |
5ba5649b RD |
5370 | """ |
5371 | A paint event is sent when a window's contents needs to be repainted. | |
5372 | Note that in an EVT_PAINT handler the application must *always* create | |
5373 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5374 | Windows assumes that the window has not been painted yet and will send | |
5375 | the event again, causing endless refreshes. | |
5376 | ||
5377 | You can optimize painting by retrieving the rectangles that have been | |
5378 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5379 | and only repainting these rectangles. The rectangles are in terms of | |
5380 | the client area, and are unscrolled, so you will need to do some | |
5381 | calculations using the current view position to obtain logical, | |
5382 | scrolled units. | |
5383 | ||
5384 | """ | |
d55e5bfc RD |
5385 | def __repr__(self): |
5386 | return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5387 | def __init__(self, *args, **kwargs): | |
5388 | """__init__(self, int Id=0) -> PaintEvent""" | |
5389 | newobj = _core_.new_PaintEvent(*args, **kwargs) | |
5390 | self.this = newobj.this | |
5391 | self.thisown = 1 | |
5392 | del newobj.thisown | |
5393 | ||
5394 | class PaintEventPtr(PaintEvent): | |
5395 | def __init__(self, this): | |
5396 | self.this = this | |
5397 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5398 | self.__class__ = PaintEvent | |
5399 | _core_.PaintEvent_swigregister(PaintEventPtr) | |
5400 | ||
5401 | class NcPaintEvent(Event): | |
093d3ff1 | 5402 | """Proxy of C++ NcPaintEvent class""" |
d55e5bfc RD |
5403 | def __repr__(self): |
5404 | return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5405 | def __init__(self, *args, **kwargs): | |
5406 | """__init__(self, int winid=0) -> NcPaintEvent""" | |
5407 | newobj = _core_.new_NcPaintEvent(*args, **kwargs) | |
5408 | self.this = newobj.this | |
5409 | self.thisown = 1 | |
5410 | del newobj.thisown | |
5411 | ||
5412 | class NcPaintEventPtr(NcPaintEvent): | |
5413 | def __init__(self, this): | |
5414 | self.this = this | |
5415 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5416 | self.__class__ = NcPaintEvent | |
5417 | _core_.NcPaintEvent_swigregister(NcPaintEventPtr) | |
5418 | ||
5419 | #--------------------------------------------------------------------------- | |
5420 | ||
5421 | class EraseEvent(Event): | |
5ba5649b RD |
5422 | """ |
5423 | An erase event is sent whenever the background of a window needs to be | |
5424 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5425 | binder. On some platforms, such as GTK+, this event is simulated | |
5426 | (simply generated just before the paint event) and may cause flicker. | |
5427 | ||
5428 | To paint a custom background use the `GetDC` method and use the returned | |
5429 | device context if it is not ``None``, otherwise create a temporary | |
5430 | `wx.ClientDC` and draw on that. | |
5431 | ||
5432 | """ | |
d55e5bfc RD |
5433 | def __repr__(self): |
5434 | return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5435 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5436 | """ |
5437 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5438 | ||
5439 | Constructor | |
5440 | """ | |
d55e5bfc RD |
5441 | newobj = _core_.new_EraseEvent(*args, **kwargs) |
5442 | self.this = newobj.this | |
5443 | self.thisown = 1 | |
5444 | del newobj.thisown | |
5445 | def GetDC(*args, **kwargs): | |
5ba5649b RD |
5446 | """ |
5447 | GetDC(self) -> DC | |
5448 | ||
5449 | Returns the device context the event handler should draw upon. If | |
5450 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5451 | that instead. | |
5452 | """ | |
d55e5bfc RD |
5453 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
5454 | ||
5455 | ||
5456 | class EraseEventPtr(EraseEvent): | |
5457 | def __init__(self, this): | |
5458 | self.this = this | |
5459 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5460 | self.__class__ = EraseEvent | |
5461 | _core_.EraseEvent_swigregister(EraseEventPtr) | |
5462 | ||
5463 | #--------------------------------------------------------------------------- | |
5464 | ||
5465 | class FocusEvent(Event): | |
5ba5649b RD |
5466 | """ |
5467 | A focus event is sent when a window's focus changes. The window losing | |
5468 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5469 | gets an EVT_SET_FOCUS event. | |
5470 | ||
5471 | Notice that the set focus event happens both when the user gives focus | |
5472 | to the window (whether using the mouse or keyboard) and when it is | |
5473 | done from the program itself using `wx.Window.SetFocus`. | |
5474 | ||
5475 | """ | |
d55e5bfc RD |
5476 | def __repr__(self): |
5477 | return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5478 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5479 | """ |
5480 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent | |
5481 | ||
5482 | Constructor | |
5483 | """ | |
d55e5bfc RD |
5484 | newobj = _core_.new_FocusEvent(*args, **kwargs) |
5485 | self.this = newobj.this | |
5486 | self.thisown = 1 | |
5487 | del newobj.thisown | |
5488 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
5489 | """ |
5490 | GetWindow(self) -> Window | |
5491 | ||
5492 | Returns the other window associated with this event, that is the | |
5493 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5494 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5495 | ||
5496 | Warning: the window returned may be None! | |
5497 | """ | |
d55e5bfc RD |
5498 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
5499 | ||
5500 | def SetWindow(*args, **kwargs): | |
5501 | """SetWindow(self, Window win)""" | |
5502 | return _core_.FocusEvent_SetWindow(*args, **kwargs) | |
5503 | ||
5504 | ||
5505 | class FocusEventPtr(FocusEvent): | |
5506 | def __init__(self, this): | |
5507 | self.this = this | |
5508 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5509 | self.__class__ = FocusEvent | |
5510 | _core_.FocusEvent_swigregister(FocusEventPtr) | |
5511 | ||
5512 | #--------------------------------------------------------------------------- | |
5513 | ||
5514 | class ChildFocusEvent(CommandEvent): | |
5ba5649b RD |
5515 | """ |
5516 | wx.ChildFocusEvent notifies the parent that a child has received the | |
5517 | focus. Unlike `wx.FocusEvent` it is propagated up the window | |
5518 | heirarchy. | |
5519 | """ | |
d55e5bfc RD |
5520 | def __repr__(self): |
5521 | return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5522 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5523 | """ |
5524 | __init__(self, Window win=None) -> ChildFocusEvent | |
5525 | ||
5526 | Constructor | |
5527 | """ | |
d55e5bfc RD |
5528 | newobj = _core_.new_ChildFocusEvent(*args, **kwargs) |
5529 | self.this = newobj.this | |
5530 | self.thisown = 1 | |
5531 | del newobj.thisown | |
5532 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
5533 | """ |
5534 | GetWindow(self) -> Window | |
5535 | ||
5536 | The window which has just received the focus. | |
5537 | """ | |
d55e5bfc RD |
5538 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
5539 | ||
5540 | ||
5541 | class ChildFocusEventPtr(ChildFocusEvent): | |
5542 | def __init__(self, this): | |
5543 | self.this = this | |
5544 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5545 | self.__class__ = ChildFocusEvent | |
5546 | _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr) | |
5547 | ||
5548 | #--------------------------------------------------------------------------- | |
5549 | ||
5550 | class ActivateEvent(Event): | |
5ba5649b RD |
5551 | """ |
5552 | An activate event is sent when a top-level window or the entire | |
5553 | application is being activated or deactivated. | |
5554 | ||
5555 | A top-level window (a dialog or frame) receives an activate event when | |
5556 | is being activated or deactivated. This is indicated visually by the | |
5557 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5558 | An application is activated or deactivated when one of its frames | |
5559 | becomes activated, or a frame becomes inactivate resulting in all | |
5560 | application frames being inactive. | |
5561 | ||
5562 | Please note that usually you should call event.Skip() in your handlers | |
5563 | for these events so the default handlers will still be called, as not | |
5564 | doing so can result in strange effects. | |
5565 | ||
5566 | """ | |
d55e5bfc RD |
5567 | def __repr__(self): |
5568 | return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5569 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5570 | """ |
5571 | __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent | |
5572 | ||
5573 | Constructor | |
5574 | """ | |
d55e5bfc RD |
5575 | newobj = _core_.new_ActivateEvent(*args, **kwargs) |
5576 | self.this = newobj.this | |
5577 | self.thisown = 1 | |
5578 | del newobj.thisown | |
5579 | def GetActive(*args, **kwargs): | |
5ba5649b RD |
5580 | """ |
5581 | GetActive(self) -> bool | |
5582 | ||
5583 | Returns true if the application or window is being activated, false | |
5584 | otherwise. | |
5585 | """ | |
d55e5bfc RD |
5586 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
5587 | ||
5588 | ||
5589 | class ActivateEventPtr(ActivateEvent): | |
5590 | def __init__(self, this): | |
5591 | self.this = this | |
5592 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5593 | self.__class__ = ActivateEvent | |
5594 | _core_.ActivateEvent_swigregister(ActivateEventPtr) | |
5595 | ||
5596 | #--------------------------------------------------------------------------- | |
5597 | ||
5598 | class InitDialogEvent(Event): | |
5ba5649b RD |
5599 | """ |
5600 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5601 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5602 | event can transfer data to the window, or anything else that should be | |
5603 | done before the user begins editing the form. The default handler | |
5604 | calls `wx.Window.TransferDataToWindow`. | |
5605 | """ | |
d55e5bfc RD |
5606 | def __repr__(self): |
5607 | return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5608 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5609 | """ |
5610 | __init__(self, int Id=0) -> InitDialogEvent | |
5611 | ||
5612 | Constructor | |
5613 | """ | |
d55e5bfc RD |
5614 | newobj = _core_.new_InitDialogEvent(*args, **kwargs) |
5615 | self.this = newobj.this | |
5616 | self.thisown = 1 | |
5617 | del newobj.thisown | |
5618 | ||
5619 | class InitDialogEventPtr(InitDialogEvent): | |
5620 | def __init__(self, this): | |
5621 | self.this = this | |
5622 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5623 | self.__class__ = InitDialogEvent | |
5624 | _core_.InitDialogEvent_swigregister(InitDialogEventPtr) | |
5625 | ||
5626 | #--------------------------------------------------------------------------- | |
5627 | ||
5628 | class MenuEvent(Event): | |
5ba5649b RD |
5629 | """ |
5630 | This class is used for a variety of menu-related events. Note that | |
5631 | these do not include menu command events, which are handled by sending | |
5632 | `wx.CommandEvent` objects. | |
5633 | ||
5634 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5635 | text in the first field of the status bar. | |
5636 | """ | |
d55e5bfc RD |
5637 | def __repr__(self): |
5638 | return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5639 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5640 | """ |
5641 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent | |
5642 | ||
5643 | Constructor | |
5644 | """ | |
d55e5bfc RD |
5645 | newobj = _core_.new_MenuEvent(*args, **kwargs) |
5646 | self.this = newobj.this | |
5647 | self.thisown = 1 | |
5648 | del newobj.thisown | |
5649 | def GetMenuId(*args, **kwargs): | |
5ba5649b RD |
5650 | """ |
5651 | GetMenuId(self) -> int | |
5652 | ||
5653 | Returns the menu identifier associated with the event. This method | |
5654 | should be only used with the HIGHLIGHT events. | |
5655 | """ | |
d55e5bfc RD |
5656 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
5657 | ||
5658 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5659 | """ |
5660 | IsPopup(self) -> bool | |
5661 | ||
5662 | Returns ``True`` if the menu which is being opened or closed is a | |
5663 | popup menu, ``False`` if it is a normal one. This method should only | |
5664 | be used with the OPEN and CLOSE events. | |
5665 | """ | |
d55e5bfc RD |
5666 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
5667 | ||
5668 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5669 | """ |
5670 | GetMenu(self) -> Menu | |
5671 | ||
5672 | Returns the menu which is being opened or closed. This method should | |
5673 | only be used with the OPEN and CLOSE events. | |
5674 | """ | |
d55e5bfc RD |
5675 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
5676 | ||
5677 | ||
5678 | class MenuEventPtr(MenuEvent): | |
5679 | def __init__(self, this): | |
5680 | self.this = this | |
5681 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5682 | self.__class__ = MenuEvent | |
5683 | _core_.MenuEvent_swigregister(MenuEventPtr) | |
5684 | ||
5685 | #--------------------------------------------------------------------------- | |
5686 | ||
5687 | class CloseEvent(Event): | |
5ba5649b RD |
5688 | """ |
5689 | This event class contains information about window and session close | |
5690 | events. | |
5691 | ||
5692 | The handler function for EVT_CLOSE is called when the user has tried | |
5693 | to close a a frame or dialog box using the window manager controls or | |
5694 | the system menu. It can also be invoked by the application itself | |
5695 | programmatically, for example by calling the `wx.Window.Close` | |
5696 | function. | |
5697 | ||
5698 | You should check whether the application is forcing the deletion of | |
5699 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5700 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5701 | it is up to you whether you respond by destroying the window or not. | |
5702 | For example you may wish to display a message dialog prompting to save | |
5703 | files or to cancel the close. | |
5704 | ||
5705 | If you don't destroy the window, you should call `Veto` to let the | |
5706 | calling code know that you did not destroy the window. This allows the | |
5707 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5708 | on whether the close instruction was honored or not. | |
5709 | """ | |
d55e5bfc RD |
5710 | def __repr__(self): |
5711 | return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5712 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5713 | """ |
5714 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent | |
5715 | ||
5716 | Constructor. | |
5717 | """ | |
d55e5bfc RD |
5718 | newobj = _core_.new_CloseEvent(*args, **kwargs) |
5719 | self.this = newobj.this | |
5720 | self.thisown = 1 | |
5721 | del newobj.thisown | |
5722 | def SetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5723 | """ |
5724 | SetLoggingOff(self, bool logOff) | |
5725 | ||
5726 | Sets the 'logging off' flag. | |
5727 | """ | |
d55e5bfc RD |
5728 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
5729 | ||
5730 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5731 | """ |
5732 | GetLoggingOff(self) -> bool | |
5733 | ||
034e3677 RD |
5734 | Returns ``True`` if the user is logging off or ``False`` if the |
5735 | system is shutting down. This method can only be called for end | |
5736 | session and query end session events, it doesn't make sense for close | |
5737 | window event. | |
5ba5649b | 5738 | """ |
d55e5bfc RD |
5739 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
5740 | ||
5741 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5742 | """ |
5743 | Veto(self, bool veto=True) | |
5744 | ||
5745 | Call this from your event handler to veto a system shutdown or to | |
5746 | signal to the calling application that a window close did not happen. | |
5747 | ||
5748 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5749 | """ | |
d55e5bfc RD |
5750 | return _core_.CloseEvent_Veto(*args, **kwargs) |
5751 | ||
5ba5649b RD |
5752 | def GetVeto(*args, **kwargs): |
5753 | """GetVeto(self) -> bool""" | |
5754 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5755 | ||
d55e5bfc | 5756 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5757 | """ |
5758 | SetCanVeto(self, bool canVeto) | |
5759 | ||
5760 | Sets the 'can veto' flag. | |
5761 | """ | |
d55e5bfc RD |
5762 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
5763 | ||
5764 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5765 | """ |
5766 | CanVeto(self) -> bool | |
d55e5bfc | 5767 | |
5ba5649b RD |
5768 | Returns true if you can veto a system shutdown or a window close |
5769 | event. Vetoing a window close event is not possible if the calling | |
5770 | code wishes to force the application to exit, and so this function | |
5771 | must be called to check this. | |
5772 | """ | |
5773 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
d55e5bfc RD |
5774 | |
5775 | ||
5776 | class CloseEventPtr(CloseEvent): | |
5777 | def __init__(self, this): | |
5778 | self.this = this | |
5779 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5780 | self.__class__ = CloseEvent | |
5781 | _core_.CloseEvent_swigregister(CloseEventPtr) | |
5782 | ||
5783 | #--------------------------------------------------------------------------- | |
5784 | ||
5785 | class ShowEvent(Event): | |
5ba5649b | 5786 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
d55e5bfc RD |
5787 | def __repr__(self): |
5788 | return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5789 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5790 | """ |
5791 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5792 | ||
5793 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5794 | """ | |
d55e5bfc RD |
5795 | newobj = _core_.new_ShowEvent(*args, **kwargs) |
5796 | self.this = newobj.this | |
5797 | self.thisown = 1 | |
5798 | del newobj.thisown | |
5799 | def SetShow(*args, **kwargs): | |
5800 | """SetShow(self, bool show)""" | |
5801 | return _core_.ShowEvent_SetShow(*args, **kwargs) | |
5802 | ||
5803 | def GetShow(*args, **kwargs): | |
5804 | """GetShow(self) -> bool""" | |
5805 | return _core_.ShowEvent_GetShow(*args, **kwargs) | |
5806 | ||
5807 | ||
5808 | class ShowEventPtr(ShowEvent): | |
5809 | def __init__(self, this): | |
5810 | self.this = this | |
5811 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5812 | self.__class__ = ShowEvent | |
5813 | _core_.ShowEvent_swigregister(ShowEventPtr) | |
5814 | ||
5815 | #--------------------------------------------------------------------------- | |
5816 | ||
5817 | class IconizeEvent(Event): | |
5ba5649b RD |
5818 | """ |
5819 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5820 | restored. | |
5821 | """ | |
d55e5bfc RD |
5822 | def __repr__(self): |
5823 | return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5824 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5825 | """ |
5826 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5827 | ||
5828 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5829 | restored. | |
5830 | """ | |
d55e5bfc RD |
5831 | newobj = _core_.new_IconizeEvent(*args, **kwargs) |
5832 | self.this = newobj.this | |
5833 | self.thisown = 1 | |
5834 | del newobj.thisown | |
5835 | def Iconized(*args, **kwargs): | |
5ba5649b RD |
5836 | """ |
5837 | Iconized(self) -> bool | |
5838 | ||
5839 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5840 | been restored. | |
5841 | """ | |
d55e5bfc RD |
5842 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
5843 | ||
5844 | ||
5845 | class IconizeEventPtr(IconizeEvent): | |
5846 | def __init__(self, this): | |
5847 | self.this = this | |
5848 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5849 | self.__class__ = IconizeEvent | |
5850 | _core_.IconizeEvent_swigregister(IconizeEventPtr) | |
5851 | ||
5852 | #--------------------------------------------------------------------------- | |
5853 | ||
5854 | class MaximizeEvent(Event): | |
5ba5649b | 5855 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
d55e5bfc RD |
5856 | def __repr__(self): |
5857 | return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5858 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5859 | """ |
5860 | __init__(self, int id=0) -> MaximizeEvent | |
5861 | ||
5862 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5863 | """ | |
d55e5bfc RD |
5864 | newobj = _core_.new_MaximizeEvent(*args, **kwargs) |
5865 | self.this = newobj.this | |
5866 | self.thisown = 1 | |
5867 | del newobj.thisown | |
5868 | ||
5869 | class MaximizeEventPtr(MaximizeEvent): | |
5870 | def __init__(self, this): | |
5871 | self.this = this | |
5872 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5873 | self.__class__ = MaximizeEvent | |
5874 | _core_.MaximizeEvent_swigregister(MaximizeEventPtr) | |
5875 | ||
5876 | #--------------------------------------------------------------------------- | |
5877 | ||
5878 | class DropFilesEvent(Event): | |
5ba5649b RD |
5879 | """ |
5880 | This class is used for drop files events, that is, when files have | |
5881 | been dropped onto the window. This functionality is only available | |
5882 | under Windows. The window must have previously been enabled for | |
5883 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5884 | ||
5885 | Important note: this is a separate implementation to the more general | |
5886 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5887 | implementation uses the older, Windows message-based approach of | |
5888 | dropping files. | |
5889 | ||
5890 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5891 | events. | |
5892 | ||
5893 | """ | |
d55e5bfc RD |
5894 | def __init__(self): raise RuntimeError, "No constructor defined" |
5895 | def __repr__(self): | |
5896 | return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5897 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
5898 | """ |
5899 | GetPosition(self) -> Point | |
5900 | ||
5901 | Returns the position at which the files were dropped. | |
5902 | """ | |
d55e5bfc RD |
5903 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
5904 | ||
5905 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5906 | """ |
5907 | GetNumberOfFiles(self) -> int | |
5908 | ||
5909 | Returns the number of files dropped. | |
5910 | """ | |
d55e5bfc RD |
5911 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
5912 | ||
5913 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5914 | """ |
5915 | GetFiles(self) -> PyObject | |
5916 | ||
5917 | Returns a list of the filenames that were dropped. | |
5918 | """ | |
d55e5bfc RD |
5919 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
5920 | ||
5921 | ||
5922 | class DropFilesEventPtr(DropFilesEvent): | |
5923 | def __init__(self, this): | |
5924 | self.this = this | |
5925 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5926 | self.__class__ = DropFilesEvent | |
5927 | _core_.DropFilesEvent_swigregister(DropFilesEventPtr) | |
5928 | ||
5929 | #--------------------------------------------------------------------------- | |
5930 | ||
5931 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL | |
5932 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
5933 | class UpdateUIEvent(CommandEvent): | |
5ba5649b RD |
5934 | """ |
5935 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5936 | wxWidgets to give an application the chance to update various user | |
5937 | interface elements. | |
5938 | ||
5939 | Without update UI events, an application has to work hard to | |
5940 | check/uncheck, enable/disable, and set the text for elements such as | |
5941 | menu items and toolbar buttons. The code for doing this has to be | |
5942 | mixed up with the code that is invoked when an action is invoked for a | |
5943 | menu item or button. | |
5944 | ||
5945 | With update UI events, you define an event handler to look at the | |
5946 | state of the application and change UI elements accordingly. wxWidgets | |
5947 | will call your handler functions in idle time, so you don't have to | |
5948 | worry where to call this code. In addition to being a clearer and more | |
5949 | declarative method, it also means you don't have to worry whether | |
5950 | you're updating a toolbar or menubar identifier. The same handler can | |
5951 | update a menu item and toolbar button, if the ID values are the same. | |
5952 | ||
5953 | Instead of directly manipulating the menu or button, you call | |
5954 | functions in the event object, such as `Check`. wxWidgets will | |
5955 | determine whether such a call has been made, and which UI element to | |
5956 | update. | |
5957 | ||
5958 | These events will work for popup menus as well as menubars. Just | |
5959 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5960 | any UI events for the window that owns the menu. | |
5961 | ||
5962 | If you find that the overhead of UI update processing is affecting | |
5963 | your application, you can do one or both of the following: | |
5964 | ||
5965 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5966 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5967 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5968 | receive update events. No other windows will receive update | |
5969 | events. | |
5970 | ||
5971 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5972 | value to set the delay between updates. You may need to call | |
5973 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5974 | a dialog is about to be shown, in case the user sees a slight | |
5975 | delay before windows are updated. | |
5976 | ||
5977 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5978 | handler for a window does not affect this because the events are sent | |
5979 | from an internal idle handler. | |
5980 | ||
5981 | wxWidgets tries to optimize update events on some platforms. On | |
5982 | Windows and GTK+, events for menubar items are only sent when the menu | |
5983 | is about to be shown, and not in idle time. | |
5984 | ||
5985 | """ | |
d55e5bfc RD |
5986 | def __repr__(self): |
5987 | return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5988 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5989 | """ |
5990 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5991 | ||
5992 | Constructor | |
5993 | """ | |
d55e5bfc RD |
5994 | newobj = _core_.new_UpdateUIEvent(*args, **kwargs) |
5995 | self.this = newobj.this | |
5996 | self.thisown = 1 | |
5997 | del newobj.thisown | |
5998 | def GetChecked(*args, **kwargs): | |
5ba5649b RD |
5999 | """ |
6000 | GetChecked(self) -> bool | |
6001 | ||
6002 | Returns ``True`` if the UI element should be checked. | |
6003 | """ | |
d55e5bfc RD |
6004 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
6005 | ||
6006 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
6007 | """ |
6008 | GetEnabled(self) -> bool | |
6009 | ||
6010 | Returns ``True`` if the UI element should be enabled. | |
6011 | """ | |
d55e5bfc RD |
6012 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
6013 | ||
6014 | def GetText(*args, **kwargs): | |
5ba5649b RD |
6015 | """ |
6016 | GetText(self) -> String | |
6017 | ||
6018 | Returns the text that should be set for the UI element. | |
6019 | """ | |
d55e5bfc RD |
6020 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
6021 | ||
6022 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
6023 | """ |
6024 | GetSetText(self) -> bool | |
6025 | ||
6026 | Returns ``True`` if the application has called `SetText`. For | |
6027 | wxWidgets internal use only. | |
6028 | """ | |
d55e5bfc RD |
6029 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
6030 | ||
6031 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
6032 | """ |
6033 | GetSetChecked(self) -> bool | |
6034 | ||
6035 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
6036 | internal use only. | |
6037 | """ | |
d55e5bfc RD |
6038 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
6039 | ||
6040 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
6041 | """ |
6042 | GetSetEnabled(self) -> bool | |
6043 | ||
6044 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
6045 | internal use only. | |
6046 | """ | |
d55e5bfc RD |
6047 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
6048 | ||
6049 | def Check(*args, **kwargs): | |
5ba5649b RD |
6050 | """ |
6051 | Check(self, bool check) | |
6052 | ||
6053 | Check or uncheck the UI element. | |
6054 | """ | |
d55e5bfc RD |
6055 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
6056 | ||
6057 | def Enable(*args, **kwargs): | |
5ba5649b RD |
6058 | """ |
6059 | Enable(self, bool enable) | |
6060 | ||
6061 | Enable or disable the UI element. | |
6062 | """ | |
d55e5bfc RD |
6063 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
6064 | ||
6065 | def SetText(*args, **kwargs): | |
5ba5649b RD |
6066 | """ |
6067 | SetText(self, String text) | |
6068 | ||
6069 | Sets the text for this UI element. | |
6070 | """ | |
d55e5bfc RD |
6071 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
6072 | ||
6073 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
6074 | """ |
6075 | SetUpdateInterval(long updateInterval) | |
6076 | ||
6077 | Sets the interval between updates in milliseconds. Set to -1 to | |
6078 | disable updates, or to 0 to update as frequently as possible. The | |
6079 | default is 0. | |
6080 | ||
6081 | Use this to reduce the overhead of UI update events if your | |
6082 | application has a lot of windows. If you set the value to -1 or | |
6083 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
6084 | at appropriate points in your application, such as when a dialog is | |
6085 | about to be shown. | |
6086 | """ | |
d55e5bfc RD |
6087 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
6088 | ||
6089 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
6090 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
6091 | """ |
6092 | GetUpdateInterval() -> long | |
6093 | ||
6094 | Returns the current interval between updates in milliseconds. -1 | |
6095 | disables updates, 0 updates as frequently as possible. | |
6096 | """ | |
d55e5bfc RD |
6097 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
6098 | ||
6099 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
6100 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
6101 | """ |
6102 | CanUpdate(Window win) -> bool | |
6103 | ||
6104 | Returns ``True`` if it is appropriate to update (send UI update events | |
6105 | to) this window. | |
6106 | ||
6107 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6108 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6109 | events were last sent in idle time, and the update interval, to | |
6110 | determine whether events should be sent to this window now. By default | |
6111 | this will always return true because the update mode is initially | |
6112 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6113 | events will be sent as often as possible. You can reduce the frequency | |
6114 | that events are sent by changing the mode and/or setting an update | |
6115 | interval. | |
6116 | ||
6117 | """ | |
d55e5bfc RD |
6118 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
6119 | ||
6120 | CanUpdate = staticmethod(CanUpdate) | |
6121 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
6122 | """ |
6123 | ResetUpdateTime() | |
6124 | ||
6125 | Used internally to reset the last-updated time to the current time. It | |
6126 | is assumed that update events are normally sent in idle time, so this | |
6127 | is called at the end of idle processing. | |
6128 | """ | |
d55e5bfc RD |
6129 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
6130 | ||
6131 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
6132 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6133 | """ |
6134 | SetMode(int mode) | |
6135 | ||
6136 | Specify how wxWidgets will send update events: to all windows, or only | |
6137 | to those which specify that they will process the events. | |
6138 | ||
6139 | The mode may be one of the following values: | |
6140 | ||
6141 | ============================= ========================================== | |
6142 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6143 | is the default setting. | |
6144 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6145 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6146 | style set. | |
6147 | ============================= ========================================== | |
6148 | ||
6149 | """ | |
d55e5bfc RD |
6150 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
6151 | ||
6152 | SetMode = staticmethod(SetMode) | |
6153 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6154 | """ |
6155 | GetMode() -> int | |
6156 | ||
6157 | Returns a value specifying how wxWidgets will send update events: to | |
6158 | all windows, or only to those which specify that they will process the | |
6159 | events. | |
6160 | """ | |
d55e5bfc RD |
6161 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
6162 | ||
6163 | GetMode = staticmethod(GetMode) | |
6164 | ||
6165 | class UpdateUIEventPtr(UpdateUIEvent): | |
6166 | def __init__(self, this): | |
6167 | self.this = this | |
6168 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6169 | self.__class__ = UpdateUIEvent | |
6170 | _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr) | |
6171 | ||
6172 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
6173 | """ |
6174 | UpdateUIEvent_SetUpdateInterval(long updateInterval) | |
6175 | ||
6176 | Sets the interval between updates in milliseconds. Set to -1 to | |
6177 | disable updates, or to 0 to update as frequently as possible. The | |
6178 | default is 0. | |
6179 | ||
6180 | Use this to reduce the overhead of UI update events if your | |
6181 | application has a lot of windows. If you set the value to -1 or | |
6182 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
6183 | at appropriate points in your application, such as when a dialog is | |
6184 | about to be shown. | |
6185 | """ | |
d55e5bfc RD |
6186 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
6187 | ||
6188 | def UpdateUIEvent_GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
6189 | """ |
6190 | UpdateUIEvent_GetUpdateInterval() -> long | |
6191 | ||
6192 | Returns the current interval between updates in milliseconds. -1 | |
6193 | disables updates, 0 updates as frequently as possible. | |
6194 | """ | |
d55e5bfc RD |
6195 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
6196 | ||
6197 | def UpdateUIEvent_CanUpdate(*args, **kwargs): | |
5ba5649b RD |
6198 | """ |
6199 | UpdateUIEvent_CanUpdate(Window win) -> bool | |
6200 | ||
6201 | Returns ``True`` if it is appropriate to update (send UI update events | |
6202 | to) this window. | |
6203 | ||
6204 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6205 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6206 | events were last sent in idle time, and the update interval, to | |
6207 | determine whether events should be sent to this window now. By default | |
6208 | this will always return true because the update mode is initially | |
6209 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6210 | events will be sent as often as possible. You can reduce the frequency | |
6211 | that events are sent by changing the mode and/or setting an update | |
6212 | interval. | |
6213 | ||
6214 | """ | |
d55e5bfc RD |
6215 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
6216 | ||
6217 | def UpdateUIEvent_ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
6218 | """ |
6219 | UpdateUIEvent_ResetUpdateTime() | |
6220 | ||
6221 | Used internally to reset the last-updated time to the current time. It | |
6222 | is assumed that update events are normally sent in idle time, so this | |
6223 | is called at the end of idle processing. | |
6224 | """ | |
d55e5bfc RD |
6225 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
6226 | ||
6227 | def UpdateUIEvent_SetMode(*args, **kwargs): | |
5ba5649b RD |
6228 | """ |
6229 | UpdateUIEvent_SetMode(int mode) | |
6230 | ||
6231 | Specify how wxWidgets will send update events: to all windows, or only | |
6232 | to those which specify that they will process the events. | |
6233 | ||
6234 | The mode may be one of the following values: | |
6235 | ||
6236 | ============================= ========================================== | |
6237 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6238 | is the default setting. | |
6239 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6240 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6241 | style set. | |
6242 | ============================= ========================================== | |
6243 | ||
6244 | """ | |
d55e5bfc RD |
6245 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
6246 | ||
6247 | def UpdateUIEvent_GetMode(*args, **kwargs): | |
5ba5649b RD |
6248 | """ |
6249 | UpdateUIEvent_GetMode() -> int | |
6250 | ||
6251 | Returns a value specifying how wxWidgets will send update events: to | |
6252 | all windows, or only to those which specify that they will process the | |
6253 | events. | |
6254 | """ | |
d55e5bfc RD |
6255 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
6256 | ||
6257 | #--------------------------------------------------------------------------- | |
6258 | ||
6259 | class SysColourChangedEvent(Event): | |
5ba5649b RD |
6260 | """ |
6261 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
6262 | when the user changes the colour settings using the control | |
6263 | panel. This is only applicable under Windows. | |
6264 | ||
6265 | The default event handler for this event propagates the event to child | |
6266 | windows, since Windows only sends the events to top-level windows. If | |
6267 | intercepting this event for a top-level window, remember to call | |
6268 | `Skip` so the the base class handler will still be executed, or to | |
6269 | pass the event on to the window's children explicitly. | |
6270 | ||
6271 | """ | |
d55e5bfc RD |
6272 | def __repr__(self): |
6273 | return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6274 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6275 | """ |
6276 | __init__(self) -> SysColourChangedEvent | |
6277 | ||
6278 | Constructor | |
6279 | """ | |
d55e5bfc RD |
6280 | newobj = _core_.new_SysColourChangedEvent(*args, **kwargs) |
6281 | self.this = newobj.this | |
6282 | self.thisown = 1 | |
6283 | del newobj.thisown | |
6284 | ||
6285 | class SysColourChangedEventPtr(SysColourChangedEvent): | |
6286 | def __init__(self, this): | |
6287 | self.this = this | |
6288 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6289 | self.__class__ = SysColourChangedEvent | |
6290 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr) | |
6291 | ||
6292 | #--------------------------------------------------------------------------- | |
6293 | ||
6294 | class MouseCaptureChangedEvent(Event): | |
5ba5649b RD |
6295 | """ |
6296 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
6297 | a window that loses its mouse capture. This is called even if | |
6298 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
6299 | this event allows an application to cater for unexpected capture | |
6300 | releases which might otherwise confuse mouse handling code. | |
6301 | ||
6302 | This event is implemented under Windows only. | |
6303 | """ | |
d55e5bfc RD |
6304 | def __repr__(self): |
6305 | return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6306 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6307 | """ |
6308 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
6309 | ||
6310 | Constructor | |
6311 | """ | |
d55e5bfc RD |
6312 | newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs) |
6313 | self.this = newobj.this | |
6314 | self.thisown = 1 | |
6315 | del newobj.thisown | |
6316 | def GetCapturedWindow(*args, **kwargs): | |
5ba5649b RD |
6317 | """ |
6318 | GetCapturedWindow(self) -> Window | |
6319 | ||
6320 | Returns the window that gained the capture, or ``None`` if it was a | |
6321 | non-wxWidgets window. | |
6322 | """ | |
d55e5bfc RD |
6323 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
6324 | ||
6325 | ||
6326 | class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent): | |
6327 | def __init__(self, this): | |
6328 | self.this = this | |
6329 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6330 | self.__class__ = MouseCaptureChangedEvent | |
6331 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr) | |
6332 | ||
6333 | #--------------------------------------------------------------------------- | |
6334 | ||
6335 | class DisplayChangedEvent(Event): | |
5ba5649b RD |
6336 | """ |
6337 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
6338 | resolution has changed. | |
6339 | ||
6340 | This event is implemented under Windows only. | |
6341 | """ | |
d55e5bfc RD |
6342 | def __repr__(self): |
6343 | return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6344 | def __init__(self, *args, **kwargs): | |
6345 | """__init__(self) -> DisplayChangedEvent""" | |
6346 | newobj = _core_.new_DisplayChangedEvent(*args, **kwargs) | |
6347 | self.this = newobj.this | |
6348 | self.thisown = 1 | |
6349 | del newobj.thisown | |
6350 | ||
6351 | class DisplayChangedEventPtr(DisplayChangedEvent): | |
6352 | def __init__(self, this): | |
6353 | self.this = this | |
6354 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6355 | self.__class__ = DisplayChangedEvent | |
6356 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr) | |
6357 | ||
6358 | #--------------------------------------------------------------------------- | |
6359 | ||
6360 | class PaletteChangedEvent(Event): | |
5ba5649b RD |
6361 | """ |
6362 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6363 | changed, thereby giving each window a chance to redo their own to | |
6364 | match. | |
6365 | ||
6366 | This event is implemented under Windows only. | |
6367 | """ | |
d55e5bfc RD |
6368 | def __repr__(self): |
6369 | return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6370 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6371 | """ |
6372 | __init__(self, int id=0) -> PaletteChangedEvent | |
6373 | ||
6374 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6375 | changed, thereby giving each window a chance to redo their own to | |
6376 | match. | |
6377 | ||
6378 | This event is implemented under Windows only. | |
6379 | """ | |
d55e5bfc RD |
6380 | newobj = _core_.new_PaletteChangedEvent(*args, **kwargs) |
6381 | self.this = newobj.this | |
6382 | self.thisown = 1 | |
6383 | del newobj.thisown | |
6384 | def SetChangedWindow(*args, **kwargs): | |
6385 | """SetChangedWindow(self, Window win)""" | |
6386 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) | |
6387 | ||
6388 | def GetChangedWindow(*args, **kwargs): | |
6389 | """GetChangedWindow(self) -> Window""" | |
6390 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) | |
6391 | ||
6392 | ||
6393 | class PaletteChangedEventPtr(PaletteChangedEvent): | |
6394 | def __init__(self, this): | |
6395 | self.this = this | |
6396 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6397 | self.__class__ = PaletteChangedEvent | |
6398 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr) | |
6399 | ||
6400 | #--------------------------------------------------------------------------- | |
6401 | ||
6402 | class QueryNewPaletteEvent(Event): | |
5ba5649b RD |
6403 | """ |
6404 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6405 | focus and should re-do its palette. | |
6406 | ||
6407 | This event is implemented under Windows only. | |
6408 | """ | |
d55e5bfc RD |
6409 | def __repr__(self): |
6410 | return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6411 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6412 | """ |
6413 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6414 | ||
6415 | Constructor. | |
6416 | """ | |
d55e5bfc RD |
6417 | newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs) |
6418 | self.this = newobj.this | |
6419 | self.thisown = 1 | |
6420 | del newobj.thisown | |
6421 | def SetPaletteRealized(*args, **kwargs): | |
5ba5649b RD |
6422 | """ |
6423 | SetPaletteRealized(self, bool realized) | |
6424 | ||
6425 | App should set this if it changes the palette. | |
6426 | """ | |
d55e5bfc RD |
6427 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
6428 | ||
6429 | def GetPaletteRealized(*args, **kwargs): | |
6430 | """GetPaletteRealized(self) -> bool""" | |
6431 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) | |
6432 | ||
6433 | ||
6434 | class QueryNewPaletteEventPtr(QueryNewPaletteEvent): | |
6435 | def __init__(self, this): | |
6436 | self.this = this | |
6437 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6438 | self.__class__ = QueryNewPaletteEvent | |
6439 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr) | |
6440 | ||
6441 | #--------------------------------------------------------------------------- | |
6442 | ||
6443 | class NavigationKeyEvent(Event): | |
5ba5649b RD |
6444 | """ |
6445 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6446 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6447 | catch navigation events in applications as there are already | |
6448 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6449 | it useful to send navigation events in certain situations to change | |
6450 | the focus in certain ways, although it's probably easier to just call | |
6451 | `wx.Window.Navigate`. | |
6452 | """ | |
d55e5bfc RD |
6453 | def __repr__(self): |
6454 | return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6455 | def __init__(self, *args, **kwargs): | |
6456 | """__init__(self) -> NavigationKeyEvent""" | |
6457 | newobj = _core_.new_NavigationKeyEvent(*args, **kwargs) | |
6458 | self.this = newobj.this | |
6459 | self.thisown = 1 | |
6460 | del newobj.thisown | |
6461 | def GetDirection(*args, **kwargs): | |
5ba5649b RD |
6462 | """ |
6463 | GetDirection(self) -> bool | |
6464 | ||
6465 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6466 | """ | |
d55e5bfc RD |
6467 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
6468 | ||
6469 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6470 | """ |
6471 | SetDirection(self, bool forward) | |
6472 | ||
6473 | Specify the direction that the navigation should take. Usually the | |
6474 | difference between using Tab and Shift-Tab. | |
6475 | """ | |
d55e5bfc RD |
6476 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
6477 | ||
6478 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6479 | """ |
6480 | IsWindowChange(self) -> bool | |
6481 | ||
6482 | Returns ``True`` if window change is allowed. | |
6483 | """ | |
d55e5bfc RD |
6484 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
6485 | ||
6486 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6487 | """ |
6488 | SetWindowChange(self, bool ischange) | |
6489 | ||
6490 | Specify if the navigation should be able to change parent windows. | |
6491 | For example, changing notebook pages, etc. This is usually implemented | |
6492 | by using Control-Tab. | |
6493 | """ | |
d55e5bfc RD |
6494 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
6495 | ||
68350608 | 6496 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6497 | """ |
6498 | IsFromTab(self) -> bool | |
6499 | ||
6500 | Returns ``True`` if the navigation event is originated from the Tab | |
6501 | key. | |
6502 | """ | |
68350608 RD |
6503 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
6504 | ||
6505 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6506 | """ |
6507 | SetFromTab(self, bool bIs) | |
6508 | ||
6509 | Set to true under MSW if the event was generated using the tab key. | |
6510 | This is required for proper navogation over radio buttons. | |
6511 | """ | |
68350608 RD |
6512 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
6513 | ||
908b74cd | 6514 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6515 | """ |
6516 | SetFlags(self, long flags) | |
6517 | ||
6518 | Set the navigation flags to a combination of the following: | |
6519 | ||
6520 | * wx.NavigationKeyEvent.IsBackward | |
6521 | * wx.NavigationKeyEvent.IsForward | |
6522 | * wx.NavigationKeyEvent.WinChange | |
6523 | * wx.NavigationKeyEvent.FromTab | |
6524 | ||
6525 | """ | |
908b74cd RD |
6526 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
6527 | ||
d55e5bfc | 6528 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6529 | """ |
6530 | GetCurrentFocus(self) -> Window | |
6531 | ||
6532 | Returns the child window which currenty has the focus. May be | |
6533 | ``None``. | |
6534 | """ | |
d55e5bfc RD |
6535 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
6536 | ||
6537 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6538 | """ |
6539 | SetCurrentFocus(self, Window win) | |
6540 | ||
6541 | Set the window that has the focus. | |
6542 | """ | |
d55e5bfc RD |
6543 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
6544 | ||
b0f7404b | 6545 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
908b74cd RD |
6546 | IsForward = _core_.NavigationKeyEvent_IsForward |
6547 | WinChange = _core_.NavigationKeyEvent_WinChange | |
68350608 | 6548 | FromTab = _core_.NavigationKeyEvent_FromTab |
d55e5bfc RD |
6549 | |
6550 | class NavigationKeyEventPtr(NavigationKeyEvent): | |
6551 | def __init__(self, this): | |
6552 | self.this = this | |
6553 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6554 | self.__class__ = NavigationKeyEvent | |
6555 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr) | |
6556 | ||
6557 | #--------------------------------------------------------------------------- | |
6558 | ||
6559 | class WindowCreateEvent(CommandEvent): | |
5ba5649b RD |
6560 | """ |
6561 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6562 | underlying GUI object) exists. | |
6563 | """ | |
d55e5bfc RD |
6564 | def __repr__(self): |
6565 | return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6566 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6567 | """ |
6568 | __init__(self, Window win=None) -> WindowCreateEvent | |
6569 | ||
6570 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6571 | underlying GUI object) exists. | |
6572 | """ | |
d55e5bfc RD |
6573 | newobj = _core_.new_WindowCreateEvent(*args, **kwargs) |
6574 | self.this = newobj.this | |
6575 | self.thisown = 1 | |
6576 | del newobj.thisown | |
6577 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
6578 | """ |
6579 | GetWindow(self) -> Window | |
6580 | ||
6581 | Returns the window that this event refers to. | |
6582 | """ | |
d55e5bfc RD |
6583 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
6584 | ||
6585 | ||
6586 | class WindowCreateEventPtr(WindowCreateEvent): | |
6587 | def __init__(self, this): | |
6588 | self.this = this | |
6589 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6590 | self.__class__ = WindowCreateEvent | |
6591 | _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr) | |
6592 | ||
6593 | class WindowDestroyEvent(CommandEvent): | |
5ba5649b | 6594 | """ |
9d7dfdff RD |
6595 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6596 | when the GUI window is destroyed. | |
6597 | ||
6598 | When a class derived from `wx.Window` is destroyed its destructor will | |
6599 | have already run by the time this event is sent. Therefore this event | |
6600 | will not usually be received at all by the window itself. Since it is | |
6601 | received after the destructor has run, an object should not try to | |
6602 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6603 | notification of the destruction of another window. | |
5ba5649b | 6604 | """ |
d55e5bfc RD |
6605 | def __repr__(self): |
6606 | return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6607 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6608 | """ |
6609 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6610 | ||
9d7dfdff RD |
6611 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6612 | when the GUI window is destroyed. | |
6613 | ||
6614 | When a class derived from `wx.Window` is destroyed its destructor will | |
6615 | have already run by the time this event is sent. Therefore this event | |
6616 | will not usually be received at all by the window itself. Since it is | |
6617 | received after the destructor has run, an object should not try to | |
6618 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6619 | notification of the destruction of another window. | |
5ba5649b | 6620 | """ |
d55e5bfc RD |
6621 | newobj = _core_.new_WindowDestroyEvent(*args, **kwargs) |
6622 | self.this = newobj.this | |
6623 | self.thisown = 1 | |
6624 | del newobj.thisown | |
6625 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
6626 | """ |
6627 | GetWindow(self) -> Window | |
6628 | ||
6629 | Returns the window that this event refers to. | |
6630 | """ | |
d55e5bfc RD |
6631 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
6632 | ||
6633 | ||
6634 | class WindowDestroyEventPtr(WindowDestroyEvent): | |
6635 | def __init__(self, this): | |
6636 | self.this = this | |
6637 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6638 | self.__class__ = WindowDestroyEvent | |
6639 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr) | |
6640 | ||
6641 | #--------------------------------------------------------------------------- | |
6642 | ||
6643 | class ContextMenuEvent(CommandEvent): | |
5ba5649b RD |
6644 | """ |
6645 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6646 | give the application a chance to show a context (popup) menu. | |
6647 | """ | |
d55e5bfc RD |
6648 | def __repr__(self): |
6649 | return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6650 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6651 | """ |
6652 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent | |
6653 | ||
6654 | Constructor. | |
6655 | """ | |
d55e5bfc RD |
6656 | newobj = _core_.new_ContextMenuEvent(*args, **kwargs) |
6657 | self.this = newobj.this | |
6658 | self.thisown = 1 | |
6659 | del newobj.thisown | |
6660 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
6661 | """ |
6662 | GetPosition(self) -> Point | |
6663 | ||
6664 | Returns the position (in screen coordinants) at which the menu should | |
6665 | be shown. | |
6666 | """ | |
d55e5bfc RD |
6667 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
6668 | ||
6669 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6670 | """ |
6671 | SetPosition(self, Point pos) | |
6672 | ||
6673 | Sets the position at which the menu should be shown. | |
6674 | """ | |
d55e5bfc RD |
6675 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
6676 | ||
6677 | ||
6678 | class ContextMenuEventPtr(ContextMenuEvent): | |
6679 | def __init__(self, this): | |
6680 | self.this = this | |
6681 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6682 | self.__class__ = ContextMenuEvent | |
6683 | _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr) | |
6684 | ||
6685 | #--------------------------------------------------------------------------- | |
6686 | ||
6687 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL | |
6688 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
6689 | class IdleEvent(Event): | |
5ba5649b RD |
6690 | """ |
6691 | This class is used for EVT_IDLE events, which are generated and sent | |
6692 | when the application *becomes* idle. In other words, the when the | |
6693 | event queue becomes empty then idle events are sent to all windows (by | |
6694 | default) and as long as none of them call `RequestMore` then there are | |
6695 | no more idle events until after the system event queue has some normal | |
6696 | events and then becomes empty again. | |
6697 | ||
6698 | By default, idle events are sent to all windows. If this is causing a | |
6699 | significant overhead in your application, you can call | |
6700 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6701 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6702 | which should receive idle events. Then idle events will only be sent | |
6703 | to those windows and not to any others. | |
6704 | """ | |
d55e5bfc RD |
6705 | def __repr__(self): |
6706 | return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6707 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6708 | """ |
6709 | __init__(self) -> IdleEvent | |
6710 | ||
6711 | Constructor | |
6712 | """ | |
d55e5bfc RD |
6713 | newobj = _core_.new_IdleEvent(*args, **kwargs) |
6714 | self.this = newobj.this | |
6715 | self.thisown = 1 | |
6716 | del newobj.thisown | |
6717 | def RequestMore(*args, **kwargs): | |
5ba5649b RD |
6718 | """ |
6719 | RequestMore(self, bool needMore=True) | |
6720 | ||
6721 | Tells wxWidgets that more processing is required. This function can be | |
6722 | called by an EVT_IDLE handler for a window to indicate that the | |
6723 | application should forward the EVT_IDLE event once more to the | |
6724 | application windows. If no window calls this function during its | |
6725 | EVT_IDLE handler, then the application will remain in a passive event | |
6726 | loop until a new event is posted to the application by the windowing | |
6727 | system. | |
6728 | """ | |
d55e5bfc RD |
6729 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
6730 | ||
6731 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6732 | """ |
6733 | MoreRequested(self) -> bool | |
6734 | ||
6735 | Returns ``True`` if the OnIdle function processing this event | |
6736 | requested more processing time. | |
6737 | """ | |
d55e5bfc RD |
6738 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
6739 | ||
6740 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6741 | """ |
6742 | SetMode(int mode) | |
6743 | ||
6744 | Static method for specifying how wxWidgets will send idle events: to | |
6745 | all windows, or only to those which specify that they will process the | |
6746 | events. | |
6747 | ||
6748 | The mode can be one of the following values: | |
6749 | ||
6750 | ========================= ======================================== | |
6751 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6752 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6753 | the wx.WS_EX_PROCESS_IDLE extra style | |
6754 | flag set. | |
6755 | ========================= ======================================== | |
6756 | ||
6757 | """ | |
d55e5bfc RD |
6758 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
6759 | ||
6760 | SetMode = staticmethod(SetMode) | |
6761 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6762 | """ |
6763 | GetMode() -> int | |
6764 | ||
6765 | Static method returning a value specifying how wxWidgets will send | |
6766 | idle events: to all windows, or only to those which specify that they | |
6767 | will process the events. | |
6768 | """ | |
d55e5bfc RD |
6769 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
6770 | ||
6771 | GetMode = staticmethod(GetMode) | |
6772 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6773 | """ |
6774 | CanSend(Window win) -> bool | |
6775 | ||
6776 | Returns ``True`` if it is appropriate to send idle events to this | |
6777 | window. | |
6778 | ||
6779 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6780 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6781 | events should be sent to this window now. By default this will always | |
6782 | return ``True`` because the update mode is initially | |
6783 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6784 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6785 | """ | |
d55e5bfc RD |
6786 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
6787 | ||
6788 | CanSend = staticmethod(CanSend) | |
6789 | ||
6790 | class IdleEventPtr(IdleEvent): | |
6791 | def __init__(self, this): | |
6792 | self.this = this | |
6793 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6794 | self.__class__ = IdleEvent | |
6795 | _core_.IdleEvent_swigregister(IdleEventPtr) | |
6796 | ||
6797 | def IdleEvent_SetMode(*args, **kwargs): | |
5ba5649b RD |
6798 | """ |
6799 | IdleEvent_SetMode(int mode) | |
6800 | ||
6801 | Static method for specifying how wxWidgets will send idle events: to | |
6802 | all windows, or only to those which specify that they will process the | |
6803 | events. | |
6804 | ||
6805 | The mode can be one of the following values: | |
6806 | ||
6807 | ========================= ======================================== | |
6808 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6809 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6810 | the wx.WS_EX_PROCESS_IDLE extra style | |
6811 | flag set. | |
6812 | ========================= ======================================== | |
6813 | ||
6814 | """ | |
d55e5bfc RD |
6815 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
6816 | ||
6817 | def IdleEvent_GetMode(*args, **kwargs): | |
5ba5649b RD |
6818 | """ |
6819 | IdleEvent_GetMode() -> int | |
6820 | ||
6821 | Static method returning a value specifying how wxWidgets will send | |
6822 | idle events: to all windows, or only to those which specify that they | |
6823 | will process the events. | |
6824 | """ | |
d55e5bfc RD |
6825 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
6826 | ||
6827 | def IdleEvent_CanSend(*args, **kwargs): | |
5ba5649b RD |
6828 | """ |
6829 | IdleEvent_CanSend(Window win) -> bool | |
6830 | ||
6831 | Returns ``True`` if it is appropriate to send idle events to this | |
6832 | window. | |
6833 | ||
6834 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6835 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6836 | events should be sent to this window now. By default this will always | |
6837 | return ``True`` because the update mode is initially | |
6838 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6839 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6840 | """ | |
d55e5bfc RD |
6841 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
6842 | ||
6843 | #--------------------------------------------------------------------------- | |
6844 | ||
6845 | class PyEvent(Event): | |
5ba5649b RD |
6846 | """ |
6847 | wx.PyEvent can be used as a base class for implementing custom event | |
6848 | types in Python. You should derived from this class instead of | |
6849 | `wx.Event` because this class is Python-aware and is able to transport | |
6850 | its Python bits safely through the wxWidgets event system and have | |
6851 | them still be there when the event handler is invoked. | |
6852 | ||
6853 | :see: `wx.PyCommandEvent` | |
6854 | ||
6855 | """ | |
d55e5bfc RD |
6856 | def __repr__(self): |
6857 | return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6858 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6859 | """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent""" |
d55e5bfc RD |
6860 | newobj = _core_.new_PyEvent(*args, **kwargs) |
6861 | self.this = newobj.this | |
6862 | self.thisown = 1 | |
6863 | del newobj.thisown | |
5ba5649b | 6864 | self._SetSelf(self) |
d55e5bfc RD |
6865 | |
6866 | def __del__(self, destroy=_core_.delete_PyEvent): | |
6867 | """__del__(self)""" | |
6868 | try: | |
6869 | if self.thisown: destroy(self) | |
6870 | except: pass | |
6871 | ||
5ba5649b RD |
6872 | def _SetSelf(*args, **kwargs): |
6873 | """_SetSelf(self, PyObject self)""" | |
6874 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
d55e5bfc | 6875 | |
5ba5649b RD |
6876 | def _GetSelf(*args, **kwargs): |
6877 | """_GetSelf(self) -> PyObject""" | |
6878 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
d55e5bfc RD |
6879 | |
6880 | ||
6881 | class PyEventPtr(PyEvent): | |
6882 | def __init__(self, this): | |
6883 | self.this = this | |
6884 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6885 | self.__class__ = PyEvent | |
6886 | _core_.PyEvent_swigregister(PyEventPtr) | |
6887 | ||
6888 | class PyCommandEvent(CommandEvent): | |
5ba5649b RD |
6889 | """ |
6890 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6891 | event types in Python, where the event shoudl travel up to parent | |
6892 | windows looking for a handler. You should derived from this class | |
6893 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6894 | able to transport its Python bits safely through the wxWidgets event | |
6895 | system and have them still be there when the event handler is invoked. | |
6896 | ||
6897 | :see: `wx.PyEvent` | |
6898 | ||
6899 | """ | |
d55e5bfc RD |
6900 | def __repr__(self): |
6901 | return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6902 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6903 | """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
d55e5bfc RD |
6904 | newobj = _core_.new_PyCommandEvent(*args, **kwargs) |
6905 | self.this = newobj.this | |
6906 | self.thisown = 1 | |
6907 | del newobj.thisown | |
5ba5649b | 6908 | self._SetSelf(self) |
d55e5bfc RD |
6909 | |
6910 | def __del__(self, destroy=_core_.delete_PyCommandEvent): | |
6911 | """__del__(self)""" | |
6912 | try: | |
6913 | if self.thisown: destroy(self) | |
6914 | except: pass | |
6915 | ||
5ba5649b RD |
6916 | def _SetSelf(*args, **kwargs): |
6917 | """_SetSelf(self, PyObject self)""" | |
6918 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
d55e5bfc | 6919 | |
5ba5649b RD |
6920 | def _GetSelf(*args, **kwargs): |
6921 | """_GetSelf(self) -> PyObject""" | |
6922 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
d55e5bfc RD |
6923 | |
6924 | ||
6925 | class PyCommandEventPtr(PyCommandEvent): | |
6926 | def __init__(self, this): | |
6927 | self.this = this | |
6928 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6929 | self.__class__ = PyCommandEvent | |
6930 | _core_.PyCommandEvent_swigregister(PyCommandEventPtr) | |
6931 | ||
53aa7709 | 6932 | class DateEvent(CommandEvent): |
5ba5649b RD |
6933 | """ |
6934 | This event class holds information about a date change event and is | |
6935 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6936 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6937 | EVT_DATE_CHANGED. | |
6938 | """ | |
53aa7709 RD |
6939 | def __repr__(self): |
6940 | return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6941 | def __init__(self, *args, **kwargs): | |
6942 | """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent""" | |
6943 | newobj = _core_.new_DateEvent(*args, **kwargs) | |
6944 | self.this = newobj.this | |
6945 | self.thisown = 1 | |
6946 | del newobj.thisown | |
6947 | def GetDate(*args, **kwargs): | |
5ba5649b RD |
6948 | """ |
6949 | GetDate(self) -> DateTime | |
6950 | ||
6951 | Returns the date. | |
6952 | """ | |
53aa7709 RD |
6953 | return _core_.DateEvent_GetDate(*args, **kwargs) |
6954 | ||
6955 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6956 | """ |
6957 | SetDate(self, DateTime date) | |
6958 | ||
6959 | Sets the date carried by the event, normally only used by the library | |
6960 | internally. | |
6961 | """ | |
53aa7709 RD |
6962 | return _core_.DateEvent_SetDate(*args, **kwargs) |
6963 | ||
6964 | ||
6965 | class DateEventPtr(DateEvent): | |
6966 | def __init__(self, this): | |
6967 | self.this = this | |
6968 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6969 | self.__class__ = DateEvent | |
6970 | _core_.DateEvent_swigregister(DateEventPtr) | |
6971 | ||
6972 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
6973 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
6974 | ||
d55e5bfc RD |
6975 | #--------------------------------------------------------------------------- |
6976 | ||
6977 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS | |
6978 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6979 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6980 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6981 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6982 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
6983 | class PyApp(EvtHandler): | |
c24da6d6 RD |
6984 | """ |
6985 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6986 | `wx.App` class (or some other derived class) instead. | |
6987 | """ | |
d55e5bfc RD |
6988 | def __repr__(self): |
6989 | return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6990 | def __init__(self, *args, **kwargs): | |
6991 | """ | |
6992 | __init__(self) -> PyApp | |
6993 | ||
6994 | Create a new application object, starting the bootstrap process. | |
6995 | """ | |
6996 | newobj = _core_.new_PyApp(*args, **kwargs) | |
6997 | self.this = newobj.this | |
6998 | self.thisown = 1 | |
6999 | del newobj.thisown | |
70b7a5fe RD |
7000 | self._setCallbackInfo(self, PyApp, False) |
7001 | self._setOORInfo(self, False) | |
d55e5bfc RD |
7002 | |
7003 | def __del__(self, destroy=_core_.delete_PyApp): | |
7004 | """__del__(self)""" | |
7005 | try: | |
7006 | if self.thisown: destroy(self) | |
7007 | except: pass | |
7008 | ||
7009 | def _setCallbackInfo(*args, **kwargs): | |
70b7a5fe | 7010 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
d55e5bfc RD |
7011 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
7012 | ||
7013 | def GetAppName(*args, **kwargs): | |
7014 | """ | |
7015 | GetAppName(self) -> String | |
7016 | ||
7017 | Get the application name. | |
7018 | """ | |
7019 | return _core_.PyApp_GetAppName(*args, **kwargs) | |
7020 | ||
7021 | def SetAppName(*args, **kwargs): | |
7022 | """ | |
7023 | SetAppName(self, String name) | |
7024 | ||
c24da6d6 RD |
7025 | Set the application name. This value may be used automatically by |
7026 | `wx.Config` and such. | |
d55e5bfc RD |
7027 | """ |
7028 | return _core_.PyApp_SetAppName(*args, **kwargs) | |
7029 | ||
7030 | def GetClassName(*args, **kwargs): | |
7031 | """ | |
7032 | GetClassName(self) -> String | |
7033 | ||
7034 | Get the application's class name. | |
7035 | """ | |
7036 | return _core_.PyApp_GetClassName(*args, **kwargs) | |
7037 | ||
7038 | def SetClassName(*args, **kwargs): | |
7039 | """ | |
7040 | SetClassName(self, String name) | |
7041 | ||
c24da6d6 RD |
7042 | Set the application's class name. This value may be used for |
7043 | X-resources if applicable for the platform | |
d55e5bfc RD |
7044 | """ |
7045 | return _core_.PyApp_SetClassName(*args, **kwargs) | |
7046 | ||
7047 | def GetVendorName(*args, **kwargs): | |
7048 | """ | |
7049 | GetVendorName(self) -> String | |
7050 | ||
7051 | Get the application's vendor name. | |
7052 | """ | |
7053 | return _core_.PyApp_GetVendorName(*args, **kwargs) | |
7054 | ||
7055 | def SetVendorName(*args, **kwargs): | |
7056 | """ | |
7057 | SetVendorName(self, String name) | |
7058 | ||
c24da6d6 RD |
7059 | Set the application's vendor name. This value may be used |
7060 | automatically by `wx.Config` and such. | |
d55e5bfc RD |
7061 | """ |
7062 | return _core_.PyApp_SetVendorName(*args, **kwargs) | |
7063 | ||
7064 | def GetTraits(*args, **kwargs): | |
7065 | """ | |
7066 | GetTraits(self) -> wxAppTraits | |
7067 | ||
c24da6d6 RD |
7068 | Return (and create if necessary) the app traits object to which we |
7069 | delegate for everything which either should be configurable by the | |
7070 | user (then he can change the default behaviour simply by overriding | |
7071 | CreateTraits() and returning his own traits object) or which is | |
7072 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
7073 | differences behind the common facade. | |
7074 | ||
7075 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
d55e5bfc RD |
7076 | """ |
7077 | return _core_.PyApp_GetTraits(*args, **kwargs) | |
7078 | ||
7079 | def ProcessPendingEvents(*args, **kwargs): | |
7080 | """ | |
7081 | ProcessPendingEvents(self) | |
7082 | ||
c24da6d6 RD |
7083 | Process all events in the Pending Events list -- it is necessary to |
7084 | call this function to process posted events. This normally happens | |
7085 | during each event loop iteration. | |
d55e5bfc RD |
7086 | """ |
7087 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) | |
7088 | ||
7089 | def Yield(*args, **kwargs): | |
7090 | """ | |
7091 | Yield(self, bool onlyIfNeeded=False) -> bool | |
7092 | ||
c24da6d6 RD |
7093 | Process all currently pending events right now, instead of waiting |
7094 | until return to the event loop. It is an error to call ``Yield`` | |
7095 | recursively unless the value of ``onlyIfNeeded`` is True. | |
d55e5bfc | 7096 | |
c24da6d6 | 7097 | :warning: This function is dangerous as it can lead to unexpected |
79fccf9d RD |
7098 | reentrancies (i.e. when called from an event handler it may |
7099 | result in calling the same event handler again), use with | |
7100 | extreme care or, better, don't use at all! | |
d55e5bfc | 7101 | |
c24da6d6 | 7102 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
79fccf9d | 7103 | |
d55e5bfc RD |
7104 | """ |
7105 | return _core_.PyApp_Yield(*args, **kwargs) | |
7106 | ||
7107 | def WakeUpIdle(*args, **kwargs): | |
7108 | """ | |
7109 | WakeUpIdle(self) | |
7110 | ||
c24da6d6 RD |
7111 | Make sure that idle events are sent again. |
7112 | :see: `wx.WakeUpIdle` | |
d55e5bfc RD |
7113 | """ |
7114 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) | |
7115 | ||
84f85550 RD |
7116 | def IsMainLoopRunning(*args, **kwargs): |
7117 | """ | |
7118 | IsMainLoopRunning() -> bool | |
7119 | ||
7120 | Returns True if we're running the main loop, i.e. if the events can | |
7121 | currently be dispatched. | |
7122 | """ | |
7123 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
7124 | ||
7125 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
d55e5bfc RD |
7126 | def MainLoop(*args, **kwargs): |
7127 | """ | |
7128 | MainLoop(self) -> int | |
7129 | ||
c24da6d6 RD |
7130 | Execute the main GUI loop, the function doesn't normally return until |
7131 | all top level windows have been closed and destroyed. | |
d55e5bfc RD |
7132 | """ |
7133 | return _core_.PyApp_MainLoop(*args, **kwargs) | |
7134 | ||
7135 | def Exit(*args, **kwargs): | |
7136 | """ | |
7137 | Exit(self) | |
7138 | ||
7139 | Exit the main loop thus terminating the application. | |
c24da6d6 | 7140 | :see: `wx.Exit` |
d55e5bfc RD |
7141 | """ |
7142 | return _core_.PyApp_Exit(*args, **kwargs) | |
7143 | ||
7144 | def ExitMainLoop(*args, **kwargs): | |
7145 | """ | |
7146 | ExitMainLoop(self) | |
7147 | ||
c24da6d6 RD |
7148 | Exit the main GUI loop during the next iteration of the main |
7149 | loop, (i.e. it does not stop the program immediately!) | |
d55e5bfc RD |
7150 | """ |
7151 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) | |
7152 | ||
7153 | def Pending(*args, **kwargs): | |
7154 | """ | |
7155 | Pending(self) -> bool | |
7156 | ||
7157 | Returns True if there are unprocessed events in the event queue. | |
7158 | """ | |
7159 | return _core_.PyApp_Pending(*args, **kwargs) | |
7160 | ||
7161 | def Dispatch(*args, **kwargs): | |
7162 | """ | |
7163 | Dispatch(self) -> bool | |
7164 | ||
7165 | Process the first event in the event queue (blocks until an event | |
7166 | appears if there are none currently) | |
7167 | """ | |
7168 | return _core_.PyApp_Dispatch(*args, **kwargs) | |
7169 | ||
7170 | def ProcessIdle(*args, **kwargs): | |
7171 | """ | |
7172 | ProcessIdle(self) -> bool | |
7173 | ||
c24da6d6 RD |
7174 | Called from the MainLoop when the application becomes idle (there are |
7175 | no pending events) and sends a `wx.IdleEvent` to all interested | |
7176 | parties. Returns True if more idle events are needed, False if not. | |
d55e5bfc RD |
7177 | """ |
7178 | return _core_.PyApp_ProcessIdle(*args, **kwargs) | |
7179 | ||
7180 | def SendIdleEvents(*args, **kwargs): | |
7181 | """ | |
7182 | SendIdleEvents(self, Window win, IdleEvent event) -> bool | |
7183 | ||
c24da6d6 RD |
7184 | Send idle event to window and all subwindows. Returns True if more |
7185 | idle time is requested. | |
d55e5bfc RD |
7186 | """ |
7187 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) | |
7188 | ||
7189 | def IsActive(*args, **kwargs): | |
7190 | """ | |
7191 | IsActive(self) -> bool | |
7192 | ||
7193 | Return True if our app has focus. | |
7194 | """ | |
7195 | return _core_.PyApp_IsActive(*args, **kwargs) | |
7196 | ||
7197 | def SetTopWindow(*args, **kwargs): | |
7198 | """ | |
7199 | SetTopWindow(self, Window win) | |
7200 | ||
c24da6d6 | 7201 | Set the *main* top level window |
d55e5bfc RD |
7202 | """ |
7203 | return _core_.PyApp_SetTopWindow(*args, **kwargs) | |
7204 | ||
7205 | def GetTopWindow(*args, **kwargs): | |
7206 | """ | |
7207 | GetTopWindow(self) -> Window | |
7208 | ||
c24da6d6 RD |
7209 | Return the *main* top level window (if it hadn't been set previously |
7210 | with SetTopWindow(), will return just some top level window and, if | |
7211 | there not any, will return None) | |
d55e5bfc RD |
7212 | """ |
7213 | return _core_.PyApp_GetTopWindow(*args, **kwargs) | |
7214 | ||
7215 | def SetExitOnFrameDelete(*args, **kwargs): | |
7216 | """ | |
7217 | SetExitOnFrameDelete(self, bool flag) | |
7218 | ||
c24da6d6 RD |
7219 | Control the exit behaviour: by default, the program will exit the main |
7220 | loop (and so, usually, terminate) when the last top-level program | |
7221 | window is deleted. Beware that if you disable this behaviour (with | |
7222 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
7223 | explicitly from somewhere. | |
d55e5bfc RD |
7224 | """ |
7225 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) | |
7226 | ||
7227 | def GetExitOnFrameDelete(*args, **kwargs): | |
7228 | """ | |
7229 | GetExitOnFrameDelete(self) -> bool | |
7230 | ||
7231 | Get the current exit behaviour setting. | |
7232 | """ | |
7233 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) | |
7234 | ||
7235 | def SetUseBestVisual(*args, **kwargs): | |
7236 | """ | |
7237 | SetUseBestVisual(self, bool flag) | |
7238 | ||
c24da6d6 RD |
7239 | Set whether the app should try to use the best available visual on |
7240 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
d55e5bfc RD |
7241 | """ |
7242 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) | |
7243 | ||
7244 | def GetUseBestVisual(*args, **kwargs): | |
7245 | """ | |
7246 | GetUseBestVisual(self) -> bool | |
7247 | ||
7248 | Get current UseBestVisual setting. | |
7249 | """ | |
7250 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) | |
7251 | ||
7252 | def SetPrintMode(*args, **kwargs): | |
7253 | """SetPrintMode(self, int mode)""" | |
7254 | return _core_.PyApp_SetPrintMode(*args, **kwargs) | |
7255 | ||
7256 | def GetPrintMode(*args, **kwargs): | |
7257 | """GetPrintMode(self) -> int""" | |
7258 | return _core_.PyApp_GetPrintMode(*args, **kwargs) | |
7259 | ||
7260 | def SetAssertMode(*args, **kwargs): | |
7261 | """ | |
7262 | SetAssertMode(self, int mode) | |
7263 | ||
79fccf9d | 7264 | Set the OnAssert behaviour for debug and hybrid builds. |
d55e5bfc RD |
7265 | """ |
7266 | return _core_.PyApp_SetAssertMode(*args, **kwargs) | |
7267 | ||
7268 | def GetAssertMode(*args, **kwargs): | |
7269 | """ | |
7270 | GetAssertMode(self) -> int | |
7271 | ||
7272 | Get the current OnAssert behaviour setting. | |
7273 | """ | |
7274 | return _core_.PyApp_GetAssertMode(*args, **kwargs) | |
7275 | ||
7276 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): | |
c24da6d6 | 7277 | """GetMacSupportPCMenuShortcuts() -> bool""" |
d55e5bfc RD |
7278 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
7279 | ||
7280 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
7281 | def GetMacAboutMenuItemId(*args, **kwargs): | |
c24da6d6 | 7282 | """GetMacAboutMenuItemId() -> long""" |
d55e5bfc RD |
7283 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
7284 | ||
7285 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
7286 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
c24da6d6 | 7287 | """GetMacPreferencesMenuItemId() -> long""" |
d55e5bfc RD |
7288 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
7289 | ||
7290 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
7291 | def GetMacExitMenuItemId(*args, **kwargs): | |
c24da6d6 | 7292 | """GetMacExitMenuItemId() -> long""" |
d55e5bfc RD |
7293 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
7294 | ||
7295 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
7296 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
c24da6d6 | 7297 | """GetMacHelpMenuTitleName() -> String""" |
d55e5bfc RD |
7298 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
7299 | ||
7300 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
7301 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
c24da6d6 | 7302 | """SetMacSupportPCMenuShortcuts(bool val)""" |
d55e5bfc RD |
7303 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
7304 | ||
7305 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
7306 | def SetMacAboutMenuItemId(*args, **kwargs): | |
c24da6d6 | 7307 | """SetMacAboutMenuItemId(long val)""" |
d55e5bfc RD |
7308 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
7309 | ||
7310 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
7311 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
c24da6d6 | 7312 | """SetMacPreferencesMenuItemId(long val)""" |
d55e5bfc RD |
7313 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
7314 | ||
7315 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
7316 | def SetMacExitMenuItemId(*args, **kwargs): | |
c24da6d6 | 7317 | """SetMacExitMenuItemId(long val)""" |
d55e5bfc RD |
7318 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
7319 | ||
7320 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
7321 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
c24da6d6 | 7322 | """SetMacHelpMenuTitleName(String val)""" |
d55e5bfc RD |
7323 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
7324 | ||
7325 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
7326 | def _BootstrapApp(*args, **kwargs): | |
7327 | """ | |
7328 | _BootstrapApp(self) | |
7329 | ||
7330 | For internal use only | |
7331 | """ | |
7332 | return _core_.PyApp__BootstrapApp(*args, **kwargs) | |
7333 | ||
7334 | def GetComCtl32Version(*args, **kwargs): | |
7335 | """ | |
c24da6d6 | 7336 | GetComCtl32Version() -> int |
d55e5bfc | 7337 | |
c24da6d6 RD |
7338 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7339 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc RD |
7340 | """ |
7341 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) | |
7342 | ||
7343 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
7344 | ||
7345 | class PyAppPtr(PyApp): | |
7346 | def __init__(self, this): | |
7347 | self.this = this | |
7348 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7349 | self.__class__ = PyApp | |
7350 | _core_.PyApp_swigregister(PyAppPtr) | |
7351 | ||
84f85550 RD |
7352 | def PyApp_IsMainLoopRunning(*args, **kwargs): |
7353 | """ | |
7354 | PyApp_IsMainLoopRunning() -> bool | |
7355 | ||
7356 | Returns True if we're running the main loop, i.e. if the events can | |
7357 | currently be dispatched. | |
7358 | """ | |
7359 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
7360 | ||
d55e5bfc RD |
7361 | def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs): |
7362 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
7363 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) | |
7364 | ||
7365 | def PyApp_GetMacAboutMenuItemId(*args, **kwargs): | |
7366 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
7367 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) | |
7368 | ||
7369 | def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs): | |
7370 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
7371 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) | |
7372 | ||
7373 | def PyApp_GetMacExitMenuItemId(*args, **kwargs): | |
7374 | """PyApp_GetMacExitMenuItemId() -> long""" | |
7375 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) | |
7376 | ||
7377 | def PyApp_GetMacHelpMenuTitleName(*args, **kwargs): | |
7378 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
7379 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) | |
7380 | ||
7381 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
7382 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" | |
7383 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
7384 | ||
7385 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): | |
7386 | """PyApp_SetMacAboutMenuItemId(long val)""" | |
7387 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
7388 | ||
7389 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): | |
7390 | """PyApp_SetMacPreferencesMenuItemId(long val)""" | |
7391 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
7392 | ||
7393 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): | |
7394 | """PyApp_SetMacExitMenuItemId(long val)""" | |
7395 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
7396 | ||
7397 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): | |
7398 | """PyApp_SetMacHelpMenuTitleName(String val)""" | |
7399 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
7400 | ||
7401 | def PyApp_GetComCtl32Version(*args, **kwargs): | |
7402 | """ | |
7403 | PyApp_GetComCtl32Version() -> int | |
7404 | ||
c24da6d6 RD |
7405 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7406 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc RD |
7407 | """ |
7408 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) | |
7409 | ||
7410 | #--------------------------------------------------------------------------- | |
7411 | ||
7412 | ||
7413 | def Exit(*args, **kwargs): | |
7414 | """ | |
7415 | Exit() | |
7416 | ||
7417 | Force an exit of the application. Convenience for wx.GetApp().Exit() | |
7418 | """ | |
7419 | return _core_.Exit(*args, **kwargs) | |
7420 | ||
7421 | def Yield(*args, **kwargs): | |
7422 | """ | |
7423 | Yield() -> bool | |
7424 | ||
7425 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() | |
7426 | """ | |
7427 | return _core_.Yield(*args, **kwargs) | |
7428 | ||
7429 | def YieldIfNeeded(*args, **kwargs): | |
7430 | """ | |
7431 | YieldIfNeeded() -> bool | |
7432 | ||
7433 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) | |
7434 | """ | |
7435 | return _core_.YieldIfNeeded(*args, **kwargs) | |
7436 | ||
7437 | def SafeYield(*args, **kwargs): | |
7438 | """ | |
7439 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool | |
7440 | ||
c24da6d6 RD |
7441 | This function is similar to `wx.Yield`, except that it disables the |
7442 | user input to all program windows before calling `wx.Yield` and | |
7443 | re-enables it again afterwards. If ``win`` is not None, this window | |
7444 | will remain enabled, allowing the implementation of some limited user | |
7445 | interaction. | |
d55e5bfc | 7446 | |
c24da6d6 | 7447 | :Returns: the result of the call to `wx.Yield`. |
d55e5bfc RD |
7448 | """ |
7449 | return _core_.SafeYield(*args, **kwargs) | |
7450 | ||
7451 | def WakeUpIdle(*args, **kwargs): | |
7452 | """ | |
7453 | WakeUpIdle() | |
7454 | ||
c24da6d6 RD |
7455 | Cause the message queue to become empty again, so idle events will be |
7456 | sent. | |
d55e5bfc RD |
7457 | """ |
7458 | return _core_.WakeUpIdle(*args, **kwargs) | |
7459 | ||
7460 | def PostEvent(*args, **kwargs): | |
7461 | """ | |
7462 | PostEvent(EvtHandler dest, Event event) | |
7463 | ||
c24da6d6 RD |
7464 | Send an event to a window or other wx.EvtHandler to be processed |
7465 | later. | |
d55e5bfc RD |
7466 | """ |
7467 | return _core_.PostEvent(*args, **kwargs) | |
7468 | ||
7469 | def App_CleanUp(*args, **kwargs): | |
7470 | """ | |
7471 | App_CleanUp() | |
7472 | ||
79fccf9d | 7473 | For internal use only, it is used to cleanup after wxWidgets when |
c24da6d6 | 7474 | Python shuts down. |
d55e5bfc RD |
7475 | """ |
7476 | return _core_.App_CleanUp(*args, **kwargs) | |
7477 | ||
7478 | def GetApp(*args, **kwargs): | |
7479 | """ | |
7480 | GetApp() -> PyApp | |
7481 | ||
7482 | Return a reference to the current wx.App object. | |
7483 | """ | |
7484 | return _core_.GetApp(*args, **kwargs) | |
5cbf236d RD |
7485 | |
7486 | def SetDefaultPyEncoding(*args, **kwargs): | |
7487 | """ | |
7488 | SetDefaultPyEncoding(string encoding) | |
7489 | ||
7490 | Sets the encoding that wxPython will use when it needs to convert a | |
7491 | Python string or unicode object to or from a wxString. | |
62d32a5f RD |
7492 | |
7493 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7494 | but please be aware that the default encoding within the same locale | |
7495 | may be slightly different on different platforms. For example, please | |
7496 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7497 | between the common latin/roman encodings. | |
5cbf236d RD |
7498 | """ |
7499 | return _core_.SetDefaultPyEncoding(*args, **kwargs) | |
7500 | ||
7501 | def GetDefaultPyEncoding(*args, **kwargs): | |
7502 | """ | |
7503 | GetDefaultPyEncoding() -> string | |
7504 | ||
7505 | Gets the current encoding that wxPython will use when it needs to | |
7506 | convert a Python string or unicode object to or from a wxString. | |
7507 | """ | |
7508 | return _core_.GetDefaultPyEncoding(*args, **kwargs) | |
d55e5bfc RD |
7509 | #---------------------------------------------------------------------- |
7510 | ||
7511 | class PyOnDemandOutputWindow: | |
7512 | """ | |
7513 | A class that can be used for redirecting Python's stdout and | |
7514 | stderr streams. It will do nothing until something is wrriten to | |
7515 | the stream at which point it will create a Frame with a text area | |
7516 | and write the text there. | |
7517 | """ | |
7518 | def __init__(self, title = "wxPython: stdout/stderr"): | |
7519 | self.frame = None | |
7520 | self.title = title | |
412d302d RD |
7521 | self.pos = wx.DefaultPosition |
7522 | self.size = (450, 300) | |
d55e5bfc RD |
7523 | self.parent = None |
7524 | ||
7525 | def SetParent(self, parent): | |
7526 | """Set the window to be used as the popup Frame's parent.""" | |
7527 | self.parent = parent | |
7528 | ||
7529 | ||
7530 | def CreateOutputWindow(self, st): | |
412d302d RD |
7531 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7532 | style=wx.DEFAULT_FRAME_STYLE) | |
d55e5bfc | 7533 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7534 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d55e5bfc | 7535 | self.text.AppendText(st) |
d55e5bfc RD |
7536 | self.frame.Show(True) |
7537 | EVT_CLOSE(self.frame, self.OnCloseWindow) | |
7538 | ||
7539 | ||
7540 | def OnCloseWindow(self, event): | |
7541 | if self.frame is not None: | |
7542 | self.frame.Destroy() | |
7543 | self.frame = None | |
7544 | self.text = None | |
7545 | ||
7546 | ||
7547 | # These methods provide the file-like output behaviour. | |
7548 | def write(self, text): | |
7549 | """ | |
7550 | Create the output window if needed and write the string to it. | |
7551 | If not called in the context of the gui thread then uses | |
7552 | CallAfter to do the work there. | |
7553 | """ | |
7554 | if self.frame is None: | |
7555 | if not wx.Thread_IsMain(): | |
7556 | wx.CallAfter(self.CreateOutputWindow, text) | |
7557 | else: | |
7558 | self.CreateOutputWindow(text) | |
7559 | else: | |
7560 | if not wx.Thread_IsMain(): | |
7561 | wx.CallAfter(self.text.AppendText, text) | |
7562 | else: | |
7563 | self.text.AppendText(text) | |
7564 | ||
7565 | ||
7566 | def close(self): | |
7567 | if self.frame is not None: | |
7568 | wx.CallAfter(self.frame.Close) | |
7569 | ||
7570 | ||
19272049 RD |
7571 | def flush(self): |
7572 | pass | |
7573 | ||
7574 | ||
d55e5bfc RD |
7575 | |
7576 | #---------------------------------------------------------------------- | |
7577 | ||
7578 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
7579 | ||
7580 | class App(wx.PyApp): | |
7581 | """ | |
c24da6d6 RD |
7582 | The ``wx.App`` class represents the application and is used to: |
7583 | ||
7584 | * bootstrap the wxPython system and initialize the underlying | |
7585 | gui toolkit | |
7586 | * set and get application-wide properties | |
7587 | * implement the windowing system main message or event loop, | |
7588 | and to dispatch events to window instances | |
7589 | * etc. | |
7590 | ||
7591 | Every application must have a ``wx.App`` instance, and all | |
7592 | creation of UI objects should be delayed until after the | |
7593 | ``wx.App`` object has been created in order to ensure that the gui | |
7594 | platform and wxWidgets have been fully initialized. | |
7595 | ||
7596 | Normally you would derive from this class and implement an | |
7597 | ``OnInit`` method that creates a frame and then calls | |
7598 | ``self.SetTopWindow(frame)``. | |
7599 | ||
7600 | :see: `wx.PySimpleApp` for a simpler app class that can be used | |
79fccf9d | 7601 | directly. |
d55e5bfc | 7602 | """ |
c24da6d6 | 7603 | |
d55e5bfc RD |
7604 | outputWindowClass = PyOnDemandOutputWindow |
7605 | ||
c24da6d6 RD |
7606 | def __init__(self, redirect=_defRedirect, filename=None, |
7607 | useBestVisual=False, clearSigInt=True): | |
7608 | """ | |
7609 | Construct a ``wx.App`` object. | |
7610 | ||
7611 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be | |
7612 | redirected? Defaults to True on Windows and Mac, False | |
7613 | otherwise. If `filename` is None then output will be | |
7614 | redirected to a window that pops up as needed. (You can | |
7615 | control what kind of window is created for the output by | |
7616 | resetting the class variable ``outputWindowClass`` to a | |
7617 | class of your choosing.) | |
7618 | ||
7619 | :param filename: The name of a file to redirect output to, if | |
7620 | redirect is True. | |
7621 | ||
7622 | :param useBestVisual: Should the app try to use the best | |
7623 | available visual provided by the system (only relevant on | |
7624 | systems that have more than one visual.) This parameter | |
7625 | must be used instead of calling `SetUseBestVisual` later | |
7626 | on because it must be set before the underlying GUI | |
7627 | toolkit is initialized. | |
7628 | ||
7629 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7630 | app to terminate upon a Ctrl-C in the console like other | |
7631 | GUI apps will. | |
7632 | ||
7633 | :note: You should override OnInit to do applicaition | |
7634 | initialization to ensure that the system, toolkit and | |
7635 | wxWidgets are fully initialized. | |
7636 | """ | |
d55e5bfc RD |
7637 | wx.PyApp.__init__(self) |
7638 | ||
7639 | if wx.Platform == "__WXMAC__": | |
7640 | try: | |
7641 | import MacOS | |
7642 | if not MacOS.WMAvailable(): | |
7643 | print """\ | |
7644 | This program needs access to the screen. Please run with 'pythonw', | |
7645 | not 'python', and only when you are logged in on the main display of | |
7646 | your Mac.""" | |
7647 | _sys.exit(1) | |
b1f29bf7 RD |
7648 | except SystemExit: |
7649 | raise | |
d55e5bfc RD |
7650 | except: |
7651 | pass | |
7652 | ||
7653 | # This has to be done before OnInit | |
7654 | self.SetUseBestVisual(useBestVisual) | |
7655 | ||
7656 | # Set the default handler for SIGINT. This fixes a problem | |
7657 | # where if Ctrl-C is pressed in the console that started this | |
7658 | # app then it will not appear to do anything, (not even send | |
7659 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7660 | # setting the default handler then the app will exit, as | |
7661 | # expected (depending on platform.) | |
c24da6d6 RD |
7662 | if clearSigInt: |
7663 | try: | |
7664 | import signal | |
7665 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7666 | except: | |
7667 | pass | |
d55e5bfc RD |
7668 | |
7669 | # Save and redirect the stdio to a window? | |
7670 | self.stdioWin = None | |
7671 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7672 | if redirect: | |
7673 | self.RedirectStdio(filename) | |
7674 | ||
8fb0e70a RD |
7675 | # Use Python's install prefix as the default |
7676 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7677 | ||
d55e5bfc RD |
7678 | # This finishes the initialization of wxWindows and then calls |
7679 | # the OnInit that should be present in the derived class | |
7680 | self._BootstrapApp() | |
7681 | ||
7682 | ||
66af7a75 RD |
7683 | def __del__(self, destroy=wx.PyApp.__del__): |
7684 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7685 | destroy(self) | |
d55e5bfc | 7686 | |
70b7a5fe RD |
7687 | def Destroy(self): |
7688 | wx.PyApp.Destroy(self) | |
7689 | self.thisown = 0 | |
d55e5bfc RD |
7690 | |
7691 | def SetTopWindow(self, frame): | |
7692 | """Set the \"main\" top level window""" | |
7693 | if self.stdioWin: | |
7694 | self.stdioWin.SetParent(frame) | |
7695 | wx.PyApp.SetTopWindow(self, frame) | |
7696 | ||
7697 | ||
7698 | def MainLoop(self): | |
7699 | """Execute the main GUI event loop""" | |
7700 | wx.PyApp.MainLoop(self) | |
7701 | self.RestoreStdio() | |
7702 | ||
7703 | ||
7704 | def RedirectStdio(self, filename=None): | |
7705 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" | |
7706 | if filename: | |
7707 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7708 | else: | |
7709 | self.stdioWin = self.outputWindowClass() | |
7710 | _sys.stdout = _sys.stderr = self.stdioWin | |
7711 | ||
7712 | ||
7713 | def RestoreStdio(self): | |
66af7a75 RD |
7714 | try: |
7715 | _sys.stdout, _sys.stderr = self.saveStdio | |
7716 | except: | |
7717 | pass | |
d55e5bfc RD |
7718 | |
7719 | ||
412d302d RD |
7720 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7721 | """ | |
7722 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7723 | the stdio has been redirected. This should be called before |
7724 | any output would cause the output window to be created. | |
412d302d RD |
7725 | """ |
7726 | if self.stdioWin: | |
7727 | if title is not None: | |
7728 | self.stdioWin.title = title | |
7729 | if pos is not None: | |
7730 | self.stdioWin.pos = pos | |
7731 | if size is not None: | |
7732 | self.stdioWin.size = size | |
7733 | ||
7734 | ||
7735 | ||
d55e5bfc | 7736 | |
c24da6d6 | 7737 | # change from wx.PyApp_XX to wx.App_XX |
d55e5bfc RD |
7738 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7739 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7740 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7741 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7742 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7743 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7744 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7745 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7746 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7747 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7748 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
7749 | ||
7750 | #---------------------------------------------------------------------------- | |
7751 | ||
7752 | class PySimpleApp(wx.App): | |
7753 | """ | |
7754 | A simple application class. You can just create one of these and | |
7755 | then then make your top level windows later, and not have to worry | |
c24da6d6 | 7756 | about OnInit. For example:: |
d55e5bfc | 7757 | |
c24da6d6 RD |
7758 | app = wx.PySimpleApp() |
7759 | frame = wx.Frame(None, title='Hello World') | |
7760 | frame.Show() | |
7761 | app.MainLoop() | |
7762 | ||
7763 | :see: `wx.App` | |
7764 | """ | |
7765 | ||
7766 | def __init__(self, redirect=False, filename=None, | |
7767 | useBestVisual=False, clearSigInt=True): | |
7768 | """ | |
7769 | :see: `wx.App.__init__` | |
7770 | """ | |
7771 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) | |
d55e5bfc RD |
7772 | |
7773 | def OnInit(self): | |
d55e5bfc RD |
7774 | return True |
7775 | ||
7776 | ||
c24da6d6 | 7777 | |
d55e5bfc RD |
7778 | # Is anybody using this one? |
7779 | class PyWidgetTester(wx.App): | |
7780 | def __init__(self, size = (250, 100)): | |
7781 | self.size = size | |
7782 | wx.App.__init__(self, 0) | |
7783 | ||
7784 | def OnInit(self): | |
7785 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) | |
7786 | self.SetTopWindow(self.frame) | |
7787 | return True | |
7788 | ||
c24da6d6 RD |
7789 | def SetWidget(self, widgetClass, *args, **kwargs): |
7790 | w = widgetClass(self.frame, *args, **kwargs) | |
d55e5bfc RD |
7791 | self.frame.Show(True) |
7792 | ||
7793 | #---------------------------------------------------------------------------- | |
7794 | # DO NOT hold any other references to this object. This is how we | |
c24da6d6 | 7795 | # know when to cleanup system resources that wxWidgets is holding. When |
d55e5bfc | 7796 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
c24da6d6 | 7797 | # goes to zero and it calls the wx.App_CleanUp function. |
d55e5bfc RD |
7798 | |
7799 | class __wxPyCleanup: | |
7800 | def __init__(self): | |
7801 | self.cleanup = _core_.App_CleanUp | |
7802 | def __del__(self): | |
7803 | self.cleanup() | |
7804 | ||
7805 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7806 | ||
7807 | ## # another possible solution, but it gets called too early... | |
c24da6d6 RD |
7808 | ## import atexit |
7809 | ## atexit.register(_core_.wxApp_CleanUp) | |
d55e5bfc RD |
7810 | |
7811 | ||
7812 | #---------------------------------------------------------------------------- | |
7813 | ||
7814 | #--------------------------------------------------------------------------- | |
7815 | ||
ae8162c8 | 7816 | class EventLoop(object): |
093d3ff1 | 7817 | """Proxy of C++ EventLoop class""" |
ae8162c8 RD |
7818 | def __repr__(self): |
7819 | return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7820 | def __init__(self, *args, **kwargs): | |
7821 | """__init__(self) -> EventLoop""" | |
7822 | newobj = _core_.new_EventLoop(*args, **kwargs) | |
7823 | self.this = newobj.this | |
7824 | self.thisown = 1 | |
7825 | del newobj.thisown | |
7826 | def __del__(self, destroy=_core_.delete_EventLoop): | |
7827 | """__del__(self)""" | |
7828 | try: | |
7829 | if self.thisown: destroy(self) | |
7830 | except: pass | |
7831 | ||
7832 | def Run(*args, **kwargs): | |
7833 | """Run(self) -> int""" | |
7834 | return _core_.EventLoop_Run(*args, **kwargs) | |
7835 | ||
7836 | def Exit(*args, **kwargs): | |
7837 | """Exit(self, int rc=0)""" | |
7838 | return _core_.EventLoop_Exit(*args, **kwargs) | |
7839 | ||
7840 | def Pending(*args, **kwargs): | |
7841 | """Pending(self) -> bool""" | |
7842 | return _core_.EventLoop_Pending(*args, **kwargs) | |
7843 | ||
7844 | def Dispatch(*args, **kwargs): | |
7845 | """Dispatch(self) -> bool""" | |
7846 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
7847 | ||
7848 | def IsRunning(*args, **kwargs): | |
7849 | """IsRunning(self) -> bool""" | |
7850 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
7851 | ||
7852 | def GetActive(*args, **kwargs): | |
7853 | """GetActive() -> EventLoop""" | |
7854 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7855 | ||
7856 | GetActive = staticmethod(GetActive) | |
7857 | def SetActive(*args, **kwargs): | |
7858 | """SetActive(EventLoop loop)""" | |
7859 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7860 | ||
7861 | SetActive = staticmethod(SetActive) | |
7862 | ||
7863 | class EventLoopPtr(EventLoop): | |
7864 | def __init__(self, this): | |
7865 | self.this = this | |
7866 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7867 | self.__class__ = EventLoop | |
7868 | _core_.EventLoop_swigregister(EventLoopPtr) | |
7869 | ||
7870 | def EventLoop_GetActive(*args, **kwargs): | |
7871 | """EventLoop_GetActive() -> EventLoop""" | |
7872 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7873 | ||
7874 | def EventLoop_SetActive(*args, **kwargs): | |
7875 | """EventLoop_SetActive(EventLoop loop)""" | |
7876 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7877 | ||
7449af73 RD |
7878 | class EventLoopActivator(object): |
7879 | """Proxy of C++ EventLoopActivator class""" | |
7880 | def __repr__(self): | |
7881 | return "<%s.%s; proxy of C++ wxEventLoopActivator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7882 | def __init__(self, *args, **kwargs): | |
7883 | """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" | |
7884 | newobj = _core_.new_EventLoopActivator(*args, **kwargs) | |
7885 | self.this = newobj.this | |
7886 | self.thisown = 1 | |
7887 | del newobj.thisown | |
7888 | def __del__(self, destroy=_core_.delete_EventLoopActivator): | |
7889 | """__del__(self)""" | |
7890 | try: | |
7891 | if self.thisown: destroy(self) | |
7892 | except: pass | |
7893 | ||
7894 | ||
7895 | class EventLoopActivatorPtr(EventLoopActivator): | |
7896 | def __init__(self, this): | |
7897 | self.this = this | |
7898 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7899 | self.__class__ = EventLoopActivator | |
7900 | _core_.EventLoopActivator_swigregister(EventLoopActivatorPtr) | |
7901 | ||
ae8162c8 RD |
7902 | #--------------------------------------------------------------------------- |
7903 | ||
d55e5bfc | 7904 | class AcceleratorEntry(object): |
c24da6d6 RD |
7905 | """ |
7906 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7907 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7908 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
79fccf9d | 7909 | as well. See `__init__` for of the tuple values. |
c24da6d6 RD |
7910 | |
7911 | :see: `wx.AcceleratorTable` | |
7912 | """ | |
d55e5bfc RD |
7913 | def __repr__(self): |
7914 | return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7915 | def __init__(self, *args, **kwargs): | |
c24da6d6 RD |
7916 | """ |
7917 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
7918 | ||
7919 | Construct a wx.AcceleratorEntry. | |
c24da6d6 | 7920 | """ |
d55e5bfc RD |
7921 | newobj = _core_.new_AcceleratorEntry(*args, **kwargs) |
7922 | self.this = newobj.this | |
7923 | self.thisown = 1 | |
7924 | del newobj.thisown | |
7925 | def __del__(self, destroy=_core_.delete_AcceleratorEntry): | |
7926 | """__del__(self)""" | |
7927 | try: | |
7928 | if self.thisown: destroy(self) | |
7929 | except: pass | |
7930 | ||
7931 | def Set(*args, **kwargs): | |
c24da6d6 RD |
7932 | """ |
7933 | Set(self, int flags, int keyCode, int cmd) | |
d55e5bfc | 7934 | |
c24da6d6 RD |
7935 | (Re)set the attributes of a wx.AcceleratorEntry. |
7936 | :see `__init__` | |
7937 | """ | |
7938 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
d55e5bfc RD |
7939 | |
7940 | def GetFlags(*args, **kwargs): | |
c24da6d6 RD |
7941 | """ |
7942 | GetFlags(self) -> int | |
7943 | ||
7944 | Get the AcceleratorEntry's flags. | |
7945 | """ | |
d55e5bfc RD |
7946 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
7947 | ||
7948 | def GetKeyCode(*args, **kwargs): | |
c24da6d6 RD |
7949 | """ |
7950 | GetKeyCode(self) -> int | |
7951 | ||
7952 | Get the AcceleratorEntry's keycode. | |
7953 | """ | |
d55e5bfc RD |
7954 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
7955 | ||
7956 | def GetCommand(*args, **kwargs): | |
c24da6d6 RD |
7957 | """ |
7958 | GetCommand(self) -> int | |
7959 | ||
7960 | Get the AcceleratorEntry's command ID. | |
7961 | """ | |
d55e5bfc RD |
7962 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
7963 | ||
7964 | ||
7965 | class AcceleratorEntryPtr(AcceleratorEntry): | |
7966 | def __init__(self, this): | |
7967 | self.this = this | |
7968 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7969 | self.__class__ = AcceleratorEntry | |
7970 | _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr) | |
7971 | ||
7972 | class AcceleratorTable(Object): | |
c24da6d6 RD |
7973 | """ |
7974 | An accelerator table allows the application to specify a table of | |
7975 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7976 | button commands are supported; on GTK, only menu commands are | |
7977 | supported. | |
c24da6d6 | 7978 | """ |
d55e5bfc RD |
7979 | def __repr__(self): |
7980 | return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7981 | def __init__(self, *args, **kwargs): | |
7982 | """ | |
7983 | __init__(entries) -> AcceleratorTable | |
7984 | ||
c24da6d6 RD |
7985 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7986 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7987 | ||
7988 | :see: `wx.AcceleratorEntry` | |
d55e5bfc RD |
7989 | """ |
7990 | newobj = _core_.new_AcceleratorTable(*args, **kwargs) | |
7991 | self.this = newobj.this | |
7992 | self.thisown = 1 | |
7993 | del newobj.thisown | |
7994 | def __del__(self, destroy=_core_.delete_AcceleratorTable): | |
7995 | """__del__(self)""" | |
7996 | try: | |
7997 | if self.thisown: destroy(self) | |
7998 | except: pass | |
7999 | ||
8000 | def Ok(*args, **kwargs): | |
8001 | """Ok(self) -> bool""" | |
8002 | return _core_.AcceleratorTable_Ok(*args, **kwargs) | |
8003 | ||
8004 | ||
8005 | class AcceleratorTablePtr(AcceleratorTable): | |
8006 | def __init__(self, this): | |
8007 | self.this = this | |
8008 | if not hasattr(self,"thisown"): self.thisown = 0 | |
8009 | self.__class__ = AcceleratorTable | |
8010 | _core_.AcceleratorTable_swigregister(AcceleratorTablePtr) | |
8011 | ||
8012 | ||
8013 | def GetAccelFromString(*args, **kwargs): | |
8014 | """GetAccelFromString(String label) -> AcceleratorEntry""" | |
8015 | return _core_.GetAccelFromString(*args, **kwargs) | |
8016 | #--------------------------------------------------------------------------- | |
8017 | ||
8018 | class VisualAttributes(object): | |
8019 | """struct containing all the visual attributes of a control""" | |
8020 | def __repr__(self): | |
8021 | return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
8022 | def __init__(self, *args, **kwargs): | |
8023 | """ | |
8024 | __init__(self) -> VisualAttributes | |
8025 | ||
8026 | struct containing all the visual attributes of a control | |
8027 | """ | |
8028 | newobj = _core_.new_VisualAttributes(*args, **kwargs) | |
8029 | self.this = newobj.this | |
8030 | self.thisown = 1 | |
8031 | del newobj.thisown | |
8032 | def __del__(self, destroy=_core_.delete_VisualAttributes): | |
8033 | """__del__(self)""" | |
8034 | try: | |
8035 | if self.thisown: destroy(self) | |
8036 | except: pass | |
8037 | ||
8038 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) | |
8039 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
8040 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
8041 | ||
8042 | class VisualAttributesPtr(VisualAttributes): | |
8043 | def __init__(self, this): | |
8044 | self.this = this | |
8045 | if not hasattr(self,"thisown"): self.thisown = 0 | |
8046 | self.__class__ = VisualAttributes | |
8047 | _core_.VisualAttributes_swigregister(VisualAttributesPtr) | |
8048 | NullAcceleratorTable = cvar.NullAcceleratorTable | |
8049 | PanelNameStr = cvar.PanelNameStr | |
8050 | ||
8051 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL | |
8052 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
8053 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
8054 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
8055 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
8056 | class Window(EvtHandler): | |
8057 | """ | |
8058 | wx.Window is the base class for all windows and represents any visible | |
8059 | object on the screen. All controls, top level windows and so on are | |
8060 | wx.Windows. Sizers and device contexts are not however, as they don't | |
8061 | appear on screen themselves. | |
8062 | ||
8063 | """ | |
8064 | def __repr__(self): | |
8065 | return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
8066 | def __init__(self, *args, **kwargs): | |
8067 | """ | |
8068 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, | |
8069 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window | |
8070 | ||
8071 | Construct and show a generic Window. | |
8072 | """ | |
8073 | newobj = _core_.new_Window(*args, **kwargs) | |
8074 | self.this = newobj.this | |
8075 | self.thisown = 1 | |
8076 | del newobj.thisown | |
8077 | self._setOORInfo(self) | |
8078 | ||
8079 | def Create(*args, **kwargs): | |
8080 | """ | |
8081 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, | |
8082 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool | |
8083 | ||
8084 | Create the GUI part of the Window for 2-phase creation mode. | |
8085 | """ | |
8086 | return _core_.Window_Create(*args, **kwargs) | |
8087 | ||
8088 | def Close(*args, **kwargs): | |
8089 | """ | |
8090 | Close(self, bool force=False) -> bool | |
8091 | ||
8092 | This function simply generates a EVT_CLOSE event whose handler usually | |
8093 | tries to close the window. It doesn't close the window itself, | |
8094 | however. If force is False (the default) then the window's close | |
8095 | handler will be allowed to veto the destruction of the window. | |
d55e5bfc RD |
8096 | """ |
8097 | return _core_.Window_Close(*args, **kwargs) | |
8098 | ||
8099 | def Destroy(*args, **kwargs): | |
8100 | """ | |
8101 | Destroy(self) -> bool | |
8102 | ||
8103 | Destroys the window safely. Frames and dialogs are not destroyed | |
8104 | immediately when this function is called -- they are added to a list | |
8105 | of windows to be deleted on idle time, when all the window's events | |
8106 | have been processed. This prevents problems with events being sent to | |
8107 | non-existent windows. | |
8108 | ||
8109 | Returns True if the window has either been successfully deleted, or it | |
8110 | has been added to the list of windows pending real deletion. | |
8111 | """ | |
8112 | return _core_.Window_Destroy(*args, **kwargs) | |
8113 | ||
8114 | def DestroyChildren(*args, **kwargs): | |
8115 | """ | |
8116 | DestroyChildren(self) -> bool | |
8117 | ||
79fccf9d RD |
8118 | Destroys all children of a window. Called automatically by the |
8119 | destructor. | |
d55e5bfc RD |
8120 | """ |
8121 | return _core_.Window_DestroyChildren(*args, **kwargs) | |
8122 | ||
8123 | def IsBeingDeleted(*args, **kwargs): | |
8124 | """ | |
8125 | IsBeingDeleted(self) -> bool | |
8126 | ||
8127 | Is the window in the process of being deleted? | |
8128 | """ | |
8129 | return _core_.Window_IsBeingDeleted(*args, **kwargs) | |
8130 | ||
d55e5bfc RD |
8131 | def SetLabel(*args, **kwargs): |
8132 | """ | |
8133 | SetLabel(self, String label) | |
8134 | ||
8135 | Set the text which the window shows in its label if applicable. | |
8136 | """ | |
8137 | return _core_.Window_SetLabel(*args, **kwargs) | |
8138 | ||
8139 | def GetLabel(*args, **kwargs): | |
8140 | """ | |
8141 | GetLabel(self) -> String | |
8142 | ||
79fccf9d RD |
8143 | Generic way of getting a label from any window, for identification |
8144 | purposes. The interpretation of this function differs from class to | |
8145 | class. For frames and dialogs, the value returned is the title. For | |
8146 | buttons or static text controls, it is the button text. This function | |
8147 | can be useful for meta-programs such as testing tools or special-needs | |
8148 | access programs)which need to identify windows by name. | |
d55e5bfc RD |
8149 | """ |
8150 | return _core_.Window_GetLabel(*args, **kwargs) | |
8151 | ||
8152 | def SetName(*args, **kwargs): | |
8153 | """ | |
8154 | SetName(self, String name) | |
8155 | ||
79fccf9d RD |
8156 | Sets the window's name. The window name is used for ressource setting |
8157 | in X, it is not the same as the window title/label | |
d55e5bfc RD |
8158 | """ |
8159 | return _core_.Window_SetName(*args, **kwargs) | |
8160 | ||
8161 | def GetName(*args, **kwargs): | |
8162 | """ | |
8163 | GetName(self) -> String | |
8164 | ||
79fccf9d RD |
8165 | Returns the windows name. This name is not guaranteed to be unique; |
8166 | it is up to the programmer to supply an appropriate name in the window | |
8167 | constructor or via wx.Window.SetName. | |
d55e5bfc RD |
8168 | """ |
8169 | return _core_.Window_GetName(*args, **kwargs) | |
8170 | ||
8171 | def SetWindowVariant(*args, **kwargs): | |
8172 | """ | |
8173 | SetWindowVariant(self, int variant) | |
8174 | ||
79fccf9d RD |
8175 | Sets the variant of the window/font size to use for this window, if |
8176 | the platform supports variants, for example, wxMac. | |
d55e5bfc RD |
8177 | """ |
8178 | return _core_.Window_SetWindowVariant(*args, **kwargs) | |
8179 | ||
8180 | def GetWindowVariant(*args, **kwargs): | |
8181 | """GetWindowVariant(self) -> int""" | |
8182 | return _core_.Window_GetWindowVariant(*args, **kwargs) | |
8183 | ||
8184 | def SetId(*args, **kwargs): | |
8185 | """ | |
8186 | SetId(self, int winid) | |
8187 | ||
8188 | Sets the identifier of the window. Each window has an integer | |
8189 | identifier. If the application has not provided one, an identifier | |
8190 | will be generated. Normally, the identifier should be provided on | |
8191 | creation and should not be modified subsequently. | |
8192 | """ | |
8193 | return _core_.Window_SetId(*args, **kwargs) | |
8194 | ||
8195 | def GetId(*args, **kwargs): | |
8196 | """ | |
8197 | GetId(self) -> int | |
8198 | ||
8199 | Returns the identifier of the window. Each window has an integer | |
8200 | identifier. If the application has not provided one (or the default Id | |
8201 | -1 is used) then an unique identifier with a negative value will be | |
8202 | generated. | |
8203 | """ | |
8204 | return _core_.Window_GetId(*args, **kwargs) | |
8205 | ||
8206 | def NewControlId(*args, **kwargs): | |
8207 | """ | |
c24da6d6 | 8208 | NewControlId() -> int |
d55e5bfc RD |
8209 | |
8210 | Generate a control id for the controls which were not given one. | |
8211 | """ | |
8212 | return _core_.Window_NewControlId(*args, **kwargs) | |
8213 | ||
8214 | NewControlId = staticmethod(NewControlId) | |
8215 | def NextControlId(*args, **kwargs): | |
8216 | """ | |
c24da6d6 | 8217 | NextControlId(int winid) -> int |
d55e5bfc RD |
8218 | |
8219 | Get the id of the control following the one with the given | |
79fccf9d | 8220 | autogenerated) id |
d55e5bfc RD |
8221 | """ |
8222 | return _core_.Window_NextControlId(*args, **kwargs) | |
8223 | ||
8224 | NextControlId = staticmethod(NextControlId) | |
8225 | def PrevControlId(*args, **kwargs): | |
8226 | """ | |
c24da6d6 | 8227 | PrevControlId(int winid) -> int |
d55e5bfc RD |
8228 | |
8229 | Get the id of the control preceding the one with the given | |
79fccf9d | 8230 | autogenerated) id |
d55e5bfc RD |
8231 | """ |
8232 | return _core_.Window_PrevControlId(*args, **kwargs) | |
8233 | ||
8234 | PrevControlId = staticmethod(PrevControlId) | |
8235 | def SetSize(*args, **kwargs): | |
8236 | """ | |
8237 | SetSize(self, Size size) | |
8238 | ||
8239 | Sets the size of the window in pixels. | |
8240 | """ | |
8241 | return _core_.Window_SetSize(*args, **kwargs) | |
8242 | ||
8243 | def SetDimensions(*args, **kwargs): | |
8244 | """ | |
8245 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) | |
8246 | ||
8247 | Sets the position and size of the window in pixels. The sizeFlags | |
8248 | parameter indicates the interpretation of the other params if they are | |
62d32a5f RD |
8249 | equal to -1. |
8250 | ||
8251 | ======================== ====================================== | |
8252 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
8253 | default should be used. | |
8254 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
8255 | -1 values are supplied. | |
8256 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
8257 | interpreted as real dimensions, not | |
8258 | default values. | |
8259 | ======================== ====================================== | |
8260 | ||
d55e5bfc RD |
8261 | """ |
8262 | return _core_.Window_SetDimensions(*args, **kwargs) | |
8263 | ||
8264 | def SetRect(*args, **kwargs): | |
8265 | """ | |
8266 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) | |
8267 | ||
8268 | Sets the position and size of the window in pixels using a wx.Rect. | |
8269 | """ | |
8270 | return _core_.Window_SetRect(*args, **kwargs) | |
8271 | ||
8272 | def SetSizeWH(*args, **kwargs): | |
8273 | """ | |
8274 | SetSizeWH(self, int width, int height) | |
8275 | ||
8276 | Sets the size of the window in pixels. | |
8277 | """ | |
8278 | return _core_.Window_SetSizeWH(*args, **kwargs) | |
8279 | ||
8280 | def Move(*args, **kwargs): | |
8281 | """ | |
8282 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) | |
8283 | ||
8284 | Moves the window to the given position. | |
8285 | """ | |
8286 | return _core_.Window_Move(*args, **kwargs) | |
8287 | ||
8288 | SetPosition = Move | |
8289 | def MoveXY(*args, **kwargs): | |
8290 | """ | |
8291 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) | |
8292 | ||
8293 | Moves the window to the given position. | |
8294 | """ | |
8295 | return _core_.Window_MoveXY(*args, **kwargs) | |
8296 | ||
f8167d6e RD |
8297 | def SetBestFittingSize(*args, **kwargs): |
8298 | """ | |
8299 | SetBestFittingSize(self, Size size=DefaultSize) | |
8300 | ||
8301 | A 'Smart' SetSize that will fill in default size components with the | |
8302 | window's *best size* values. Also set's the minsize for use with sizers. | |
8303 | """ | |
8304 | return _core_.Window_SetBestFittingSize(*args, **kwargs) | |
8305 | ||
d55e5bfc RD |
8306 | def Raise(*args, **kwargs): |
8307 | """ | |
8308 | Raise(self) | |
8309 | ||
9d7dfdff RD |
8310 | Raises the window to the top of the window hierarchy. In current |
8311 | version of wxWidgets this works both for manage and child windows. | |
d55e5bfc RD |
8312 | """ |
8313 | return _core_.Window_Raise(*args, **kwargs) | |
8314 | ||
8315 | def Lower(*args, **kwargs): | |
8316 | """ | |
8317 | Lower(self) | |
8318 | ||
9d7dfdff RD |
8319 | Lowers the window to the bottom of the window hierarchy. In current |
8320 | version of wxWidgets this works both for manage and child windows. | |
d55e5bfc RD |
8321 | """ |
8322 | return _core_.Window_Lower(*args, **kwargs) | |
8323 | ||
8324 | def SetClientSize(*args, **kwargs): | |
8325 | """ | |
8326 | SetClientSize(self, Size size) | |
8327 | ||
8328 | This sets the size of the window client area in pixels. Using this | |
8329 | function to size a window tends to be more device-independent than | |
8330 | wx.Window.SetSize, since the application need not worry about what | |
8331 | dimensions the border or title bar have when trying to fit the window | |
8332 | around panel items, for example. | |
8333 | """ | |
8334 | return _core_.Window_SetClientSize(*args, **kwargs) | |
8335 | ||
8336 | def SetClientSizeWH(*args, **kwargs): | |
8337 | """ | |
8338 | SetClientSizeWH(self, int width, int height) | |
8339 | ||
8340 | This sets the size of the window client area in pixels. Using this | |
8341 | function to size a window tends to be more device-independent than | |
8342 | wx.Window.SetSize, since the application need not worry about what | |
8343 | dimensions the border or title bar have when trying to fit the window | |
8344 | around panel items, for example. | |
8345 | """ | |
8346 | return _core_.Window_SetClientSizeWH(*args, **kwargs) | |
8347 | ||
8348 | def SetClientRect(*args, **kwargs): | |
8349 | """ | |
8350 | SetClientRect(self, Rect rect) | |
8351 | ||
8352 | This sets the size of the window client area in pixels. Using this | |
8353 | function to size a window tends to be more device-independent than | |
8354 | wx.Window.SetSize, since the application need not worry about what | |
8355 | dimensions the border or title bar have when trying to fit the window | |
8356 | around panel items, for example. | |
8357 | """ | |
8358 | return _core_.Window_SetClientRect(*args, **kwargs) | |
8359 | ||
8360 | def GetPosition(*args, **kwargs): | |
8361 | """ | |
8362 | GetPosition(self) -> Point | |
8363 | ||
8364 | Get the window's position. | |
8365 | """ | |
8366 | return _core_.Window_GetPosition(*args, **kwargs) | |
8367 | ||
8368 | def GetPositionTuple(*args, **kwargs): | |
8369 | """ | |
8370 | GetPositionTuple() -> (x,y) | |
8371 | ||
8372 | Get the window's position. | |
8373 | """ | |
8374 | return _core_.Window_GetPositionTuple(*args, **kwargs) | |
8375 | ||
8376 | def GetSize(*args, **kwargs): | |
8377 | """ | |
8378 | GetSize(self) -> Size | |
8379 | ||
8380 | Get the window size. | |
8381 | """ | |
8382 | return _core_.Window_GetSize(*args, **kwargs) | |
8383 | ||
8384 | def GetSizeTuple(*args, **kwargs): | |
8385 | """ | |
8386 | GetSizeTuple() -> (width, height) | |
8387 | ||
8388 | Get the window size. | |
8389 | """ | |
8390 | return _core_.Window_GetSizeTuple(*args, **kwargs) | |
8391 | ||
8392 | def GetRect(*args, **kwargs): | |
8393 | """ | |
8394 | GetRect(self) -> Rect | |
8395 | ||
8396 | Returns the size and position of the window as a wx.Rect object. | |
8397 | """ | |
8398 | return _core_.Window_GetRect(*args, **kwargs) | |
8399 | ||
8400 | def GetClientSize(*args, **kwargs): | |
8401 | """ | |
8402 | GetClientSize(self) -> Size | |
8403 | ||
8404 | This gets the size of the window's 'client area' in pixels. The client | |
8405 | area is the area which may be drawn on by the programmer, excluding | |
8406 | title bar, border, scrollbars, etc. | |
8407 | """ | |
8408 | return _core_.Window_GetClientSize(*args, **kwargs) | |
8409 | ||
8410 | def GetClientSizeTuple(*args, **kwargs): | |
8411 | """ | |
8412 | GetClientSizeTuple() -> (width, height) | |
8413 | ||
8414 | This gets the size of the window's 'client area' in pixels. The client | |
8415 | area is the area which may be drawn on by the programmer, excluding | |
8416 | title bar, border, scrollbars, etc. | |
8417 | """ | |
8418 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) | |
8419 | ||
8420 | def GetClientAreaOrigin(*args, **kwargs): | |
8421 | """ | |
8422 | GetClientAreaOrigin(self) -> Point | |
8423 | ||
8424 | Get the origin of the client area of the window relative to the | |
8425 | window's top left corner (the client area may be shifted because of | |
8426 | the borders, scrollbars, other decorations...) | |
8427 | """ | |
8428 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) | |
8429 | ||
8430 | def GetClientRect(*args, **kwargs): | |
8431 | """ | |
8432 | GetClientRect(self) -> Rect | |
8433 | ||
629f3c1b | 8434 | Get the client area position and size as a `wx.Rect` object. |
d55e5bfc RD |
8435 | """ |
8436 | return _core_.Window_GetClientRect(*args, **kwargs) | |
8437 | ||
8438 | def GetBestSize(*args, **kwargs): | |
8439 | """ | |
8440 | GetBestSize(self) -> Size | |
8441 | ||
248ed943 | 8442 | This function returns the best acceptable minimal size for the |
79fccf9d RD |
8443 | window, if applicable. For example, for a static text control, it will |
8444 | be the minimal size such that the control label is not truncated. For | |
8445 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8446 | this function will be the same as the size the window would have had | |
8447 | after calling Fit. | |
d55e5bfc RD |
8448 | """ |
8449 | return _core_.Window_GetBestSize(*args, **kwargs) | |
8450 | ||
8451 | def GetBestSizeTuple(*args, **kwargs): | |
8452 | """ | |
8453 | GetBestSizeTuple() -> (width, height) | |
8454 | ||
248ed943 | 8455 | This function returns the best acceptable minimal size for the |
79fccf9d RD |
8456 | window, if applicable. For example, for a static text control, it will |
8457 | be the minimal size such that the control label is not truncated. For | |
8458 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8459 | this function will be the same as the size the window would have had | |
8460 | after calling Fit. | |
d55e5bfc RD |
8461 | """ |
8462 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) | |
8463 | ||
a001823c RD |
8464 | def InvalidateBestSize(*args, **kwargs): |
8465 | """ | |
8466 | InvalidateBestSize(self) | |
8467 | ||
8468 | Reset the cached best size value so it will be recalculated the next | |
8469 | time it is needed. | |
8470 | """ | |
8471 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
8472 | ||
e2813725 RD |
8473 | def CacheBestSize(*args, **kwargs): |
8474 | """ | |
8475 | CacheBestSize(self, Size size) | |
8476 | ||
8477 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8478 | some properties of the window change.) | |
8479 | """ | |
8480 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8481 | ||
a001823c RD |
8482 | def GetBestFittingSize(*args, **kwargs): |
8483 | """ | |
8484 | GetBestFittingSize(self) -> Size | |
8485 | ||
8486 | This function will merge the window's best size into the window's | |
8487 | minimum size, giving priority to the min size components, and returns | |
8488 | the results. | |
8489 | ||
8490 | """ | |
8491 | return _core_.Window_GetBestFittingSize(*args, **kwargs) | |
8492 | ||
d55e5bfc RD |
8493 | def GetAdjustedBestSize(*args, **kwargs): |
8494 | """ | |
8495 | GetAdjustedBestSize(self) -> Size | |
8496 | ||
8497 | This method is similar to GetBestSize, except in one | |
8498 | thing. GetBestSize should return the minimum untruncated size of the | |
8499 | window, while this method will return the largest of BestSize and any | |
8500 | user specified minimum size. ie. it is the minimum size the window | |
8501 | should currently be drawn at, not the minimal size it can possibly | |
8502 | tolerate. | |
8503 | """ | |
8504 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) | |
8505 | ||
8506 | def Center(*args, **kwargs): | |
8507 | """ | |
8508 | Center(self, int direction=BOTH) | |
8509 | ||
8510 | Centers the window. The parameter specifies the direction for | |
8511 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8512 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8513 | on the entire screen and not on its parent window. If it is a | |
8514 | top-level window and has no parent then it will always be centered | |
8515 | relative to the screen. | |
8516 | """ | |
8517 | return _core_.Window_Center(*args, **kwargs) | |
8518 | ||
8519 | Centre = Center | |
8520 | def CenterOnScreen(*args, **kwargs): | |
8521 | """ | |
8522 | CenterOnScreen(self, int dir=BOTH) | |
8523 | ||
8524 | Center on screen (only works for top level windows) | |
8525 | """ | |
8526 | return _core_.Window_CenterOnScreen(*args, **kwargs) | |
8527 | ||
8528 | CentreOnScreen = CenterOnScreen | |
8529 | def CenterOnParent(*args, **kwargs): | |
8530 | """ | |
8531 | CenterOnParent(self, int dir=BOTH) | |
8532 | ||
8533 | Center with respect to the the parent window | |
8534 | """ | |
8535 | return _core_.Window_CenterOnParent(*args, **kwargs) | |
8536 | ||
8537 | CentreOnParent = CenterOnParent | |
8538 | def Fit(*args, **kwargs): | |
8539 | """ | |
8540 | Fit(self) | |
8541 | ||
8542 | Sizes the window so that it fits around its subwindows. This function | |
8543 | won't do anything if there are no subwindows and will only really work | |
8544 | correctly if sizers are used for the subwindows layout. Also, if the | |
8545 | window has exactly one subwindow it is better (faster and the result | |
8546 | is more precise as Fit adds some margin to account for fuzziness of | |
8547 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8548 | instead of calling Fit. | |
8549 | """ | |
8550 | return _core_.Window_Fit(*args, **kwargs) | |
8551 | ||
8552 | def FitInside(*args, **kwargs): | |
8553 | """ | |
8554 | FitInside(self) | |
8555 | ||
8556 | Similar to Fit, but sizes the interior (virtual) size of a | |
8557 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8558 | sizing changes that do not trigger a size event, and/or scrolled | |
8559 | windows without an interior sizer. This function similarly won't do | |
8560 | anything if there are no subwindows. | |
8561 | """ | |
8562 | return _core_.Window_FitInside(*args, **kwargs) | |
8563 | ||
03837c5c | 8564 | def SetSizeHints(*args, **kwargs): |
d55e5bfc RD |
8565 | """ |
8566 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, | |
8567 | int incH=-1) | |
d55e5bfc RD |
8568 | |
8569 | Allows specification of minimum and maximum window sizes, and window | |
8570 | size increments. If a pair of values is not set (or set to -1), the | |
8571 | default values will be used. If this function is called, the user | |
908b74cd RD |
8572 | will not be able to size the window outside the given bounds (if it is |
8573 | a top-level window.) Sizers will also inspect the minimum window size | |
8574 | and will use that value if set when calculating layout. | |
8575 | ||
8576 | The resizing increments are only significant under Motif or Xt. | |
d55e5bfc | 8577 | """ |
03837c5c | 8578 | return _core_.Window_SetSizeHints(*args, **kwargs) |
d55e5bfc | 8579 | |
03837c5c RD |
8580 | def SetSizeHintsSz(*args, **kwargs): |
8581 | """ | |
8582 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
8583 | ||
8584 | Allows specification of minimum and maximum window sizes, and window | |
8585 | size increments. If a pair of values is not set (or set to -1), the | |
8586 | default values will be used. If this function is called, the user | |
8587 | will not be able to size the window outside the given bounds (if it is | |
8588 | a top-level window.) Sizers will also inspect the minimum window size | |
8589 | and will use that value if set when calculating layout. | |
8590 | ||
8591 | The resizing increments are only significant under Motif or Xt. | |
8592 | """ | |
8593 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
8594 | ||
8595 | def SetVirtualSizeHints(*args, **kwargs): | |
d55e5bfc | 8596 | """ |
908b74cd | 8597 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
d55e5bfc RD |
8598 | |
8599 | Allows specification of minimum and maximum virtual window sizes. If a | |
8600 | pair of values is not set (or set to -1), the default values will be | |
8601 | used. If this function is called, the user will not be able to size | |
8602 | the virtual area of the window outside the given bounds. | |
8603 | """ | |
03837c5c RD |
8604 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
8605 | ||
8606 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8607 | """ | |
8608 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
8609 | ||
8610 | Allows specification of minimum and maximum virtual window sizes. If a | |
8611 | pair of values is not set (or set to -1), the default values will be | |
8612 | used. If this function is called, the user will not be able to size | |
8613 | the virtual area of the window outside the given bounds. | |
8614 | """ | |
8615 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
d55e5bfc | 8616 | |
908b74cd RD |
8617 | def GetMaxSize(*args, **kwargs): |
8618 | """GetMaxSize(self) -> Size""" | |
8619 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
8620 | ||
8621 | def GetMinSize(*args, **kwargs): | |
8622 | """GetMinSize(self) -> Size""" | |
8623 | return _core_.Window_GetMinSize(*args, **kwargs) | |
8624 | ||
8625 | def SetMinSize(*args, **kwargs): | |
8626 | """ | |
8627 | SetMinSize(self, Size minSize) | |
8628 | ||
8629 | A more convenient method than `SetSizeHints` for setting just the | |
8630 | min size. | |
8631 | """ | |
8632 | return _core_.Window_SetMinSize(*args, **kwargs) | |
8633 | ||
8634 | def SetMaxSize(*args, **kwargs): | |
8635 | """ | |
8636 | SetMaxSize(self, Size maxSize) | |
8637 | ||
8638 | A more convenient method than `SetSizeHints` for setting just the | |
8639 | max size. | |
8640 | """ | |
8641 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
8642 | ||
d55e5bfc RD |
8643 | def GetMinWidth(*args, **kwargs): |
8644 | """GetMinWidth(self) -> int""" | |
8645 | return _core_.Window_GetMinWidth(*args, **kwargs) | |
8646 | ||
8647 | def GetMinHeight(*args, **kwargs): | |
8648 | """GetMinHeight(self) -> int""" | |
8649 | return _core_.Window_GetMinHeight(*args, **kwargs) | |
8650 | ||
8651 | def GetMaxWidth(*args, **kwargs): | |
8652 | """GetMaxWidth(self) -> int""" | |
8653 | return _core_.Window_GetMaxWidth(*args, **kwargs) | |
8654 | ||
8655 | def GetMaxHeight(*args, **kwargs): | |
8656 | """GetMaxHeight(self) -> int""" | |
8657 | return _core_.Window_GetMaxHeight(*args, **kwargs) | |
8658 | ||
d55e5bfc RD |
8659 | def SetVirtualSize(*args, **kwargs): |
8660 | """ | |
8661 | SetVirtualSize(self, Size size) | |
8662 | ||
8663 | Set the the virtual size of a window in pixels. For most windows this | |
8664 | is just the client area of the window, but for some like scrolled | |
8665 | windows it is more or less independent of the screen window size. | |
8666 | """ | |
8667 | return _core_.Window_SetVirtualSize(*args, **kwargs) | |
8668 | ||
8669 | def SetVirtualSizeWH(*args, **kwargs): | |
8670 | """ | |
8671 | SetVirtualSizeWH(self, int w, int h) | |
8672 | ||
8673 | Set the the virtual size of a window in pixels. For most windows this | |
8674 | is just the client area of the window, but for some like scrolled | |
8675 | windows it is more or less independent of the screen window size. | |
8676 | """ | |
8677 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) | |
8678 | ||
8679 | def GetVirtualSize(*args, **kwargs): | |
8680 | """ | |
8681 | GetVirtualSize(self) -> Size | |
8682 | ||
8683 | Get the the virtual size of the window in pixels. For most windows | |
8684 | this is just the client area of the window, but for some like scrolled | |
8685 | windows it is more or less independent of the screen window size. | |
8686 | """ | |
8687 | return _core_.Window_GetVirtualSize(*args, **kwargs) | |
8688 | ||
8689 | def GetVirtualSizeTuple(*args, **kwargs): | |
8690 | """ | |
8691 | GetVirtualSizeTuple() -> (width, height) | |
8692 | ||
8693 | Get the the virtual size of the window in pixels. For most windows | |
8694 | this is just the client area of the window, but for some like scrolled | |
8695 | windows it is more or less independent of the screen window size. | |
8696 | """ | |
8697 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) | |
8698 | ||
8699 | def GetBestVirtualSize(*args, **kwargs): | |
8700 | """ | |
8701 | GetBestVirtualSize(self) -> Size | |
8702 | ||
8703 | Return the largest of ClientSize and BestSize (as determined by a | |
8704 | sizer, interior children, or other means) | |
8705 | """ | |
8706 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) | |
8707 | ||
8708 | def Show(*args, **kwargs): | |
8709 | """ | |
8710 | Show(self, bool show=True) -> bool | |
8711 | ||
8712 | Shows or hides the window. You may need to call Raise for a top level | |
8713 | window if you want to bring it to top, although this is not needed if | |
8714 | Show is called immediately after the frame creation. Returns True if | |
8715 | the window has been shown or hidden or False if nothing was done | |
8716 | because it already was in the requested state. | |
8717 | """ | |
8718 | return _core_.Window_Show(*args, **kwargs) | |
8719 | ||
8720 | def Hide(*args, **kwargs): | |
8721 | """ | |
8722 | Hide(self) -> bool | |
8723 | ||
8724 | Equivalent to calling Show(False). | |
8725 | """ | |
8726 | return _core_.Window_Hide(*args, **kwargs) | |
8727 | ||
8728 | def Enable(*args, **kwargs): | |
8729 | """ | |
8730 | Enable(self, bool enable=True) -> bool | |
8731 | ||
8732 | Enable or disable the window for user input. Note that when a parent | |
8733 | window is disabled, all of its children are disabled as well and they | |
8734 | are reenabled again when the parent is. Returns true if the window | |
8735 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8736 | window had already been in the specified state. | |
8737 | """ | |
8738 | return _core_.Window_Enable(*args, **kwargs) | |
8739 | ||
8740 | def Disable(*args, **kwargs): | |
8741 | """ | |
8742 | Disable(self) -> bool | |
8743 | ||
8744 | Disables the window, same as Enable(false). | |
8745 | """ | |
8746 | return _core_.Window_Disable(*args, **kwargs) | |
8747 | ||
8748 | def IsShown(*args, **kwargs): | |
8749 | """ | |
8750 | IsShown(self) -> bool | |
8751 | ||
8752 | Returns true if the window is shown, false if it has been hidden. | |
8753 | """ | |
8754 | return _core_.Window_IsShown(*args, **kwargs) | |
8755 | ||
8756 | def IsEnabled(*args, **kwargs): | |
8757 | """ | |
8758 | IsEnabled(self) -> bool | |
8759 | ||
8760 | Returns true if the window is enabled for input, false otherwise. | |
8761 | """ | |
8762 | return _core_.Window_IsEnabled(*args, **kwargs) | |
8763 | ||
8764 | def SetWindowStyleFlag(*args, **kwargs): | |
8765 | """ | |
8766 | SetWindowStyleFlag(self, long style) | |
8767 | ||
79fccf9d RD |
8768 | Sets the style of the window. Please note that some styles cannot be |
8769 | changed after the window creation and that Refresh() might need to be | |
8770 | called after changing the others for the change to take place | |
8771 | immediately. | |
d55e5bfc RD |
8772 | """ |
8773 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) | |
8774 | ||
8775 | def GetWindowStyleFlag(*args, **kwargs): | |
8776 | """ | |
8777 | GetWindowStyleFlag(self) -> long | |
8778 | ||
8779 | Gets the window style that was passed to the constructor or Create | |
8780 | method. | |
8781 | """ | |
8782 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) | |
8783 | ||
8784 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag | |
8785 | def HasFlag(*args, **kwargs): | |
8786 | """ | |
8787 | HasFlag(self, int flag) -> bool | |
8788 | ||
8789 | Test if the given style is set for this window. | |
8790 | """ | |
8791 | return _core_.Window_HasFlag(*args, **kwargs) | |
8792 | ||
8793 | def IsRetained(*args, **kwargs): | |
8794 | """ | |
8795 | IsRetained(self) -> bool | |
8796 | ||
8797 | Returns true if the window is retained, false otherwise. Retained | |
8798 | windows are only available on X platforms. | |
8799 | """ | |
8800 | return _core_.Window_IsRetained(*args, **kwargs) | |
8801 | ||
8802 | def SetExtraStyle(*args, **kwargs): | |
8803 | """ | |
8804 | SetExtraStyle(self, long exStyle) | |
8805 | ||
8806 | Sets the extra style bits for the window. Extra styles are the less | |
8807 | often used style bits which can't be set with the constructor or with | |
8808 | SetWindowStyleFlag() | |
8809 | """ | |
8810 | return _core_.Window_SetExtraStyle(*args, **kwargs) | |
8811 | ||
8812 | def GetExtraStyle(*args, **kwargs): | |
8813 | """ | |
8814 | GetExtraStyle(self) -> long | |
8815 | ||
8816 | Returns the extra style bits for the window. | |
8817 | """ | |
8818 | return _core_.Window_GetExtraStyle(*args, **kwargs) | |
8819 | ||
8820 | def MakeModal(*args, **kwargs): | |
8821 | """ | |
8822 | MakeModal(self, bool modal=True) | |
8823 | ||
8824 | Disables all other windows in the application so that the user can | |
8825 | only interact with this window. Passing False will reverse this | |
8826 | effect. | |
8827 | """ | |
8828 | return _core_.Window_MakeModal(*args, **kwargs) | |
8829 | ||
8830 | def SetThemeEnabled(*args, **kwargs): | |
8831 | """ | |
8832 | SetThemeEnabled(self, bool enableTheme) | |
8833 | ||
8834 | This function tells a window if it should use the system's "theme" | |
8835 | code to draw the windows' background instead if its own background | |
8836 | drawing code. This will only have an effect on platforms that support | |
8837 | the notion of themes in user defined windows. One such platform is | |
8838 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8839 | user's selected theme. | |
8840 | ||
8841 | Dialogs, notebook pages and the status bar have this flag set to true | |
8842 | by default so that the default look and feel is simulated best. | |
8843 | """ | |
8844 | return _core_.Window_SetThemeEnabled(*args, **kwargs) | |
8845 | ||
8846 | def GetThemeEnabled(*args, **kwargs): | |
8847 | """ | |
8848 | GetThemeEnabled(self) -> bool | |
8849 | ||
8850 | Return the themeEnabled flag. | |
8851 | """ | |
8852 | return _core_.Window_GetThemeEnabled(*args, **kwargs) | |
8853 | ||
8854 | def SetFocus(*args, **kwargs): | |
8855 | """ | |
8856 | SetFocus(self) | |
8857 | ||
8858 | Set's the focus to this window, allowing it to receive keyboard input. | |
8859 | """ | |
8860 | return _core_.Window_SetFocus(*args, **kwargs) | |
8861 | ||
8862 | def SetFocusFromKbd(*args, **kwargs): | |
8863 | """ | |
8864 | SetFocusFromKbd(self) | |
8865 | ||
8866 | Set focus to this window as the result of a keyboard action. Normally | |
8867 | only called internally. | |
8868 | """ | |
8869 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) | |
8870 | ||
8871 | def FindFocus(*args, **kwargs): | |
8872 | """ | |
c24da6d6 | 8873 | FindFocus() -> Window |
d55e5bfc RD |
8874 | |
8875 | Returns the window or control that currently has the keyboard focus, | |
8876 | or None. | |
8877 | """ | |
8878 | return _core_.Window_FindFocus(*args, **kwargs) | |
8879 | ||
8880 | FindFocus = staticmethod(FindFocus) | |
8881 | def AcceptsFocus(*args, **kwargs): | |
8882 | """ | |
8883 | AcceptsFocus(self) -> bool | |
8884 | ||
8885 | Can this window have focus? | |
8886 | """ | |
8887 | return _core_.Window_AcceptsFocus(*args, **kwargs) | |
8888 | ||
8889 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
8890 | """ | |
8891 | AcceptsFocusFromKeyboard(self) -> bool | |
8892 | ||
8893 | Can this window be given focus by keyboard navigation? if not, the | |
8894 | only way to give it focus (provided it accepts it at all) is to click | |
8895 | it. | |
8896 | """ | |
8897 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) | |
8898 | ||
8899 | def GetDefaultItem(*args, **kwargs): | |
8900 | """ | |
8901 | GetDefaultItem(self) -> Window | |
8902 | ||
8903 | Get the default child of this parent, i.e. the one which is activated | |
8904 | by pressing <Enter> such as the OK button on a wx.Dialog. | |
8905 | """ | |
8906 | return _core_.Window_GetDefaultItem(*args, **kwargs) | |
8907 | ||
8908 | def SetDefaultItem(*args, **kwargs): | |
8909 | """ | |
8910 | SetDefaultItem(self, Window child) -> Window | |
8911 | ||
8912 | Set this child as default, return the old default. | |
8913 | """ | |
8914 | return _core_.Window_SetDefaultItem(*args, **kwargs) | |
8915 | ||
8916 | def SetTmpDefaultItem(*args, **kwargs): | |
8917 | """ | |
8918 | SetTmpDefaultItem(self, Window win) | |
8919 | ||
8920 | Set this child as temporary default | |
8921 | """ | |
8922 | return _core_.Window_SetTmpDefaultItem(*args, **kwargs) | |
8923 | ||
908b74cd RD |
8924 | def Navigate(*args, **kwargs): |
8925 | """ | |
8926 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8927 | ||
a8eff060 RD |
8928 | Does keyboard navigation from this window to another, by sending a |
8929 | `wx.NavigationKeyEvent`. | |
908b74cd RD |
8930 | """ |
8931 | return _core_.Window_Navigate(*args, **kwargs) | |
8932 | ||
bf26d883 RD |
8933 | def MoveAfterInTabOrder(*args, **kwargs): |
8934 | """ | |
8935 | MoveAfterInTabOrder(self, Window win) | |
8936 | ||
8937 | Moves this window in the tab navigation order after the specified | |
8938 | sibling window. This means that when the user presses the TAB key on | |
8939 | that other window, the focus switches to this window. | |
8940 | ||
8941 | The default tab order is the same as creation order. This function | |
8942 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8943 | windows. | |
8944 | ||
8945 | """ | |
8946 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
8947 | ||
8948 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8949 | """ | |
8950 | MoveBeforeInTabOrder(self, Window win) | |
8951 | ||
8952 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8953 | before win instead of putting it right after it. | |
8954 | """ | |
8955 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
8956 | ||
d55e5bfc RD |
8957 | def GetChildren(*args, **kwargs): |
8958 | """ | |
8959 | GetChildren(self) -> PyObject | |
8960 | ||
8961 | Returns a list of the window's children. NOTE: Currently this is a | |
8962 | copy of the child window list maintained by the window, so the return | |
8963 | value of this function is only valid as long as the window's children | |
8964 | do not change. | |
8965 | """ | |
8966 | return _core_.Window_GetChildren(*args, **kwargs) | |
8967 | ||
8968 | def GetParent(*args, **kwargs): | |
8969 | """ | |
8970 | GetParent(self) -> Window | |
8971 | ||
8972 | Returns the parent window of this window, or None if there isn't one. | |
8973 | """ | |
8974 | return _core_.Window_GetParent(*args, **kwargs) | |
8975 | ||
8976 | def GetGrandParent(*args, **kwargs): | |
8977 | """ | |
8978 | GetGrandParent(self) -> Window | |
8979 | ||
79fccf9d RD |
8980 | Returns the parent of the parent of this window, or None if there |
8981 | isn't one. | |
d55e5bfc RD |
8982 | """ |
8983 | return _core_.Window_GetGrandParent(*args, **kwargs) | |
8984 | ||
8985 | def IsTopLevel(*args, **kwargs): | |
8986 | """ | |
8987 | IsTopLevel(self) -> bool | |
8988 | ||
8989 | Returns true if the given window is a top-level one. Currently all | |
8990 | frames and dialogs are always considered to be top-level windows (even | |
8991 | if they have a parent window). | |
8992 | """ | |
8993 | return _core_.Window_IsTopLevel(*args, **kwargs) | |
8994 | ||
8995 | def Reparent(*args, **kwargs): | |
8996 | """ | |
8997 | Reparent(self, Window newParent) -> bool | |
8998 | ||
8999 | Reparents the window, i.e the window will be removed from its current | |
9000 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
9001 | re-inserted into another. Available on Windows and GTK. Returns True | |
9002 | if the parent was changed, False otherwise (error or newParent == | |
9003 | oldParent) | |
9004 | """ | |
9005 | return _core_.Window_Reparent(*args, **kwargs) | |
9006 | ||
9007 | def AddChild(*args, **kwargs): | |
9008 | """ | |
9009 | AddChild(self, Window child) | |
9010 | ||
9011 | Adds a child window. This is called automatically by window creation | |
9012 | functions so should not be required by the application programmer. | |
9013 | """ | |
9014 | return _core_.Window_AddChild(*args, **kwargs) | |
9015 | ||
9016 | def RemoveChild(*args, **kwargs): | |
9017 | """ | |
9018 | RemoveChild(self, Window child) | |
9019 | ||
9020 | Removes a child window. This is called automatically by window | |
9021 | deletion functions so should not be required by the application | |
9022 | programmer. | |
9023 | """ | |
9024 | return _core_.Window_RemoveChild(*args, **kwargs) | |
9025 | ||
9026 | def FindWindowById(*args, **kwargs): | |
9027 | """ | |
9028 | FindWindowById(self, long winid) -> Window | |
9029 | ||
9030 | Find a chld of this window by window ID | |
9031 | """ | |
9032 | return _core_.Window_FindWindowById(*args, **kwargs) | |
9033 | ||
9034 | def FindWindowByName(*args, **kwargs): | |
9035 | """ | |
9036 | FindWindowByName(self, String name) -> Window | |
9037 | ||
9038 | Find a child of this window by name | |
9039 | """ | |
9040 | return _core_.Window_FindWindowByName(*args, **kwargs) | |
9041 | ||
9042 | def GetEventHandler(*args, **kwargs): | |
9043 | """ | |
9044 | GetEventHandler(self) -> EvtHandler | |
9045 | ||
9046 | Returns the event handler for this window. By default, the window is | |
9047 | its own event handler. | |
9048 | """ | |
9049 | return _core_.Window_GetEventHandler(*args, **kwargs) | |
9050 | ||
9051 | def SetEventHandler(*args, **kwargs): | |
9052 | """ | |
9053 | SetEventHandler(self, EvtHandler handler) | |
9054 | ||
9055 | Sets the event handler for this window. An event handler is an object | |
9056 | that is capable of processing the events sent to a window. By default, | |
9057 | the window is its own event handler, but an application may wish to | |
9058 | substitute another, for example to allow central implementation of | |
9059 | event-handling for a variety of different window classes. | |
9060 | ||
79fccf9d | 9061 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
d55e5bfc RD |
9062 | up a chain of event handlers, where an event not handled by one event |
9063 | handler is handed to the next one in the chain. | |
9064 | """ | |
9065 | return _core_.Window_SetEventHandler(*args, **kwargs) | |
9066 | ||
9067 | def PushEventHandler(*args, **kwargs): | |
9068 | """ | |
9069 | PushEventHandler(self, EvtHandler handler) | |
9070 | ||
9071 | Pushes this event handler onto the event handler stack for the window. | |
9072 | An event handler is an object that is capable of processing the events | |
9073 | sent to a window. By default, the window is its own event handler, but | |
9074 | an application may wish to substitute another, for example to allow | |
9075 | central implementation of event-handling for a variety of different | |
9076 | window classes. | |
9077 | ||
9078 | wx.Window.PushEventHandler allows an application to set up a chain of | |
9079 | event handlers, where an event not handled by one event handler is | |
79fccf9d | 9080 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` to |
d55e5bfc RD |
9081 | remove the event handler. |
9082 | """ | |
9083 | return _core_.Window_PushEventHandler(*args, **kwargs) | |
9084 | ||
9085 | def PopEventHandler(*args, **kwargs): | |
9086 | """ | |
9087 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler | |
9088 | ||
9089 | Removes and returns the top-most event handler on the event handler | |
9090 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
9091 | destroyed after it is popped. | |
9092 | """ | |
9093 | return _core_.Window_PopEventHandler(*args, **kwargs) | |
9094 | ||
9095 | def RemoveEventHandler(*args, **kwargs): | |
9096 | """ | |
9097 | RemoveEventHandler(self, EvtHandler handler) -> bool | |
9098 | ||
79fccf9d RD |
9099 | Find the given handler in the event handler chain and remove (but not |
9100 | delete) it from the event handler chain, return True if it was found | |
9101 | and False otherwise (this also results in an assert failure so this | |
9102 | function should only be called when the handler is supposed to be | |
9103 | there.) | |
d55e5bfc RD |
9104 | """ |
9105 | return _core_.Window_RemoveEventHandler(*args, **kwargs) | |
9106 | ||
9107 | def SetValidator(*args, **kwargs): | |
9108 | """ | |
9109 | SetValidator(self, Validator validator) | |
9110 | ||
9111 | Deletes the current validator (if any) and sets the window validator, | |
9112 | having called wx.Validator.Clone to create a new validator of this | |
9113 | type. | |
9114 | """ | |
9115 | return _core_.Window_SetValidator(*args, **kwargs) | |
9116 | ||
9117 | def GetValidator(*args, **kwargs): | |
9118 | """ | |
9119 | GetValidator(self) -> Validator | |
9120 | ||
9121 | Returns a pointer to the current validator for the window, or None if | |
9122 | there is none. | |
9123 | """ | |
9124 | return _core_.Window_GetValidator(*args, **kwargs) | |
9125 | ||
9126 | def Validate(*args, **kwargs): | |
9127 | """ | |
9128 | Validate(self) -> bool | |
9129 | ||
9130 | Validates the current values of the child controls using their | |
79fccf9d RD |
9131 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
9132 | style flag set, the method will also call Validate() of all child | |
9133 | windows. Returns false if any of the validations failed. | |
d55e5bfc RD |
9134 | """ |
9135 | return _core_.Window_Validate(*args, **kwargs) | |
9136 | ||
9137 | def TransferDataToWindow(*args, **kwargs): | |
9138 | """ | |
9139 | TransferDataToWindow(self) -> bool | |
9140 | ||
79fccf9d RD |
9141 | Transfers values to child controls from data areas specified by their |
9142 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
9143 | style flag set, the method will also call TransferDataToWindow() of | |
9144 | all child windows. | |
d55e5bfc RD |
9145 | """ |
9146 | return _core_.Window_TransferDataToWindow(*args, **kwargs) | |
9147 | ||
9148 | def TransferDataFromWindow(*args, **kwargs): | |
9149 | """ | |
9150 | TransferDataFromWindow(self) -> bool | |
9151 | ||
79fccf9d RD |
9152 | Transfers values from child controls to data areas specified by their |
9153 | validators. Returns false if a transfer failed. If the window has | |
9154 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
9155 | also call TransferDataFromWindow() of all child windows. | |
d55e5bfc RD |
9156 | """ |
9157 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) | |
9158 | ||
9159 | def InitDialog(*args, **kwargs): | |
9160 | """ | |
9161 | InitDialog(self) | |
9162 | ||
79fccf9d RD |
9163 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
9164 | to the dialog via validators. | |
d55e5bfc RD |
9165 | """ |
9166 | return _core_.Window_InitDialog(*args, **kwargs) | |
9167 | ||
9168 | def SetAcceleratorTable(*args, **kwargs): | |
9169 | """ | |
9170 | SetAcceleratorTable(self, AcceleratorTable accel) | |
9171 | ||
9172 | Sets the accelerator table for this window. | |
9173 | """ | |
9174 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) | |
9175 | ||
9176 | def GetAcceleratorTable(*args, **kwargs): | |
9177 | """ | |
9178 | GetAcceleratorTable(self) -> AcceleratorTable | |
9179 | ||
9180 | Gets the accelerator table for this window. | |
9181 | """ | |
9182 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) | |
9183 | ||
9184 | def RegisterHotKey(*args, **kwargs): | |
9185 | """ | |
9186 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool | |
9187 | ||
9188 | Registers a system wide hotkey. Every time the user presses the hotkey | |
9189 | registered here, this window will receive a hotkey event. It will | |
9190 | receive the event even if the application is in the background and | |
9191 | does not have the input focus because the user is working with some | |
9192 | other application. To bind an event handler function to this hotkey | |
9193 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
9194 | hotkey was registered successfully. | |
9195 | """ | |
9196 | return _core_.Window_RegisterHotKey(*args, **kwargs) | |
9197 | ||
9198 | def UnregisterHotKey(*args, **kwargs): | |
9199 | """ | |
9200 | UnregisterHotKey(self, int hotkeyId) -> bool | |
9201 | ||
9202 | Unregisters a system wide hotkey. | |
9203 | """ | |
9204 | return _core_.Window_UnregisterHotKey(*args, **kwargs) | |
9205 | ||
9206 | def ConvertDialogPointToPixels(*args, **kwargs): | |
9207 | """ | |
9208 | ConvertDialogPointToPixels(self, Point pt) -> Point | |
9209 | ||
9210 | Converts a point or size from dialog units to pixels. Dialog units | |
9211 | are used for maintaining a dialog's proportions even if the font | |
9212 | changes. For the x dimension, the dialog units are multiplied by the | |
9213 | average character width and then divided by 4. For the y dimension, | |
9214 | the dialog units are multiplied by the average character height and | |
9215 | then divided by 8. | |
9216 | """ | |
9217 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) | |
9218 | ||
9219 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
9220 | """ | |
9221 | ConvertDialogSizeToPixels(self, Size sz) -> Size | |
9222 | ||
9223 | Converts a point or size from dialog units to pixels. Dialog units | |
9224 | are used for maintaining a dialog's proportions even if the font | |
9225 | changes. For the x dimension, the dialog units are multiplied by the | |
9226 | average character width and then divided by 4. For the y dimension, | |
9227 | the dialog units are multiplied by the average character height and | |
9228 | then divided by 8. | |
9229 | """ | |
9230 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) | |
9231 | ||
9232 | def DLG_PNT(*args, **kwargs): | |
9233 | """ | |
9234 | DLG_PNT(self, Point pt) -> Point | |
9235 | ||
9236 | Converts a point or size from dialog units to pixels. Dialog units | |
9237 | are used for maintaining a dialog's proportions even if the font | |
9238 | changes. For the x dimension, the dialog units are multiplied by the | |
9239 | average character width and then divided by 4. For the y dimension, | |
9240 | the dialog units are multiplied by the average character height and | |
9241 | then divided by 8. | |
9242 | """ | |
9243 | return _core_.Window_DLG_PNT(*args, **kwargs) | |
9244 | ||
9245 | def DLG_SZE(*args, **kwargs): | |
9246 | """ | |
9247 | DLG_SZE(self, Size sz) -> Size | |
9248 | ||
9249 | Converts a point or size from dialog units to pixels. Dialog units | |
9250 | are used for maintaining a dialog's proportions even if the font | |
9251 | changes. For the x dimension, the dialog units are multiplied by the | |
9252 | average character width and then divided by 4. For the y dimension, | |
9253 | the dialog units are multiplied by the average character height and | |
9254 | then divided by 8. | |
9255 | """ | |
9256 | return _core_.Window_DLG_SZE(*args, **kwargs) | |
9257 | ||
9258 | def ConvertPixelPointToDialog(*args, **kwargs): | |
9259 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" | |
9260 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) | |
9261 | ||
9262 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
9263 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" | |
9264 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) | |
9265 | ||
9266 | def WarpPointer(*args, **kwargs): | |
9267 | """ | |
9268 | WarpPointer(self, int x, int y) | |
9269 | ||
9270 | Moves the pointer to the given position on the window. | |
9271 | ||
9272 | NOTE: This function is not supported under Mac because Apple Human | |
9273 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
9274 | """ | |
9275 | return _core_.Window_WarpPointer(*args, **kwargs) | |
9276 | ||
9277 | def CaptureMouse(*args, **kwargs): | |
9278 | """ | |
9279 | CaptureMouse(self) | |
9280 | ||
9281 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
9282 | release the capture. | |
9283 | ||
9284 | Note that wxWindows maintains the stack of windows having captured the | |
9285 | mouse and when the mouse is released the capture returns to the window | |
9286 | which had had captured it previously and it is only really released if | |
9287 | there were no previous window. In particular, this means that you must | |
9288 | release the mouse as many times as you capture it. | |
9289 | """ | |
9290 | return _core_.Window_CaptureMouse(*args, **kwargs) | |
9291 | ||
9292 | def ReleaseMouse(*args, **kwargs): | |
9293 | """ | |
9294 | ReleaseMouse(self) | |
9295 | ||
9296 | Releases mouse input captured with wx.Window.CaptureMouse. | |
9297 | """ | |
9298 | return _core_.Window_ReleaseMouse(*args, **kwargs) | |
9299 | ||
9300 | def GetCapture(*args, **kwargs): | |
9301 | """ | |
c24da6d6 | 9302 | GetCapture() -> Window |
d55e5bfc RD |
9303 | |
9304 | Returns the window which currently captures the mouse or None | |
9305 | """ | |
9306 | return _core_.Window_GetCapture(*args, **kwargs) | |
9307 | ||
9308 | GetCapture = staticmethod(GetCapture) | |
9309 | def HasCapture(*args, **kwargs): | |
9310 | """ | |
9311 | HasCapture(self) -> bool | |
9312 | ||
9313 | Returns true if this window has the current mouse capture. | |
9314 | """ | |
9315 | return _core_.Window_HasCapture(*args, **kwargs) | |
9316 | ||
9317 | def Refresh(*args, **kwargs): | |
9318 | """ | |
9319 | Refresh(self, bool eraseBackground=True, Rect rect=None) | |
9320 | ||
9321 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
9322 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
9323 | to the window. | |
9324 | """ | |
9325 | return _core_.Window_Refresh(*args, **kwargs) | |
9326 | ||
9327 | def RefreshRect(*args, **kwargs): | |
9328 | """ | |
fef4c27a | 9329 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
d55e5bfc RD |
9330 | |
9331 | Redraws the contents of the given rectangle: the area inside it will | |
9332 | be repainted. This is the same as Refresh but has a nicer syntax. | |
9333 | """ | |
9334 | return _core_.Window_RefreshRect(*args, **kwargs) | |
9335 | ||
9336 | def Update(*args, **kwargs): | |
9337 | """ | |
9338 | Update(self) | |
9339 | ||
9340 | Calling this method immediately repaints the invalidated area of the | |
9341 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
9342 | this would usually only happen when the flow of control returns to the | |
9343 | event loop.) Notice that this function doesn't refresh the window and | |
9344 | does nothing if the window has been already repainted. Use Refresh | |
9345 | first if you want to immediately redraw the window (or some portion of | |
9346 | it) unconditionally. | |
9347 | """ | |
9348 | return _core_.Window_Update(*args, **kwargs) | |
9349 | ||
9350 | def ClearBackground(*args, **kwargs): | |
9351 | """ | |
9352 | ClearBackground(self) | |
9353 | ||
9354 | Clears the window by filling it with the current background | |
9355 | colour. Does not cause an erase background event to be generated. | |
9356 | """ | |
9357 | return _core_.Window_ClearBackground(*args, **kwargs) | |
9358 | ||
9359 | def Freeze(*args, **kwargs): | |
9360 | """ | |
9361 | Freeze(self) | |
9362 | ||
79fccf9d RD |
9363 | Freezes the window or, in other words, prevents any updates from |
9364 | taking place on screen, the window is not redrawn at all. Thaw must be | |
9365 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
9366 | nested, with the actual Thaw being delayed until all the nesting has | |
9367 | been undone. | |
d55e5bfc RD |
9368 | |
9369 | This method is useful for visual appearance optimization (for example, | |
9370 | it is a good idea to use it before inserting large amount of text into | |
9371 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
9372 | for all controls so it is mostly just a hint to wxWindows and not a | |
9373 | mandatory directive. | |
9374 | """ | |
9375 | return _core_.Window_Freeze(*args, **kwargs) | |
9376 | ||
9377 | def Thaw(*args, **kwargs): | |
9378 | """ | |
9379 | Thaw(self) | |
9380 | ||
9381 | Reenables window updating after a previous call to Freeze. Calls to | |
79fccf9d RD |
9382 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
9383 | times that Freeze was before the window will be updated. | |
d55e5bfc RD |
9384 | """ |
9385 | return _core_.Window_Thaw(*args, **kwargs) | |
9386 | ||
9387 | def PrepareDC(*args, **kwargs): | |
9388 | """ | |
9389 | PrepareDC(self, DC dc) | |
9390 | ||
9391 | Call this function to prepare the device context for drawing a | |
9392 | scrolled image. It sets the device origin according to the current | |
9393 | scroll position. | |
9394 | """ | |
9395 | return _core_.Window_PrepareDC(*args, **kwargs) | |
9396 | ||
9397 | def GetUpdateRegion(*args, **kwargs): | |
9398 | """ | |
9399 | GetUpdateRegion(self) -> Region | |
9400 | ||
9401 | Returns the region specifying which parts of the window have been | |
9402 | damaged. Should only be called within an EVT_PAINT handler. | |
9403 | """ | |
9404 | return _core_.Window_GetUpdateRegion(*args, **kwargs) | |
9405 | ||
9406 | def GetUpdateClientRect(*args, **kwargs): | |
9407 | """ | |
9408 | GetUpdateClientRect(self) -> Rect | |
9409 | ||
9410 | Get the update rectangle region bounding box in client coords. | |
9411 | """ | |
9412 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) | |
9413 | ||
9414 | def IsExposed(*args, **kwargs): | |
9415 | """ | |
9416 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool | |
9417 | ||
9418 | Returns true if the given point or rectangle area has been exposed | |
9419 | since the last repaint. Call this in an paint event handler to | |
9420 | optimize redrawing by only redrawing those areas, which have been | |
9421 | exposed. | |
9422 | """ | |
9423 | return _core_.Window_IsExposed(*args, **kwargs) | |
9424 | ||
9425 | def IsExposedPoint(*args, **kwargs): | |
9426 | """ | |
9427 | IsExposedPoint(self, Point pt) -> bool | |
9428 | ||
9429 | Returns true if the given point or rectangle area has been exposed | |
9430 | since the last repaint. Call this in an paint event handler to | |
9431 | optimize redrawing by only redrawing those areas, which have been | |
9432 | exposed. | |
9433 | """ | |
9434 | return _core_.Window_IsExposedPoint(*args, **kwargs) | |
9435 | ||
9436 | def IsExposedRect(*args, **kwargs): | |
9437 | """ | |
9438 | IsExposedRect(self, Rect rect) -> bool | |
9439 | ||
9440 | Returns true if the given point or rectangle area has been exposed | |
9441 | since the last repaint. Call this in an paint event handler to | |
9442 | optimize redrawing by only redrawing those areas, which have been | |
9443 | exposed. | |
9444 | """ | |
9445 | return _core_.Window_IsExposedRect(*args, **kwargs) | |
9446 | ||
9447 | def GetDefaultAttributes(*args, **kwargs): | |
9448 | """ | |
9449 | GetDefaultAttributes(self) -> VisualAttributes | |
9450 | ||
79fccf9d RD |
9451 | Get the default attributes for an instance of this class. This is |
9452 | useful if you want to use the same font or colour in your own control | |
9453 | as in a standard control -- which is a much better idea than hard | |
9454 | coding specific colours or fonts which might look completely out of | |
caef1a4d | 9455 | place on the user's system, especially if it uses themes. |
d55e5bfc RD |
9456 | """ |
9457 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) | |
9458 | ||
9459 | def GetClassDefaultAttributes(*args, **kwargs): | |
9460 | """ | |
c24da6d6 | 9461 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
d55e5bfc | 9462 | |
79fccf9d RD |
9463 | Get the default attributes for this class. This is useful if you want |
9464 | to use the same font or colour in your own control as in a standard | |
9465 | control -- which is a much better idea than hard coding specific | |
caef1a4d RD |
9466 | colours or fonts which might look completely out of place on the |
9467 | user's system, especially if it uses themes. | |
d55e5bfc RD |
9468 | |
9469 | The variant parameter is only relevant under Mac currently and is | |
79fccf9d | 9470 | ignore under other platforms. Under Mac, it will change the size of |
caef1a4d RD |
9471 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9472 | this. | |
d55e5bfc RD |
9473 | """ |
9474 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) | |
9475 | ||
9476 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
9477 | def SetBackgroundColour(*args, **kwargs): | |
9478 | """ | |
9479 | SetBackgroundColour(self, Colour colour) -> bool | |
9480 | ||
9481 | Sets the background colour of the window. Returns True if the colour | |
9482 | was changed. The background colour is usually painted by the default | |
9483 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9484 | automatically under GTK. Using `wx.NullColour` will reset the window |
9485 | to the default background colour. | |
d55e5bfc | 9486 | |
caef1a4d | 9487 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9488 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
d55e5bfc RD |
9489 | calling this function. |
9490 | ||
f8167d6e RD |
9491 | Using this function will disable attempts to use themes for this |
9492 | window, if the system supports them. Use with care since usually the | |
9493 | themes represent the appearance chosen by the user to be used for all | |
9494 | applications on the system. | |
d55e5bfc RD |
9495 | """ |
9496 | return _core_.Window_SetBackgroundColour(*args, **kwargs) | |
9497 | ||
412d302d RD |
9498 | def SetOwnBackgroundColour(*args, **kwargs): |
9499 | """SetOwnBackgroundColour(self, Colour colour)""" | |
9500 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
d55e5bfc RD |
9501 | |
9502 | def SetForegroundColour(*args, **kwargs): | |
9503 | """ | |
9504 | SetForegroundColour(self, Colour colour) -> bool | |
9505 | ||
9506 | Sets the foreground colour of the window. Returns True is the colour | |
9507 | was changed. The interpretation of foreground colour is dependent on | |
9508 | the window class; it may be the text colour or other colour, or it may | |
9509 | not be used at all. | |
9510 | """ | |
9511 | return _core_.Window_SetForegroundColour(*args, **kwargs) | |
9512 | ||
fa47d7a7 VS |
9513 | def SetOwnForegroundColour(*args, **kwargs): |
9514 | """SetOwnForegroundColour(self, Colour colour)""" | |
9515 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
d55e5bfc RD |
9516 | |
9517 | def GetBackgroundColour(*args, **kwargs): | |
9518 | """ | |
9519 | GetBackgroundColour(self) -> Colour | |
9520 | ||
9521 | Returns the background colour of the window. | |
9522 | """ | |
9523 | return _core_.Window_GetBackgroundColour(*args, **kwargs) | |
9524 | ||
9525 | def GetForegroundColour(*args, **kwargs): | |
9526 | """ | |
9527 | GetForegroundColour(self) -> Colour | |
9528 | ||
9529 | Returns the foreground colour of the window. The interpretation of | |
9530 | foreground colour is dependent on the window class; it may be the text | |
9531 | colour or other colour, or it may not be used at all. | |
9532 | """ | |
9533 | return _core_.Window_GetForegroundColour(*args, **kwargs) | |
9534 | ||
dcb8fc74 RD |
9535 | def InheritsBackgroundColour(*args, **kwargs): |
9536 | """InheritsBackgroundColour(self) -> bool""" | |
9537 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
9538 | ||
9539 | def UseBgCol(*args, **kwargs): | |
9540 | """UseBgCol(self) -> bool""" | |
9541 | return _core_.Window_UseBgCol(*args, **kwargs) | |
9542 | ||
0f63ec68 RD |
9543 | def SetBackgroundStyle(*args, **kwargs): |
9544 | """ | |
9545 | SetBackgroundStyle(self, int style) -> bool | |
9546 | ||
9547 | Returns the background style of the window. The background style | |
9548 | indicates how the background of the window is drawn. | |
9549 | ||
9550 | ====================== ======================================== | |
9551 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9552 | be determined by the system | |
9553 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9554 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9555 | application. | |
9556 | ====================== ======================================== | |
9557 | ||
9558 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9559 | a custom background, such as a tiled bitmap. Currently the style has | |
9560 | no effect on other platforms. | |
9561 | ||
9562 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9563 | """ | |
9564 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
9565 | ||
9566 | def GetBackgroundStyle(*args, **kwargs): | |
9567 | """ | |
9568 | GetBackgroundStyle(self) -> int | |
9569 | ||
9570 | Returns the background style of the window. | |
9571 | ||
9572 | :see: `SetBackgroundStyle` | |
9573 | """ | |
9574 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
9575 | ||
51b83b37 RD |
9576 | def HasTransparentBackground(*args, **kwargs): |
9577 | """ | |
9578 | HasTransparentBackground(self) -> bool | |
9579 | ||
9580 | Returns True if this window's background is transparent (as, for | |
9581 | example, for `wx.StaticText`) and should show the parent window's | |
9582 | background. | |
9583 | ||
9584 | This method is mostly used internally by the library itself and you | |
9585 | normally shouldn't have to call it. You may, however, have to override | |
9586 | it in your custom control classes to ensure that background is painted | |
9587 | correctly. | |
9588 | """ | |
9589 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
9590 | ||
d55e5bfc RD |
9591 | def SetCursor(*args, **kwargs): |
9592 | """ | |
9593 | SetCursor(self, Cursor cursor) -> bool | |
9594 | ||
9595 | Sets the window's cursor. Notice that the window cursor also sets it | |
9596 | for the children of the window implicitly. | |
9597 | ||
9598 | The cursor may be wx.NullCursor in which case the window cursor will | |
9599 | be reset back to default. | |
9600 | """ | |
9601 | return _core_.Window_SetCursor(*args, **kwargs) | |
9602 | ||
9603 | def GetCursor(*args, **kwargs): | |
9604 | """ | |
9605 | GetCursor(self) -> Cursor | |
9606 | ||
9607 | Return the cursor associated with this window. | |
9608 | """ | |
9609 | return _core_.Window_GetCursor(*args, **kwargs) | |
9610 | ||
9611 | def SetFont(*args, **kwargs): | |
9612 | """ | |
9613 | SetFont(self, Font font) -> bool | |
9614 | ||
9615 | Sets the font for this window. | |
9616 | """ | |
9617 | return _core_.Window_SetFont(*args, **kwargs) | |
9618 | ||
fa47d7a7 VS |
9619 | def SetOwnFont(*args, **kwargs): |
9620 | """SetOwnFont(self, Font font)""" | |
9621 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
d55e5bfc RD |
9622 | |
9623 | def GetFont(*args, **kwargs): | |
9624 | """ | |
9625 | GetFont(self) -> Font | |
9626 | ||
9627 | Returns the default font used for this window. | |
9628 | """ | |
9629 | return _core_.Window_GetFont(*args, **kwargs) | |
9630 | ||
9631 | def SetCaret(*args, **kwargs): | |
9632 | """ | |
9633 | SetCaret(self, Caret caret) | |
9634 | ||
9635 | Sets the caret associated with the window. | |
9636 | """ | |
9637 | return _core_.Window_SetCaret(*args, **kwargs) | |
9638 | ||
9639 | def GetCaret(*args, **kwargs): | |
9640 | """ | |
9641 | GetCaret(self) -> Caret | |
9642 | ||
9643 | Returns the caret associated with the window. | |
9644 | """ | |
9645 | return _core_.Window_GetCaret(*args, **kwargs) | |
9646 | ||
9647 | def GetCharHeight(*args, **kwargs): | |
9648 | """ | |
9649 | GetCharHeight(self) -> int | |
9650 | ||
9651 | Get the (average) character size for the current font. | |
9652 | """ | |
9653 | return _core_.Window_GetCharHeight(*args, **kwargs) | |
9654 | ||
9655 | def GetCharWidth(*args, **kwargs): | |
9656 | """ | |
9657 | GetCharWidth(self) -> int | |
9658 | ||
9659 | Get the (average) character size for the current font. | |
9660 | """ | |
9661 | return _core_.Window_GetCharWidth(*args, **kwargs) | |
9662 | ||
9663 | def GetTextExtent(*args, **kwargs): | |
a8eff060 RD |
9664 | """ |
9665 | GetTextExtent(String string) -> (width, height) | |
9666 | ||
9667 | Get the width and height of the text using the current font. | |
9668 | """ | |
d55e5bfc RD |
9669 | return _core_.Window_GetTextExtent(*args, **kwargs) |
9670 | ||
9671 | def GetFullTextExtent(*args, **kwargs): | |
9672 | """ | |
9673 | GetFullTextExtent(String string, Font font=None) -> | |
9674 | (width, height, descent, externalLeading) | |
9675 | ||
9676 | Get the width, height, decent and leading of the text using the | |
9677 | current or specified font. | |
9678 | """ | |
9679 | return _core_.Window_GetFullTextExtent(*args, **kwargs) | |
9680 | ||
9681 | def ClientToScreenXY(*args, **kwargs): | |
9682 | """ | |
9683 | ClientToScreenXY(int x, int y) -> (x,y) | |
9684 | ||
9685 | Converts to screen coordinates from coordinates relative to this window. | |
9686 | """ | |
9687 | return _core_.Window_ClientToScreenXY(*args, **kwargs) | |
9688 | ||
9689 | def ScreenToClientXY(*args, **kwargs): | |
9690 | """ | |
9691 | ScreenToClientXY(int x, int y) -> (x,y) | |
9692 | ||
9693 | Converts from screen to client window coordinates. | |
9694 | """ | |
9695 | return _core_.Window_ScreenToClientXY(*args, **kwargs) | |
9696 | ||
9697 | def ClientToScreen(*args, **kwargs): | |
9698 | """ | |
9699 | ClientToScreen(self, Point pt) -> Point | |
9700 | ||
9701 | Converts to screen coordinates from coordinates relative to this window. | |
9702 | """ | |
9703 | return _core_.Window_ClientToScreen(*args, **kwargs) | |
9704 | ||
9705 | def ScreenToClient(*args, **kwargs): | |
9706 | """ | |
9707 | ScreenToClient(self, Point pt) -> Point | |
9708 | ||
9709 | Converts from screen to client window coordinates. | |
9710 | """ | |
9711 | return _core_.Window_ScreenToClient(*args, **kwargs) | |
9712 | ||
9713 | def HitTestXY(*args, **kwargs): | |
9714 | """ | |
9715 | HitTestXY(self, int x, int y) -> int | |
9716 | ||
9717 | Test where the given (in client coords) point lies | |
9718 | """ | |
9719 | return _core_.Window_HitTestXY(*args, **kwargs) | |
9720 | ||
9721 | def HitTest(*args, **kwargs): | |
9722 | """ | |
9723 | HitTest(self, Point pt) -> int | |
9724 | ||
9725 | Test where the given (in client coords) point lies | |
9726 | """ | |
9727 | return _core_.Window_HitTest(*args, **kwargs) | |
9728 | ||
9729 | def GetBorder(*args): | |
9730 | """ | |
9731 | GetBorder(self, long flags) -> int | |
9732 | GetBorder(self) -> int | |
9733 | ||
9734 | Get border for the flags of this window | |
9735 | """ | |
9736 | return _core_.Window_GetBorder(*args) | |
9737 | ||
9738 | def UpdateWindowUI(*args, **kwargs): | |
9739 | """ | |
9740 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) | |
9741 | ||
9742 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9743 | implementation depends on the window; for example a wx.ToolBar will | |
9744 | send an update UI event for each toolbar button, and a wx.Frame will | |
9745 | send an update UI event for each menubar menu item. You can call this | |
9746 | function from your application to ensure that your UI is up-to-date at | |
9747 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9748 | concerned). This may be necessary if you have called | |
5ba5649b | 9749 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
d55e5bfc RD |
9750 | limit the overhead that wxWindows incurs by sending update UI events |
9751 | in idle time. | |
d55e5bfc RD |
9752 | """ |
9753 | return _core_.Window_UpdateWindowUI(*args, **kwargs) | |
9754 | ||
9755 | def PopupMenuXY(*args, **kwargs): | |
9756 | """ | |
7a0b95b0 | 9757 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
d55e5bfc | 9758 | |
7a0b95b0 RD |
9759 | Pops up the given menu at the specified coordinates, relative to this window, |
9760 | and returns control when the user has dismissed the menu. If a menu item is | |
9761 | selected, the corresponding menu event is generated and will be processed as | |
9762 | usual. If the default position is given then the current position of the | |
9763 | mouse cursor will be used. | |
d55e5bfc RD |
9764 | """ |
9765 | return _core_.Window_PopupMenuXY(*args, **kwargs) | |
9766 | ||
9767 | def PopupMenu(*args, **kwargs): | |
9768 | """ | |
7a0b95b0 | 9769 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
d55e5bfc | 9770 | |
7a0b95b0 RD |
9771 | Pops up the given menu at the specified coordinates, relative to this window, |
9772 | and returns control when the user has dismissed the menu. If a menu item is | |
9773 | selected, the corresponding menu event is generated and will be processed as | |
9774 | usual. If the default position is given then the current position of the | |
9775 | mouse cursor will be used. | |
d55e5bfc RD |
9776 | """ |
9777 | return _core_.Window_PopupMenu(*args, **kwargs) | |
9778 | ||
9779 | def GetHandle(*args, **kwargs): | |
9780 | """ | |
9781 | GetHandle(self) -> long | |
9782 | ||
9783 | Returns the platform-specific handle (as a long integer) of the | |
9784 | physical window. Currently on wxMac it returns the handle of the | |
9785 | toplevel parent of the window. | |
9786 | """ | |
9787 | return _core_.Window_GetHandle(*args, **kwargs) | |
9788 | ||
629e65c2 RD |
9789 | def AssociateHandle(*args, **kwargs): |
9790 | """ | |
9791 | AssociateHandle(self, long handle) | |
9792 | ||
9793 | Associate the window with a new native handle | |
9794 | """ | |
9795 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
9796 | ||
9797 | def DissociateHandle(*args, **kwargs): | |
9798 | """ | |
9799 | DissociateHandle(self) | |
9800 | ||
9801 | Dissociate the current native handle from the window | |
9802 | """ | |
9803 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
9804 | ||
d55e5bfc RD |
9805 | def OnPaint(*args, **kwargs): |
9806 | """OnPaint(self, PaintEvent event)""" | |
9807 | return _core_.Window_OnPaint(*args, **kwargs) | |
9808 | ||
9809 | def HasScrollbar(*args, **kwargs): | |
9810 | """ | |
9811 | HasScrollbar(self, int orient) -> bool | |
9812 | ||
9813 | Does the window have the scrollbar for this orientation? | |
9814 | """ | |
9815 | return _core_.Window_HasScrollbar(*args, **kwargs) | |
9816 | ||
9817 | def SetScrollbar(*args, **kwargs): | |
9818 | """ | |
79fccf9d | 9819 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
d55e5bfc RD |
9820 | bool refresh=True) |
9821 | ||
9822 | Sets the scrollbar properties of a built-in scrollbar. | |
d55e5bfc RD |
9823 | """ |
9824 | return _core_.Window_SetScrollbar(*args, **kwargs) | |
9825 | ||
9826 | def SetScrollPos(*args, **kwargs): | |
9827 | """ | |
9828 | SetScrollPos(self, int orientation, int pos, bool refresh=True) | |
9829 | ||
9830 | Sets the position of one of the built-in scrollbars. | |
9831 | """ | |
9832 | return _core_.Window_SetScrollPos(*args, **kwargs) | |
9833 | ||
9834 | def GetScrollPos(*args, **kwargs): | |
9835 | """ | |
9836 | GetScrollPos(self, int orientation) -> int | |
9837 | ||
9838 | Returns the built-in scrollbar position. | |
9839 | """ | |
9840 | return _core_.Window_GetScrollPos(*args, **kwargs) | |
9841 | ||
9842 | def GetScrollThumb(*args, **kwargs): | |
9843 | """ | |
9844 | GetScrollThumb(self, int orientation) -> int | |
9845 | ||
9846 | Returns the built-in scrollbar thumb size. | |
9847 | """ | |
9848 | return _core_.Window_GetScrollThumb(*args, **kwargs) | |
9849 | ||
9850 | def GetScrollRange(*args, **kwargs): | |
9851 | """ | |
9852 | GetScrollRange(self, int orientation) -> int | |
9853 | ||
9854 | Returns the built-in scrollbar range. | |
9855 | """ | |
9856 | return _core_.Window_GetScrollRange(*args, **kwargs) | |
9857 | ||
9858 | def ScrollWindow(*args, **kwargs): | |
9859 | """ | |
9860 | ScrollWindow(self, int dx, int dy, Rect rect=None) | |
9861 | ||
9862 | Physically scrolls the pixels in the window and move child windows | |
9863 | accordingly. Use this function to optimise your scrolling | |
9864 | implementations, to minimise the area that must be redrawn. Note that | |
9865 | it is rarely required to call this function from a user program. | |
d55e5bfc RD |
9866 | """ |
9867 | return _core_.Window_ScrollWindow(*args, **kwargs) | |
9868 | ||
9869 | def ScrollLines(*args, **kwargs): | |
9870 | """ | |
9871 | ScrollLines(self, int lines) -> bool | |
9872 | ||
9873 | If the platform and window class supports it, scrolls the window by | |
9874 | the given number of lines down, if lines is positive, or up if lines | |
9875 | is negative. Returns True if the window was scrolled, False if it was | |
9876 | already on top/bottom and nothing was done. | |
9877 | """ | |
9878 | return _core_.Window_ScrollLines(*args, **kwargs) | |
9879 | ||
9880 | def ScrollPages(*args, **kwargs): | |
9881 | """ | |
9882 | ScrollPages(self, int pages) -> bool | |
9883 | ||
79fccf9d | 9884 | If the platform and window class supports it, scrolls the window by |
d55e5bfc RD |
9885 | the given number of pages down, if pages is positive, or up if pages |
9886 | is negative. Returns True if the window was scrolled, False if it was | |
9887 | already on top/bottom and nothing was done. | |
9888 | """ | |
9889 | return _core_.Window_ScrollPages(*args, **kwargs) | |
9890 | ||
9891 | def LineUp(*args, **kwargs): | |
9892 | """ | |
9893 | LineUp(self) -> bool | |
9894 | ||
9895 | This is just a wrapper for ScrollLines(-1). | |
9896 | """ | |
9897 | return _core_.Window_LineUp(*args, **kwargs) | |
9898 | ||
9899 | def LineDown(*args, **kwargs): | |
9900 | """ | |
9901 | LineDown(self) -> bool | |
9902 | ||
9903 | This is just a wrapper for ScrollLines(1). | |
9904 | """ | |
9905 | return _core_.Window_LineDown(*args, **kwargs) | |
9906 | ||
9907 | def PageUp(*args, **kwargs): | |
9908 | """ | |
9909 | PageUp(self) -> bool | |
9910 | ||
9911 | This is just a wrapper for ScrollPages(-1). | |
9912 | """ | |
9913 | return _core_.Window_PageUp(*args, **kwargs) | |
9914 | ||
9915 | def PageDown(*args, **kwargs): | |
9916 | """ | |
9917 | PageDown(self) -> bool | |
9918 | ||
9919 | This is just a wrapper for ScrollPages(1). | |
9920 | """ | |
9921 | return _core_.Window_PageDown(*args, **kwargs) | |
9922 | ||
9923 | def SetHelpText(*args, **kwargs): | |
9924 | """ | |
9925 | SetHelpText(self, String text) | |
9926 | ||
9927 | Sets the help text to be used as context-sensitive help for this | |
9928 | window. Note that the text is actually stored by the current | |
9929 | wxHelpProvider implementation, and not in the window object itself. | |
9930 | """ | |
9931 | return _core_.Window_SetHelpText(*args, **kwargs) | |
9932 | ||
9933 | def SetHelpTextForId(*args, **kwargs): | |
9934 | """ | |
9935 | SetHelpTextForId(self, String text) | |
9936 | ||
9937 | Associate this help text with all windows with the same id as this | |
9938 | one. | |
9939 | """ | |
9940 | return _core_.Window_SetHelpTextForId(*args, **kwargs) | |
9941 | ||
9942 | def GetHelpText(*args, **kwargs): | |
9943 | """ | |
9944 | GetHelpText(self) -> String | |
9945 | ||
9946 | Gets the help text to be used as context-sensitive help for this | |
9947 | window. Note that the text is actually stored by the current | |
9948 | wxHelpProvider implementation, and not in the window object itself. | |
9949 | """ | |
9950 | return _core_.Window_GetHelpText(*args, **kwargs) | |
9951 | ||
9952 | def SetToolTipString(*args, **kwargs): | |
9953 | """ | |
9954 | SetToolTipString(self, String tip) | |
9955 | ||
9956 | Attach a tooltip to the window. | |
9957 | """ | |
9958 | return _core_.Window_SetToolTipString(*args, **kwargs) | |
9959 | ||
9960 | def SetToolTip(*args, **kwargs): | |
9961 | """ | |
9962 | SetToolTip(self, ToolTip tip) | |
9963 | ||
9964 | Attach a tooltip to the window. | |
9965 | """ | |
9966 | return _core_.Window_SetToolTip(*args, **kwargs) | |
9967 | ||
9968 | def GetToolTip(*args, **kwargs): | |
9969 | """ | |
9970 | GetToolTip(self) -> ToolTip | |
9971 | ||
9972 | get the associated tooltip or None if none | |
9973 | """ | |
9974 | return _core_.Window_GetToolTip(*args, **kwargs) | |
9975 | ||
9976 | def SetDropTarget(*args, **kwargs): | |
9977 | """ | |
9978 | SetDropTarget(self, DropTarget dropTarget) | |
9979 | ||
9980 | Associates a drop target with this window. If the window already has | |
9981 | a drop target, it is deleted. | |
9982 | """ | |
9983 | return _core_.Window_SetDropTarget(*args, **kwargs) | |
9984 | ||
9985 | def GetDropTarget(*args, **kwargs): | |
9986 | """ | |
9987 | GetDropTarget(self) -> DropTarget | |
9988 | ||
9989 | Returns the associated drop target, which may be None. | |
9990 | """ | |
9991 | return _core_.Window_GetDropTarget(*args, **kwargs) | |
9992 | ||
9993 | def DragAcceptFiles(*args, **kwargs): | |
9994 | """ | |
9995 | DragAcceptFiles(self, bool accept) | |
9996 | ||
9997 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
5ba5649b | 9998 | Only functional on Windows. |
d55e5bfc RD |
9999 | """ |
10000 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
10001 | ||
10002 | def SetConstraints(*args, **kwargs): | |
10003 | """ | |
10004 | SetConstraints(self, LayoutConstraints constraints) | |
10005 | ||
10006 | Sets the window to have the given layout constraints. If an existing | |
10007 | layout constraints object is already owned by the window, it will be | |
10008 | deleted. Pass None to disassociate and delete the window's current | |
10009 | constraints. | |
10010 | ||
10011 | You must call SetAutoLayout to tell a window to use the constraints | |
10012 | automatically in its default EVT_SIZE handler; otherwise, you must | |
10013 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
10014 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
10015 | effect. | |
10016 | """ | |
10017 | return _core_.Window_SetConstraints(*args, **kwargs) | |
10018 | ||
10019 | def GetConstraints(*args, **kwargs): | |
10020 | """ | |
10021 | GetConstraints(self) -> LayoutConstraints | |
10022 | ||
10023 | Returns a pointer to the window's layout constraints, or None if there | |
10024 | are none. | |
10025 | """ | |
10026 | return _core_.Window_GetConstraints(*args, **kwargs) | |
10027 | ||
10028 | def SetAutoLayout(*args, **kwargs): | |
10029 | """ | |
10030 | SetAutoLayout(self, bool autoLayout) | |
10031 | ||
10032 | Determines whether the Layout function will be called automatically | |
10033 | when the window is resized. It is called implicitly by SetSizer but | |
10034 | if you use SetConstraints you should call it manually or otherwise the | |
10035 | window layout won't be correctly updated when its size changes. | |
10036 | """ | |
10037 | return _core_.Window_SetAutoLayout(*args, **kwargs) | |
10038 | ||
10039 | def GetAutoLayout(*args, **kwargs): | |
10040 | """ | |
10041 | GetAutoLayout(self) -> bool | |
10042 | ||
10043 | Returns the current autoLayout setting | |
10044 | """ | |
10045 | return _core_.Window_GetAutoLayout(*args, **kwargs) | |
10046 | ||
10047 | def Layout(*args, **kwargs): | |
10048 | """ | |
10049 | Layout(self) -> bool | |
10050 | ||
10051 | Invokes the constraint-based layout algorithm or the sizer-based | |
10052 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
10053 | this function gets called automatically by the default EVT_SIZE | |
10054 | handler when the window is resized. | |
10055 | """ | |
10056 | return _core_.Window_Layout(*args, **kwargs) | |
10057 | ||
10058 | def SetSizer(*args, **kwargs): | |
10059 | """ | |
10060 | SetSizer(self, Sizer sizer, bool deleteOld=True) | |
10061 | ||
10062 | Sets the window to have the given layout sizer. The window will then | |
10063 | own the object, and will take care of its deletion. If an existing | |
10064 | layout sizer object is already owned by the window, it will be deleted | |
10065 | if the deleteOld parameter is true. Note that this function will also | |
10066 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
ae8162c8 | 10067 | non-None, and False otherwise. |
d55e5bfc RD |
10068 | """ |
10069 | return _core_.Window_SetSizer(*args, **kwargs) | |
10070 | ||
10071 | def SetSizerAndFit(*args, **kwargs): | |
10072 | """ | |
10073 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) | |
10074 | ||
10075 | The same as SetSizer, except it also sets the size hints for the | |
10076 | window based on the sizer's minimum size. | |
10077 | """ | |
10078 | return _core_.Window_SetSizerAndFit(*args, **kwargs) | |
10079 | ||
10080 | def GetSizer(*args, **kwargs): | |
10081 | """ | |
10082 | GetSizer(self) -> Sizer | |
10083 | ||
10084 | Return the sizer associated with the window by a previous call to | |
10085 | SetSizer or None if there isn't one. | |
10086 | """ | |
10087 | return _core_.Window_GetSizer(*args, **kwargs) | |
10088 | ||
10089 | def SetContainingSizer(*args, **kwargs): | |
10090 | """ | |
10091 | SetContainingSizer(self, Sizer sizer) | |
10092 | ||
10093 | This normally does not need to be called by application code. It is | |
10094 | called internally when a window is added to a sizer, and is used so | |
10095 | the window can remove itself from the sizer when it is destroyed. | |
10096 | """ | |
10097 | return _core_.Window_SetContainingSizer(*args, **kwargs) | |
10098 | ||
10099 | def GetContainingSizer(*args, **kwargs): | |
10100 | """ | |
10101 | GetContainingSizer(self) -> Sizer | |
10102 | ||
10103 | Return the sizer that this window is a member of, if any, otherwise None. | |
10104 | """ | |
10105 | return _core_.Window_GetContainingSizer(*args, **kwargs) | |
10106 | ||
10107 | def InheritAttributes(*args, **kwargs): | |
10108 | """ | |
10109 | InheritAttributes(self) | |
10110 | ||
79fccf9d RD |
10111 | This function is (or should be, in case of custom controls) called |
10112 | during window creation to intelligently set up the window visual | |
10113 | attributes, that is the font and the foreground and background | |
10114 | colours. | |
10115 | ||
10116 | By 'intelligently' the following is meant: by default, all windows use | |
10117 | their own default attributes. However if some of the parent's | |
10118 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 10119 | SetOwnFont) and if the corresponding attribute hadn't been |
79fccf9d RD |
10120 | explicitly set for this window itself, then this window takes the same |
10121 | value as used by the parent. In addition, if the window overrides | |
10122 | ShouldInheritColours to return false, the colours will not be changed | |
10123 | no matter what and only the font might. | |
10124 | ||
ec9b55ca RD |
10125 | This rather complicated logic is necessary in order to accommodate the |
10126 | different usage scenarios. The most common one is when all default | |
79fccf9d RD |
10127 | attributes are used and in this case, nothing should be inherited as |
10128 | in modern GUIs different controls use different fonts (and colours) | |
10129 | than their siblings so they can't inherit the same value from the | |
10130 | parent. However it was also deemed desirable to allow to simply change | |
10131 | the attributes of all children at once by just changing the font or | |
10132 | colour of their common parent, hence in this case we do inherit the | |
10133 | parents attributes. | |
10134 | ||
d55e5bfc RD |
10135 | """ |
10136 | return _core_.Window_InheritAttributes(*args, **kwargs) | |
10137 | ||
10138 | def ShouldInheritColours(*args, **kwargs): | |
10139 | """ | |
10140 | ShouldInheritColours(self) -> bool | |
10141 | ||
10142 | Return true from here to allow the colours of this window to be | |
79fccf9d RD |
10143 | changed by InheritAttributes, returning false forbids inheriting them |
10144 | from the parent window. | |
d55e5bfc | 10145 | |
79fccf9d RD |
10146 | The base class version returns false, but this method is overridden in |
10147 | wxControl where it returns true. | |
d55e5bfc RD |
10148 | """ |
10149 | return _core_.Window_ShouldInheritColours(*args, **kwargs) | |
10150 | ||
10151 | def PostCreate(self, pre): | |
10152 | """ | |
10153 | Phase 3 of the 2-phase create <wink!> | |
10154 | Call this method after precreating the window with the 2-phase create method. | |
10155 | """ | |
10156 | self.this = pre.this | |
10157 | self.thisown = pre.thisown | |
10158 | pre.thisown = 0 | |
10159 | if hasattr(self, '_setOORInfo'): | |
10160 | self._setOORInfo(self) | |
10161 | if hasattr(self, '_setCallbackInfo'): | |
10162 | self._setCallbackInfo(self, self.__class__) | |
10163 | ||
10164 | ||
10165 | class WindowPtr(Window): | |
10166 | def __init__(self, this): | |
10167 | self.this = this | |
10168 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10169 | self.__class__ = Window | |
10170 | _core_.Window_swigregister(WindowPtr) | |
10171 | ||
10172 | def PreWindow(*args, **kwargs): | |
10173 | """ | |
10174 | PreWindow() -> Window | |
10175 | ||
10176 | Precreate a Window for 2-phase creation. | |
10177 | """ | |
10178 | val = _core_.new_PreWindow(*args, **kwargs) | |
10179 | val.thisown = 1 | |
10180 | return val | |
10181 | ||
10182 | def Window_NewControlId(*args, **kwargs): | |
10183 | """ | |
10184 | Window_NewControlId() -> int | |
10185 | ||
10186 | Generate a control id for the controls which were not given one. | |
10187 | """ | |
10188 | return _core_.Window_NewControlId(*args, **kwargs) | |
10189 | ||
10190 | def Window_NextControlId(*args, **kwargs): | |
10191 | """ | |
10192 | Window_NextControlId(int winid) -> int | |
10193 | ||
10194 | Get the id of the control following the one with the given | |
79fccf9d | 10195 | autogenerated) id |
d55e5bfc RD |
10196 | """ |
10197 | return _core_.Window_NextControlId(*args, **kwargs) | |
10198 | ||
10199 | def Window_PrevControlId(*args, **kwargs): | |
10200 | """ | |
10201 | Window_PrevControlId(int winid) -> int | |
10202 | ||
10203 | Get the id of the control preceding the one with the given | |
79fccf9d | 10204 | autogenerated) id |
d55e5bfc RD |
10205 | """ |
10206 | return _core_.Window_PrevControlId(*args, **kwargs) | |
10207 | ||
10208 | def Window_FindFocus(*args, **kwargs): | |
10209 | """ | |
10210 | Window_FindFocus() -> Window | |
10211 | ||
10212 | Returns the window or control that currently has the keyboard focus, | |
10213 | or None. | |
10214 | """ | |
10215 | return _core_.Window_FindFocus(*args, **kwargs) | |
10216 | ||
10217 | def Window_GetCapture(*args, **kwargs): | |
10218 | """ | |
10219 | Window_GetCapture() -> Window | |
10220 | ||
10221 | Returns the window which currently captures the mouse or None | |
10222 | """ | |
10223 | return _core_.Window_GetCapture(*args, **kwargs) | |
10224 | ||
10225 | def Window_GetClassDefaultAttributes(*args, **kwargs): | |
10226 | """ | |
10227 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
10228 | ||
79fccf9d RD |
10229 | Get the default attributes for this class. This is useful if you want |
10230 | to use the same font or colour in your own control as in a standard | |
10231 | control -- which is a much better idea than hard coding specific | |
caef1a4d RD |
10232 | colours or fonts which might look completely out of place on the |
10233 | user's system, especially if it uses themes. | |
d55e5bfc RD |
10234 | |
10235 | The variant parameter is only relevant under Mac currently and is | |
79fccf9d | 10236 | ignore under other platforms. Under Mac, it will change the size of |
caef1a4d RD |
10237 | the returned font. See `wx.Window.SetWindowVariant` for more about |
10238 | this. | |
d55e5bfc RD |
10239 | """ |
10240 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) | |
10241 | ||
10242 | def DLG_PNT(win, point_or_x, y=None): | |
10243 | """ | |
10244 | Convenience function for converting a Point or (x,y) in | |
10245 | dialog units to pixel units. | |
10246 | """ | |
10247 | if y is None: | |
10248 | return win.ConvertDialogPointToPixels(point_or_x) | |
10249 | else: | |
10250 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) | |
10251 | ||
10252 | def DLG_SZE(win, size_width, height=None): | |
10253 | """ | |
10254 | Convenience function for converting a Size or (w,h) in | |
10255 | dialog units to pixel units. | |
10256 | """ | |
10257 | if height is None: | |
10258 | return win.ConvertDialogSizeToPixels(size_width) | |
10259 | else: | |
10260 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) | |
10261 | ||
10262 | ||
10263 | def FindWindowById(*args, **kwargs): | |
10264 | """ | |
10265 | FindWindowById(long id, Window parent=None) -> Window | |
10266 | ||
10267 | Find the first window in the application with the given id. If parent | |
10268 | is None, the search will start from all top-level frames and dialog | |
10269 | boxes; if non-None, the search will be limited to the given window | |
10270 | hierarchy. The search is recursive in both cases. | |
10271 | """ | |
10272 | return _core_.FindWindowById(*args, **kwargs) | |
10273 | ||
10274 | def FindWindowByName(*args, **kwargs): | |
10275 | """ | |
10276 | FindWindowByName(String name, Window parent=None) -> Window | |
10277 | ||
10278 | Find a window by its name (as given in a window constructor or Create | |
10279 | function call). If parent is None, the search will start from all | |
10280 | top-level frames and dialog boxes; if non-None, the search will be | |
10281 | limited to the given window hierarchy. The search is recursive in both | |
10282 | cases. | |
10283 | ||
10284 | If no window with such name is found, wx.FindWindowByLabel is called. | |
10285 | """ | |
10286 | return _core_.FindWindowByName(*args, **kwargs) | |
10287 | ||
10288 | def FindWindowByLabel(*args, **kwargs): | |
10289 | """ | |
10290 | FindWindowByLabel(String label, Window parent=None) -> Window | |
10291 | ||
10292 | Find a window by its label. Depending on the type of window, the label | |
10293 | may be a window title or panel item label. If parent is None, the | |
10294 | search will start from all top-level frames and dialog boxes; if | |
10295 | non-None, the search will be limited to the given window | |
10296 | hierarchy. The search is recursive in both cases. | |
10297 | """ | |
10298 | return _core_.FindWindowByLabel(*args, **kwargs) | |
10299 | ||
10300 | def Window_FromHWND(*args, **kwargs): | |
10301 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" | |
10302 | return _core_.Window_FromHWND(*args, **kwargs) | |
3215336e RD |
10303 | |
10304 | def GetTopLevelWindows(*args, **kwargs): | |
10305 | """ | |
10306 | GetTopLevelWindows() -> PyObject | |
10307 | ||
10308 | Returns a list of the the application's top-level windows, (frames, | |
10309 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
10310 | by wxWidgets, and so it is only valid as long as no top-level windows | |
10311 | are closed or new top-level windows are created. | |
10312 | ||
10313 | """ | |
10314 | return _core_.GetTopLevelWindows(*args, **kwargs) | |
d55e5bfc RD |
10315 | #--------------------------------------------------------------------------- |
10316 | ||
10317 | class Validator(EvtHandler): | |
093d3ff1 | 10318 | """Proxy of C++ Validator class""" |
d55e5bfc RD |
10319 | def __repr__(self): |
10320 | return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10321 | def __init__(self, *args, **kwargs): | |
10322 | """__init__(self) -> Validator""" | |
10323 | newobj = _core_.new_Validator(*args, **kwargs) | |
10324 | self.this = newobj.this | |
10325 | self.thisown = 1 | |
10326 | del newobj.thisown | |
10327 | self._setOORInfo(self) | |
10328 | ||
10329 | def Clone(*args, **kwargs): | |
10330 | """Clone(self) -> Validator""" | |
10331 | return _core_.Validator_Clone(*args, **kwargs) | |
10332 | ||
10333 | def Validate(*args, **kwargs): | |
10334 | """Validate(self, Window parent) -> bool""" | |
10335 | return _core_.Validator_Validate(*args, **kwargs) | |
10336 | ||
10337 | def TransferToWindow(*args, **kwargs): | |
10338 | """TransferToWindow(self) -> bool""" | |
10339 | return _core_.Validator_TransferToWindow(*args, **kwargs) | |
10340 | ||
10341 | def TransferFromWindow(*args, **kwargs): | |
10342 | """TransferFromWindow(self) -> bool""" | |
10343 | return _core_.Validator_TransferFromWindow(*args, **kwargs) | |
10344 | ||
10345 | def GetWindow(*args, **kwargs): | |
10346 | """GetWindow(self) -> Window""" | |
10347 | return _core_.Validator_GetWindow(*args, **kwargs) | |
10348 | ||
10349 | def SetWindow(*args, **kwargs): | |
10350 | """SetWindow(self, Window window)""" | |
10351 | return _core_.Validator_SetWindow(*args, **kwargs) | |
10352 | ||
10353 | def IsSilent(*args, **kwargs): | |
c24da6d6 | 10354 | """IsSilent() -> bool""" |
d55e5bfc RD |
10355 | return _core_.Validator_IsSilent(*args, **kwargs) |
10356 | ||
10357 | IsSilent = staticmethod(IsSilent) | |
10358 | def SetBellOnError(*args, **kwargs): | |
c24da6d6 | 10359 | """SetBellOnError(int doIt=True)""" |
d55e5bfc RD |
10360 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
10361 | ||
10362 | SetBellOnError = staticmethod(SetBellOnError) | |
10363 | ||
10364 | class ValidatorPtr(Validator): | |
10365 | def __init__(self, this): | |
10366 | self.this = this | |
10367 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10368 | self.__class__ = Validator | |
10369 | _core_.Validator_swigregister(ValidatorPtr) | |
10370 | ||
10371 | def Validator_IsSilent(*args, **kwargs): | |
10372 | """Validator_IsSilent() -> bool""" | |
10373 | return _core_.Validator_IsSilent(*args, **kwargs) | |
10374 | ||
10375 | def Validator_SetBellOnError(*args, **kwargs): | |
10376 | """Validator_SetBellOnError(int doIt=True)""" | |
10377 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
10378 | ||
10379 | class PyValidator(Validator): | |
093d3ff1 | 10380 | """Proxy of C++ PyValidator class""" |
d55e5bfc RD |
10381 | def __repr__(self): |
10382 | return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10383 | def __init__(self, *args, **kwargs): | |
10384 | """__init__(self) -> PyValidator""" | |
10385 | newobj = _core_.new_PyValidator(*args, **kwargs) | |
10386 | self.this = newobj.this | |
10387 | self.thisown = 1 | |
10388 | del newobj.thisown | |
10389 | ||
10390 | self._setCallbackInfo(self, PyValidator, 1) | |
10391 | self._setOORInfo(self) | |
10392 | ||
10393 | def _setCallbackInfo(*args, **kwargs): | |
10394 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" | |
10395 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) | |
10396 | ||
10397 | ||
10398 | class PyValidatorPtr(PyValidator): | |
10399 | def __init__(self, this): | |
10400 | self.this = this | |
10401 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10402 | self.__class__ = PyValidator | |
10403 | _core_.PyValidator_swigregister(PyValidatorPtr) | |
10404 | ||
10405 | #--------------------------------------------------------------------------- | |
10406 | ||
10407 | class Menu(EvtHandler): | |
093d3ff1 | 10408 | """Proxy of C++ Menu class""" |
d55e5bfc RD |
10409 | def __repr__(self): |
10410 | return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10411 | def __init__(self, *args, **kwargs): | |
10412 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" | |
10413 | newobj = _core_.new_Menu(*args, **kwargs) | |
10414 | self.this = newobj.this | |
10415 | self.thisown = 1 | |
10416 | del newobj.thisown | |
10417 | self._setOORInfo(self) | |
10418 | ||
10419 | def Append(*args, **kwargs): | |
10420 | """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" | |
10421 | return _core_.Menu_Append(*args, **kwargs) | |
10422 | ||
10423 | def AppendSeparator(*args, **kwargs): | |
10424 | """AppendSeparator(self) -> MenuItem""" | |
10425 | return _core_.Menu_AppendSeparator(*args, **kwargs) | |
10426 | ||
10427 | def AppendCheckItem(*args, **kwargs): | |
10428 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
10429 | return _core_.Menu_AppendCheckItem(*args, **kwargs) | |
10430 | ||
10431 | def AppendRadioItem(*args, **kwargs): | |
10432 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
10433 | return _core_.Menu_AppendRadioItem(*args, **kwargs) | |
10434 | ||
10435 | def AppendMenu(*args, **kwargs): | |
10436 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
10437 | return _core_.Menu_AppendMenu(*args, **kwargs) | |
10438 | ||
10439 | def AppendItem(*args, **kwargs): | |
10440 | """AppendItem(self, MenuItem item) -> MenuItem""" | |
10441 | return _core_.Menu_AppendItem(*args, **kwargs) | |
10442 | ||
10443 | def Break(*args, **kwargs): | |
10444 | """Break(self)""" | |
10445 | return _core_.Menu_Break(*args, **kwargs) | |
10446 | ||
10447 | def InsertItem(*args, **kwargs): | |
10448 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" | |
10449 | return _core_.Menu_InsertItem(*args, **kwargs) | |
10450 | ||
10451 | def Insert(*args, **kwargs): | |
10452 | """ | |
10453 | Insert(self, size_t pos, int id, String text, String help=EmptyString, | |
10454 | int kind=ITEM_NORMAL) -> MenuItem | |
10455 | """ | |
10456 | return _core_.Menu_Insert(*args, **kwargs) | |
10457 | ||
10458 | def InsertSeparator(*args, **kwargs): | |
10459 | """InsertSeparator(self, size_t pos) -> MenuItem""" | |
10460 | return _core_.Menu_InsertSeparator(*args, **kwargs) | |
10461 | ||
10462 | def InsertCheckItem(*args, **kwargs): | |
10463 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" | |
10464 | return _core_.Menu_InsertCheckItem(*args, **kwargs) | |
10465 | ||
10466 | def InsertRadioItem(*args, **kwargs): | |
10467 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" | |
10468 | return _core_.Menu_InsertRadioItem(*args, **kwargs) | |
10469 | ||
10470 | def InsertMenu(*args, **kwargs): | |
10471 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
10472 | return _core_.Menu_InsertMenu(*args, **kwargs) | |
10473 | ||
10474 | def PrependItem(*args, **kwargs): | |
10475 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
10476 | return _core_.Menu_PrependItem(*args, **kwargs) | |
10477 | ||
10478 | def Prepend(*args, **kwargs): | |
10479 | """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" | |
10480 | return _core_.Menu_Prepend(*args, **kwargs) | |
10481 | ||
10482 | def PrependSeparator(*args, **kwargs): | |
10483 | """PrependSeparator(self) -> MenuItem""" | |
10484 | return _core_.Menu_PrependSeparator(*args, **kwargs) | |
10485 | ||
10486 | def PrependCheckItem(*args, **kwargs): | |
10487 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
10488 | return _core_.Menu_PrependCheckItem(*args, **kwargs) | |
10489 | ||
10490 | def PrependRadioItem(*args, **kwargs): | |
10491 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
10492 | return _core_.Menu_PrependRadioItem(*args, **kwargs) | |
10493 | ||
10494 | def PrependMenu(*args, **kwargs): | |
10495 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
10496 | return _core_.Menu_PrependMenu(*args, **kwargs) | |
10497 | ||
10498 | def Remove(*args, **kwargs): | |
10499 | """Remove(self, int id) -> MenuItem""" | |
10500 | return _core_.Menu_Remove(*args, **kwargs) | |
10501 | ||
10502 | def RemoveItem(*args, **kwargs): | |
10503 | """RemoveItem(self, MenuItem item) -> MenuItem""" | |
10504 | return _core_.Menu_RemoveItem(*args, **kwargs) | |
10505 | ||
10506 | def Delete(*args, **kwargs): | |
10507 | """Delete(self, int id) -> bool""" | |
10508 | return _core_.Menu_Delete(*args, **kwargs) | |
10509 | ||
10510 | def DeleteItem(*args, **kwargs): | |
10511 | """DeleteItem(self, MenuItem item) -> bool""" | |
10512 | return _core_.Menu_DeleteItem(*args, **kwargs) | |
10513 | ||
10514 | def Destroy(*args, **kwargs): | |
10515 | """ | |
10516 | Destroy(self) | |
10517 | ||
10518 | Deletes the C++ object this Python object is a proxy for. | |
10519 | """ | |
10520 | return _core_.Menu_Destroy(*args, **kwargs) | |
10521 | ||
10522 | def DestroyId(*args, **kwargs): | |
10523 | """ | |
10524 | DestroyId(self, int id) -> bool | |
10525 | ||
10526 | Deletes the C++ object this Python object is a proxy for. | |
10527 | """ | |
10528 | return _core_.Menu_DestroyId(*args, **kwargs) | |
10529 | ||
10530 | def DestroyItem(*args, **kwargs): | |
10531 | """ | |
10532 | DestroyItem(self, MenuItem item) -> bool | |
10533 | ||
10534 | Deletes the C++ object this Python object is a proxy for. | |
10535 | """ | |
10536 | return _core_.Menu_DestroyItem(*args, **kwargs) | |
10537 | ||
10538 | def GetMenuItemCount(*args, **kwargs): | |
10539 | """GetMenuItemCount(self) -> size_t""" | |
10540 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) | |
10541 | ||
10542 | def GetMenuItems(*args, **kwargs): | |
10543 | """GetMenuItems(self) -> PyObject""" | |
10544 | return _core_.Menu_GetMenuItems(*args, **kwargs) | |
10545 | ||
10546 | def FindItem(*args, **kwargs): | |
10547 | """FindItem(self, String item) -> int""" | |
10548 | return _core_.Menu_FindItem(*args, **kwargs) | |
10549 | ||
10550 | def FindItemById(*args, **kwargs): | |
10551 | """FindItemById(self, int id) -> MenuItem""" | |
10552 | return _core_.Menu_FindItemById(*args, **kwargs) | |
10553 | ||
10554 | def FindItemByPosition(*args, **kwargs): | |
10555 | """FindItemByPosition(self, size_t position) -> MenuItem""" | |
10556 | return _core_.Menu_FindItemByPosition(*args, **kwargs) | |
10557 | ||
10558 | def Enable(*args, **kwargs): | |
10559 | """Enable(self, int id, bool enable)""" | |
10560 | return _core_.Menu_Enable(*args, **kwargs) | |
10561 | ||
10562 | def IsEnabled(*args, **kwargs): | |
10563 | """IsEnabled(self, int id) -> bool""" | |
10564 | return _core_.Menu_IsEnabled(*args, **kwargs) | |
10565 | ||
10566 | def Check(*args, **kwargs): | |
10567 | """Check(self, int id, bool check)""" | |
10568 | return _core_.Menu_Check(*args, **kwargs) | |
10569 | ||
10570 | def IsChecked(*args, **kwargs): | |
10571 | """IsChecked(self, int id) -> bool""" | |
10572 | return _core_.Menu_IsChecked(*args, **kwargs) | |
10573 | ||
10574 | def SetLabel(*args, **kwargs): | |
10575 | """SetLabel(self, int id, String label)""" | |
10576 | return _core_.Menu_SetLabel(*args, **kwargs) | |
10577 | ||
10578 | def GetLabel(*args, **kwargs): | |
10579 | """GetLabel(self, int id) -> String""" | |
10580 | return _core_.Menu_GetLabel(*args, **kwargs) | |
10581 | ||
10582 | def SetHelpString(*args, **kwargs): | |
10583 | """SetHelpString(self, int id, String helpString)""" | |
10584 | return _core_.Menu_SetHelpString(*args, **kwargs) | |
10585 | ||
10586 | def GetHelpString(*args, **kwargs): | |
10587 | """GetHelpString(self, int id) -> String""" | |
10588 | return _core_.Menu_GetHelpString(*args, **kwargs) | |
10589 | ||
10590 | def SetTitle(*args, **kwargs): | |
10591 | """SetTitle(self, String title)""" | |
10592 | return _core_.Menu_SetTitle(*args, **kwargs) | |
10593 | ||
10594 | def GetTitle(*args, **kwargs): | |
10595 | """GetTitle(self) -> String""" | |
10596 | return _core_.Menu_GetTitle(*args, **kwargs) | |
10597 | ||
10598 | def SetEventHandler(*args, **kwargs): | |
10599 | """SetEventHandler(self, EvtHandler handler)""" | |
10600 | return _core_.Menu_SetEventHandler(*args, **kwargs) | |
10601 | ||
10602 | def GetEventHandler(*args, **kwargs): | |
10603 | """GetEventHandler(self) -> EvtHandler""" | |
10604 | return _core_.Menu_GetEventHandler(*args, **kwargs) | |
10605 | ||
10606 | def SetInvokingWindow(*args, **kwargs): | |
10607 | """SetInvokingWindow(self, Window win)""" | |
10608 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) | |
10609 | ||
10610 | def GetInvokingWindow(*args, **kwargs): | |
10611 | """GetInvokingWindow(self) -> Window""" | |
10612 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) | |
10613 | ||
10614 | def GetStyle(*args, **kwargs): | |
10615 | """GetStyle(self) -> long""" | |
10616 | return _core_.Menu_GetStyle(*args, **kwargs) | |
10617 | ||
10618 | def UpdateUI(*args, **kwargs): | |
10619 | """UpdateUI(self, EvtHandler source=None)""" | |
10620 | return _core_.Menu_UpdateUI(*args, **kwargs) | |
10621 | ||
10622 | def GetMenuBar(*args, **kwargs): | |
10623 | """GetMenuBar(self) -> MenuBar""" | |
10624 | return _core_.Menu_GetMenuBar(*args, **kwargs) | |
10625 | ||
10626 | def Attach(*args, **kwargs): | |
10627 | """Attach(self, wxMenuBarBase menubar)""" | |
10628 | return _core_.Menu_Attach(*args, **kwargs) | |
10629 | ||
10630 | def Detach(*args, **kwargs): | |
10631 | """Detach(self)""" | |
10632 | return _core_.Menu_Detach(*args, **kwargs) | |
10633 | ||
10634 | def IsAttached(*args, **kwargs): | |
10635 | """IsAttached(self) -> bool""" | |
10636 | return _core_.Menu_IsAttached(*args, **kwargs) | |
10637 | ||
10638 | def SetParent(*args, **kwargs): | |
10639 | """SetParent(self, Menu parent)""" | |
10640 | return _core_.Menu_SetParent(*args, **kwargs) | |
10641 | ||
10642 | def GetParent(*args, **kwargs): | |
10643 | """GetParent(self) -> Menu""" | |
10644 | return _core_.Menu_GetParent(*args, **kwargs) | |
10645 | ||
10646 | ||
10647 | class MenuPtr(Menu): | |
10648 | def __init__(self, this): | |
10649 | self.this = this | |
10650 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10651 | self.__class__ = Menu | |
10652 | _core_.Menu_swigregister(MenuPtr) | |
10653 | DefaultValidator = cvar.DefaultValidator | |
10654 | ||
10655 | #--------------------------------------------------------------------------- | |
10656 | ||
10657 | class MenuBar(Window): | |
093d3ff1 | 10658 | """Proxy of C++ MenuBar class""" |
d55e5bfc RD |
10659 | def __repr__(self): |
10660 | return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10661 | def __init__(self, *args, **kwargs): | |
10662 | """__init__(self, long style=0) -> MenuBar""" | |
10663 | newobj = _core_.new_MenuBar(*args, **kwargs) | |
10664 | self.this = newobj.this | |
10665 | self.thisown = 1 | |
10666 | del newobj.thisown | |
10667 | self._setOORInfo(self) | |
10668 | ||
10669 | def Append(*args, **kwargs): | |
10670 | """Append(self, Menu menu, String title) -> bool""" | |
10671 | return _core_.MenuBar_Append(*args, **kwargs) | |
10672 | ||
10673 | def Insert(*args, **kwargs): | |
10674 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" | |
10675 | return _core_.MenuBar_Insert(*args, **kwargs) | |
10676 | ||
10677 | def GetMenuCount(*args, **kwargs): | |
10678 | """GetMenuCount(self) -> size_t""" | |
10679 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) | |
10680 | ||
10681 | def GetMenu(*args, **kwargs): | |
10682 | """GetMenu(self, size_t pos) -> Menu""" | |
10683 | return _core_.MenuBar_GetMenu(*args, **kwargs) | |
10684 | ||
10685 | def Replace(*args, **kwargs): | |
10686 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" | |
10687 | return _core_.MenuBar_Replace(*args, **kwargs) | |
10688 | ||
10689 | def Remove(*args, **kwargs): | |
10690 | """Remove(self, size_t pos) -> Menu""" | |
10691 | return _core_.MenuBar_Remove(*args, **kwargs) | |
10692 | ||
10693 | def EnableTop(*args, **kwargs): | |
10694 | """EnableTop(self, size_t pos, bool enable)""" | |
10695 | return _core_.MenuBar_EnableTop(*args, **kwargs) | |
10696 | ||
10697 | def IsEnabledTop(*args, **kwargs): | |
10698 | """IsEnabledTop(self, size_t pos) -> bool""" | |
10699 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) | |
10700 | ||
10701 | def SetLabelTop(*args, **kwargs): | |
10702 | """SetLabelTop(self, size_t pos, String label)""" | |
10703 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) | |
10704 | ||
10705 | def GetLabelTop(*args, **kwargs): | |
10706 | """GetLabelTop(self, size_t pos) -> String""" | |
10707 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) | |
10708 | ||
10709 | def FindMenuItem(*args, **kwargs): | |
10710 | """FindMenuItem(self, String menu, String item) -> int""" | |
10711 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) | |
10712 | ||
10713 | def FindItemById(*args, **kwargs): | |
10714 | """FindItemById(self, int id) -> MenuItem""" | |
10715 | return _core_.MenuBar_FindItemById(*args, **kwargs) | |
10716 | ||
10717 | def FindMenu(*args, **kwargs): | |
10718 | """FindMenu(self, String title) -> int""" | |
10719 | return _core_.MenuBar_FindMenu(*args, **kwargs) | |
10720 | ||
10721 | def Enable(*args, **kwargs): | |
10722 | """Enable(self, int id, bool enable)""" | |
10723 | return _core_.MenuBar_Enable(*args, **kwargs) | |
10724 | ||
10725 | def Check(*args, **kwargs): | |
10726 | """Check(self, int id, bool check)""" | |
10727 | return _core_.MenuBar_Check(*args, **kwargs) | |
10728 | ||
10729 | def IsChecked(*args, **kwargs): | |
10730 | """IsChecked(self, int id) -> bool""" | |
10731 | return _core_.MenuBar_IsChecked(*args, **kwargs) | |
10732 | ||
10733 | def IsEnabled(*args, **kwargs): | |
10734 | """IsEnabled(self, int id) -> bool""" | |
10735 | return _core_.MenuBar_IsEnabled(*args, **kwargs) | |
10736 | ||
10737 | def SetLabel(*args, **kwargs): | |
10738 | """SetLabel(self, int id, String label)""" | |
10739 | return _core_.MenuBar_SetLabel(*args, **kwargs) | |
10740 | ||
10741 | def GetLabel(*args, **kwargs): | |
10742 | """GetLabel(self, int id) -> String""" | |
10743 | return _core_.MenuBar_GetLabel(*args, **kwargs) | |
10744 | ||
10745 | def SetHelpString(*args, **kwargs): | |
10746 | """SetHelpString(self, int id, String helpString)""" | |
10747 | return _core_.MenuBar_SetHelpString(*args, **kwargs) | |
10748 | ||
10749 | def GetHelpString(*args, **kwargs): | |
10750 | """GetHelpString(self, int id) -> String""" | |
10751 | return _core_.MenuBar_GetHelpString(*args, **kwargs) | |
10752 | ||
10753 | def GetFrame(*args, **kwargs): | |
10754 | """GetFrame(self) -> wxFrame""" | |
10755 | return _core_.MenuBar_GetFrame(*args, **kwargs) | |
10756 | ||
10757 | def IsAttached(*args, **kwargs): | |
10758 | """IsAttached(self) -> bool""" | |
10759 | return _core_.MenuBar_IsAttached(*args, **kwargs) | |
10760 | ||
10761 | def Attach(*args, **kwargs): | |
10762 | """Attach(self, wxFrame frame)""" | |
10763 | return _core_.MenuBar_Attach(*args, **kwargs) | |
10764 | ||
10765 | def Detach(*args, **kwargs): | |
10766 | """Detach(self)""" | |
10767 | return _core_.MenuBar_Detach(*args, **kwargs) | |
10768 | ||
db67f999 RD |
10769 | def SetAutoWindowMenu(*args, **kwargs): |
10770 | """SetAutoWindowMenu(bool enable)""" | |
10771 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10772 | ||
10773 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
10774 | def GetAutoWindowMenu(*args, **kwargs): | |
10775 | """GetAutoWindowMenu() -> bool""" | |
10776 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10777 | ||
10778 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
d55e5bfc RD |
10779 | |
10780 | class MenuBarPtr(MenuBar): | |
10781 | def __init__(self, this): | |
10782 | self.this = this | |
10783 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10784 | self.__class__ = MenuBar | |
10785 | _core_.MenuBar_swigregister(MenuBarPtr) | |
10786 | ||
db67f999 RD |
10787 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
10788 | """MenuBar_SetAutoWindowMenu(bool enable)""" | |
10789 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10790 | ||
10791 | def MenuBar_GetAutoWindowMenu(*args, **kwargs): | |
10792 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
10793 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10794 | ||
d55e5bfc RD |
10795 | #--------------------------------------------------------------------------- |
10796 | ||
10797 | class MenuItem(Object): | |
093d3ff1 | 10798 | """Proxy of C++ MenuItem class""" |
d55e5bfc RD |
10799 | def __repr__(self): |
10800 | return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10801 | def __init__(self, *args, **kwargs): | |
10802 | """ | |
10803 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, | |
10804 | String help=EmptyString, int kind=ITEM_NORMAL, | |
10805 | Menu subMenu=None) -> MenuItem | |
10806 | """ | |
10807 | newobj = _core_.new_MenuItem(*args, **kwargs) | |
10808 | self.this = newobj.this | |
10809 | self.thisown = 1 | |
10810 | del newobj.thisown | |
10811 | def GetMenu(*args, **kwargs): | |
10812 | """GetMenu(self) -> Menu""" | |
10813 | return _core_.MenuItem_GetMenu(*args, **kwargs) | |
10814 | ||
10815 | def SetMenu(*args, **kwargs): | |
10816 | """SetMenu(self, Menu menu)""" | |
10817 | return _core_.MenuItem_SetMenu(*args, **kwargs) | |
10818 | ||
10819 | def SetId(*args, **kwargs): | |
10820 | """SetId(self, int id)""" | |
10821 | return _core_.MenuItem_SetId(*args, **kwargs) | |
10822 | ||
10823 | def GetId(*args, **kwargs): | |
10824 | """GetId(self) -> int""" | |
10825 | return _core_.MenuItem_GetId(*args, **kwargs) | |
10826 | ||
10827 | def IsSeparator(*args, **kwargs): | |
10828 | """IsSeparator(self) -> bool""" | |
10829 | return _core_.MenuItem_IsSeparator(*args, **kwargs) | |
10830 | ||
10831 | def SetText(*args, **kwargs): | |
10832 | """SetText(self, String str)""" | |
10833 | return _core_.MenuItem_SetText(*args, **kwargs) | |
10834 | ||
10835 | def GetLabel(*args, **kwargs): | |
10836 | """GetLabel(self) -> String""" | |
10837 | return _core_.MenuItem_GetLabel(*args, **kwargs) | |
10838 | ||
10839 | def GetText(*args, **kwargs): | |
10840 | """GetText(self) -> String""" | |
10841 | return _core_.MenuItem_GetText(*args, **kwargs) | |
10842 | ||
10843 | def GetLabelFromText(*args, **kwargs): | |
c24da6d6 | 10844 | """GetLabelFromText(String text) -> String""" |
d55e5bfc RD |
10845 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
10846 | ||
10847 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10848 | def GetKind(*args, **kwargs): | |
10849 | """GetKind(self) -> int""" | |
10850 | return _core_.MenuItem_GetKind(*args, **kwargs) | |
10851 | ||
10852 | def SetKind(*args, **kwargs): | |
10853 | """SetKind(self, int kind)""" | |
10854 | return _core_.MenuItem_SetKind(*args, **kwargs) | |
10855 | ||
10856 | def SetCheckable(*args, **kwargs): | |
10857 | """SetCheckable(self, bool checkable)""" | |
10858 | return _core_.MenuItem_SetCheckable(*args, **kwargs) | |
10859 | ||
10860 | def IsCheckable(*args, **kwargs): | |
10861 | """IsCheckable(self) -> bool""" | |
10862 | return _core_.MenuItem_IsCheckable(*args, **kwargs) | |
10863 | ||
10864 | def IsSubMenu(*args, **kwargs): | |
10865 | """IsSubMenu(self) -> bool""" | |
10866 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) | |
10867 | ||
10868 | def SetSubMenu(*args, **kwargs): | |
10869 | """SetSubMenu(self, Menu menu)""" | |
10870 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) | |
10871 | ||
10872 | def GetSubMenu(*args, **kwargs): | |
10873 | """GetSubMenu(self) -> Menu""" | |
10874 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) | |
10875 | ||
10876 | def Enable(*args, **kwargs): | |
10877 | """Enable(self, bool enable=True)""" | |
10878 | return _core_.MenuItem_Enable(*args, **kwargs) | |
10879 | ||
10880 | def IsEnabled(*args, **kwargs): | |
10881 | """IsEnabled(self) -> bool""" | |
10882 | return _core_.MenuItem_IsEnabled(*args, **kwargs) | |
10883 | ||
10884 | def Check(*args, **kwargs): | |
10885 | """Check(self, bool check=True)""" | |
10886 | return _core_.MenuItem_Check(*args, **kwargs) | |
10887 | ||
10888 | def IsChecked(*args, **kwargs): | |
10889 | """IsChecked(self) -> bool""" | |
10890 | return _core_.MenuItem_IsChecked(*args, **kwargs) | |
10891 | ||
10892 | def Toggle(*args, **kwargs): | |
10893 | """Toggle(self)""" | |
10894 | return _core_.MenuItem_Toggle(*args, **kwargs) | |
10895 | ||
10896 | def SetHelp(*args, **kwargs): | |
10897 | """SetHelp(self, String str)""" | |
10898 | return _core_.MenuItem_SetHelp(*args, **kwargs) | |
10899 | ||
10900 | def GetHelp(*args, **kwargs): | |
10901 | """GetHelp(self) -> String""" | |
10902 | return _core_.MenuItem_GetHelp(*args, **kwargs) | |
10903 | ||
10904 | def GetAccel(*args, **kwargs): | |
10905 | """GetAccel(self) -> AcceleratorEntry""" | |
10906 | return _core_.MenuItem_GetAccel(*args, **kwargs) | |
10907 | ||
10908 | def SetAccel(*args, **kwargs): | |
10909 | """SetAccel(self, AcceleratorEntry accel)""" | |
10910 | return _core_.MenuItem_SetAccel(*args, **kwargs) | |
10911 | ||
7449af73 RD |
10912 | def SetBitmap(*args, **kwargs): |
10913 | """SetBitmap(self, Bitmap bitmap)""" | |
10914 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
10915 | ||
10916 | def GetBitmap(*args, **kwargs): | |
10917 | """GetBitmap(self) -> Bitmap""" | |
10918 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
10919 | ||
d55e5bfc RD |
10920 | def SetFont(*args, **kwargs): |
10921 | """SetFont(self, Font font)""" | |
10922 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
10923 | ||
10924 | def GetFont(*args, **kwargs): | |
10925 | """GetFont(self) -> Font""" | |
10926 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
10927 | ||
10928 | def SetTextColour(*args, **kwargs): | |
10929 | """SetTextColour(self, Colour colText)""" | |
10930 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
10931 | ||
10932 | def GetTextColour(*args, **kwargs): | |
10933 | """GetTextColour(self) -> Colour""" | |
10934 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
10935 | ||
10936 | def SetBackgroundColour(*args, **kwargs): | |
10937 | """SetBackgroundColour(self, Colour colBack)""" | |
10938 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
10939 | ||
10940 | def GetBackgroundColour(*args, **kwargs): | |
10941 | """GetBackgroundColour(self) -> Colour""" | |
10942 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
10943 | ||
10944 | def SetBitmaps(*args, **kwargs): | |
10945 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
10946 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
10947 | ||
10948 | def SetDisabledBitmap(*args, **kwargs): | |
10949 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
10950 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
10951 | ||
10952 | def GetDisabledBitmap(*args, **kwargs): | |
10953 | """GetDisabledBitmap(self) -> Bitmap""" | |
10954 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
10955 | ||
10956 | def SetMarginWidth(*args, **kwargs): | |
10957 | """SetMarginWidth(self, int nWidth)""" | |
10958 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
10959 | ||
10960 | def GetMarginWidth(*args, **kwargs): | |
10961 | """GetMarginWidth(self) -> int""" | |
10962 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
10963 | ||
10964 | def GetDefaultMarginWidth(*args, **kwargs): | |
c24da6d6 | 10965 | """GetDefaultMarginWidth() -> int""" |
d55e5bfc RD |
10966 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
10967 | ||
10968 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
10969 | def IsOwnerDrawn(*args, **kwargs): | |
10970 | """IsOwnerDrawn(self) -> bool""" | |
10971 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
10972 | ||
10973 | def SetOwnerDrawn(*args, **kwargs): | |
10974 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
10975 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
10976 | ||
10977 | def ResetOwnerDrawn(*args, **kwargs): | |
10978 | """ResetOwnerDrawn(self)""" | |
10979 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
10980 | ||
d55e5bfc RD |
10981 | |
10982 | class MenuItemPtr(MenuItem): | |
10983 | def __init__(self, this): | |
10984 | self.this = this | |
10985 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10986 | self.__class__ = MenuItem | |
10987 | _core_.MenuItem_swigregister(MenuItemPtr) | |
10988 | ||
10989 | def MenuItem_GetLabelFromText(*args, **kwargs): | |
10990 | """MenuItem_GetLabelFromText(String text) -> String""" | |
10991 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
10992 | ||
10993 | def MenuItem_GetDefaultMarginWidth(*args, **kwargs): | |
10994 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
10995 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) | |
10996 | ||
10997 | #--------------------------------------------------------------------------- | |
10998 | ||
10999 | class Control(Window): | |
11000 | """ | |
11001 | This is the base class for a control or 'widget'. | |
11002 | ||
79fccf9d RD |
11003 | A control is generally a small window which processes user input |
11004 | and/or displays one or more item of data. | |
d55e5bfc RD |
11005 | """ |
11006 | def __repr__(self): | |
11007 | return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11008 | def __init__(self, *args, **kwargs): | |
11009 | """ | |
248ed943 RD |
11010 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
11011 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
d55e5bfc RD |
11012 | String name=ControlNameStr) -> Control |
11013 | ||
79fccf9d RD |
11014 | Create a Control. Normally you should only call this from a subclass' |
11015 | __init__ as a plain old wx.Control is not very useful. | |
d55e5bfc RD |
11016 | """ |
11017 | newobj = _core_.new_Control(*args, **kwargs) | |
11018 | self.this = newobj.this | |
11019 | self.thisown = 1 | |
11020 | del newobj.thisown | |
11021 | self._setOORInfo(self) | |
11022 | ||
11023 | def Create(*args, **kwargs): | |
11024 | """ | |
248ed943 RD |
11025 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
11026 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
d55e5bfc RD |
11027 | String name=ControlNameStr) -> bool |
11028 | ||
11029 | Do the 2nd phase and create the GUI control. | |
11030 | """ | |
11031 | return _core_.Control_Create(*args, **kwargs) | |
11032 | ||
11033 | def Command(*args, **kwargs): | |
11034 | """ | |
11035 | Command(self, CommandEvent event) | |
11036 | ||
79fccf9d RD |
11037 | Simulates the effect of the user issuing a command to the item. |
11038 | ||
11039 | :see: `wx.CommandEvent` | |
11040 | ||
d55e5bfc RD |
11041 | """ |
11042 | return _core_.Control_Command(*args, **kwargs) | |
11043 | ||
11044 | def GetLabel(*args, **kwargs): | |
11045 | """ | |
11046 | GetLabel(self) -> String | |
11047 | ||
11048 | Return a control's text. | |
11049 | """ | |
11050 | return _core_.Control_GetLabel(*args, **kwargs) | |
11051 | ||
11052 | def SetLabel(*args, **kwargs): | |
11053 | """ | |
11054 | SetLabel(self, String label) | |
11055 | ||
11056 | Sets the item's text. | |
11057 | """ | |
11058 | return _core_.Control_SetLabel(*args, **kwargs) | |
11059 | ||
a001823c | 11060 | def GetClassDefaultAttributes(*args, **kwargs): |
f8167d6e | 11061 | """ |
a001823c | 11062 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
f8167d6e | 11063 | |
a001823c RD |
11064 | Get the default attributes for this class. This is useful if you want |
11065 | to use the same font or colour in your own control as in a standard | |
11066 | control -- which is a much better idea than hard coding specific | |
11067 | colours or fonts which might look completely out of place on the | |
11068 | user's system, especially if it uses themes. | |
f8167d6e | 11069 | |
a001823c RD |
11070 | The variant parameter is only relevant under Mac currently and is |
11071 | ignore under other platforms. Under Mac, it will change the size of | |
11072 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11073 | this. | |
f8167d6e | 11074 | """ |
d55e5bfc RD |
11075 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
11076 | ||
11077 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
11078 | ||
11079 | class ControlPtr(Control): | |
11080 | def __init__(self, this): | |
11081 | self.this = this | |
11082 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11083 | self.__class__ = Control | |
11084 | _core_.Control_swigregister(ControlPtr) | |
11085 | ControlNameStr = cvar.ControlNameStr | |
11086 | ||
11087 | def PreControl(*args, **kwargs): | |
11088 | """ | |
11089 | PreControl() -> Control | |
11090 | ||
11091 | Precreate a Control control for 2-phase creation | |
11092 | """ | |
11093 | val = _core_.new_PreControl(*args, **kwargs) | |
11094 | val.thisown = 1 | |
11095 | return val | |
11096 | ||
11097 | def Control_GetClassDefaultAttributes(*args, **kwargs): | |
a001823c RD |
11098 | """ |
11099 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
11100 | ||
11101 | Get the default attributes for this class. This is useful if you want | |
11102 | to use the same font or colour in your own control as in a standard | |
11103 | control -- which is a much better idea than hard coding specific | |
11104 | colours or fonts which might look completely out of place on the | |
11105 | user's system, especially if it uses themes. | |
11106 | ||
11107 | The variant parameter is only relevant under Mac currently and is | |
11108 | ignore under other platforms. Under Mac, it will change the size of | |
11109 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11110 | this. | |
11111 | """ | |
d55e5bfc RD |
11112 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
11113 | ||
11114 | #--------------------------------------------------------------------------- | |
11115 | ||
11116 | class ItemContainer(object): | |
11117 | """ | |
53aa7709 RD |
11118 | The wx.ItemContainer class defines an interface which is implemented |
11119 | by all controls which have string subitems, each of which may be | |
11120 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
11121 | as `wx.ComboBox` which implements an extended interface deriving from | |
79fccf9d | 11122 | this one. |
d55e5bfc | 11123 | |
79fccf9d RD |
11124 | It defines the methods for accessing the control's items and although |
11125 | each of the derived classes implements them differently, they still | |
11126 | all conform to the same interface. | |
d55e5bfc | 11127 | |
79fccf9d RD |
11128 | The items in a wx.ItemContainer have (non empty) string labels and, |
11129 | optionally, client data associated with them. | |
d55e5bfc RD |
11130 | |
11131 | """ | |
11132 | def __init__(self): raise RuntimeError, "No constructor defined" | |
11133 | def __repr__(self): | |
11134 | return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11135 | def Append(*args, **kwargs): | |
11136 | """ | |
11137 | Append(self, String item, PyObject clientData=None) -> int | |
11138 | ||
79fccf9d RD |
11139 | Adds the item to the control, associating the given data with the item |
11140 | if not None. The return value is the index of the newly added item | |
11141 | which may be different from the last one if the control is sorted (e.g. | |
11142 | has wx.LB_SORT or wx.CB_SORT style). | |
d55e5bfc RD |
11143 | """ |
11144 | return _core_.ItemContainer_Append(*args, **kwargs) | |
11145 | ||
11146 | def AppendItems(*args, **kwargs): | |
11147 | """ | |
f5b96ee1 | 11148 | AppendItems(self, List strings) |
d55e5bfc | 11149 | |
79fccf9d RD |
11150 | Apend several items at once to the control. Notice that calling this |
11151 | method may be much faster than appending the items one by one if you | |
11152 | need to add a lot of items. | |
d55e5bfc RD |
11153 | """ |
11154 | return _core_.ItemContainer_AppendItems(*args, **kwargs) | |
11155 | ||
11156 | def Insert(*args, **kwargs): | |
11157 | """ | |
11158 | Insert(self, String item, int pos, PyObject clientData=None) -> int | |
11159 | ||
79fccf9d | 11160 | Insert an item into the control before the item at the ``pos`` index, |
d55e5bfc RD |
11161 | optionally associating some data object with the item. |
11162 | """ | |
11163 | return _core_.ItemContainer_Insert(*args, **kwargs) | |
11164 | ||
11165 | def Clear(*args, **kwargs): | |
11166 | """ | |
11167 | Clear(self) | |
11168 | ||
11169 | Removes all items from the control. | |
11170 | """ | |
11171 | return _core_.ItemContainer_Clear(*args, **kwargs) | |
11172 | ||
11173 | def Delete(*args, **kwargs): | |
11174 | """ | |
11175 | Delete(self, int n) | |
11176 | ||
79fccf9d RD |
11177 | Deletes the item at the zero-based index 'n' from the control. Note |
11178 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
11179 | enabled) to remove an item with the index negative or greater or equal | |
11180 | than the number of items in the control. | |
d55e5bfc RD |
11181 | """ |
11182 | return _core_.ItemContainer_Delete(*args, **kwargs) | |
11183 | ||
53aa7709 RD |
11184 | def GetClientData(*args, **kwargs): |
11185 | """ | |
11186 | GetClientData(self, int n) -> PyObject | |
11187 | ||
11188 | Returns the client data associated with the given item, (if any.) | |
11189 | """ | |
11190 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
11191 | ||
11192 | def SetClientData(*args, **kwargs): | |
11193 | """ | |
11194 | SetClientData(self, int n, PyObject clientData) | |
11195 | ||
11196 | Associate the given client data with the item at position n. | |
11197 | """ | |
11198 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
11199 | ||
d55e5bfc RD |
11200 | def GetCount(*args, **kwargs): |
11201 | """ | |
11202 | GetCount(self) -> int | |
11203 | ||
11204 | Returns the number of items in the control. | |
11205 | """ | |
11206 | return _core_.ItemContainer_GetCount(*args, **kwargs) | |
11207 | ||
11208 | def IsEmpty(*args, **kwargs): | |
11209 | """ | |
11210 | IsEmpty(self) -> bool | |
11211 | ||
11212 | Returns True if the control is empty or False if it has some items. | |
11213 | """ | |
11214 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) | |
11215 | ||
11216 | def GetString(*args, **kwargs): | |
11217 | """ | |
11218 | GetString(self, int n) -> String | |
11219 | ||
11220 | Returns the label of the item with the given index. | |
11221 | """ | |
11222 | return _core_.ItemContainer_GetString(*args, **kwargs) | |
11223 | ||
11224 | def GetStrings(*args, **kwargs): | |
11225 | """GetStrings(self) -> wxArrayString""" | |
11226 | return _core_.ItemContainer_GetStrings(*args, **kwargs) | |
11227 | ||
11228 | def SetString(*args, **kwargs): | |
11229 | """ | |
11230 | SetString(self, int n, String s) | |
11231 | ||
11232 | Sets the label for the given item. | |
11233 | """ | |
11234 | return _core_.ItemContainer_SetString(*args, **kwargs) | |
11235 | ||
11236 | def FindString(*args, **kwargs): | |
11237 | """ | |
11238 | FindString(self, String s) -> int | |
11239 | ||
11240 | Finds an item whose label matches the given string. Returns the | |
79fccf9d RD |
11241 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
11242 | found. | |
d55e5bfc RD |
11243 | """ |
11244 | return _core_.ItemContainer_FindString(*args, **kwargs) | |
11245 | ||
53aa7709 | 11246 | def SetSelection(*args, **kwargs): |
d55e5bfc | 11247 | """ |
53aa7709 | 11248 | SetSelection(self, int n) |
d55e5bfc RD |
11249 | |
11250 | Sets the item at index 'n' to be the selected item. | |
11251 | """ | |
53aa7709 | 11252 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
d55e5bfc | 11253 | |
d55e5bfc RD |
11254 | def GetSelection(*args, **kwargs): |
11255 | """ | |
11256 | GetSelection(self) -> int | |
11257 | ||
79fccf9d RD |
11258 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
11259 | is selected. | |
d55e5bfc RD |
11260 | """ |
11261 | return _core_.ItemContainer_GetSelection(*args, **kwargs) | |
11262 | ||
53aa7709 RD |
11263 | def SetStringSelection(*args, **kwargs): |
11264 | """SetStringSelection(self, String s) -> bool""" | |
11265 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
11266 | ||
d55e5bfc RD |
11267 | def GetStringSelection(*args, **kwargs): |
11268 | """ | |
11269 | GetStringSelection(self) -> String | |
11270 | ||
79fccf9d RD |
11271 | Returns the label of the selected item or an empty string if no item |
11272 | is selected. | |
d55e5bfc RD |
11273 | """ |
11274 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) | |
11275 | ||
53aa7709 | 11276 | def Select(*args, **kwargs): |
d55e5bfc | 11277 | """ |
53aa7709 | 11278 | Select(self, int n) |
d55e5bfc | 11279 | |
53aa7709 RD |
11280 | This is the same as `SetSelection` and exists only because it is |
11281 | slightly more natural for controls which support multiple selection. | |
d55e5bfc | 11282 | """ |
53aa7709 | 11283 | return _core_.ItemContainer_Select(*args, **kwargs) |
d55e5bfc RD |
11284 | |
11285 | ||
11286 | class ItemContainerPtr(ItemContainer): | |
11287 | def __init__(self, this): | |
11288 | self.this = this | |
11289 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11290 | self.__class__ = ItemContainer | |
11291 | _core_.ItemContainer_swigregister(ItemContainerPtr) | |
11292 | ||
11293 | #--------------------------------------------------------------------------- | |
11294 | ||
11295 | class ControlWithItems(Control,ItemContainer): | |
11296 | """ | |
79fccf9d RD |
11297 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
11298 | wx.Control class, and is used for the base class of various controls | |
11299 | that have items. | |
d55e5bfc RD |
11300 | """ |
11301 | def __init__(self): raise RuntimeError, "No constructor defined" | |
11302 | def __repr__(self): | |
11303 | return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11304 | ||
11305 | class ControlWithItemsPtr(ControlWithItems): | |
11306 | def __init__(self, this): | |
11307 | self.this = this | |
11308 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11309 | self.__class__ = ControlWithItems | |
11310 | _core_.ControlWithItems_swigregister(ControlWithItemsPtr) | |
11311 | ||
11312 | #--------------------------------------------------------------------------- | |
11313 | ||
11314 | class SizerItem(Object): | |
248ed943 RD |
11315 | """ |
11316 | The wx.SizerItem class is used to track the position, size and other | |
11317 | attributes of each item managed by a `wx.Sizer`. In normal usage user | |
11318 | code should never need to deal directly with a wx.SizerItem, but | |
11319 | custom classes derived from `wx.PySizer` will probably need to use the | |
11320 | collection of wx.SizerItems held by wx.Sizer when calculating layout. | |
11321 | ||
11322 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
11323 | """ | |
d55e5bfc RD |
11324 | def __repr__(self): |
11325 | return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11326 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11327 | """ |
11328 | __init__(self) -> SizerItem | |
11329 | ||
11330 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
11331 | size will need to be set before this item can be used in a Sizer. | |
11332 | ||
11333 | You will probably never need to create a wx.SizerItem directly as they | |
11334 | are created automatically when the sizer's Add, Insert or Prepend | |
11335 | methods are called. | |
11336 | ||
11337 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
11338 | """ | |
d55e5bfc RD |
11339 | newobj = _core_.new_SizerItem(*args, **kwargs) |
11340 | self.this = newobj.this | |
11341 | self.thisown = 1 | |
11342 | del newobj.thisown | |
11343 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
11344 | """ |
11345 | DeleteWindows(self) | |
11346 | ||
11347 | Destroy the window or the windows in a subsizer, depending on the type | |
11348 | of item. | |
11349 | """ | |
d55e5bfc RD |
11350 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
11351 | ||
11352 | def DetachSizer(*args, **kwargs): | |
248ed943 RD |
11353 | """ |
11354 | DetachSizer(self) | |
11355 | ||
11356 | Enable deleting the SizerItem without destroying the contained sizer. | |
11357 | """ | |
d55e5bfc RD |
11358 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
11359 | ||
11360 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11361 | """ |
11362 | GetSize(self) -> Size | |
11363 | ||
11364 | Get the current size of the item, as set in the last Layout. | |
11365 | """ | |
d55e5bfc RD |
11366 | return _core_.SizerItem_GetSize(*args, **kwargs) |
11367 | ||
11368 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11369 | """ |
11370 | CalcMin(self) -> Size | |
11371 | ||
11372 | Calculates the minimum desired size for the item, including any space | |
11373 | needed by borders. | |
11374 | """ | |
d55e5bfc RD |
11375 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
11376 | ||
11377 | def SetDimension(*args, **kwargs): | |
248ed943 RD |
11378 | """ |
11379 | SetDimension(self, Point pos, Size size) | |
11380 | ||
11381 | Set the position and size of the space allocated for this item by the | |
11382 | sizer, and adjust the position and size of the item (window or | |
11383 | subsizer) to be within that space taking alignment and borders into | |
11384 | account. | |
11385 | """ | |
d55e5bfc RD |
11386 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
11387 | ||
11388 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11389 | """ |
11390 | GetMinSize(self) -> Size | |
11391 | ||
11392 | Get the minimum size needed for the item. | |
11393 | """ | |
d55e5bfc RD |
11394 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
11395 | ||
a001823c RD |
11396 | def GetMinSizeWithBorder(*args, **kwargs): |
11397 | """ | |
11398 | GetMinSizeWithBorder(self) -> Size | |
11399 | ||
11400 | Get the minimum size needed for the item with space for the borders | |
11401 | added, if needed. | |
11402 | """ | |
11403 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
11404 | ||
d55e5bfc RD |
11405 | def SetInitSize(*args, **kwargs): |
11406 | """SetInitSize(self, int x, int y)""" | |
11407 | return _core_.SizerItem_SetInitSize(*args, **kwargs) | |
11408 | ||
11409 | def SetRatioWH(*args, **kwargs): | |
248ed943 RD |
11410 | """ |
11411 | SetRatioWH(self, int width, int height) | |
11412 | ||
11413 | Set the ratio item attribute. | |
11414 | """ | |
d55e5bfc RD |
11415 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
11416 | ||
11417 | def SetRatioSize(*args, **kwargs): | |
248ed943 RD |
11418 | """ |
11419 | SetRatioSize(self, Size size) | |
11420 | ||
11421 | Set the ratio item attribute. | |
11422 | """ | |
d55e5bfc RD |
11423 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
11424 | ||
11425 | def SetRatio(*args, **kwargs): | |
248ed943 RD |
11426 | """ |
11427 | SetRatio(self, float ratio) | |
11428 | ||
11429 | Set the ratio item attribute. | |
11430 | """ | |
d55e5bfc RD |
11431 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
11432 | ||
11433 | def GetRatio(*args, **kwargs): | |
248ed943 RD |
11434 | """ |
11435 | GetRatio(self) -> float | |
11436 | ||
11437 | Set the ratio item attribute. | |
11438 | """ | |
d55e5bfc RD |
11439 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
11440 | ||
c1cb24a4 RD |
11441 | def GetRect(*args, **kwargs): |
11442 | """ | |
11443 | GetRect(self) -> Rect | |
11444 | ||
11445 | Returns the rectangle that the sizer item should occupy | |
11446 | """ | |
11447 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
11448 | ||
d55e5bfc | 11449 | def IsWindow(*args, **kwargs): |
248ed943 RD |
11450 | """ |
11451 | IsWindow(self) -> bool | |
11452 | ||
11453 | Is this sizer item a window? | |
11454 | """ | |
d55e5bfc RD |
11455 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
11456 | ||
11457 | def IsSizer(*args, **kwargs): | |
248ed943 RD |
11458 | """ |
11459 | IsSizer(self) -> bool | |
11460 | ||
11461 | Is this sizer item a subsizer? | |
11462 | """ | |
d55e5bfc RD |
11463 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
11464 | ||
11465 | def IsSpacer(*args, **kwargs): | |
248ed943 RD |
11466 | """ |
11467 | IsSpacer(self) -> bool | |
11468 | ||
11469 | Is this sizer item a spacer? | |
11470 | """ | |
d55e5bfc RD |
11471 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
11472 | ||
11473 | def SetProportion(*args, **kwargs): | |
248ed943 RD |
11474 | """ |
11475 | SetProportion(self, int proportion) | |
11476 | ||
11477 | Set the proportion value for this item. | |
11478 | """ | |
d55e5bfc RD |
11479 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
11480 | ||
11481 | def GetProportion(*args, **kwargs): | |
248ed943 RD |
11482 | """ |
11483 | GetProportion(self) -> int | |
11484 | ||
11485 | Get the proportion value for this item. | |
11486 | """ | |
d55e5bfc RD |
11487 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
11488 | ||
248ed943 RD |
11489 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
11490 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
d55e5bfc | 11491 | def SetFlag(*args, **kwargs): |
248ed943 RD |
11492 | """ |
11493 | SetFlag(self, int flag) | |
11494 | ||
11495 | Set the flag value for this item. | |
11496 | """ | |
d55e5bfc RD |
11497 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
11498 | ||
11499 | def GetFlag(*args, **kwargs): | |
248ed943 RD |
11500 | """ |
11501 | GetFlag(self) -> int | |
11502 | ||
11503 | Get the flag value for this item. | |
11504 | """ | |
d55e5bfc RD |
11505 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
11506 | ||
11507 | def SetBorder(*args, **kwargs): | |
248ed943 RD |
11508 | """ |
11509 | SetBorder(self, int border) | |
11510 | ||
11511 | Set the border value for this item. | |
11512 | """ | |
d55e5bfc RD |
11513 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
11514 | ||
11515 | def GetBorder(*args, **kwargs): | |
248ed943 RD |
11516 | """ |
11517 | GetBorder(self) -> int | |
11518 | ||
11519 | Get the border value for this item. | |
11520 | """ | |
d55e5bfc RD |
11521 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
11522 | ||
11523 | def GetWindow(*args, **kwargs): | |
248ed943 RD |
11524 | """ |
11525 | GetWindow(self) -> Window | |
11526 | ||
11527 | Get the window (if any) that is managed by this sizer item. | |
11528 | """ | |
d55e5bfc RD |
11529 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
11530 | ||
11531 | def SetWindow(*args, **kwargs): | |
248ed943 RD |
11532 | """ |
11533 | SetWindow(self, Window window) | |
11534 | ||
11535 | Set the window to be managed by this sizer item. | |
11536 | """ | |
d55e5bfc RD |
11537 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
11538 | ||
11539 | def GetSizer(*args, **kwargs): | |
248ed943 RD |
11540 | """ |
11541 | GetSizer(self) -> Sizer | |
11542 | ||
11543 | Get the subsizer (if any) that is managed by this sizer item. | |
11544 | """ | |
d55e5bfc RD |
11545 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
11546 | ||
11547 | def SetSizer(*args, **kwargs): | |
248ed943 RD |
11548 | """ |
11549 | SetSizer(self, Sizer sizer) | |
11550 | ||
11551 | Set the subsizer to be managed by this sizer item. | |
11552 | """ | |
d55e5bfc RD |
11553 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
11554 | ||
11555 | def GetSpacer(*args, **kwargs): | |
248ed943 RD |
11556 | """ |
11557 | GetSpacer(self) -> Size | |
11558 | ||
11559 | Get the size of the spacer managed by this sizer item. | |
11560 | """ | |
d55e5bfc RD |
11561 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
11562 | ||
11563 | def SetSpacer(*args, **kwargs): | |
248ed943 RD |
11564 | """ |
11565 | SetSpacer(self, Size size) | |
11566 | ||
11567 | Set the size of the spacer to be managed by this sizer item. | |
11568 | """ | |
d55e5bfc RD |
11569 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
11570 | ||
11571 | def Show(*args, **kwargs): | |
248ed943 RD |
11572 | """ |
11573 | Show(self, bool show) | |
11574 | ||
11575 | Set the show item attribute, which sizers use to determine if the item | |
11576 | is to be made part of the layout or not. If the item is tracking a | |
11577 | window then it is shown or hidden as needed. | |
11578 | """ | |
d55e5bfc RD |
11579 | return _core_.SizerItem_Show(*args, **kwargs) |
11580 | ||
11581 | def IsShown(*args, **kwargs): | |
248ed943 RD |
11582 | """ |
11583 | IsShown(self) -> bool | |
11584 | ||
11585 | Is the item to be shown in the layout? | |
11586 | """ | |
d55e5bfc RD |
11587 | return _core_.SizerItem_IsShown(*args, **kwargs) |
11588 | ||
11589 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11590 | """ |
11591 | GetPosition(self) -> Point | |
11592 | ||
11593 | Returns the current position of the item, as set in the last Layout. | |
11594 | """ | |
d55e5bfc RD |
11595 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
11596 | ||
11597 | def GetUserData(*args, **kwargs): | |
248ed943 RD |
11598 | """ |
11599 | GetUserData(self) -> PyObject | |
11600 | ||
11601 | Returns the userData associated with this sizer item, or None if there | |
11602 | isn't any. | |
11603 | """ | |
d55e5bfc RD |
11604 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
11605 | ||
7449af73 RD |
11606 | def SetUserData(*args, **kwargs): |
11607 | """ | |
11608 | SetUserData(self, PyObject userData) | |
11609 | ||
11610 | Associate a Python object with this sizer item. | |
11611 | """ | |
11612 | return _core_.SizerItem_SetUserData(*args, **kwargs) | |
11613 | ||
d55e5bfc RD |
11614 | |
11615 | class SizerItemPtr(SizerItem): | |
11616 | def __init__(self, this): | |
11617 | self.this = this | |
11618 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11619 | self.__class__ = SizerItem | |
11620 | _core_.SizerItem_swigregister(SizerItemPtr) | |
11621 | ||
248ed943 | 11622 | def SizerItemWindow(*args, **kwargs): |
d55e5bfc | 11623 | """ |
248ed943 RD |
11624 | SizerItemWindow(Window window, int proportion, int flag, int border, |
11625 | PyObject userData=None) -> SizerItem | |
11626 | ||
11627 | Constructs a `wx.SizerItem` for tracking a window. | |
d55e5bfc | 11628 | """ |
248ed943 | 11629 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d55e5bfc RD |
11630 | val.thisown = 1 |
11631 | return val | |
11632 | ||
248ed943 | 11633 | def SizerItemSpacer(*args, **kwargs): |
d55e5bfc | 11634 | """ |
248ed943 RD |
11635 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
11636 | PyObject userData=None) -> SizerItem | |
11637 | ||
11638 | Constructs a `wx.SizerItem` for tracking a spacer. | |
d55e5bfc | 11639 | """ |
248ed943 | 11640 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d55e5bfc RD |
11641 | val.thisown = 1 |
11642 | return val | |
11643 | ||
11644 | def SizerItemSizer(*args, **kwargs): | |
11645 | """ | |
11646 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
248ed943 RD |
11647 | PyObject userData=None) -> SizerItem |
11648 | ||
11649 | Constructs a `wx.SizerItem` for tracking a subsizer | |
d55e5bfc RD |
11650 | """ |
11651 | val = _core_.new_SizerItemSizer(*args, **kwargs) | |
11652 | val.thisown = 1 | |
11653 | return val | |
11654 | ||
11655 | class Sizer(Object): | |
248ed943 RD |
11656 | """ |
11657 | wx.Sizer is the abstract base class used for laying out subwindows in | |
11658 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
11659 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
11660 | `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer` | |
11661 | and `wx.GridBagSizer`. | |
11662 | ||
11663 | The concept implemented by sizers in wxWidgets is closely related to | |
11664 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
11665 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
11666 | subwindows reporting their minimal required size and their ability to | |
11667 | get stretched if the size of the parent window has changed. This will | |
11668 | most often mean that the programmer does not set the original size of | |
11669 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
11670 | this sizer will be queried about the recommended size. The sizer in | |
11671 | turn will query its children, which can be normal windows or contorls, | |
11672 | empty space or other sizers, so that a hierarchy of sizers can be | |
11673 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
11674 | do not interfere with tab ordering and requires very little resources | |
11675 | compared to a real window on screen. | |
11676 | ||
11677 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
11678 | every control reports its own minimal size and the algorithm can | |
11679 | handle differences in font sizes or different window (dialog item) | |
11680 | sizes on different platforms without problems. If for example the | |
11681 | standard font as well as the overall design of Mac widgets requires | |
11682 | more space than on Windows, then the initial size of a dialog using a | |
11683 | sizer will automatically be bigger on Mac than on Windows. | |
11684 | """ | |
d55e5bfc RD |
11685 | def __init__(self): raise RuntimeError, "No constructor defined" |
11686 | def __repr__(self): | |
11687 | return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11688 | def _setOORInfo(*args, **kwargs): | |
11689 | """_setOORInfo(self, PyObject _self)""" | |
11690 | return _core_.Sizer__setOORInfo(*args, **kwargs) | |
11691 | ||
11692 | def Add(*args, **kwargs): | |
11693 | """ | |
248ed943 | 11694 | Add(self, item, int proportion=0, int flag=0, int border=0, |
c1cb24a4 | 11695 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11696 | |
11697 | Appends a child item to the sizer. | |
d55e5bfc RD |
11698 | """ |
11699 | return _core_.Sizer_Add(*args, **kwargs) | |
11700 | ||
11701 | def Insert(*args, **kwargs): | |
11702 | """ | |
248ed943 | 11703 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
c1cb24a4 | 11704 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11705 | |
11706 | Inserts a new item into the list of items managed by this sizer before | |
11707 | the item at index *before*. See `Add` for a description of the parameters. | |
d55e5bfc RD |
11708 | """ |
11709 | return _core_.Sizer_Insert(*args, **kwargs) | |
11710 | ||
11711 | def Prepend(*args, **kwargs): | |
11712 | """ | |
248ed943 | 11713 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
c1cb24a4 | 11714 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11715 | |
11716 | Adds a new item to the begining of the list of sizer items managed by | |
11717 | this sizer. See `Add` for a description of the parameters. | |
d55e5bfc RD |
11718 | """ |
11719 | return _core_.Sizer_Prepend(*args, **kwargs) | |
11720 | ||
11721 | def Remove(*args, **kwargs): | |
248ed943 RD |
11722 | """ |
11723 | Remove(self, item) -> bool | |
11724 | ||
11725 | Removes an item from the sizer and destroys it. This method does not | |
11726 | cause any layout or resizing to take place, call `Layout` to update | |
11727 | the layout on screen after removing a child from the sizer. The | |
11728 | *item* parameter can be either a window, a sizer, or the zero-based | |
11729 | index of an item to remove. Returns True if the child item was found | |
11730 | and removed. | |
11731 | """ | |
d55e5bfc RD |
11732 | return _core_.Sizer_Remove(*args, **kwargs) |
11733 | ||
1a6bba1e | 11734 | def Detach(*args, **kwargs): |
248ed943 RD |
11735 | """ |
11736 | Detach(self, item) -> bool | |
11737 | ||
11738 | Detaches an item from the sizer without destroying it. This method | |
11739 | does not cause any layout or resizing to take place, call `Layout` to | |
11740 | do so. The *item* parameter can be either a window, a sizer, or the | |
11741 | zero-based index of the item to be detached. Returns True if the child item | |
11742 | was found and detached. | |
11743 | """ | |
1a6bba1e RD |
11744 | return _core_.Sizer_Detach(*args, **kwargs) |
11745 | ||
c1cb24a4 RD |
11746 | def GetItem(*args, **kwargs): |
11747 | """ | |
11748 | GetItem(self, item) -> wx.SizerItem | |
11749 | ||
11750 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11751 | parameter can be either a window, a sizer, or the zero-based index of | |
4d170c95 | 11752 | the item to be found. |
c1cb24a4 RD |
11753 | """ |
11754 | return _core_.Sizer_GetItem(*args, **kwargs) | |
11755 | ||
d55e5bfc RD |
11756 | def _SetItemMinSize(*args, **kwargs): |
11757 | """_SetItemMinSize(self, PyObject item, Size size)""" | |
11758 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) | |
11759 | ||
248ed943 RD |
11760 | def SetItemMinSize(self, item, *args): |
11761 | """ | |
11762 | SetItemMinSize(self, item, Size size) | |
11763 | ||
11764 | Sets the minimum size that will be allocated for an item in the sizer. | |
11765 | The *item* parameter can be either a window, a sizer, or the | |
11766 | zero-based index of the item. If a window or sizer is given then it | |
11767 | will be searched for recursivly in subsizers if neccessary. | |
11768 | """ | |
11769 | if len(args) == 2: | |
11770 | # for backward compatibility accept separate width,height args too | |
11771 | return self._SetItemMinSize(item, args) | |
11772 | else: | |
11773 | return self._SetItemMinSize(item, args[0]) | |
11774 | ||
d55e5bfc | 11775 | def AddItem(*args, **kwargs): |
248ed943 RD |
11776 | """ |
11777 | AddItem(self, SizerItem item) | |
11778 | ||
11779 | Adds a `wx.SizerItem` to the sizer. | |
11780 | """ | |
d55e5bfc RD |
11781 | return _core_.Sizer_AddItem(*args, **kwargs) |
11782 | ||
11783 | def InsertItem(*args, **kwargs): | |
248ed943 RD |
11784 | """ |
11785 | InsertItem(self, int index, SizerItem item) | |
11786 | ||
11787 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11788 | """ | |
d55e5bfc RD |
11789 | return _core_.Sizer_InsertItem(*args, **kwargs) |
11790 | ||
11791 | def PrependItem(*args, **kwargs): | |
248ed943 RD |
11792 | """ |
11793 | PrependItem(self, SizerItem item) | |
11794 | ||
11795 | Prepends a `wx.SizerItem` to the sizer. | |
11796 | """ | |
d55e5bfc RD |
11797 | return _core_.Sizer_PrependItem(*args, **kwargs) |
11798 | ||
248ed943 | 11799 | def AddMany(self, items): |
c24da6d6 RD |
11800 | """ |
11801 | AddMany is a convenience method for adding several items | |
11802 | to a sizer at one time. Simply pass it a list of tuples, | |
11803 | where each tuple consists of the parameters that you | |
11804 | would normally pass to the `Add` method. | |
11805 | """ | |
248ed943 RD |
11806 | for item in items: |
11807 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11808 | item = (item, ) | |
11809 | self.Add(*item) | |
d55e5bfc RD |
11810 | |
11811 | # for backwards compatibility only, please do not use in new code | |
b9d6a5f3 RD |
11812 | def AddWindow(self, *args, **kw): |
11813 | """Compatibility alias for `Add`.""" | |
11814 | return self.Add(*args, **kw) | |
11815 | def AddSizer(self, *args, **kw): | |
11816 | """Compatibility alias for `Add`.""" | |
11817 | return self.Add(*args, **kw) | |
11818 | def AddSpacer(self, *args, **kw): | |
11819 | """Compatibility alias for `Add`.""" | |
11820 | return self.Add(*args, **kw) | |
11821 | ||
11822 | def PrependWindow(self, *args, **kw): | |
11823 | """Compatibility alias for `Prepend`.""" | |
11824 | return self.Prepend(*args, **kw) | |
11825 | def PrependSizer(self, *args, **kw): | |
11826 | """Compatibility alias for `Prepend`.""" | |
11827 | return self.Prepend(*args, **kw) | |
11828 | def PrependSpacer(self, *args, **kw): | |
11829 | """Compatibility alias for `Prepend`.""" | |
11830 | return self.Prepend(*args, **kw) | |
11831 | ||
11832 | def InsertWindow(self, *args, **kw): | |
11833 | """Compatibility alias for `Insert`.""" | |
11834 | return self.Insert(*args, **kw) | |
11835 | def InsertSizer(self, *args, **kw): | |
11836 | """Compatibility alias for `Insert`.""" | |
11837 | return self.Insert(*args, **kw) | |
11838 | def InsertSpacer(self, *args, **kw): | |
11839 | """Compatibility alias for `Insert`.""" | |
11840 | return self.Insert(*args, **kw) | |
11841 | ||
11842 | def RemoveWindow(self, *args, **kw): | |
11843 | """Compatibility alias for `Remove`.""" | |
11844 | return self.Remove(*args, **kw) | |
11845 | def RemoveSizer(self, *args, **kw): | |
11846 | """Compatibility alias for `Remove`.""" | |
11847 | return self.Remove(*args, **kw) | |
11848 | def RemovePos(self, *args, **kw): | |
11849 | """Compatibility alias for `Remove`.""" | |
11850 | return self.Remove(*args, **kw) | |
d55e5bfc RD |
11851 | |
11852 | ||
d55e5bfc | 11853 | def SetDimension(*args, **kwargs): |
248ed943 RD |
11854 | """ |
11855 | SetDimension(self, int x, int y, int width, int height) | |
11856 | ||
11857 | Call this to force the sizer to take the given dimension and thus | |
11858 | force the items owned by the sizer to resize themselves according to | |
11859 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11860 | methods. | |
11861 | """ | |
d55e5bfc RD |
11862 | return _core_.Sizer_SetDimension(*args, **kwargs) |
11863 | ||
11864 | def SetMinSize(*args, **kwargs): | |
248ed943 RD |
11865 | """ |
11866 | SetMinSize(self, Size size) | |
11867 | ||
11868 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11869 | calculate its minimal size based purely on how much space its children | |
11870 | need. After calling this method `GetMinSize` will return either the | |
11871 | minimal size as requested by its children or the minimal size set | |
11872 | here, depending on which is bigger. | |
11873 | """ | |
d55e5bfc RD |
11874 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
11875 | ||
11876 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11877 | """ |
11878 | GetSize(self) -> Size | |
11879 | ||
11880 | Returns the current size of the space managed by the sizer. | |
11881 | """ | |
d55e5bfc RD |
11882 | return _core_.Sizer_GetSize(*args, **kwargs) |
11883 | ||
11884 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11885 | """ |
11886 | GetPosition(self) -> Point | |
11887 | ||
11888 | Returns the current position of the sizer's managed space. | |
11889 | """ | |
d55e5bfc RD |
11890 | return _core_.Sizer_GetPosition(*args, **kwargs) |
11891 | ||
11892 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11893 | """ |
11894 | GetMinSize(self) -> Size | |
11895 | ||
11896 | Returns the minimal size of the sizer. This is either the combined | |
11897 | minimal size of all the children and their borders or the minimal size | |
11898 | set by SetMinSize, depending on which is bigger. | |
11899 | """ | |
d55e5bfc RD |
11900 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
11901 | ||
11902 | def GetSizeTuple(self): | |
1a6bba1e | 11903 | return self.GetSize().Get() |
d55e5bfc | 11904 | def GetPositionTuple(self): |
1a6bba1e | 11905 | return self.GetPosition().Get() |
d55e5bfc | 11906 | def GetMinSizeTuple(self): |
1a6bba1e | 11907 | return self.GetMinSize().Get() |
d55e5bfc RD |
11908 | |
11909 | def RecalcSizes(*args, **kwargs): | |
248ed943 RD |
11910 | """ |
11911 | RecalcSizes(self) | |
11912 | ||
11913 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11914 | items managed by this sizer. You should not need to call this directly as | |
11915 | it is called by `Layout`. | |
11916 | """ | |
d55e5bfc RD |
11917 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
11918 | ||
11919 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11920 | """ |
11921 | CalcMin(self) -> Size | |
11922 | ||
11923 | This method is where the sizer will do the actual calculation of its | |
11924 | children's minimal sizes. You should not need to call this directly as | |
11925 | it is called by `Layout`. | |
11926 | """ | |
d55e5bfc RD |
11927 | return _core_.Sizer_CalcMin(*args, **kwargs) |
11928 | ||
11929 | def Layout(*args, **kwargs): | |
248ed943 RD |
11930 | """ |
11931 | Layout(self) | |
11932 | ||
11933 | This method will force the recalculation and layout of the items | |
11934 | controlled by the sizer using the current space allocated to the | |
11935 | sizer. Normally this is called automatically from the owning window's | |
11936 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11937 | one of the items in a sizer change size, or items are added or | |
11938 | removed. | |
11939 | """ | |
d55e5bfc RD |
11940 | return _core_.Sizer_Layout(*args, **kwargs) |
11941 | ||
11942 | def Fit(*args, **kwargs): | |
248ed943 RD |
11943 | """ |
11944 | Fit(self, Window window) -> Size | |
11945 | ||
11946 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11947 | size. This is commonly done in the constructor of the window itself in | |
11948 | order to set its initial size to match the needs of the children as | |
11949 | determined by the sizer. Returns the new size. | |
11950 | ||
11951 | For a top level window this is the total window size, not the client size. | |
11952 | """ | |
d55e5bfc RD |
11953 | return _core_.Sizer_Fit(*args, **kwargs) |
11954 | ||
11955 | def FitInside(*args, **kwargs): | |
248ed943 RD |
11956 | """ |
11957 | FitInside(self, Window window) | |
11958 | ||
11959 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
11960 | sizer's minimal size. This will not alter the on screen size of the | |
11961 | window, but may cause the addition/removal/alteration of scrollbars | |
11962 | required to view the virtual area in windows which manage it. | |
11963 | ||
11964 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
11965 | ||
11966 | """ | |
d55e5bfc RD |
11967 | return _core_.Sizer_FitInside(*args, **kwargs) |
11968 | ||
11969 | def SetSizeHints(*args, **kwargs): | |
248ed943 RD |
11970 | """ |
11971 | SetSizeHints(self, Window window) | |
11972 | ||
11973 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
11974 | match the sizer's minimal size. This is commonly done in the | |
11975 | constructor of the window itself if the window is resizable (as are | |
11976 | many dialogs under Unix and frames on probably all platforms) in order | |
11977 | to prevent the window from being sized smaller than the minimal size | |
11978 | required by the sizer. | |
11979 | """ | |
d55e5bfc RD |
11980 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
11981 | ||
11982 | def SetVirtualSizeHints(*args, **kwargs): | |
248ed943 RD |
11983 | """ |
11984 | SetVirtualSizeHints(self, Window window) | |
11985 | ||
11986 | Tell the sizer to set the minimal size of the window virtual area to | |
11987 | match the sizer's minimal size. For windows with managed scrollbars | |
11988 | this will set them appropriately. | |
11989 | ||
11990 | :see: `wx.ScrolledWindow.SetScrollbars` | |
11991 | ||
11992 | """ | |
d55e5bfc RD |
11993 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
11994 | ||
11995 | def Clear(*args, **kwargs): | |
248ed943 RD |
11996 | """ |
11997 | Clear(self, bool deleteWindows=False) | |
11998 | ||
11999 | Clear all items from the sizer, optionally destroying the window items | |
12000 | as well. | |
12001 | """ | |
d55e5bfc RD |
12002 | return _core_.Sizer_Clear(*args, **kwargs) |
12003 | ||
12004 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
12005 | """ |
12006 | DeleteWindows(self) | |
12007 | ||
12008 | Destroy all windows managed by the sizer. | |
12009 | """ | |
d55e5bfc RD |
12010 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
12011 | ||
12012 | def GetChildren(*args, **kwargs): | |
248ed943 | 12013 | """ |
51b83b37 | 12014 | GetChildren(self) -> list |
248ed943 RD |
12015 | |
12016 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
12017 | """ | |
d55e5bfc RD |
12018 | return _core_.Sizer_GetChildren(*args, **kwargs) |
12019 | ||
12020 | def Show(*args, **kwargs): | |
248ed943 | 12021 | """ |
ae8162c8 | 12022 | Show(self, item, bool show=True, bool recursive=false) -> bool |
d55e5bfc | 12023 | |
248ed943 RD |
12024 | Shows or hides an item managed by the sizer. To make a sizer item |
12025 | disappear or reappear, use Show followed by `Layout`. The *item* | |
12026 | parameter can be either a window, a sizer, or the zero-based index of | |
629e65c2 RD |
12027 | the item. Use the recursive parameter to show or hide an item in a |
12028 | subsizer. Returns True if the item was found. | |
248ed943 RD |
12029 | """ |
12030 | return _core_.Sizer_Show(*args, **kwargs) | |
d55e5bfc RD |
12031 | |
12032 | def IsShown(*args, **kwargs): | |
248ed943 RD |
12033 | """ |
12034 | IsShown(self, item) | |
12035 | ||
12036 | Determines if the item is currently shown. sizer. To make a sizer | |
12037 | item disappear or reappear, use Show followed by `Layout`. The *item* | |
12038 | parameter can be either a window, a sizer, or the zero-based index of | |
12039 | the item. | |
12040 | """ | |
d55e5bfc RD |
12041 | return _core_.Sizer_IsShown(*args, **kwargs) |
12042 | ||
629e65c2 | 12043 | def Hide(self, item, recursive=False): |
248ed943 | 12044 | """ |
27fb7603 | 12045 | A convenience method for `Show` (item, False, recursive). |
248ed943 | 12046 | """ |
06759a38 | 12047 | return self.Show(item, False, recursive) |
248ed943 | 12048 | |
d55e5bfc | 12049 | def ShowItems(*args, **kwargs): |
248ed943 RD |
12050 | """ |
12051 | ShowItems(self, bool show) | |
12052 | ||
84f85550 | 12053 | Recursively call `wx.SizerItem.Show` on all sizer items. |
248ed943 | 12054 | """ |
d55e5bfc RD |
12055 | return _core_.Sizer_ShowItems(*args, **kwargs) |
12056 | ||
12057 | ||
12058 | class SizerPtr(Sizer): | |
12059 | def __init__(self, this): | |
12060 | self.this = this | |
12061 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12062 | self.__class__ = Sizer | |
12063 | _core_.Sizer_swigregister(SizerPtr) | |
12064 | ||
12065 | class PySizer(Sizer): | |
248ed943 RD |
12066 | """ |
12067 | wx.PySizer is a special version of `wx.Sizer` that has been | |
12068 | instrumented to allow the C++ virtual methods to be overloaded in | |
12069 | Python derived classes. You would derive from this class if you are | |
12070 | wanting to implement a custom sizer in Python code. Simply implement | |
12071 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
12072 | For example:: | |
12073 | ||
12074 | class MySizer(wx.PySizer): | |
12075 | def __init__(self): | |
12076 | wx.PySizer.__init__(self) | |
12077 | ||
12078 | def CalcMin(self): | |
12079 | for item in self.GetChildren(): | |
12080 | # calculate the total minimum width and height needed | |
12081 | # by all items in the sizer according to this sizer's | |
12082 | # layout algorithm. | |
12083 | ... | |
12084 | return wx.Size(width, height) | |
12085 | ||
12086 | def RecalcSizes(self): | |
12087 | # find the space allotted to this sizer | |
12088 | pos = self.GetPosition() | |
12089 | size = self.GetSize() | |
12090 | for item in self.GetChildren(): | |
12091 | # Recalculate (if necessary) the position and size of | |
12092 | # each item and then call item.SetDimension to do the | |
12093 | # actual positioning and sizing of the items within the | |
12094 | # space alloted to this sizer. | |
12095 | ... | |
12096 | item.SetDimension(itemPos, itemSize) | |
12097 | ||
12098 | ||
12099 | When `Layout` is called it first calls `CalcMin` followed by | |
12100 | `RecalcSizes` so you can optimize a bit by saving the results of | |
62d32a5f | 12101 | `CalcMin` and reusing them in `RecalcSizes`. |
248ed943 RD |
12102 | |
12103 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
12104 | ||
12105 | ||
12106 | """ | |
d55e5bfc RD |
12107 | def __repr__(self): |
12108 | return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12109 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12110 | """ |
12111 | __init__(self) -> PySizer | |
12112 | ||
12113 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
12114 | class. | |
12115 | """ | |
d55e5bfc RD |
12116 | newobj = _core_.new_PySizer(*args, **kwargs) |
12117 | self.this = newobj.this | |
12118 | self.thisown = 1 | |
12119 | del newobj.thisown | |
12120 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) | |
12121 | ||
12122 | def _setCallbackInfo(*args, **kwargs): | |
12123 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
12124 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) | |
12125 | ||
12126 | ||
12127 | class PySizerPtr(PySizer): | |
12128 | def __init__(self, this): | |
12129 | self.this = this | |
12130 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12131 | self.__class__ = PySizer | |
12132 | _core_.PySizer_swigregister(PySizerPtr) | |
12133 | ||
12134 | #--------------------------------------------------------------------------- | |
12135 | ||
12136 | class BoxSizer(Sizer): | |
248ed943 RD |
12137 | """ |
12138 | The basic idea behind a box sizer is that windows will most often be | |
12139 | laid out in rather simple basic geometry, typically in a row or a | |
12140 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
12141 | its items in a simple row or column, depending on the orientation | |
12142 | parameter passed to the constructor. | |
12143 | """ | |
d55e5bfc RD |
12144 | def __repr__(self): |
12145 | return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12146 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12147 | """ |
12148 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
12149 | ||
12150 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
12151 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
12152 | sizer. | |
12153 | """ | |
d55e5bfc RD |
12154 | newobj = _core_.new_BoxSizer(*args, **kwargs) |
12155 | self.this = newobj.this | |
12156 | self.thisown = 1 | |
12157 | del newobj.thisown | |
12158 | self._setOORInfo(self) | |
12159 | ||
12160 | def GetOrientation(*args, **kwargs): | |
248ed943 RD |
12161 | """ |
12162 | GetOrientation(self) -> int | |
12163 | ||
12164 | Returns the current orientation of the sizer. | |
12165 | """ | |
d55e5bfc RD |
12166 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
12167 | ||
12168 | def SetOrientation(*args, **kwargs): | |
248ed943 RD |
12169 | """ |
12170 | SetOrientation(self, int orient) | |
d55e5bfc | 12171 | |
248ed943 RD |
12172 | Resets the orientation of the sizer. |
12173 | """ | |
12174 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
d55e5bfc RD |
12175 | |
12176 | ||
12177 | class BoxSizerPtr(BoxSizer): | |
12178 | def __init__(self, this): | |
12179 | self.this = this | |
12180 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12181 | self.__class__ = BoxSizer | |
12182 | _core_.BoxSizer_swigregister(BoxSizerPtr) | |
12183 | ||
12184 | #--------------------------------------------------------------------------- | |
12185 | ||
12186 | class StaticBoxSizer(BoxSizer): | |
248ed943 RD |
12187 | """ |
12188 | wx.StaticBoxSizer derives from and functions identically to the | |
12189 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
12190 | manages. Note that this static box must be created separately and | |
12191 | passed to the sizer constructor. | |
12192 | """ | |
d55e5bfc RD |
12193 | def __repr__(self): |
12194 | return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12195 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12196 | """ |
12197 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
12198 | ||
12199 | Constructor. It takes an associated static box and the orientation | |
12200 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
12201 | ``wx.HORIZONTAL``. | |
12202 | """ | |
d55e5bfc RD |
12203 | newobj = _core_.new_StaticBoxSizer(*args, **kwargs) |
12204 | self.this = newobj.this | |
12205 | self.thisown = 1 | |
12206 | del newobj.thisown | |
12207 | self._setOORInfo(self) | |
12208 | ||
12209 | def GetStaticBox(*args, **kwargs): | |
248ed943 RD |
12210 | """ |
12211 | GetStaticBox(self) -> StaticBox | |
d55e5bfc | 12212 | |
248ed943 RD |
12213 | Returns the static box associated with this sizer. |
12214 | """ | |
12215 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
d55e5bfc RD |
12216 | |
12217 | ||
12218 | class StaticBoxSizerPtr(StaticBoxSizer): | |
12219 | def __init__(self, this): | |
12220 | self.this = this | |
12221 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12222 | self.__class__ = StaticBoxSizer | |
12223 | _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr) | |
12224 | ||
12225 | #--------------------------------------------------------------------------- | |
12226 | ||
12227 | class GridSizer(Sizer): | |
248ed943 RD |
12228 | """ |
12229 | A grid sizer is a sizer which lays out its children in a | |
12230 | two-dimensional table with all cells having the same size. In other | |
12231 | words, the width of each cell within the grid is the width of the | |
12232 | widest item added to the sizer and the height of each grid cell is the | |
12233 | height of the tallest item. An optional vertical and/or horizontal | |
12234 | gap between items can also be specified (in pixels.) | |
12235 | ||
12236 | Items are placed in the cells of the grid in the order they are added, | |
12237 | in row-major order. In other words, the first row is filled first, | |
12238 | then the second, and so on until all items have been added. (If | |
12239 | neccessary, additional rows will be added as items are added.) If you | |
12240 | need to have greater control over the cells that items are placed in | |
12241 | then use the `wx.GridBagSizer`. | |
12242 | ||
12243 | """ | |
d55e5bfc RD |
12244 | def __repr__(self): |
12245 | return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12246 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12247 | """ |
12248 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
12249 | ||
12250 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
12251 | of columns and rows in the sizer - if either of the parameters is | |
12252 | zero, it will be calculated to from the total number of children in | |
12253 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12254 | define extra space between all children. | |
12255 | """ | |
d55e5bfc RD |
12256 | newobj = _core_.new_GridSizer(*args, **kwargs) |
12257 | self.this = newobj.this | |
12258 | self.thisown = 1 | |
12259 | del newobj.thisown | |
12260 | self._setOORInfo(self) | |
12261 | ||
d55e5bfc | 12262 | def SetCols(*args, **kwargs): |
248ed943 RD |
12263 | """ |
12264 | SetCols(self, int cols) | |
12265 | ||
12266 | Sets the number of columns in the sizer. | |
12267 | """ | |
d55e5bfc RD |
12268 | return _core_.GridSizer_SetCols(*args, **kwargs) |
12269 | ||
12270 | def SetRows(*args, **kwargs): | |
248ed943 RD |
12271 | """ |
12272 | SetRows(self, int rows) | |
12273 | ||
12274 | Sets the number of rows in the sizer. | |
12275 | """ | |
d55e5bfc RD |
12276 | return _core_.GridSizer_SetRows(*args, **kwargs) |
12277 | ||
12278 | def SetVGap(*args, **kwargs): | |
248ed943 RD |
12279 | """ |
12280 | SetVGap(self, int gap) | |
12281 | ||
12282 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
12283 | """ | |
d55e5bfc RD |
12284 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
12285 | ||
12286 | def SetHGap(*args, **kwargs): | |
248ed943 RD |
12287 | """ |
12288 | SetHGap(self, int gap) | |
12289 | ||
12290 | Sets the horizontal gap (in pixels) between cells in the sizer | |
12291 | """ | |
d55e5bfc RD |
12292 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
12293 | ||
12294 | def GetCols(*args, **kwargs): | |
248ed943 RD |
12295 | """ |
12296 | GetCols(self) -> int | |
12297 | ||
12298 | Returns the number of columns in the sizer. | |
12299 | """ | |
d55e5bfc RD |
12300 | return _core_.GridSizer_GetCols(*args, **kwargs) |
12301 | ||
12302 | def GetRows(*args, **kwargs): | |
248ed943 RD |
12303 | """ |
12304 | GetRows(self) -> int | |
12305 | ||
12306 | Returns the number of rows in the sizer. | |
12307 | """ | |
d55e5bfc RD |
12308 | return _core_.GridSizer_GetRows(*args, **kwargs) |
12309 | ||
12310 | def GetVGap(*args, **kwargs): | |
248ed943 RD |
12311 | """ |
12312 | GetVGap(self) -> int | |
12313 | ||
12314 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
12315 | """ | |
d55e5bfc RD |
12316 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
12317 | ||
12318 | def GetHGap(*args, **kwargs): | |
248ed943 RD |
12319 | """ |
12320 | GetHGap(self) -> int | |
12321 | ||
12322 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
12323 | """ | |
d55e5bfc RD |
12324 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
12325 | ||
12326 | ||
12327 | class GridSizerPtr(GridSizer): | |
12328 | def __init__(self, this): | |
12329 | self.this = this | |
12330 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12331 | self.__class__ = GridSizer | |
12332 | _core_.GridSizer_swigregister(GridSizerPtr) | |
12333 | ||
12334 | #--------------------------------------------------------------------------- | |
12335 | ||
12336 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE | |
12337 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
12338 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
12339 | class FlexGridSizer(GridSizer): | |
248ed943 RD |
12340 | """ |
12341 | A flex grid sizer is a sizer which lays out its children in a | |
12342 | two-dimensional table with all table cells in one row having the same | |
12343 | height and all cells in one column having the same width, but all | |
12344 | rows or all columns are not necessarily the same height or width as in | |
12345 | the `wx.GridSizer`. | |
12346 | ||
12347 | wx.FlexGridSizer can also size items equally in one direction but | |
12348 | unequally ("flexibly") in the other. If the sizer is only flexible | |
12349 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
12350 | needs to be decided how the sizer should grow in the other ("non | |
12351 | flexible") direction in order to fill the available space. The | |
12352 | `SetNonFlexibleGrowMode` method serves this purpose. | |
12353 | ||
12354 | ||
12355 | """ | |
d55e5bfc RD |
12356 | def __repr__(self): |
12357 | return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12358 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12359 | """ |
12360 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
12361 | ||
12362 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
12363 | number of columns and rows in the sizer - if either of the parameters | |
12364 | is zero, it will be calculated to from the total number of children in | |
12365 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12366 | define extra space between all children. | |
12367 | """ | |
d55e5bfc RD |
12368 | newobj = _core_.new_FlexGridSizer(*args, **kwargs) |
12369 | self.this = newobj.this | |
12370 | self.thisown = 1 | |
12371 | del newobj.thisown | |
12372 | self._setOORInfo(self) | |
12373 | ||
248ed943 RD |
12374 | def AddGrowableRow(*args, **kwargs): |
12375 | """ | |
12376 | AddGrowableRow(self, size_t idx, int proportion=0) | |
d55e5bfc | 12377 | |
248ed943 RD |
12378 | Specifies that row *idx* (starting from zero) should be grown if there |
12379 | is extra space available to the sizer. | |
d55e5bfc | 12380 | |
248ed943 RD |
12381 | The *proportion* parameter has the same meaning as the stretch factor |
12382 | for the box sizers except that if all proportions are 0, then all | |
12383 | columns are resized equally (instead of not being resized at all). | |
12384 | """ | |
d55e5bfc RD |
12385 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
12386 | ||
12387 | def RemoveGrowableRow(*args, **kwargs): | |
248ed943 RD |
12388 | """ |
12389 | RemoveGrowableRow(self, size_t idx) | |
12390 | ||
12391 | Specifies that row *idx* is no longer growable. | |
12392 | """ | |
d55e5bfc RD |
12393 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
12394 | ||
12395 | def AddGrowableCol(*args, **kwargs): | |
248ed943 RD |
12396 | """ |
12397 | AddGrowableCol(self, size_t idx, int proportion=0) | |
12398 | ||
12399 | Specifies that column *idx* (starting from zero) should be grown if | |
12400 | there is extra space available to the sizer. | |
12401 | ||
12402 | The *proportion* parameter has the same meaning as the stretch factor | |
12403 | for the box sizers except that if all proportions are 0, then all | |
12404 | columns are resized equally (instead of not being resized at all). | |
12405 | """ | |
d55e5bfc RD |
12406 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
12407 | ||
12408 | def RemoveGrowableCol(*args, **kwargs): | |
248ed943 RD |
12409 | """ |
12410 | RemoveGrowableCol(self, size_t idx) | |
12411 | ||
12412 | Specifies that column *idx* is no longer growable. | |
12413 | """ | |
d55e5bfc RD |
12414 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
12415 | ||
12416 | def SetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12417 | """ |
12418 | SetFlexibleDirection(self, int direction) | |
12419 | ||
12420 | Specifies whether the sizer should flexibly resize its columns, rows, | |
12421 | or both. Argument *direction* can be one of the following values. Any | |
12422 | other value is ignored. | |
12423 | ||
12424 | ============== ======================================= | |
12425 | wx.VERTICAL Rows are flexibly sized. | |
12426 | wx.HORIZONTAL Columns are flexibly sized. | |
12427 | wx.BOTH Both rows and columns are flexibly sized | |
12428 | (this is the default value). | |
12429 | ============== ======================================= | |
12430 | ||
12431 | Note that this method does not trigger relayout. | |
12432 | ||
12433 | """ | |
d55e5bfc RD |
12434 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
12435 | ||
12436 | def GetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12437 | """ |
12438 | GetFlexibleDirection(self) -> int | |
12439 | ||
12440 | Returns a value that specifies whether the sizer | |
12441 | flexibly resizes its columns, rows, or both (default). | |
12442 | ||
12443 | :see: `SetFlexibleDirection` | |
12444 | """ | |
d55e5bfc RD |
12445 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
12446 | ||
12447 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12448 | """ |
12449 | SetNonFlexibleGrowMode(self, int mode) | |
12450 | ||
12451 | Specifies how the sizer should grow in the non-flexible direction if | |
12452 | there is one (so `SetFlexibleDirection` must have been called | |
12453 | previously). Argument *mode* can be one of the following values: | |
12454 | ||
12455 | ========================== ================================================= | |
12456 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
12457 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
12458 | `AddGrowableCol` and `AddGrowableRow`. In this | |
12459 | case equal sizing applies to minimum sizes of | |
12460 | columns or rows (this is the default value). | |
12461 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
12462 | the non flexible direction, whether they are | |
12463 | growable or not in the flexbile direction. | |
12464 | ========================== ================================================= | |
12465 | ||
12466 | Note that this method does not trigger relayout. | |
12467 | ||
12468 | ||
12469 | """ | |
d55e5bfc RD |
12470 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
12471 | ||
12472 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12473 | """ |
12474 | GetNonFlexibleGrowMode(self) -> int | |
12475 | ||
12476 | Returns the value that specifies how the sizer grows in the | |
12477 | non-flexible direction if there is one. | |
12478 | ||
12479 | :see: `SetNonFlexibleGrowMode` | |
12480 | """ | |
d55e5bfc RD |
12481 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
12482 | ||
12483 | def GetRowHeights(*args, **kwargs): | |
a8eff060 RD |
12484 | """ |
12485 | GetRowHeights(self) -> list | |
12486 | ||
12487 | Returns a list of integers representing the heights of each of the | |
12488 | rows in the sizer. | |
12489 | """ | |
d55e5bfc RD |
12490 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
12491 | ||
12492 | def GetColWidths(*args, **kwargs): | |
a8eff060 RD |
12493 | """ |
12494 | GetColWidths(self) -> list | |
12495 | ||
12496 | Returns a list of integers representing the widths of each of the | |
12497 | columns in the sizer. | |
12498 | """ | |
d55e5bfc RD |
12499 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
12500 | ||
12501 | ||
12502 | class FlexGridSizerPtr(FlexGridSizer): | |
12503 | def __init__(self, this): | |
12504 | self.this = this | |
12505 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12506 | self.__class__ = FlexGridSizer | |
12507 | _core_.FlexGridSizer_swigregister(FlexGridSizerPtr) | |
12508 | ||
62d32a5f RD |
12509 | class StdDialogButtonSizer(BoxSizer): |
12510 | """ | |
12511 | A special sizer that knows how to order and position standard buttons | |
12512 | in order to conform to the current platform's standards. You simply | |
12513 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 12514 | buttons using the standard ID's. Then call `Realize` and the sizer |
62d32a5f RD |
12515 | will take care of the rest. |
12516 | ||
12517 | """ | |
12518 | def __repr__(self): | |
12519 | return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12520 | def __init__(self, *args, **kwargs): | |
12521 | """__init__(self) -> StdDialogButtonSizer""" | |
12522 | newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs) | |
12523 | self.this = newobj.this | |
12524 | self.thisown = 1 | |
12525 | del newobj.thisown | |
12526 | def AddButton(*args, **kwargs): | |
12527 | """ | |
12528 | AddButton(self, wxButton button) | |
12529 | ||
12530 | Use this to add the buttons to this sizer. Do not use the `Add` | |
12531 | method in the base class. | |
12532 | """ | |
12533 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
12534 | ||
53aa7709 | 12535 | def Realize(*args, **kwargs): |
62d32a5f | 12536 | """ |
53aa7709 | 12537 | Realize(self) |
62d32a5f RD |
12538 | |
12539 | This funciton needs to be called after all the buttons have been added | |
12540 | to the sizer. It will reorder them and position them in a platform | |
12541 | specifc manner. | |
12542 | """ | |
53aa7709 | 12543 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
12544 | |
12545 | def SetAffirmativeButton(*args, **kwargs): | |
12546 | """SetAffirmativeButton(self, wxButton button)""" | |
12547 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
12548 | ||
12549 | def SetNegativeButton(*args, **kwargs): | |
12550 | """SetNegativeButton(self, wxButton button)""" | |
12551 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
12552 | ||
12553 | def SetCancelButton(*args, **kwargs): | |
12554 | """SetCancelButton(self, wxButton button)""" | |
12555 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
62d32a5f RD |
12556 | |
12557 | def GetAffirmativeButton(*args, **kwargs): | |
12558 | """GetAffirmativeButton(self) -> wxButton""" | |
12559 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
12560 | ||
12561 | def GetApplyButton(*args, **kwargs): | |
12562 | """GetApplyButton(self) -> wxButton""" | |
12563 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
12564 | ||
12565 | def GetNegativeButton(*args, **kwargs): | |
12566 | """GetNegativeButton(self) -> wxButton""" | |
12567 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
12568 | ||
12569 | def GetCancelButton(*args, **kwargs): | |
12570 | """GetCancelButton(self) -> wxButton""" | |
12571 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
12572 | ||
12573 | def GetHelpButton(*args, **kwargs): | |
12574 | """GetHelpButton(self) -> wxButton""" | |
12575 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
12576 | ||
12577 | ||
12578 | class StdDialogButtonSizerPtr(StdDialogButtonSizer): | |
12579 | def __init__(self, this): | |
12580 | self.this = this | |
12581 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12582 | self.__class__ = StdDialogButtonSizer | |
12583 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr) | |
12584 | ||
d55e5bfc RD |
12585 | #--------------------------------------------------------------------------- |
12586 | ||
12587 | class GBPosition(object): | |
248ed943 RD |
12588 | """ |
12589 | This class represents the position of an item in a virtual grid of | |
12590 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12591 | typemaps that will automatically convert from a 2-element sequence of | |
12592 | integers to a wx.GBPosition, so you can use the more pythonic | |
12593 | representation of the position nearly transparently in Python code. | |
12594 | """ | |
d55e5bfc RD |
12595 | def __repr__(self): |
12596 | return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12597 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12598 | """ |
12599 | __init__(self, int row=0, int col=0) -> GBPosition | |
12600 | ||
12601 | This class represents the position of an item in a virtual grid of | |
12602 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12603 | typemaps that will automatically convert from a 2-element sequence of | |
12604 | integers to a wx.GBPosition, so you can use the more pythonic | |
12605 | representation of the position nearly transparently in Python code. | |
12606 | """ | |
d55e5bfc RD |
12607 | newobj = _core_.new_GBPosition(*args, **kwargs) |
12608 | self.this = newobj.this | |
12609 | self.thisown = 1 | |
12610 | del newobj.thisown | |
12611 | def GetRow(*args, **kwargs): | |
12612 | """GetRow(self) -> int""" | |
12613 | return _core_.GBPosition_GetRow(*args, **kwargs) | |
12614 | ||
12615 | def GetCol(*args, **kwargs): | |
12616 | """GetCol(self) -> int""" | |
12617 | return _core_.GBPosition_GetCol(*args, **kwargs) | |
12618 | ||
12619 | def SetRow(*args, **kwargs): | |
12620 | """SetRow(self, int row)""" | |
12621 | return _core_.GBPosition_SetRow(*args, **kwargs) | |
12622 | ||
12623 | def SetCol(*args, **kwargs): | |
12624 | """SetCol(self, int col)""" | |
12625 | return _core_.GBPosition_SetCol(*args, **kwargs) | |
12626 | ||
12627 | def __eq__(*args, **kwargs): | |
12628 | """__eq__(self, GBPosition other) -> bool""" | |
12629 | return _core_.GBPosition___eq__(*args, **kwargs) | |
12630 | ||
12631 | def __ne__(*args, **kwargs): | |
12632 | """__ne__(self, GBPosition other) -> bool""" | |
12633 | return _core_.GBPosition___ne__(*args, **kwargs) | |
12634 | ||
12635 | def Set(*args, **kwargs): | |
12636 | """Set(self, int row=0, int col=0)""" | |
12637 | return _core_.GBPosition_Set(*args, **kwargs) | |
12638 | ||
12639 | def Get(*args, **kwargs): | |
12640 | """Get(self) -> PyObject""" | |
12641 | return _core_.GBPosition_Get(*args, **kwargs) | |
12642 | ||
79fccf9d | 12643 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
12644 | def __str__(self): return str(self.Get()) |
12645 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
12646 | def __len__(self): return len(self.Get()) | |
12647 | def __getitem__(self, index): return self.Get()[index] | |
12648 | def __setitem__(self, index, val): | |
12649 | if index == 0: self.SetRow(val) | |
12650 | elif index == 1: self.SetCol(val) | |
12651 | else: raise IndexError | |
12652 | def __nonzero__(self): return self.Get() != (0,0) | |
12653 | __safe_for_unpickling__ = True | |
12654 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
12655 | ||
12656 | row = property(GetRow, SetRow) | |
12657 | col = property(GetCol, SetCol) | |
12658 | ||
12659 | ||
12660 | class GBPositionPtr(GBPosition): | |
12661 | def __init__(self, this): | |
12662 | self.this = this | |
12663 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12664 | self.__class__ = GBPosition | |
12665 | _core_.GBPosition_swigregister(GBPositionPtr) | |
12666 | ||
12667 | class GBSpan(object): | |
248ed943 RD |
12668 | """ |
12669 | This class is used to hold the row and column spanning attributes of | |
12670 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
12671 | automatically convert from a 2-element sequence of integers to a | |
12672 | wx.GBSpan, so you can use the more pythonic representation of the span | |
12673 | nearly transparently in Python code. | |
12674 | ||
12675 | """ | |
d55e5bfc RD |
12676 | def __repr__(self): |
12677 | return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12678 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12679 | """ |
12680 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
12681 | ||
12682 | Construct a new wxGBSpan, optionally setting the rowspan and | |
12683 | colspan. The default is (1,1). (Meaning that the item occupies one | |
12684 | cell in each direction. | |
12685 | """ | |
d55e5bfc RD |
12686 | newobj = _core_.new_GBSpan(*args, **kwargs) |
12687 | self.this = newobj.this | |
12688 | self.thisown = 1 | |
12689 | del newobj.thisown | |
12690 | def GetRowspan(*args, **kwargs): | |
12691 | """GetRowspan(self) -> int""" | |
12692 | return _core_.GBSpan_GetRowspan(*args, **kwargs) | |
12693 | ||
12694 | def GetColspan(*args, **kwargs): | |
12695 | """GetColspan(self) -> int""" | |
12696 | return _core_.GBSpan_GetColspan(*args, **kwargs) | |
12697 | ||
12698 | def SetRowspan(*args, **kwargs): | |
12699 | """SetRowspan(self, int rowspan)""" | |
12700 | return _core_.GBSpan_SetRowspan(*args, **kwargs) | |
12701 | ||
12702 | def SetColspan(*args, **kwargs): | |
12703 | """SetColspan(self, int colspan)""" | |
12704 | return _core_.GBSpan_SetColspan(*args, **kwargs) | |
12705 | ||
12706 | def __eq__(*args, **kwargs): | |
12707 | """__eq__(self, GBSpan other) -> bool""" | |
12708 | return _core_.GBSpan___eq__(*args, **kwargs) | |
12709 | ||
12710 | def __ne__(*args, **kwargs): | |
12711 | """__ne__(self, GBSpan other) -> bool""" | |
12712 | return _core_.GBSpan___ne__(*args, **kwargs) | |
12713 | ||
12714 | def Set(*args, **kwargs): | |
12715 | """Set(self, int rowspan=1, int colspan=1)""" | |
12716 | return _core_.GBSpan_Set(*args, **kwargs) | |
12717 | ||
12718 | def Get(*args, **kwargs): | |
12719 | """Get(self) -> PyObject""" | |
12720 | return _core_.GBSpan_Get(*args, **kwargs) | |
12721 | ||
79fccf9d | 12722 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
12723 | def __str__(self): return str(self.Get()) |
12724 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
12725 | def __len__(self): return len(self.Get()) | |
12726 | def __getitem__(self, index): return self.Get()[index] | |
12727 | def __setitem__(self, index, val): | |
12728 | if index == 0: self.SetRowspan(val) | |
12729 | elif index == 1: self.SetColspan(val) | |
12730 | else: raise IndexError | |
12731 | def __nonzero__(self): return self.Get() != (0,0) | |
12732 | __safe_for_unpickling__ = True | |
12733 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
12734 | ||
12735 | rowspan = property(GetRowspan, SetRowspan) | |
12736 | colspan = property(GetColspan, SetColspan) | |
12737 | ||
12738 | ||
12739 | class GBSpanPtr(GBSpan): | |
12740 | def __init__(self, this): | |
12741 | self.this = this | |
12742 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12743 | self.__class__ = GBSpan | |
12744 | _core_.GBSpan_swigregister(GBSpanPtr) | |
12745 | ||
12746 | class GBSizerItem(SizerItem): | |
248ed943 RD |
12747 | """ |
12748 | The wx.GBSizerItem class is used to track the additional data about | |
12749 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12750 | and how many rows or columns it spans. | |
12751 | ||
12752 | """ | |
d55e5bfc RD |
12753 | def __repr__(self): |
12754 | return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12755 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12756 | """ |
12757 | __init__(self) -> GBSizerItem | |
12758 | ||
12759 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12760 | size will need to be set, as well as a position and span before this | |
12761 | item can be used in a Sizer. | |
12762 | ||
12763 | You will probably never need to create a wx.GBSizerItem directly as they | |
12764 | are created automatically when the sizer's Add method is called. | |
12765 | """ | |
d55e5bfc RD |
12766 | newobj = _core_.new_GBSizerItem(*args, **kwargs) |
12767 | self.this = newobj.this | |
12768 | self.thisown = 1 | |
12769 | del newobj.thisown | |
12770 | def GetPos(*args, **kwargs): | |
248ed943 RD |
12771 | """ |
12772 | GetPos(self) -> GBPosition | |
12773 | ||
12774 | Get the grid position of the item | |
12775 | """ | |
d55e5bfc RD |
12776 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
12777 | ||
12778 | def GetPosTuple(self): return self.GetPos().Get() | |
12779 | def GetSpan(*args, **kwargs): | |
248ed943 RD |
12780 | """ |
12781 | GetSpan(self) -> GBSpan | |
12782 | ||
12783 | Get the row and column spanning of the item | |
12784 | """ | |
d55e5bfc RD |
12785 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
12786 | ||
12787 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12788 | def SetPos(*args, **kwargs): | |
248ed943 RD |
12789 | """ |
12790 | SetPos(self, GBPosition pos) -> bool | |
12791 | ||
12792 | If the item is already a member of a sizer then first ensure that | |
12793 | there is no other item that would intersect with this one at the new | |
12794 | position, then set the new position. Returns True if the change is | |
12795 | successful and after the next Layout() the item will be moved. | |
12796 | """ | |
d55e5bfc RD |
12797 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
12798 | ||
12799 | def SetSpan(*args, **kwargs): | |
248ed943 RD |
12800 | """ |
12801 | SetSpan(self, GBSpan span) -> bool | |
12802 | ||
12803 | If the item is already a member of a sizer then first ensure that | |
12804 | there is no other item that would intersect with this one with its new | |
12805 | spanning size, then set the new spanning. Returns True if the change | |
12806 | is successful and after the next Layout() the item will be resized. | |
12807 | ||
12808 | """ | |
d55e5bfc RD |
12809 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
12810 | ||
248ed943 | 12811 | def Intersects(*args, **kwargs): |
d55e5bfc RD |
12812 | """ |
12813 | Intersects(self, GBSizerItem other) -> bool | |
248ed943 RD |
12814 | |
12815 | Returns True if this item and the other item instersect. | |
d55e5bfc | 12816 | """ |
248ed943 RD |
12817 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
12818 | ||
12819 | def IntersectsPos(*args, **kwargs): | |
12820 | """ | |
12821 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
12822 | ||
12823 | Returns True if the given pos/span would intersect with this item. | |
12824 | """ | |
12825 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
d55e5bfc RD |
12826 | |
12827 | def GetEndPos(*args, **kwargs): | |
248ed943 RD |
12828 | """ |
12829 | GetEndPos(self) -> GBPosition | |
12830 | ||
12831 | Get the row and column of the endpoint of this item. | |
12832 | """ | |
d55e5bfc RD |
12833 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
12834 | ||
12835 | def GetGBSizer(*args, **kwargs): | |
248ed943 RD |
12836 | """ |
12837 | GetGBSizer(self) -> GridBagSizer | |
12838 | ||
12839 | Get the sizer this item is a member of. | |
12840 | """ | |
d55e5bfc RD |
12841 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
12842 | ||
12843 | def SetGBSizer(*args, **kwargs): | |
248ed943 RD |
12844 | """ |
12845 | SetGBSizer(self, GridBagSizer sizer) | |
12846 | ||
12847 | Set the sizer this item is a member of. | |
12848 | """ | |
d55e5bfc RD |
12849 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
12850 | ||
12851 | ||
12852 | class GBSizerItemPtr(GBSizerItem): | |
12853 | def __init__(self, this): | |
12854 | self.this = this | |
12855 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12856 | self.__class__ = GBSizerItem | |
12857 | _core_.GBSizerItem_swigregister(GBSizerItemPtr) | |
12858 | DefaultSpan = cvar.DefaultSpan | |
12859 | ||
12860 | def GBSizerItemWindow(*args, **kwargs): | |
12861 | """ | |
12862 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12863 | int border, PyObject userData=None) -> GBSizerItem |
12864 | ||
12865 | Construct a `wx.GBSizerItem` for a window. | |
d55e5bfc RD |
12866 | """ |
12867 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) | |
12868 | val.thisown = 1 | |
12869 | return val | |
12870 | ||
12871 | def GBSizerItemSizer(*args, **kwargs): | |
12872 | """ | |
12873 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12874 | int border, PyObject userData=None) -> GBSizerItem |
12875 | ||
12876 | Construct a `wx.GBSizerItem` for a sizer | |
d55e5bfc RD |
12877 | """ |
12878 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) | |
12879 | val.thisown = 1 | |
12880 | return val | |
12881 | ||
12882 | def GBSizerItemSpacer(*args, **kwargs): | |
12883 | """ | |
12884 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
248ed943 RD |
12885 | int flag, int border, PyObject userData=None) -> GBSizerItem |
12886 | ||
12887 | Construct a `wx.GBSizerItem` for a spacer. | |
d55e5bfc RD |
12888 | """ |
12889 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) | |
12890 | val.thisown = 1 | |
12891 | return val | |
12892 | ||
12893 | class GridBagSizer(FlexGridSizer): | |
248ed943 RD |
12894 | """ |
12895 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12896 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12897 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12898 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12899 | virtual grid is determined by the largest row and column that items are | |
12900 | positioned at, adjusted for spanning. | |
12901 | ||
12902 | """ | |
d55e5bfc RD |
12903 | def __repr__(self): |
12904 | return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12905 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12906 | """ |
12907 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
12908 | ||
12909 | Constructor, with optional parameters to specify the gap between the | |
12910 | rows and columns. | |
12911 | """ | |
d55e5bfc RD |
12912 | newobj = _core_.new_GridBagSizer(*args, **kwargs) |
12913 | self.this = newobj.this | |
12914 | self.thisown = 1 | |
12915 | del newobj.thisown | |
c9c2cf70 RD |
12916 | self._setOORInfo(self) |
12917 | ||
d55e5bfc RD |
12918 | def Add(*args, **kwargs): |
12919 | """ | |
248ed943 | 12920 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
c1cb24a4 | 12921 | int border=0, userData=None) -> wx.GBSizerItem |
248ed943 RD |
12922 | |
12923 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12924 | more than one row or column as specified with *span*. The remaining | |
12925 | args behave similarly to `wx.Sizer.Add`. | |
12926 | ||
12927 | Returns True if the item was successfully placed at the given cell | |
12928 | position, False if something was already there. | |
12929 | ||
d55e5bfc RD |
12930 | """ |
12931 | return _core_.GridBagSizer_Add(*args, **kwargs) | |
12932 | ||
12933 | def AddItem(*args, **kwargs): | |
248ed943 | 12934 | """ |
c1cb24a4 | 12935 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
248ed943 RD |
12936 | |
12937 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12938 | the item was successfully placed at its given cell position, False if | |
12939 | something was already there. | |
12940 | """ | |
d55e5bfc RD |
12941 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
12942 | ||
84f85550 RD |
12943 | def GetCellSize(*args, **kwargs): |
12944 | """ | |
12945 | GetCellSize(self, int row, int col) -> Size | |
12946 | ||
12947 | Get the size of the specified cell, including hgap and | |
12948 | vgap. Only valid after a Layout. | |
12949 | """ | |
12950 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
12951 | ||
d55e5bfc | 12952 | def GetEmptyCellSize(*args, **kwargs): |
248ed943 RD |
12953 | """ |
12954 | GetEmptyCellSize(self) -> Size | |
12955 | ||
12956 | Get the size used for cells in the grid with no item. | |
12957 | """ | |
d55e5bfc RD |
12958 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
12959 | ||
12960 | def SetEmptyCellSize(*args, **kwargs): | |
248ed943 RD |
12961 | """ |
12962 | SetEmptyCellSize(self, Size sz) | |
12963 | ||
12964 | Set the size used for cells in the grid with no item. | |
12965 | """ | |
d55e5bfc RD |
12966 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
12967 | ||
12968 | def GetItemPosition(*args): | |
12969 | """ | |
248ed943 RD |
12970 | GetItemPosition(self, item) -> GBPosition |
12971 | ||
12972 | Get the grid position of the specified *item* where *item* is either a | |
12973 | window or subsizer that is a member of this sizer, or a zero-based | |
12974 | index of an item. | |
d55e5bfc RD |
12975 | """ |
12976 | return _core_.GridBagSizer_GetItemPosition(*args) | |
12977 | ||
12978 | def SetItemPosition(*args): | |
12979 | """ | |
248ed943 RD |
12980 | SetItemPosition(self, item, GBPosition pos) -> bool |
12981 | ||
12982 | Set the grid position of the specified *item* where *item* is either a | |
12983 | window or subsizer that is a member of this sizer, or a zero-based | |
12984 | index of an item. Returns True on success. If the move is not | |
12985 | allowed (because an item is already there) then False is returned. | |
12986 | ||
d55e5bfc RD |
12987 | """ |
12988 | return _core_.GridBagSizer_SetItemPosition(*args) | |
12989 | ||
12990 | def GetItemSpan(*args): | |
12991 | """ | |
248ed943 RD |
12992 | GetItemSpan(self, item) -> GBSpan |
12993 | ||
12994 | Get the row/col spanning of the specified *item* where *item* is | |
12995 | either a window or subsizer that is a member of this sizer, or a | |
12996 | zero-based index of an item. | |
d55e5bfc RD |
12997 | """ |
12998 | return _core_.GridBagSizer_GetItemSpan(*args) | |
12999 | ||
13000 | def SetItemSpan(*args): | |
13001 | """ | |
248ed943 RD |
13002 | SetItemSpan(self, item, GBSpan span) -> bool |
13003 | ||
13004 | Set the row/col spanning of the specified *item* where *item* is | |
13005 | either a window or subsizer that is a member of this sizer, or a | |
13006 | zero-based index of an item. Returns True on success. If the move is | |
13007 | not allowed (because an item is already there) then False is returned. | |
d55e5bfc RD |
13008 | """ |
13009 | return _core_.GridBagSizer_SetItemSpan(*args) | |
13010 | ||
13011 | def FindItem(*args): | |
13012 | """ | |
248ed943 RD |
13013 | FindItem(self, item) -> GBSizerItem |
13014 | ||
13015 | Find the sizer item for the given window or subsizer, returns None if | |
13016 | not found. (non-recursive) | |
d55e5bfc RD |
13017 | """ |
13018 | return _core_.GridBagSizer_FindItem(*args) | |
13019 | ||
13020 | def FindItemAtPosition(*args, **kwargs): | |
248ed943 RD |
13021 | """ |
13022 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
13023 | ||
13024 | Return the sizer item for the given grid cell, or None if there is no | |
13025 | item at that position. (non-recursive) | |
13026 | """ | |
d55e5bfc RD |
13027 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
13028 | ||
13029 | def FindItemAtPoint(*args, **kwargs): | |
248ed943 RD |
13030 | """ |
13031 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
13032 | ||
13033 | Return the sizer item located at the point given in *pt*, or None if | |
13034 | there is no item at that point. The (x,y) coordinates in pt correspond | |
13035 | to the client coordinates of the window using the sizer for | |
13036 | layout. (non-recursive) | |
13037 | """ | |
d55e5bfc RD |
13038 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
13039 | ||
248ed943 RD |
13040 | def CheckForIntersection(*args, **kwargs): |
13041 | """ | |
13042 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
d55e5bfc | 13043 | |
248ed943 RD |
13044 | Look at all items and see if any intersect (or would overlap) the |
13045 | given *item*. Returns True if so, False if there would be no overlap. | |
13046 | If an *excludeItem* is given then it will not be checked for | |
13047 | intersection, for example it may be the item we are checking the | |
13048 | position of. | |
d55e5bfc | 13049 | |
248ed943 RD |
13050 | """ |
13051 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
d55e5bfc | 13052 | |
248ed943 | 13053 | def CheckForIntersectionPos(*args, **kwargs): |
d55e5bfc | 13054 | """ |
248ed943 RD |
13055 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
13056 | ||
13057 | Look at all items and see if any intersect (or would overlap) the | |
13058 | given position and span. Returns True if so, False if there would be | |
13059 | no overlap. If an *excludeItem* is given then it will not be checked | |
13060 | for intersection, for example it may be the item we are checking the | |
13061 | position of. | |
d55e5bfc | 13062 | """ |
248ed943 | 13063 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
d55e5bfc RD |
13064 | |
13065 | ||
13066 | class GridBagSizerPtr(GridBagSizer): | |
13067 | def __init__(self, this): | |
13068 | self.this = this | |
13069 | if not hasattr(self,"thisown"): self.thisown = 0 | |
13070 | self.__class__ = GridBagSizer | |
13071 | _core_.GridBagSizer_swigregister(GridBagSizerPtr) | |
13072 | ||
13073 | #--------------------------------------------------------------------------- | |
13074 | ||
13075 | Left = _core_.Left | |
13076 | Top = _core_.Top | |
13077 | Right = _core_.Right | |
13078 | Bottom = _core_.Bottom | |
13079 | Width = _core_.Width | |
13080 | Height = _core_.Height | |
13081 | Centre = _core_.Centre | |
13082 | Center = _core_.Center | |
13083 | CentreX = _core_.CentreX | |
13084 | CentreY = _core_.CentreY | |
13085 | Unconstrained = _core_.Unconstrained | |
13086 | AsIs = _core_.AsIs | |
13087 | PercentOf = _core_.PercentOf | |
13088 | Above = _core_.Above | |
13089 | Below = _core_.Below | |
13090 | LeftOf = _core_.LeftOf | |
13091 | RightOf = _core_.RightOf | |
13092 | SameAs = _core_.SameAs | |
13093 | Absolute = _core_.Absolute | |
13094 | class IndividualLayoutConstraint(Object): | |
13095 | """ | |
79fccf9d RD |
13096 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
13097 | one of eight possible constraints that a window can be involved in. | |
13098 | You will never need to create an instance of | |
13099 | wx.IndividualLayoutConstraint, rather you should create a | |
13100 | `wx.LayoutConstraints` instance and use the individual contstraints | |
d55e5bfc | 13101 | that it contains. |
d55e5bfc RD |
13102 | """ |
13103 | def __init__(self): raise RuntimeError, "No constructor defined" | |
13104 | def __repr__(self): | |
13105 | return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
13106 | def Set(*args, **kwargs): | |
79fccf9d RD |
13107 | """ |
13108 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
13109 | ||
13110 | Sets the properties of the constraint. Normally called by one of the | |
13111 | convenience functions such as Above, RightOf, SameAs. | |
13112 | """ | |
d55e5bfc RD |
13113 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
13114 | ||
13115 | def LeftOf(*args, **kwargs): | |
13116 | """ | |
13117 | LeftOf(self, Window sibling, int marg=0) | |
13118 | ||
79fccf9d RD |
13119 | Constrains this edge to be to the left of the given window, with an |
13120 | optional margin. Implicitly, this is relative to the left edge of the | |
13121 | other window. | |
d55e5bfc RD |
13122 | """ |
13123 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) | |
13124 | ||
13125 | def RightOf(*args, **kwargs): | |
13126 | """ | |
13127 | RightOf(self, Window sibling, int marg=0) | |
13128 | ||
79fccf9d RD |
13129 | Constrains this edge to be to the right of the given window, with an |
13130 | optional margin. Implicitly, this is relative to the right edge of the | |
13131 | other window. | |
d55e5bfc RD |
13132 | """ |
13133 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) | |
13134 | ||
13135 | def Above(*args, **kwargs): | |
13136 | """ | |
13137 | Above(self, Window sibling, int marg=0) | |
13138 | ||
79fccf9d RD |
13139 | Constrains this edge to be above the given window, with an optional |
13140 | margin. Implicitly, this is relative to the top edge of the other | |
13141 | window. | |
d55e5bfc RD |
13142 | """ |
13143 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) | |
13144 | ||
13145 | def Below(*args, **kwargs): | |
13146 | """ | |
13147 | Below(self, Window sibling, int marg=0) | |
13148 | ||
79fccf9d RD |
13149 | Constrains this edge to be below the given window, with an optional |
13150 | margin. Implicitly, this is relative to the bottom edge of the other | |
13151 | window. | |
d55e5bfc RD |
13152 | """ |
13153 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) | |
13154 | ||
13155 | def SameAs(*args, **kwargs): | |
13156 | """ | |
13157 | SameAs(self, Window otherW, int edge, int marg=0) | |
13158 | ||
79fccf9d RD |
13159 | Constrains this edge or dimension to be to the same as the edge of the |
13160 | given window, with an optional margin. | |
d55e5bfc RD |
13161 | """ |
13162 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) | |
13163 | ||
13164 | def PercentOf(*args, **kwargs): | |
13165 | """ | |
13166 | PercentOf(self, Window otherW, int wh, int per) | |
13167 | ||
79fccf9d RD |
13168 | Constrains this edge or dimension to be to a percentage of the given |
13169 | window, with an optional margin. | |
d55e5bfc RD |
13170 | """ |
13171 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) | |
13172 | ||
13173 | def Absolute(*args, **kwargs): | |
13174 | """ | |
13175 | Absolute(self, int val) | |
13176 | ||
79fccf9d | 13177 | Constrains this edge or dimension to be the given absolute value. |
d55e5bfc RD |
13178 | """ |
13179 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) | |
13180 | ||
13181 | def Unconstrained(*args, **kwargs): | |
13182 | """ | |
13183 | Unconstrained(self) | |
13184 | ||
79fccf9d RD |
13185 | Sets this edge or dimension to be unconstrained, that is, dependent on |
13186 | other edges and dimensions from which this value can be deduced. | |
d55e5bfc RD |
13187 | """ |
13188 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) | |
13189 | ||
13190 | def AsIs(*args, **kwargs): | |
13191 | """ | |
13192 | AsIs(self) | |
13193 | ||
79fccf9d RD |
13194 | Sets this edge or constraint to be whatever the window's value is at |
13195 | the moment. If either of the width and height constraints are *as is*, | |
13196 | the window will not be resized, but moved instead. This is important | |
13197 | when considering panel items which are intended to have a default | |
13198 | size, such as a button, which may take its size from the size of the | |
13199 | button label. | |
d55e5bfc RD |
13200 | """ |
13201 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) | |
13202 | ||
13203 | def GetOtherWindow(*args, **kwargs): | |
13204 | """GetOtherWindow(self) -> Window""" | |
13205 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) | |
13206 | ||
13207 | def GetMyEdge(*args, **kwargs): | |
13208 | """GetMyEdge(self) -> int""" | |
13209 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) | |
13210 | ||
13211 | def SetEdge(*args, **kwargs): | |
13212 | """SetEdge(self, int which)""" | |
13213 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) | |
13214 | ||
13215 | def SetValue(*args, **kwargs): | |
13216 | """SetValue(self, int v)""" | |
13217 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) | |
13218 | ||
13219 | def GetMargin(*args, **kwargs): | |
13220 | """GetMargin(self) -> int""" | |
13221 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) | |
13222 | ||
13223 | def SetMargin(*args, **kwargs): | |
13224 | """SetMargin(self, int m)""" | |
13225 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) | |
13226 | ||
13227 | def GetValue(*args, **kwargs): | |
13228 | """GetValue(self) -> int""" | |
13229 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) | |
13230 | ||
13231 | def GetPercent(*args, **kwargs): | |
13232 | """GetPercent(self) -> int""" | |
13233 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) | |
13234 | ||
13235 | def GetOtherEdge(*args, **kwargs): | |
13236 | """GetOtherEdge(self) -> int""" | |
13237 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) | |
13238 | ||
13239 | def GetDone(*args, **kwargs): | |
13240 | """GetDone(self) -> bool""" | |
13241 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) | |
13242 | ||
13243 | def SetDone(*args, **kwargs): | |
13244 | """SetDone(self, bool d)""" | |
13245 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) | |
13246 | ||
13247 | def GetRelationship(*args, **kwargs): | |
13248 | """GetRelationship(self) -> int""" | |
13249 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) | |
13250 | ||
13251 | def SetRelationship(*args, **kwargs): | |
13252 | """SetRelationship(self, int r)""" | |
13253 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) | |
13254 | ||
13255 | def ResetIfWin(*args, **kwargs): | |
13256 | """ | |
13257 | ResetIfWin(self, Window otherW) -> bool | |
13258 | ||
13259 | Reset constraint if it mentions otherWin | |
13260 | """ | |
13261 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) | |
13262 | ||
13263 | def SatisfyConstraint(*args, **kwargs): | |
13264 | """ | |
13265 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool | |
13266 | ||
13267 | Try to satisfy constraint | |
13268 | """ | |
13269 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) | |
13270 | ||
13271 | def GetEdge(*args, **kwargs): | |
13272 | """ | |
13273 | GetEdge(self, int which, Window thisWin, Window other) -> int | |
13274 | ||
13275 | Get the value of this edge or dimension, or if this | |
13276 | is not determinable, -1. | |
13277 | """ | |
13278 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) | |
13279 | ||
13280 | ||
13281 | class IndividualLayoutConstraintPtr(IndividualLayoutConstraint): | |
13282 | def __init__(self, this): | |
13283 | self.this = this | |
13284 | if not hasattr(self,"thisown"): self.thisown = 0 | |
13285 | self.__class__ = IndividualLayoutConstraint | |
13286 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr) | |
13287 | ||
13288 | class LayoutConstraints(Object): | |
13289 | """ | |
79fccf9d RD |
13290 | **Note:** constraints are now deprecated and you should use sizers |
13291 | instead. | |
d55e5bfc | 13292 | |
79fccf9d RD |
13293 | Objects of this class can be associated with a window to define its |
13294 | layout constraints, with respect to siblings or its parent. | |
d55e5bfc RD |
13295 | |
13296 | The class consists of the following eight constraints of class | |
13297 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
13298 | directly to set the appropriate constraints. | |
13299 | ||
13300 | * left: represents the left hand edge of the window | |
13301 | * right: represents the right hand edge of the window | |
13302 | * top: represents the top edge of the window | |
13303 | * bottom: represents the bottom edge of the window | |
13304 | * width: represents the width of the window | |
13305 | * height: represents the height of the window | |
13306 | * centreX: represents the horizontal centre point of the window | |
13307 | * centreY: represents the vertical centre point of the window | |
13308 | ||
79fccf9d RD |
13309 | Most constraints are initially set to have the relationship |
13310 | wxUnconstrained, which means that their values should be calculated by | |
13311 | looking at known constraints. The exceptions are width and height, | |
13312 | which are set to wxAsIs to ensure that if the user does not specify a | |
13313 | constraint, the existing width and height will be used, to be | |
13314 | compatible with panel items which often have take a default size. If | |
13315 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
13316 | ||
13317 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
d55e5bfc RD |
13318 | |
13319 | """ | |
13320 | def __repr__(self): | |
13321 | return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
13322 | left = property(_core_.LayoutConstraints_left_get) | |
13323 | top = property(_core_.LayoutConstraints_top_get) | |
13324 | right = property(_core_.LayoutConstraints_right_get) | |
13325 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
13326 | width = property(_core_.LayoutConstraints_width_get) | |
13327 | height = property(_core_.LayoutConstraints_height_get) | |
13328 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
13329 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
13330 | def __init__(self, *args, **kwargs): | |
13331 | """__init__(self) -> LayoutConstraints""" | |
13332 | newobj = _core_.new_LayoutConstraints(*args, **kwargs) | |
13333 | self.this = newobj.this | |
13334 | self.thisown = 1 | |
13335 | del newobj.thisown | |
13336 | def SatisfyConstraints(*args, **kwargs): | |
13337 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" | |
13338 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) | |
13339 | ||
13340 | def AreSatisfied(*args, **kwargs): | |
13341 | """AreSatisfied(self) -> bool""" | |
13342 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) | |
13343 | ||
13344 | ||
13345 | class LayoutConstraintsPtr(LayoutConstraints): | |
13346 | def __init__(self, this): | |
13347 | self.this = this | |
13348 | if not hasattr(self,"thisown"): self.thisown = 0 | |
13349 | self.__class__ = LayoutConstraints | |
13350 | _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr) | |
13351 | ||
13352 | #---------------------------------------------------------------------------- | |
13353 | ||
13354 | # Use Python's bool constants if available, make some if not | |
13355 | try: | |
13356 | True | |
13357 | except NameError: | |
13358 | __builtins__.True = 1==1 | |
13359 | __builtins__.False = 1==0 | |
13360 | def bool(value): return not not value | |
13361 | __builtins__.bool = bool | |
13362 | ||
13363 | ||
13364 | ||
13365 | # workarounds for bad wxRTTI names | |
13366 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
13367 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
13368 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
13369 | ||
13370 | ||
13371 | #---------------------------------------------------------------------------- | |
13372 | # Load version numbers from __version__... Ensure that major and minor | |
0f63ec68 | 13373 | # versions are the same for both wxPython and wxWidgets. |
d55e5bfc RD |
13374 | |
13375 | from __version__ import * | |
13376 | __version__ = VERSION_STRING | |
13377 | ||
0f63ec68 RD |
13378 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
13379 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
d55e5bfc RD |
13380 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
13381 | import warnings | |
0f63ec68 | 13382 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d55e5bfc RD |
13383 | |
13384 | #---------------------------------------------------------------------------- | |
13385 | ||
70b7a5fe RD |
13386 | # Set wxPython's default string<-->unicode conversion encoding from |
13387 | # the locale, but only if Python's default hasn't been changed. (We | |
13388 | # assume that if the user has customized it already then that is the | |
13389 | # encoding we need to use as well.) | |
13390 | # | |
13391 | # The encoding selected here is used when string or unicode objects | |
13392 | # need to be converted in order to pass them to wxWidgets. Please be | |
13393 | # aware that the default encoding within the same locale may be | |
13394 | # slightly different on different platforms. For example, please see | |
62d32a5f RD |
13395 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
13396 | # between the common latin/roman encodings. | |
396fb509 RD |
13397 | |
13398 | default = _sys.getdefaultencoding() | |
13399 | if default == 'ascii': | |
13400 | import locale | |
13401 | import codecs | |
13402 | try: | |
13403 | default = locale.getdefaultlocale()[1] | |
13404 | codecs.lookup(default) | |
70b7a5fe | 13405 | except (ValueError, LookupError, TypeError): |
396fb509 RD |
13406 | default = _sys.getdefaultencoding() |
13407 | del locale | |
13408 | del codecs | |
5cbf236d RD |
13409 | if default: |
13410 | wx.SetDefaultPyEncoding(default) | |
13411 | del default | |
5cbf236d RD |
13412 | |
13413 | #---------------------------------------------------------------------------- | |
13414 | ||
d55e5bfc RD |
13415 | class PyDeadObjectError(AttributeError): |
13416 | pass | |
13417 | ||
13418 | class _wxPyDeadObject(object): | |
13419 | """ | |
13420 | Instances of wx objects that are OOR capable will have their __class__ | |
13421 | changed to this class when the C++ object is deleted. This should help | |
13422 | prevent crashes due to referencing a bogus C++ pointer. | |
13423 | """ | |
13424 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
13425 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
13426 | ||
13427 | def __repr__(self): | |
13428 | if not hasattr(self, "_name"): | |
13429 | self._name = "[unknown]" | |
13430 | return self.reprStr % self._name | |
13431 | ||
13432 | def __getattr__(self, *args): | |
13433 | if not hasattr(self, "_name"): | |
13434 | self._name = "[unknown]" | |
13435 | raise PyDeadObjectError(self.attrStr % self._name) | |
13436 | ||
13437 | def __nonzero__(self): | |
13438 | return 0 | |
13439 | ||
13440 | ||
13441 | ||
13442 | class PyUnbornObjectError(AttributeError): | |
13443 | pass | |
13444 | ||
13445 | class _wxPyUnbornObject(object): | |
13446 | """ | |
13447 | Some stock objects are created when the wx._core module is | |
13448 | imported, but their C++ instance is not created until the wx.App | |
13449 | object is created and initialized. These object instances will | |
13450 | temporarily have their __class__ changed to this class so an | |
13451 | exception will be raised if they are used before the C++ instance | |
13452 | is ready. | |
13453 | """ | |
13454 | ||
13455 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
13456 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
13457 | ||
13458 | def __repr__(self): | |
13459 | #if not hasattr(self, "_name"): | |
13460 | # self._name = "[unknown]" | |
13461 | return self.reprStr #% self._name | |
13462 | ||
13463 | def __getattr__(self, *args): | |
13464 | #if not hasattr(self, "_name"): | |
13465 | # self._name = "[unknown]" | |
13466 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
13467 | ||
13468 | def __nonzero__(self): | |
13469 | return 0 | |
13470 | ||
13471 | ||
13472 | #---------------------------------------------------------------------------- | |
d55e5bfc RD |
13473 | |
13474 | def CallAfter(callable, *args, **kw): | |
13475 | """ | |
13476 | Call the specified function after the current and pending event | |
13477 | handlers have been completed. This is also good for making GUI | |
0439c23b RD |
13478 | method calls from non-GUI threads. Any extra positional or |
13479 | keyword args are passed on to the callable when it is called. | |
13480 | ||
13481 | :see: `wx.FutureCall` | |
d55e5bfc RD |
13482 | """ |
13483 | app = wx.GetApp() | |
a001823c | 13484 | assert app is not None, 'No wx.App created yet' |
d55e5bfc | 13485 | |
891bb194 RD |
13486 | if not hasattr(app, "_CallAfterId"): |
13487 | app._CallAfterId = wx.NewEventType() | |
13488 | app.Connect(-1, -1, app._CallAfterId, | |
13489 | lambda event: event.callable(*event.args, **event.kw) ) | |
d55e5bfc | 13490 | evt = wx.PyEvent() |
891bb194 | 13491 | evt.SetEventType(app._CallAfterId) |
d55e5bfc RD |
13492 | evt.callable = callable |
13493 | evt.args = args | |
13494 | evt.kw = kw | |
13495 | wx.PostEvent(app, evt) | |
13496 | ||
d55e5bfc RD |
13497 | #---------------------------------------------------------------------------- |
13498 | ||
13499 | ||
13500 | class FutureCall: | |
13501 | """ | |
8ac8dba0 | 13502 | A convenience class for `wx.Timer`, that calls the given callable |
d55e5bfc RD |
13503 | object once after the given amount of milliseconds, passing any |
13504 | positional or keyword args. The return value of the callable is | |
0439c23b | 13505 | availbale after it has been run with the `GetResult` method. |
d55e5bfc RD |
13506 | |
13507 | If you don't need to get the return value or restart the timer | |
13508 | then there is no need to hold a reference to this object. It will | |
13509 | hold a reference to itself while the timer is running (the timer | |
13510 | has a reference to self.Notify) but the cycle will be broken when | |
13511 | the timer completes, automatically cleaning up the wx.FutureCall | |
13512 | object. | |
0439c23b RD |
13513 | |
13514 | :see: `wx.CallAfter` | |
d55e5bfc RD |
13515 | """ |
13516 | def __init__(self, millis, callable, *args, **kwargs): | |
13517 | self.millis = millis | |
13518 | self.callable = callable | |
13519 | self.SetArgs(*args, **kwargs) | |
13520 | self.runCount = 0 | |
13521 | self.running = False | |
13522 | self.hasRun = False | |
13523 | self.result = None | |
13524 | self.timer = None | |
13525 | self.Start() | |
13526 | ||
13527 | def __del__(self): | |
13528 | self.Stop() | |
13529 | ||
13530 | ||
13531 | def Start(self, millis=None, *args, **kwargs): | |
13532 | """ | |
13533 | (Re)start the timer | |
13534 | """ | |
13535 | self.hasRun = False | |
13536 | if millis is not None: | |
13537 | self.millis = millis | |
13538 | if args or kwargs: | |
13539 | self.SetArgs(*args, **kwargs) | |
13540 | self.Stop() | |
13541 | self.timer = wx.PyTimer(self.Notify) | |
13542 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
13543 | self.running = True | |
13544 | Restart = Start | |
13545 | ||
13546 | ||
13547 | def Stop(self): | |
13548 | """ | |
13549 | Stop and destroy the timer. | |
13550 | """ | |
13551 | if self.timer is not None: | |
13552 | self.timer.Stop() | |
13553 | self.timer = None | |
13554 | ||
13555 | ||
13556 | def GetInterval(self): | |
13557 | if self.timer is not None: | |
13558 | return self.timer.GetInterval() | |
13559 | else: | |
13560 | return 0 | |
13561 | ||
13562 | ||
13563 | def IsRunning(self): | |
13564 | return self.timer is not None and self.timer.IsRunning() | |
13565 | ||
13566 | ||
13567 | def SetArgs(self, *args, **kwargs): | |
13568 | """ | |
13569 | (Re)set the args passed to the callable object. This is | |
13570 | useful in conjunction with Restart if you want to schedule a | |
13571 | new call to the same callable object but with different | |
13572 | parameters. | |
13573 | """ | |
13574 | self.args = args | |
13575 | self.kwargs = kwargs | |
13576 | ||
13577 | ||
13578 | def HasRun(self): | |
13579 | return self.hasRun | |
13580 | ||
13581 | def GetResult(self): | |
13582 | return self.result | |
13583 | ||
13584 | def Notify(self): | |
13585 | """ | |
13586 | The timer has expired so call the callable. | |
13587 | """ | |
13588 | if self.callable and getattr(self.callable, 'im_self', True): | |
13589 | self.runCount += 1 | |
13590 | self.running = False | |
13591 | self.result = self.callable(*self.args, **self.kwargs) | |
13592 | self.hasRun = True | |
13593 | if not self.running: | |
13594 | # if it wasn't restarted, then cleanup | |
13595 | wx.CallAfter(self.Stop) | |
13596 | ||
13597 | ||
13598 | ||
13599 | #---------------------------------------------------------------------------- | |
13600 | # Control which items in this module should be documented by epydoc. | |
13601 | # We allow only classes and functions, which will help reduce the size | |
13602 | # of the docs by filtering out the zillions of constants, EVT objects, | |
13603 | # and etc that don't make much sense by themselves, but are instead | |
13604 | # documented (or will be) as part of the classes/functions/methods | |
13605 | # where they should be used. | |
13606 | ||
c24da6d6 RD |
13607 | class __DocFilter: |
13608 | """ | |
13609 | A filter for epydoc that only allows non-Ptr classes and | |
13610 | fucntions, in order to reduce the clutter in the API docs. | |
13611 | """ | |
13612 | def __init__(self, globals): | |
13613 | self._globals = globals | |
13614 | ||
13615 | def __call__(self, name): | |
13616 | import types | |
13617 | obj = self._globals.get(name, None) | |
13618 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: | |
13619 | return False | |
13620 | if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'): | |
13621 | return False | |
13622 | return True | |
d55e5bfc RD |
13623 | |
13624 | #---------------------------------------------------------------------------- | |
13625 | #---------------------------------------------------------------------------- | |
13626 | ||
13627 | # Import other modules in this package that should show up in the | |
13628 | # "core" wx namespace | |
13629 | from _gdi import * | |
13630 | from _windows import * | |
13631 | from _controls import * | |
13632 | from _misc import * | |
13633 | ||
13634 | ||
13635 | # Fixup the stock objects since they can't be used yet. (They will be | |
13636 | # restored in wx.PyApp.OnInit.) | |
13637 | _core_._wxPyFixStockObjects() | |
13638 | ||
13639 | #---------------------------------------------------------------------------- | |
13640 | #---------------------------------------------------------------------------- | |
13641 | ||
13642 | ||
7449af73 | 13643 |