]>
Commit | Line | Data |
---|---|---|
d55e5bfc RD |
1 | # This file was created automatically by SWIG. |
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 | |
164 | PORTRAIT = _core_.PORTRAIT | |
165 | LANDSCAPE = _core_.LANDSCAPE | |
166 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
167 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
168 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
169 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
170 | ID_ANY = _core_.ID_ANY | |
171 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
172 | ID_LOWEST = _core_.ID_LOWEST | |
173 | ID_OPEN = _core_.ID_OPEN | |
174 | ID_CLOSE = _core_.ID_CLOSE | |
175 | ID_NEW = _core_.ID_NEW | |
176 | ID_SAVE = _core_.ID_SAVE | |
177 | ID_SAVEAS = _core_.ID_SAVEAS | |
178 | ID_REVERT = _core_.ID_REVERT | |
179 | ID_EXIT = _core_.ID_EXIT | |
180 | ID_UNDO = _core_.ID_UNDO | |
181 | ID_REDO = _core_.ID_REDO | |
182 | ID_HELP = _core_.ID_HELP | |
183 | ID_PRINT = _core_.ID_PRINT | |
184 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
185 | ID_PREVIEW = _core_.ID_PREVIEW | |
186 | ID_ABOUT = _core_.ID_ABOUT | |
187 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
188 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
189 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
190 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
191 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL | |
192 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
193 | ID_CUT = _core_.ID_CUT | |
194 | ID_COPY = _core_.ID_COPY | |
195 | ID_PASTE = _core_.ID_PASTE | |
196 | ID_CLEAR = _core_.ID_CLEAR | |
197 | ID_FIND = _core_.ID_FIND | |
198 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
199 | ID_SELECTALL = _core_.ID_SELECTALL | |
200 | ID_DELETE = _core_.ID_DELETE | |
201 | ID_REPLACE = _core_.ID_REPLACE | |
202 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
203 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
204 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
205 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
206 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
207 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
208 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
209 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
210 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
211 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
212 | ID_FILE1 = _core_.ID_FILE1 | |
213 | ID_FILE2 = _core_.ID_FILE2 | |
214 | ID_FILE3 = _core_.ID_FILE3 | |
215 | ID_FILE4 = _core_.ID_FILE4 | |
216 | ID_FILE5 = _core_.ID_FILE5 | |
217 | ID_FILE6 = _core_.ID_FILE6 | |
218 | ID_FILE7 = _core_.ID_FILE7 | |
219 | ID_FILE8 = _core_.ID_FILE8 | |
220 | ID_FILE9 = _core_.ID_FILE9 | |
221 | ID_OK = _core_.ID_OK | |
222 | ID_CANCEL = _core_.ID_CANCEL | |
223 | ID_APPLY = _core_.ID_APPLY | |
224 | ID_YES = _core_.ID_YES | |
225 | ID_NO = _core_.ID_NO | |
226 | ID_STATIC = _core_.ID_STATIC | |
227 | ID_FORWARD = _core_.ID_FORWARD | |
228 | ID_BACKWARD = _core_.ID_BACKWARD | |
229 | ID_DEFAULT = _core_.ID_DEFAULT | |
230 | ID_MORE = _core_.ID_MORE | |
231 | ID_SETUP = _core_.ID_SETUP | |
232 | ID_RESET = _core_.ID_RESET | |
233 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
234 | ID_YESTOALL = _core_.ID_YESTOALL | |
235 | ID_NOTOALL = _core_.ID_NOTOALL | |
236 | ID_ABORT = _core_.ID_ABORT | |
237 | ID_RETRY = _core_.ID_RETRY | |
238 | ID_IGNORE = _core_.ID_IGNORE | |
0f63ec68 RD |
239 | ID_ADD = _core_.ID_ADD |
240 | ID_REMOVE = _core_.ID_REMOVE | |
241 | ID_UP = _core_.ID_UP | |
242 | ID_DOWN = _core_.ID_DOWN | |
243 | ID_HOME = _core_.ID_HOME | |
244 | ID_REFRESH = _core_.ID_REFRESH | |
245 | ID_STOP = _core_.ID_STOP | |
246 | ID_INDEX = _core_.ID_INDEX | |
247 | ID_BOLD = _core_.ID_BOLD | |
248 | ID_ITALIC = _core_.ID_ITALIC | |
249 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
250 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
251 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
252 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
253 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
254 | ID_INDENT = _core_.ID_INDENT | |
255 | ID_UNINDENT = _core_.ID_UNINDENT | |
256 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
257 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
258 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
259 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
260 | ID_UNDELETE = _core_.ID_UNDELETE | |
261 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
d55e5bfc RD |
262 | ID_HIGHEST = _core_.ID_HIGHEST |
263 | OPEN = _core_.OPEN | |
264 | SAVE = _core_.SAVE | |
265 | HIDE_READONLY = _core_.HIDE_READONLY | |
266 | OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT | |
267 | FILE_MUST_EXIST = _core_.FILE_MUST_EXIST | |
268 | MULTIPLE = _core_.MULTIPLE | |
269 | CHANGE_DIR = _core_.CHANGE_DIR | |
270 | ACCEL_ALT = _core_.ACCEL_ALT | |
271 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
272 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
273 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
274 | PD_AUTO_HIDE = _core_.PD_AUTO_HIDE | |
275 | PD_APP_MODAL = _core_.PD_APP_MODAL | |
276 | PD_CAN_ABORT = _core_.PD_CAN_ABORT | |
277 | PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME | |
278 | PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME | |
279 | PD_REMAINING_TIME = _core_.PD_REMAINING_TIME | |
62d32a5f RD |
280 | PD_SMOOTH = _core_.PD_SMOOTH |
281 | PD_CAN_SKIP = _core_.PD_CAN_SKIP | |
d55e5bfc RD |
282 | DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON |
283 | DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE | |
284 | MENU_TEAROFF = _core_.MENU_TEAROFF | |
285 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
286 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
287 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
288 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
289 | LI_VERTICAL = _core_.LI_VERTICAL | |
290 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
291 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
292 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
293 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
294 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
295 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
296 | MM_TEXT = _core_.MM_TEXT | |
297 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
298 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
299 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
300 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
301 | MM_TWIPS = _core_.MM_TWIPS | |
302 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
303 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
304 | MM_POINTS = _core_.MM_POINTS | |
305 | MM_METRIC = _core_.MM_METRIC | |
306 | CENTRE = _core_.CENTRE | |
307 | CENTER = _core_.CENTER | |
308 | HORIZONTAL = _core_.HORIZONTAL | |
309 | VERTICAL = _core_.VERTICAL | |
310 | BOTH = _core_.BOTH | |
311 | LEFT = _core_.LEFT | |
312 | RIGHT = _core_.RIGHT | |
313 | UP = _core_.UP | |
314 | DOWN = _core_.DOWN | |
315 | TOP = _core_.TOP | |
316 | BOTTOM = _core_.BOTTOM | |
317 | NORTH = _core_.NORTH | |
318 | SOUTH = _core_.SOUTH | |
319 | WEST = _core_.WEST | |
320 | EAST = _core_.EAST | |
321 | ALL = _core_.ALL | |
322 | ALIGN_NOT = _core_.ALIGN_NOT | |
323 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
324 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
325 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
326 | ALIGN_TOP = _core_.ALIGN_TOP | |
327 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
328 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
329 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
330 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
331 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
332 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
333 | ALIGN_MASK = _core_.ALIGN_MASK | |
334 | STRETCH_NOT = _core_.STRETCH_NOT | |
335 | SHRINK = _core_.SHRINK | |
336 | GROW = _core_.GROW | |
337 | EXPAND = _core_.EXPAND | |
338 | SHAPED = _core_.SHAPED | |
339 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
340 | TILE = _core_.TILE | |
341 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
342 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
343 | BORDER_NONE = _core_.BORDER_NONE | |
344 | BORDER_STATIC = _core_.BORDER_STATIC | |
345 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
346 | BORDER_RAISED = _core_.BORDER_RAISED | |
347 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
348 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
349 | BORDER_MASK = _core_.BORDER_MASK | |
0f63ec68 RD |
350 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM |
351 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
352 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
d55e5bfc RD |
353 | DEFAULT = _core_.DEFAULT |
354 | DECORATIVE = _core_.DECORATIVE | |
355 | ROMAN = _core_.ROMAN | |
356 | SCRIPT = _core_.SCRIPT | |
357 | SWISS = _core_.SWISS | |
358 | MODERN = _core_.MODERN | |
359 | TELETYPE = _core_.TELETYPE | |
360 | VARIABLE = _core_.VARIABLE | |
361 | FIXED = _core_.FIXED | |
362 | NORMAL = _core_.NORMAL | |
363 | LIGHT = _core_.LIGHT | |
364 | BOLD = _core_.BOLD | |
365 | ITALIC = _core_.ITALIC | |
366 | SLANT = _core_.SLANT | |
367 | SOLID = _core_.SOLID | |
368 | DOT = _core_.DOT | |
369 | LONG_DASH = _core_.LONG_DASH | |
370 | SHORT_DASH = _core_.SHORT_DASH | |
371 | DOT_DASH = _core_.DOT_DASH | |
372 | USER_DASH = _core_.USER_DASH | |
373 | TRANSPARENT = _core_.TRANSPARENT | |
374 | STIPPLE = _core_.STIPPLE | |
375 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH | |
376 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
377 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
378 | CROSS_HATCH = _core_.CROSS_HATCH | |
379 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
380 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
381 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
382 | JOIN_MITER = _core_.JOIN_MITER | |
383 | JOIN_ROUND = _core_.JOIN_ROUND | |
384 | CAP_ROUND = _core_.CAP_ROUND | |
385 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
386 | CAP_BUTT = _core_.CAP_BUTT | |
387 | CLEAR = _core_.CLEAR | |
388 | XOR = _core_.XOR | |
389 | INVERT = _core_.INVERT | |
390 | OR_REVERSE = _core_.OR_REVERSE | |
391 | AND_REVERSE = _core_.AND_REVERSE | |
392 | COPY = _core_.COPY | |
393 | AND = _core_.AND | |
394 | AND_INVERT = _core_.AND_INVERT | |
395 | NO_OP = _core_.NO_OP | |
396 | NOR = _core_.NOR | |
397 | EQUIV = _core_.EQUIV | |
398 | SRC_INVERT = _core_.SRC_INVERT | |
399 | OR_INVERT = _core_.OR_INVERT | |
400 | NAND = _core_.NAND | |
401 | OR = _core_.OR | |
402 | SET = _core_.SET | |
403 | WXK_BACK = _core_.WXK_BACK | |
404 | WXK_TAB = _core_.WXK_TAB | |
405 | WXK_RETURN = _core_.WXK_RETURN | |
406 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
407 | WXK_SPACE = _core_.WXK_SPACE | |
408 | WXK_DELETE = _core_.WXK_DELETE | |
409 | WXK_START = _core_.WXK_START | |
410 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
411 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
412 | WXK_CANCEL = _core_.WXK_CANCEL | |
413 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
414 | WXK_CLEAR = _core_.WXK_CLEAR | |
415 | WXK_SHIFT = _core_.WXK_SHIFT | |
416 | WXK_ALT = _core_.WXK_ALT | |
417 | WXK_CONTROL = _core_.WXK_CONTROL | |
418 | WXK_MENU = _core_.WXK_MENU | |
419 | WXK_PAUSE = _core_.WXK_PAUSE | |
420 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
421 | WXK_PRIOR = _core_.WXK_PRIOR | |
422 | WXK_NEXT = _core_.WXK_NEXT | |
423 | WXK_END = _core_.WXK_END | |
424 | WXK_HOME = _core_.WXK_HOME | |
425 | WXK_LEFT = _core_.WXK_LEFT | |
426 | WXK_UP = _core_.WXK_UP | |
427 | WXK_RIGHT = _core_.WXK_RIGHT | |
428 | WXK_DOWN = _core_.WXK_DOWN | |
429 | WXK_SELECT = _core_.WXK_SELECT | |
430 | WXK_PRINT = _core_.WXK_PRINT | |
431 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
432 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
433 | WXK_INSERT = _core_.WXK_INSERT | |
434 | WXK_HELP = _core_.WXK_HELP | |
435 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
436 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
437 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
438 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
439 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
440 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
441 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
442 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
443 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
444 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
445 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
446 | WXK_ADD = _core_.WXK_ADD | |
447 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
448 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
449 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
450 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
451 | WXK_F1 = _core_.WXK_F1 | |
452 | WXK_F2 = _core_.WXK_F2 | |
453 | WXK_F3 = _core_.WXK_F3 | |
454 | WXK_F4 = _core_.WXK_F4 | |
455 | WXK_F5 = _core_.WXK_F5 | |
456 | WXK_F6 = _core_.WXK_F6 | |
457 | WXK_F7 = _core_.WXK_F7 | |
458 | WXK_F8 = _core_.WXK_F8 | |
459 | WXK_F9 = _core_.WXK_F9 | |
460 | WXK_F10 = _core_.WXK_F10 | |
461 | WXK_F11 = _core_.WXK_F11 | |
462 | WXK_F12 = _core_.WXK_F12 | |
463 | WXK_F13 = _core_.WXK_F13 | |
464 | WXK_F14 = _core_.WXK_F14 | |
465 | WXK_F15 = _core_.WXK_F15 | |
466 | WXK_F16 = _core_.WXK_F16 | |
467 | WXK_F17 = _core_.WXK_F17 | |
468 | WXK_F18 = _core_.WXK_F18 | |
469 | WXK_F19 = _core_.WXK_F19 | |
470 | WXK_F20 = _core_.WXK_F20 | |
471 | WXK_F21 = _core_.WXK_F21 | |
472 | WXK_F22 = _core_.WXK_F22 | |
473 | WXK_F23 = _core_.WXK_F23 | |
474 | WXK_F24 = _core_.WXK_F24 | |
475 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
476 | WXK_SCROLL = _core_.WXK_SCROLL | |
477 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
478 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
479 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
480 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
481 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
482 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
483 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
484 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
485 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
486 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
487 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
488 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
489 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
490 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
491 | WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR | |
492 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
493 | WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT | |
494 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
495 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
496 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
497 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
498 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
499 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
500 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
501 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
502 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
503 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
504 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
505 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
506 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
507 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
508 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
88c6b281 RD |
509 | WXK_COMMAND = _core_.WXK_COMMAND |
510 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
511 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
512 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
513 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
514 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
515 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
516 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
517 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
518 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
519 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
520 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
521 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
522 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
523 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
524 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
525 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
526 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
527 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
528 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
529 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
d55e5bfc RD |
530 | PAPER_NONE = _core_.PAPER_NONE |
531 | PAPER_LETTER = _core_.PAPER_LETTER | |
532 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
533 | PAPER_A4 = _core_.PAPER_A4 | |
534 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
535 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
536 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
537 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
538 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
539 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
540 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
541 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
542 | PAPER_A3 = _core_.PAPER_A3 | |
543 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
544 | PAPER_A5 = _core_.PAPER_A5 | |
545 | PAPER_B4 = _core_.PAPER_B4 | |
546 | PAPER_B5 = _core_.PAPER_B5 | |
547 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
548 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
549 | PAPER_10X14 = _core_.PAPER_10X14 | |
550 | PAPER_11X17 = _core_.PAPER_11X17 | |
551 | PAPER_NOTE = _core_.PAPER_NOTE | |
552 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
553 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
554 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
555 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
556 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
557 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
558 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
559 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
560 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
561 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
562 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
563 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
564 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
565 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
566 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
567 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
568 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
569 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
570 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
571 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
572 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
573 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
574 | PAPER_9X11 = _core_.PAPER_9X11 | |
575 | PAPER_10X11 = _core_.PAPER_10X11 | |
576 | PAPER_15X11 = _core_.PAPER_15X11 | |
577 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
578 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
579 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
580 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
581 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
582 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
583 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
584 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
585 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
586 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
587 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
588 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
589 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
590 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
591 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
592 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
593 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
594 | PAPER_A2 = _core_.PAPER_A2 | |
595 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
596 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
597 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX | |
598 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
599 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
600 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
601 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
602 | ITEM_CHECK = _core_.ITEM_CHECK | |
603 | ITEM_RADIO = _core_.ITEM_RADIO | |
604 | ITEM_MAX = _core_.ITEM_MAX | |
605 | HT_NOWHERE = _core_.HT_NOWHERE | |
606 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
607 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
608 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
609 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
610 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
611 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
612 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
613 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
614 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
615 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
616 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
617 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
618 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
619 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
620 | HT_MAX = _core_.HT_MAX | |
621 | MOD_NONE = _core_.MOD_NONE | |
622 | MOD_ALT = _core_.MOD_ALT | |
623 | MOD_CONTROL = _core_.MOD_CONTROL | |
624 | MOD_SHIFT = _core_.MOD_SHIFT | |
625 | MOD_WIN = _core_.MOD_WIN | |
626 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE | |
627 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
628 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
629 | #--------------------------------------------------------------------------- | |
630 | ||
631 | class Object(object): | |
632 | """ | |
633 | The base class for most wx objects, although in wxPython not | |
634 | much functionality is needed nor exposed. | |
635 | """ | |
636 | def __init__(self): raise RuntimeError, "No constructor defined" | |
637 | def __repr__(self): | |
638 | return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
639 | def GetClassName(*args, **kwargs): | |
640 | """ | |
641 | GetClassName(self) -> String | |
642 | ||
643 | Returns the class name of the C++ class using wxRTTI. | |
644 | """ | |
645 | return _core_.Object_GetClassName(*args, **kwargs) | |
646 | ||
647 | def Destroy(*args, **kwargs): | |
648 | """ | |
649 | Destroy(self) | |
650 | ||
651 | Deletes the C++ object this Python object is a proxy for. | |
652 | """ | |
653 | return _core_.Object_Destroy(*args, **kwargs) | |
654 | ||
655 | ||
656 | class ObjectPtr(Object): | |
657 | def __init__(self, this): | |
658 | self.this = this | |
659 | if not hasattr(self,"thisown"): self.thisown = 0 | |
660 | self.__class__ = Object | |
661 | _core_.Object_swigregister(ObjectPtr) | |
662 | _wxPySetDictionary = _core_._wxPySetDictionary | |
663 | ||
664 | _wxPyFixStockObjects = _core_._wxPyFixStockObjects | |
665 | ||
666 | cvar = _core_.cvar | |
667 | EmptyString = cvar.EmptyString | |
668 | ||
669 | #--------------------------------------------------------------------------- | |
670 | ||
671 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID | |
672 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
673 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
674 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
675 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
676 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
677 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
678 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
679 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
680 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
681 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
682 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
683 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
684 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
685 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
686 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
687 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
688 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
689 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
690 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
691 | CURSOR_NONE = _core_.CURSOR_NONE | |
692 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
693 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
694 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
695 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
696 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
697 | CURSOR_HAND = _core_.CURSOR_HAND | |
698 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
699 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
700 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
701 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
702 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
703 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
704 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
705 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
706 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
707 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
708 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
709 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
710 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
711 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
712 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
713 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
714 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
715 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
716 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
717 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
718 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
719 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
720 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
721 | CURSOR_MAX = _core_.CURSOR_MAX | |
722 | #--------------------------------------------------------------------------- | |
723 | ||
724 | class Size(object): | |
725 | """ | |
79fccf9d | 726 | wx.Size is a useful data structure used to represent the size of |
093d3ff1 RD |
727 | something. It simply contians integer width and height |
728 | proprtites. In most places in wxPython where a wx.Size is | |
729 | expected a (width, height) tuple can be used instead. | |
d55e5bfc RD |
730 | """ |
731 | def __repr__(self): | |
732 | return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
733 | width = property(_core_.Size_width_get, _core_.Size_width_set) | |
734 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
735 | x = width; y = height | |
736 | def __init__(self, *args, **kwargs): | |
737 | """ | |
738 | __init__(self, int w=0, int h=0) -> Size | |
739 | ||
740 | Creates a size object. | |
741 | """ | |
742 | newobj = _core_.new_Size(*args, **kwargs) | |
743 | self.this = newobj.this | |
744 | self.thisown = 1 | |
745 | del newobj.thisown | |
746 | def __del__(self, destroy=_core_.delete_Size): | |
747 | """__del__(self)""" | |
748 | try: | |
749 | if self.thisown: destroy(self) | |
750 | except: pass | |
751 | ||
752 | def __eq__(*args, **kwargs): | |
753 | """ | |
754 | __eq__(self, Size sz) -> bool | |
755 | ||
756 | Test for equality of wx.Size objects. | |
757 | """ | |
758 | return _core_.Size___eq__(*args, **kwargs) | |
759 | ||
760 | def __ne__(*args, **kwargs): | |
761 | """ | |
762 | __ne__(self, Size sz) -> bool | |
763 | ||
764 | Test for inequality. | |
765 | """ | |
766 | return _core_.Size___ne__(*args, **kwargs) | |
767 | ||
768 | def __add__(*args, **kwargs): | |
769 | """ | |
770 | __add__(self, Size sz) -> Size | |
771 | ||
772 | Add sz's proprties to this and return the result. | |
773 | """ | |
774 | return _core_.Size___add__(*args, **kwargs) | |
775 | ||
776 | def __sub__(*args, **kwargs): | |
777 | """ | |
778 | __sub__(self, Size sz) -> Size | |
779 | ||
780 | Subtract sz's properties from this and return the result. | |
781 | """ | |
782 | return _core_.Size___sub__(*args, **kwargs) | |
783 | ||
784 | def IncTo(*args, **kwargs): | |
785 | """ | |
786 | IncTo(self, Size sz) | |
787 | ||
788 | Increments this object so that both of its dimensions are not less | |
789 | than the corresponding dimensions of the size. | |
790 | """ | |
791 | return _core_.Size_IncTo(*args, **kwargs) | |
792 | ||
793 | def DecTo(*args, **kwargs): | |
794 | """ | |
795 | DecTo(self, Size sz) | |
796 | ||
797 | Decrements this object so that both of its dimensions are not greater | |
798 | than the corresponding dimensions of the size. | |
799 | """ | |
800 | return _core_.Size_DecTo(*args, **kwargs) | |
801 | ||
802 | def Set(*args, **kwargs): | |
803 | """ | |
804 | Set(self, int w, int h) | |
805 | ||
806 | Set both width and height. | |
807 | """ | |
808 | return _core_.Size_Set(*args, **kwargs) | |
809 | ||
810 | def SetWidth(*args, **kwargs): | |
811 | """SetWidth(self, int w)""" | |
812 | return _core_.Size_SetWidth(*args, **kwargs) | |
813 | ||
814 | def SetHeight(*args, **kwargs): | |
815 | """SetHeight(self, int h)""" | |
816 | return _core_.Size_SetHeight(*args, **kwargs) | |
817 | ||
818 | def GetWidth(*args, **kwargs): | |
819 | """GetWidth(self) -> int""" | |
820 | return _core_.Size_GetWidth(*args, **kwargs) | |
821 | ||
822 | def GetHeight(*args, **kwargs): | |
823 | """GetHeight(self) -> int""" | |
824 | return _core_.Size_GetHeight(*args, **kwargs) | |
825 | ||
826 | def IsFullySpecified(*args, **kwargs): | |
827 | """ | |
828 | IsFullySpecified(self) -> bool | |
829 | ||
830 | Returns True if both components of the size are non-default values. | |
831 | """ | |
832 | return _core_.Size_IsFullySpecified(*args, **kwargs) | |
833 | ||
834 | def SetDefaults(*args, **kwargs): | |
835 | """ | |
836 | SetDefaults(self, Size size) | |
837 | ||
79fccf9d RD |
838 | Combine this size with the other one replacing the default components |
839 | of this object (i.e. equal to -1) with those of the other. | |
d55e5bfc RD |
840 | """ |
841 | return _core_.Size_SetDefaults(*args, **kwargs) | |
842 | ||
843 | def Get(*args, **kwargs): | |
844 | """ | |
845 | Get() -> (width,height) | |
846 | ||
847 | Returns the width and height properties as a tuple. | |
848 | """ | |
849 | return _core_.Size_Get(*args, **kwargs) | |
850 | ||
79fccf9d | 851 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
852 | def __str__(self): return str(self.Get()) |
853 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
854 | def __len__(self): return len(self.Get()) | |
855 | def __getitem__(self, index): return self.Get()[index] | |
856 | def __setitem__(self, index, val): | |
857 | if index == 0: self.width = val | |
858 | elif index == 1: self.height = val | |
859 | else: raise IndexError | |
860 | def __nonzero__(self): return self.Get() != (0,0) | |
861 | __safe_for_unpickling__ = True | |
862 | def __reduce__(self): return (wx.Size, self.Get()) | |
863 | ||
864 | ||
865 | class SizePtr(Size): | |
866 | def __init__(self, this): | |
867 | self.this = this | |
868 | if not hasattr(self,"thisown"): self.thisown = 0 | |
869 | self.__class__ = Size | |
870 | _core_.Size_swigregister(SizePtr) | |
871 | ||
872 | #--------------------------------------------------------------------------- | |
873 | ||
874 | class RealPoint(object): | |
875 | """ | |
79fccf9d RD |
876 | A data structure for representing a point or position with floating |
877 | point x and y properties. In wxPython most places that expect a | |
878 | wx.RealPoint can also accept a (x,y) tuple. | |
d55e5bfc RD |
879 | """ |
880 | def __repr__(self): | |
881 | return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
882 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) | |
883 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
884 | def __init__(self, *args, **kwargs): | |
885 | """ | |
886 | __init__(self, double x=0.0, double y=0.0) -> RealPoint | |
887 | ||
888 | Create a wx.RealPoint object | |
889 | """ | |
890 | newobj = _core_.new_RealPoint(*args, **kwargs) | |
891 | self.this = newobj.this | |
892 | self.thisown = 1 | |
893 | del newobj.thisown | |
894 | def __del__(self, destroy=_core_.delete_RealPoint): | |
895 | """__del__(self)""" | |
896 | try: | |
897 | if self.thisown: destroy(self) | |
898 | except: pass | |
899 | ||
900 | def __eq__(*args, **kwargs): | |
901 | """ | |
902 | __eq__(self, RealPoint pt) -> bool | |
903 | ||
904 | Test for equality of wx.RealPoint objects. | |
905 | """ | |
906 | return _core_.RealPoint___eq__(*args, **kwargs) | |
907 | ||
908 | def __ne__(*args, **kwargs): | |
909 | """ | |
910 | __ne__(self, RealPoint pt) -> bool | |
911 | ||
912 | Test for inequality of wx.RealPoint objects. | |
913 | """ | |
914 | return _core_.RealPoint___ne__(*args, **kwargs) | |
915 | ||
916 | def __add__(*args, **kwargs): | |
917 | """ | |
918 | __add__(self, RealPoint pt) -> RealPoint | |
919 | ||
920 | Add pt's proprties to this and return the result. | |
921 | """ | |
922 | return _core_.RealPoint___add__(*args, **kwargs) | |
923 | ||
924 | def __sub__(*args, **kwargs): | |
925 | """ | |
926 | __sub__(self, RealPoint pt) -> RealPoint | |
927 | ||
928 | Subtract pt's proprties from this and return the result | |
929 | """ | |
930 | return _core_.RealPoint___sub__(*args, **kwargs) | |
931 | ||
932 | def Set(*args, **kwargs): | |
933 | """ | |
934 | Set(self, double x, double y) | |
935 | ||
936 | Set both the x and y properties | |
937 | """ | |
938 | return _core_.RealPoint_Set(*args, **kwargs) | |
939 | ||
940 | def Get(*args, **kwargs): | |
941 | """ | |
942 | Get() -> (x,y) | |
943 | ||
944 | Return the x and y properties as a tuple. | |
945 | """ | |
946 | return _core_.RealPoint_Get(*args, **kwargs) | |
947 | ||
79fccf9d | 948 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
949 | def __str__(self): return str(self.Get()) |
950 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
951 | def __len__(self): return len(self.Get()) | |
952 | def __getitem__(self, index): return self.Get()[index] | |
953 | def __setitem__(self, index, val): | |
954 | if index == 0: self.x = val | |
955 | elif index == 1: self.y = val | |
956 | else: raise IndexError | |
957 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
958 | __safe_for_unpickling__ = True | |
959 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
960 | ||
961 | ||
962 | class RealPointPtr(RealPoint): | |
963 | def __init__(self, this): | |
964 | self.this = this | |
965 | if not hasattr(self,"thisown"): self.thisown = 0 | |
966 | self.__class__ = RealPoint | |
967 | _core_.RealPoint_swigregister(RealPointPtr) | |
968 | ||
969 | #--------------------------------------------------------------------------- | |
970 | ||
971 | class Point(object): | |
972 | """ | |
79fccf9d RD |
973 | A data structure for representing a point or position with integer x |
974 | and y properties. Most places in wxPython that expect a wx.Point can | |
975 | also accept a (x,y) tuple. | |
d55e5bfc RD |
976 | """ |
977 | def __repr__(self): | |
978 | return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
979 | x = property(_core_.Point_x_get, _core_.Point_x_set) | |
980 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
981 | def __init__(self, *args, **kwargs): | |
982 | """ | |
983 | __init__(self, int x=0, int y=0) -> Point | |
984 | ||
985 | Create a wx.Point object | |
986 | """ | |
987 | newobj = _core_.new_Point(*args, **kwargs) | |
988 | self.this = newobj.this | |
989 | self.thisown = 1 | |
990 | del newobj.thisown | |
991 | def __del__(self, destroy=_core_.delete_Point): | |
992 | """__del__(self)""" | |
993 | try: | |
994 | if self.thisown: destroy(self) | |
995 | except: pass | |
996 | ||
997 | def __eq__(*args, **kwargs): | |
998 | """ | |
999 | __eq__(self, Point pt) -> bool | |
1000 | ||
1001 | Test for equality of wx.Point objects. | |
1002 | """ | |
1003 | return _core_.Point___eq__(*args, **kwargs) | |
1004 | ||
1005 | def __ne__(*args, **kwargs): | |
1006 | """ | |
1007 | __ne__(self, Point pt) -> bool | |
1008 | ||
1009 | Test for inequality of wx.Point objects. | |
1010 | """ | |
1011 | return _core_.Point___ne__(*args, **kwargs) | |
1012 | ||
1013 | def __add__(*args, **kwargs): | |
1014 | """ | |
1015 | __add__(self, Point pt) -> Point | |
1016 | ||
1017 | Add pt's proprties to this and return the result. | |
1018 | """ | |
1019 | return _core_.Point___add__(*args, **kwargs) | |
1020 | ||
1021 | def __sub__(*args, **kwargs): | |
1022 | """ | |
1023 | __sub__(self, Point pt) -> Point | |
1024 | ||
1025 | Subtract pt's proprties from this and return the result | |
1026 | """ | |
1027 | return _core_.Point___sub__(*args, **kwargs) | |
1028 | ||
1029 | def __iadd__(*args, **kwargs): | |
1030 | """ | |
1031 | __iadd__(self, Point pt) -> Point | |
1032 | ||
1033 | Add pt to this object. | |
1034 | """ | |
1035 | return _core_.Point___iadd__(*args, **kwargs) | |
1036 | ||
1037 | def __isub__(*args, **kwargs): | |
1038 | """ | |
1039 | __isub__(self, Point pt) -> Point | |
1040 | ||
1041 | Subtract pt from this object. | |
1042 | """ | |
1043 | return _core_.Point___isub__(*args, **kwargs) | |
1044 | ||
1045 | def Set(*args, **kwargs): | |
1046 | """ | |
1047 | Set(self, long x, long y) | |
1048 | ||
1049 | Set both the x and y properties | |
1050 | """ | |
1051 | return _core_.Point_Set(*args, **kwargs) | |
1052 | ||
1053 | def Get(*args, **kwargs): | |
1054 | """ | |
1055 | Get() -> (x,y) | |
1056 | ||
1057 | Return the x and y properties as a tuple. | |
1058 | """ | |
1059 | return _core_.Point_Get(*args, **kwargs) | |
1060 | ||
79fccf9d | 1061 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1062 | def __str__(self): return str(self.Get()) |
1063 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1064 | def __len__(self): return len(self.Get()) | |
1065 | def __getitem__(self, index): return self.Get()[index] | |
1066 | def __setitem__(self, index, val): | |
1067 | if index == 0: self.x = val | |
1068 | elif index == 1: self.y = val | |
1069 | else: raise IndexError | |
1070 | def __nonzero__(self): return self.Get() != (0,0) | |
1071 | __safe_for_unpickling__ = True | |
1072 | def __reduce__(self): return (wx.Point, self.Get()) | |
1073 | ||
1074 | ||
1075 | class PointPtr(Point): | |
1076 | def __init__(self, this): | |
1077 | self.this = this | |
1078 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1079 | self.__class__ = Point | |
1080 | _core_.Point_swigregister(PointPtr) | |
1081 | ||
1082 | #--------------------------------------------------------------------------- | |
1083 | ||
1084 | class Rect(object): | |
1085 | """ | |
79fccf9d RD |
1086 | A class for representing and manipulating rectangles. It has x, y, |
1087 | width and height properties. In wxPython most palces that expect a | |
1088 | wx.Rect can also accept a (x,y,width,height) tuple. | |
d55e5bfc RD |
1089 | """ |
1090 | def __repr__(self): | |
1091 | return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1092 | def __init__(self, *args, **kwargs): | |
1093 | """ | |
1094 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect | |
1095 | ||
1096 | Create a new Rect object. | |
1097 | """ | |
1098 | newobj = _core_.new_Rect(*args, **kwargs) | |
1099 | self.this = newobj.this | |
1100 | self.thisown = 1 | |
1101 | del newobj.thisown | |
1102 | def __del__(self, destroy=_core_.delete_Rect): | |
1103 | """__del__(self)""" | |
1104 | try: | |
1105 | if self.thisown: destroy(self) | |
1106 | except: pass | |
1107 | ||
1108 | def GetX(*args, **kwargs): | |
1109 | """GetX(self) -> int""" | |
1110 | return _core_.Rect_GetX(*args, **kwargs) | |
1111 | ||
1112 | def SetX(*args, **kwargs): | |
1113 | """SetX(self, int x)""" | |
1114 | return _core_.Rect_SetX(*args, **kwargs) | |
1115 | ||
1116 | def GetY(*args, **kwargs): | |
1117 | """GetY(self) -> int""" | |
1118 | return _core_.Rect_GetY(*args, **kwargs) | |
1119 | ||
1120 | def SetY(*args, **kwargs): | |
1121 | """SetY(self, int y)""" | |
1122 | return _core_.Rect_SetY(*args, **kwargs) | |
1123 | ||
1124 | def GetWidth(*args, **kwargs): | |
1125 | """GetWidth(self) -> int""" | |
1126 | return _core_.Rect_GetWidth(*args, **kwargs) | |
1127 | ||
1128 | def SetWidth(*args, **kwargs): | |
1129 | """SetWidth(self, int w)""" | |
1130 | return _core_.Rect_SetWidth(*args, **kwargs) | |
1131 | ||
1132 | def GetHeight(*args, **kwargs): | |
1133 | """GetHeight(self) -> int""" | |
1134 | return _core_.Rect_GetHeight(*args, **kwargs) | |
1135 | ||
1136 | def SetHeight(*args, **kwargs): | |
1137 | """SetHeight(self, int h)""" | |
1138 | return _core_.Rect_SetHeight(*args, **kwargs) | |
1139 | ||
1140 | def GetPosition(*args, **kwargs): | |
1141 | """GetPosition(self) -> Point""" | |
1142 | return _core_.Rect_GetPosition(*args, **kwargs) | |
1143 | ||
1144 | def SetPosition(*args, **kwargs): | |
1145 | """SetPosition(self, Point p)""" | |
1146 | return _core_.Rect_SetPosition(*args, **kwargs) | |
1147 | ||
1148 | def GetSize(*args, **kwargs): | |
1149 | """GetSize(self) -> Size""" | |
1150 | return _core_.Rect_GetSize(*args, **kwargs) | |
1151 | ||
1152 | def SetSize(*args, **kwargs): | |
1153 | """SetSize(self, Size s)""" | |
1154 | return _core_.Rect_SetSize(*args, **kwargs) | |
1155 | ||
aff4cc5c RD |
1156 | def IsEmpty(*args, **kwargs): |
1157 | """IsEmpty(self) -> bool""" | |
1158 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1159 | ||
d55e5bfc RD |
1160 | def GetTopLeft(*args, **kwargs): |
1161 | """GetTopLeft(self) -> Point""" | |
1162 | return _core_.Rect_GetTopLeft(*args, **kwargs) | |
1163 | ||
1164 | def SetTopLeft(*args, **kwargs): | |
1165 | """SetTopLeft(self, Point p)""" | |
1166 | return _core_.Rect_SetTopLeft(*args, **kwargs) | |
1167 | ||
1168 | def GetBottomRight(*args, **kwargs): | |
1169 | """GetBottomRight(self) -> Point""" | |
1170 | return _core_.Rect_GetBottomRight(*args, **kwargs) | |
1171 | ||
1172 | def SetBottomRight(*args, **kwargs): | |
1173 | """SetBottomRight(self, Point p)""" | |
1174 | return _core_.Rect_SetBottomRight(*args, **kwargs) | |
1175 | ||
1176 | def GetLeft(*args, **kwargs): | |
1177 | """GetLeft(self) -> int""" | |
1178 | return _core_.Rect_GetLeft(*args, **kwargs) | |
1179 | ||
1180 | def GetTop(*args, **kwargs): | |
1181 | """GetTop(self) -> int""" | |
1182 | return _core_.Rect_GetTop(*args, **kwargs) | |
1183 | ||
1184 | def GetBottom(*args, **kwargs): | |
1185 | """GetBottom(self) -> int""" | |
1186 | return _core_.Rect_GetBottom(*args, **kwargs) | |
1187 | ||
1188 | def GetRight(*args, **kwargs): | |
1189 | """GetRight(self) -> int""" | |
1190 | return _core_.Rect_GetRight(*args, **kwargs) | |
1191 | ||
1192 | def SetLeft(*args, **kwargs): | |
1193 | """SetLeft(self, int left)""" | |
1194 | return _core_.Rect_SetLeft(*args, **kwargs) | |
1195 | ||
1196 | def SetRight(*args, **kwargs): | |
1197 | """SetRight(self, int right)""" | |
1198 | return _core_.Rect_SetRight(*args, **kwargs) | |
1199 | ||
1200 | def SetTop(*args, **kwargs): | |
1201 | """SetTop(self, int top)""" | |
1202 | return _core_.Rect_SetTop(*args, **kwargs) | |
1203 | ||
1204 | def SetBottom(*args, **kwargs): | |
1205 | """SetBottom(self, int bottom)""" | |
1206 | return _core_.Rect_SetBottom(*args, **kwargs) | |
1207 | ||
1208 | position = property(GetPosition, SetPosition) | |
1209 | size = property(GetSize, SetSize) | |
1210 | left = property(GetLeft, SetLeft) | |
1211 | right = property(GetRight, SetRight) | |
1212 | top = property(GetTop, SetTop) | |
1213 | bottom = property(GetBottom, SetBottom) | |
1214 | ||
1215 | def Inflate(*args, **kwargs): | |
1216 | """ | |
1217 | Inflate(self, int dx, int dy) -> Rect | |
1218 | ||
091fdbfa RD |
1219 | Increases the size of the rectangle. |
1220 | ||
1221 | The left border is moved farther left and the right border is moved | |
1222 | farther right by ``dx``. The upper border is moved farther up and the | |
1223 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1224 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1225 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1226 | opposite happens: the rectangle size decreases in the respective | |
1227 | direction. | |
1228 | ||
1229 | The change is made to the rectangle inplace, if instead you need a | |
1230 | copy that is inflated, preserving the original then make the copy | |
1231 | first:: | |
1232 | ||
1233 | copy = wx.Rect(*original) | |
1234 | copy.Inflate(10,15) | |
1235 | ||
1236 | ||
d55e5bfc RD |
1237 | """ |
1238 | return _core_.Rect_Inflate(*args, **kwargs) | |
1239 | ||
1240 | def Deflate(*args, **kwargs): | |
1241 | """ | |
1242 | Deflate(self, int dx, int dy) -> Rect | |
1243 | ||
091fdbfa RD |
1244 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1245 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1246 | `Inflate` for a full description. | |
d55e5bfc RD |
1247 | """ |
1248 | return _core_.Rect_Deflate(*args, **kwargs) | |
1249 | ||
1250 | def OffsetXY(*args, **kwargs): | |
1251 | """ | |
1252 | OffsetXY(self, int dx, int dy) | |
1253 | ||
79fccf9d RD |
1254 | Moves the rectangle by the specified offset. If dx is positive, the |
1255 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1256 | bottom, otherwise it is moved to the left or top respectively. | |
d55e5bfc RD |
1257 | """ |
1258 | return _core_.Rect_OffsetXY(*args, **kwargs) | |
1259 | ||
1260 | def Offset(*args, **kwargs): | |
1261 | """ | |
1262 | Offset(self, Point pt) | |
1263 | ||
1264 | Same as OffsetXY but uses dx,dy from Point | |
1265 | """ | |
1266 | return _core_.Rect_Offset(*args, **kwargs) | |
1267 | ||
1268 | def Intersect(*args, **kwargs): | |
1269 | """ | |
1270 | Intersect(self, Rect rect) -> Rect | |
1271 | ||
b519803b | 1272 | Returns the intersectsion of this rectangle and rect. |
d55e5bfc RD |
1273 | """ |
1274 | return _core_.Rect_Intersect(*args, **kwargs) | |
1275 | ||
b519803b RD |
1276 | def Union(*args, **kwargs): |
1277 | """ | |
1278 | Union(self, Rect rect) -> Rect | |
1279 | ||
1280 | Returns the union of this rectangle and rect. | |
1281 | """ | |
1282 | return _core_.Rect_Union(*args, **kwargs) | |
1283 | ||
d55e5bfc RD |
1284 | def __add__(*args, **kwargs): |
1285 | """ | |
1286 | __add__(self, Rect rect) -> Rect | |
1287 | ||
1288 | Add the properties of rect to this rectangle and return the result. | |
1289 | """ | |
1290 | return _core_.Rect___add__(*args, **kwargs) | |
1291 | ||
1292 | def __iadd__(*args, **kwargs): | |
1293 | """ | |
1294 | __iadd__(self, Rect rect) -> Rect | |
1295 | ||
1296 | Add the properties of rect to this rectangle, updating this rectangle. | |
1297 | """ | |
1298 | return _core_.Rect___iadd__(*args, **kwargs) | |
1299 | ||
1300 | def __eq__(*args, **kwargs): | |
1301 | """ | |
1302 | __eq__(self, Rect rect) -> bool | |
1303 | ||
1304 | Test for equality. | |
1305 | """ | |
1306 | return _core_.Rect___eq__(*args, **kwargs) | |
1307 | ||
1308 | def __ne__(*args, **kwargs): | |
1309 | """ | |
1310 | __ne__(self, Rect rect) -> bool | |
1311 | ||
1312 | Test for inequality. | |
1313 | """ | |
1314 | return _core_.Rect___ne__(*args, **kwargs) | |
1315 | ||
1316 | def InsideXY(*args, **kwargs): | |
1317 | """ | |
1318 | InsideXY(self, int x, int y) -> bool | |
1319 | ||
1320 | Return True if the point is (not strcitly) inside the rect. | |
1321 | """ | |
1322 | return _core_.Rect_InsideXY(*args, **kwargs) | |
1323 | ||
1324 | def Inside(*args, **kwargs): | |
1325 | """ | |
1326 | Inside(self, Point pt) -> bool | |
1327 | ||
1328 | Return True if the point is (not strcitly) inside the rect. | |
1329 | """ | |
1330 | return _core_.Rect_Inside(*args, **kwargs) | |
1331 | ||
1332 | def Intersects(*args, **kwargs): | |
1333 | """ | |
1334 | Intersects(self, Rect rect) -> bool | |
1335 | ||
1336 | Returns True if the rectangles have a non empty intersection. | |
1337 | """ | |
1338 | return _core_.Rect_Intersects(*args, **kwargs) | |
1339 | ||
1340 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) | |
1341 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1342 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1343 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
1344 | def Set(*args, **kwargs): | |
1345 | """ | |
1346 | Set(self, int x=0, int y=0, int width=0, int height=0) | |
1347 | ||
1348 | Set all rectangle properties. | |
1349 | """ | |
1350 | return _core_.Rect_Set(*args, **kwargs) | |
1351 | ||
1352 | def Get(*args, **kwargs): | |
1353 | """ | |
1354 | Get() -> (x,y,width,height) | |
1355 | ||
1356 | Return the rectangle properties as a tuple. | |
1357 | """ | |
1358 | return _core_.Rect_Get(*args, **kwargs) | |
1359 | ||
79fccf9d | 1360 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1361 | def __str__(self): return str(self.Get()) |
1362 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1363 | def __len__(self): return len(self.Get()) | |
1364 | def __getitem__(self, index): return self.Get()[index] | |
1365 | def __setitem__(self, index, val): | |
1366 | if index == 0: self.x = val | |
1367 | elif index == 1: self.y = val | |
1368 | elif index == 2: self.width = val | |
1369 | elif index == 3: self.height = val | |
1370 | else: raise IndexError | |
1371 | def __nonzero__(self): return self.Get() != (0,0,0,0) | |
1372 | __safe_for_unpickling__ = True | |
1373 | def __reduce__(self): return (wx.Rect, self.Get()) | |
1374 | ||
1375 | ||
1376 | class RectPtr(Rect): | |
1377 | def __init__(self, this): | |
1378 | self.this = this | |
1379 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1380 | self.__class__ = Rect | |
1381 | _core_.Rect_swigregister(RectPtr) | |
1382 | ||
1383 | def RectPP(*args, **kwargs): | |
1384 | """ | |
1385 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
1386 | ||
1387 | Create a new Rect object from Points representing two corners. | |
1388 | """ | |
1389 | val = _core_.new_RectPP(*args, **kwargs) | |
1390 | val.thisown = 1 | |
1391 | return val | |
1392 | ||
1393 | def RectPS(*args, **kwargs): | |
1394 | """ | |
1395 | RectPS(Point pos, Size size) -> Rect | |
1396 | ||
1397 | Create a new Rect from a position and size. | |
1398 | """ | |
1399 | val = _core_.new_RectPS(*args, **kwargs) | |
1400 | val.thisown = 1 | |
1401 | return val | |
1402 | ||
c1cb24a4 RD |
1403 | def RectS(*args, **kwargs): |
1404 | """ | |
1405 | RectS(Size size) -> Rect | |
1406 | ||
1407 | Create a new Rect from a size only. | |
1408 | """ | |
1409 | val = _core_.new_RectS(*args, **kwargs) | |
1410 | val.thisown = 1 | |
1411 | return val | |
1412 | ||
d55e5bfc RD |
1413 | |
1414 | def IntersectRect(*args, **kwargs): | |
1415 | """ | |
1416 | IntersectRect(Rect r1, Rect r2) -> Rect | |
1417 | ||
1418 | Calculate and return the intersection of r1 and r2. | |
1419 | """ | |
1420 | return _core_.IntersectRect(*args, **kwargs) | |
1421 | #--------------------------------------------------------------------------- | |
1422 | ||
1423 | class Point2D(object): | |
79fccf9d RD |
1424 | """ |
1425 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1426 | with floating point values. | |
1427 | """ | |
d55e5bfc RD |
1428 | def __repr__(self): |
1429 | return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1430 | def __init__(self, *args, **kwargs): | |
1431 | """ | |
1432 | __init__(self, double x=0.0, double y=0.0) -> Point2D | |
1433 | ||
1434 | Create a w.Point2D object. | |
1435 | """ | |
1436 | newobj = _core_.new_Point2D(*args, **kwargs) | |
1437 | self.this = newobj.this | |
1438 | self.thisown = 1 | |
1439 | del newobj.thisown | |
1440 | def GetFloor(*args, **kwargs): | |
a8eff060 RD |
1441 | """ |
1442 | GetFloor() -> (x,y) | |
1443 | ||
1444 | Convert to integer | |
1445 | """ | |
d55e5bfc RD |
1446 | return _core_.Point2D_GetFloor(*args, **kwargs) |
1447 | ||
1448 | def GetRounded(*args, **kwargs): | |
a8eff060 RD |
1449 | """ |
1450 | GetRounded() -> (x,y) | |
1451 | ||
1452 | Convert to integer | |
1453 | """ | |
d55e5bfc RD |
1454 | return _core_.Point2D_GetRounded(*args, **kwargs) |
1455 | ||
1456 | def GetVectorLength(*args, **kwargs): | |
1457 | """GetVectorLength(self) -> double""" | |
1458 | return _core_.Point2D_GetVectorLength(*args, **kwargs) | |
1459 | ||
1460 | def GetVectorAngle(*args, **kwargs): | |
1461 | """GetVectorAngle(self) -> double""" | |
1462 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) | |
1463 | ||
1464 | def SetVectorLength(*args, **kwargs): | |
1465 | """SetVectorLength(self, double length)""" | |
1466 | return _core_.Point2D_SetVectorLength(*args, **kwargs) | |
1467 | ||
1468 | def SetVectorAngle(*args, **kwargs): | |
1469 | """SetVectorAngle(self, double degrees)""" | |
1470 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) | |
1471 | ||
1472 | def SetPolarCoordinates(self, angle, length): | |
1473 | self.SetVectorLength(length) | |
1474 | self.SetVectorAngle(angle) | |
1475 | def Normalize(self): | |
1476 | self.SetVectorLength(1.0) | |
1477 | ||
1478 | def GetDistance(*args, **kwargs): | |
1479 | """GetDistance(self, Point2D pt) -> double""" | |
1480 | return _core_.Point2D_GetDistance(*args, **kwargs) | |
1481 | ||
1482 | def GetDistanceSquare(*args, **kwargs): | |
1483 | """GetDistanceSquare(self, Point2D pt) -> double""" | |
1484 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) | |
1485 | ||
1486 | def GetDotProduct(*args, **kwargs): | |
1487 | """GetDotProduct(self, Point2D vec) -> double""" | |
1488 | return _core_.Point2D_GetDotProduct(*args, **kwargs) | |
1489 | ||
1490 | def GetCrossProduct(*args, **kwargs): | |
1491 | """GetCrossProduct(self, Point2D vec) -> double""" | |
1492 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) | |
1493 | ||
1494 | def __neg__(*args, **kwargs): | |
1495 | """ | |
1496 | __neg__(self) -> Point2D | |
1497 | ||
1498 | the reflection of this point | |
1499 | """ | |
1500 | return _core_.Point2D___neg__(*args, **kwargs) | |
1501 | ||
1502 | def __iadd__(*args, **kwargs): | |
1503 | """__iadd__(self, Point2D pt) -> Point2D""" | |
1504 | return _core_.Point2D___iadd__(*args, **kwargs) | |
1505 | ||
1506 | def __isub__(*args, **kwargs): | |
1507 | """__isub__(self, Point2D pt) -> Point2D""" | |
1508 | return _core_.Point2D___isub__(*args, **kwargs) | |
1509 | ||
1510 | def __imul__(*args, **kwargs): | |
1511 | """__imul__(self, Point2D pt) -> Point2D""" | |
1512 | return _core_.Point2D___imul__(*args, **kwargs) | |
1513 | ||
1514 | def __idiv__(*args, **kwargs): | |
1515 | """__idiv__(self, Point2D pt) -> Point2D""" | |
1516 | return _core_.Point2D___idiv__(*args, **kwargs) | |
1517 | ||
1518 | def __eq__(*args, **kwargs): | |
1519 | """ | |
1520 | __eq__(self, Point2D pt) -> bool | |
1521 | ||
1522 | Test for equality | |
1523 | """ | |
1524 | return _core_.Point2D___eq__(*args, **kwargs) | |
1525 | ||
1526 | def __ne__(*args, **kwargs): | |
1527 | """ | |
1528 | __ne__(self, Point2D pt) -> bool | |
1529 | ||
1530 | Test for inequality | |
1531 | """ | |
1532 | return _core_.Point2D___ne__(*args, **kwargs) | |
1533 | ||
1534 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) | |
1535 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
1536 | def Set(*args, **kwargs): | |
1537 | """Set(self, double x=0, double y=0)""" | |
1538 | return _core_.Point2D_Set(*args, **kwargs) | |
1539 | ||
1540 | def Get(*args, **kwargs): | |
1541 | """ | |
1542 | Get() -> (x,y) | |
1543 | ||
1544 | Return x and y properties as a tuple. | |
1545 | """ | |
1546 | return _core_.Point2D_Get(*args, **kwargs) | |
1547 | ||
79fccf9d | 1548 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1549 | def __str__(self): return str(self.Get()) |
1550 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1551 | def __len__(self): return len(self.Get()) | |
1552 | def __getitem__(self, index): return self.Get()[index] | |
1553 | def __setitem__(self, index, val): | |
1554 | if index == 0: self.x = val | |
1555 | elif index == 1: self.y = val | |
1556 | else: raise IndexError | |
1557 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1558 | __safe_for_unpickling__ = True | |
1559 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
1560 | ||
1561 | ||
1562 | class Point2DPtr(Point2D): | |
1563 | def __init__(self, this): | |
1564 | self.this = this | |
1565 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1566 | self.__class__ = Point2D | |
1567 | _core_.Point2D_swigregister(Point2DPtr) | |
1568 | ||
1569 | def Point2DCopy(*args, **kwargs): | |
1570 | """ | |
1571 | Point2DCopy(Point2D pt) -> Point2D | |
1572 | ||
1573 | Create a w.Point2D object. | |
1574 | """ | |
1575 | val = _core_.new_Point2DCopy(*args, **kwargs) | |
1576 | val.thisown = 1 | |
1577 | return val | |
1578 | ||
1579 | def Point2DFromPoint(*args, **kwargs): | |
1580 | """ | |
1581 | Point2DFromPoint(Point pt) -> Point2D | |
1582 | ||
1583 | Create a w.Point2D object. | |
1584 | """ | |
1585 | val = _core_.new_Point2DFromPoint(*args, **kwargs) | |
1586 | val.thisown = 1 | |
1587 | return val | |
1588 | ||
1589 | #--------------------------------------------------------------------------- | |
1590 | ||
1591 | FromStart = _core_.FromStart | |
1592 | FromCurrent = _core_.FromCurrent | |
1593 | FromEnd = _core_.FromEnd | |
1594 | class InputStream(object): | |
093d3ff1 | 1595 | """Proxy of C++ InputStream class""" |
d55e5bfc RD |
1596 | def __repr__(self): |
1597 | return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1598 | def __init__(self, *args, **kwargs): | |
1599 | """__init__(self, PyObject p) -> InputStream""" | |
1600 | newobj = _core_.new_InputStream(*args, **kwargs) | |
1601 | self.this = newobj.this | |
1602 | self.thisown = 1 | |
1603 | del newobj.thisown | |
8fb0e70a RD |
1604 | def __del__(self, destroy=_core_.delete_InputStream): |
1605 | """__del__(self)""" | |
1606 | try: | |
1607 | if self.thisown: destroy(self) | |
1608 | except: pass | |
1609 | ||
d55e5bfc RD |
1610 | def close(*args, **kwargs): |
1611 | """close(self)""" | |
1612 | return _core_.InputStream_close(*args, **kwargs) | |
1613 | ||
1614 | def flush(*args, **kwargs): | |
1615 | """flush(self)""" | |
1616 | return _core_.InputStream_flush(*args, **kwargs) | |
1617 | ||
1618 | def eof(*args, **kwargs): | |
1619 | """eof(self) -> bool""" | |
1620 | return _core_.InputStream_eof(*args, **kwargs) | |
1621 | ||
1622 | def read(*args, **kwargs): | |
1623 | """read(self, int size=-1) -> PyObject""" | |
1624 | return _core_.InputStream_read(*args, **kwargs) | |
1625 | ||
1626 | def readline(*args, **kwargs): | |
1627 | """readline(self, int size=-1) -> PyObject""" | |
1628 | return _core_.InputStream_readline(*args, **kwargs) | |
1629 | ||
1630 | def readlines(*args, **kwargs): | |
1631 | """readlines(self, int sizehint=-1) -> PyObject""" | |
1632 | return _core_.InputStream_readlines(*args, **kwargs) | |
1633 | ||
1634 | def seek(*args, **kwargs): | |
1635 | """seek(self, int offset, int whence=0)""" | |
1636 | return _core_.InputStream_seek(*args, **kwargs) | |
1637 | ||
1638 | def tell(*args, **kwargs): | |
1639 | """tell(self) -> int""" | |
1640 | return _core_.InputStream_tell(*args, **kwargs) | |
1641 | ||
1642 | def Peek(*args, **kwargs): | |
1643 | """Peek(self) -> char""" | |
1644 | return _core_.InputStream_Peek(*args, **kwargs) | |
1645 | ||
1646 | def GetC(*args, **kwargs): | |
1647 | """GetC(self) -> char""" | |
1648 | return _core_.InputStream_GetC(*args, **kwargs) | |
1649 | ||
1650 | def LastRead(*args, **kwargs): | |
1651 | """LastRead(self) -> size_t""" | |
1652 | return _core_.InputStream_LastRead(*args, **kwargs) | |
1653 | ||
1654 | def CanRead(*args, **kwargs): | |
1655 | """CanRead(self) -> bool""" | |
1656 | return _core_.InputStream_CanRead(*args, **kwargs) | |
1657 | ||
1658 | def Eof(*args, **kwargs): | |
1659 | """Eof(self) -> bool""" | |
1660 | return _core_.InputStream_Eof(*args, **kwargs) | |
1661 | ||
1662 | def Ungetch(*args, **kwargs): | |
1663 | """Ungetch(self, char c) -> bool""" | |
1664 | return _core_.InputStream_Ungetch(*args, **kwargs) | |
1665 | ||
1666 | def SeekI(*args, **kwargs): | |
1667 | """SeekI(self, long pos, int mode=FromStart) -> long""" | |
1668 | return _core_.InputStream_SeekI(*args, **kwargs) | |
1669 | ||
1670 | def TellI(*args, **kwargs): | |
1671 | """TellI(self) -> long""" | |
1672 | return _core_.InputStream_TellI(*args, **kwargs) | |
1673 | ||
1674 | ||
1675 | class InputStreamPtr(InputStream): | |
1676 | def __init__(self, this): | |
1677 | self.this = this | |
1678 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1679 | self.__class__ = InputStream | |
1680 | _core_.InputStream_swigregister(InputStreamPtr) | |
1681 | DefaultPosition = cvar.DefaultPosition | |
1682 | DefaultSize = cvar.DefaultSize | |
1683 | ||
1684 | class OutputStream(object): | |
093d3ff1 | 1685 | """Proxy of C++ OutputStream class""" |
d55e5bfc RD |
1686 | def __init__(self): raise RuntimeError, "No constructor defined" |
1687 | def __repr__(self): | |
1688 | return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1689 | def write(*args, **kwargs): | |
1690 | """write(self, PyObject obj)""" | |
1691 | return _core_.OutputStream_write(*args, **kwargs) | |
1692 | ||
1693 | ||
1694 | class OutputStreamPtr(OutputStream): | |
1695 | def __init__(self, this): | |
1696 | self.this = this | |
1697 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1698 | self.__class__ = OutputStream | |
1699 | _core_.OutputStream_swigregister(OutputStreamPtr) | |
1700 | ||
1701 | #--------------------------------------------------------------------------- | |
1702 | ||
1703 | class FSFile(Object): | |
093d3ff1 | 1704 | """Proxy of C++ FSFile class""" |
d55e5bfc RD |
1705 | def __repr__(self): |
1706 | return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1707 | def __init__(self, *args, **kwargs): | |
1708 | """ | |
1709 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, | |
1710 | DateTime modif) -> FSFile | |
1711 | """ | |
1712 | newobj = _core_.new_FSFile(*args, **kwargs) | |
1713 | self.this = newobj.this | |
1714 | self.thisown = 1 | |
1715 | del newobj.thisown | |
e2950dbb | 1716 | self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem |
4cf4100f | 1717 | |
d55e5bfc RD |
1718 | def __del__(self, destroy=_core_.delete_FSFile): |
1719 | """__del__(self)""" | |
1720 | try: | |
1721 | if self.thisown: destroy(self) | |
1722 | except: pass | |
1723 | ||
1724 | def GetStream(*args, **kwargs): | |
1725 | """GetStream(self) -> InputStream""" | |
1726 | return _core_.FSFile_GetStream(*args, **kwargs) | |
1727 | ||
1728 | def GetMimeType(*args, **kwargs): | |
1729 | """GetMimeType(self) -> String""" | |
1730 | return _core_.FSFile_GetMimeType(*args, **kwargs) | |
1731 | ||
1732 | def GetLocation(*args, **kwargs): | |
1733 | """GetLocation(self) -> String""" | |
1734 | return _core_.FSFile_GetLocation(*args, **kwargs) | |
1735 | ||
1736 | def GetAnchor(*args, **kwargs): | |
1737 | """GetAnchor(self) -> String""" | |
1738 | return _core_.FSFile_GetAnchor(*args, **kwargs) | |
1739 | ||
1740 | def GetModificationTime(*args, **kwargs): | |
1741 | """GetModificationTime(self) -> DateTime""" | |
1742 | return _core_.FSFile_GetModificationTime(*args, **kwargs) | |
1743 | ||
1744 | ||
1745 | class FSFilePtr(FSFile): | |
1746 | def __init__(self, this): | |
1747 | self.this = this | |
1748 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1749 | self.__class__ = FSFile | |
1750 | _core_.FSFile_swigregister(FSFilePtr) | |
1751 | ||
1752 | class CPPFileSystemHandler(object): | |
093d3ff1 | 1753 | """Proxy of C++ CPPFileSystemHandler class""" |
d55e5bfc RD |
1754 | def __init__(self): raise RuntimeError, "No constructor defined" |
1755 | def __repr__(self): | |
1756 | return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1757 | ||
1758 | class CPPFileSystemHandlerPtr(CPPFileSystemHandler): | |
1759 | def __init__(self, this): | |
1760 | self.this = this | |
1761 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1762 | self.__class__ = CPPFileSystemHandler | |
1763 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr) | |
1764 | ||
1765 | class FileSystemHandler(CPPFileSystemHandler): | |
093d3ff1 | 1766 | """Proxy of C++ FileSystemHandler class""" |
d55e5bfc RD |
1767 | def __repr__(self): |
1768 | return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1769 | def __init__(self, *args, **kwargs): | |
1770 | """__init__(self) -> FileSystemHandler""" | |
1771 | newobj = _core_.new_FileSystemHandler(*args, **kwargs) | |
1772 | self.this = newobj.this | |
1773 | self.thisown = 1 | |
1774 | del newobj.thisown | |
1775 | self._setCallbackInfo(self, FileSystemHandler) | |
1776 | ||
1777 | def _setCallbackInfo(*args, **kwargs): | |
1778 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
1779 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) | |
1780 | ||
1781 | def CanOpen(*args, **kwargs): | |
1782 | """CanOpen(self, String location) -> bool""" | |
1783 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) | |
1784 | ||
1785 | def OpenFile(*args, **kwargs): | |
1786 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
1787 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) | |
1788 | ||
1789 | def FindFirst(*args, **kwargs): | |
1790 | """FindFirst(self, String spec, int flags=0) -> String""" | |
1791 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) | |
1792 | ||
1793 | def FindNext(*args, **kwargs): | |
1794 | """FindNext(self) -> String""" | |
1795 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) | |
1796 | ||
1797 | def GetProtocol(*args, **kwargs): | |
1798 | """GetProtocol(self, String location) -> String""" | |
1799 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) | |
1800 | ||
1801 | def GetLeftLocation(*args, **kwargs): | |
1802 | """GetLeftLocation(self, String location) -> String""" | |
1803 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | |
1804 | ||
1805 | def GetAnchor(*args, **kwargs): | |
1806 | """GetAnchor(self, String location) -> String""" | |
1807 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) | |
1808 | ||
1809 | def GetRightLocation(*args, **kwargs): | |
1810 | """GetRightLocation(self, String location) -> String""" | |
1811 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) | |
1812 | ||
1813 | def GetMimeTypeFromExt(*args, **kwargs): | |
1814 | """GetMimeTypeFromExt(self, String location) -> String""" | |
1815 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) | |
1816 | ||
1817 | ||
1818 | class FileSystemHandlerPtr(FileSystemHandler): | |
1819 | def __init__(self, this): | |
1820 | self.this = this | |
1821 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1822 | self.__class__ = FileSystemHandler | |
1823 | _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr) | |
1824 | ||
1825 | class FileSystem(Object): | |
093d3ff1 | 1826 | """Proxy of C++ FileSystem class""" |
d55e5bfc RD |
1827 | def __repr__(self): |
1828 | return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1829 | def __init__(self, *args, **kwargs): | |
1830 | """__init__(self) -> FileSystem""" | |
1831 | newobj = _core_.new_FileSystem(*args, **kwargs) | |
1832 | self.this = newobj.this | |
1833 | self.thisown = 1 | |
1834 | del newobj.thisown | |
1835 | def __del__(self, destroy=_core_.delete_FileSystem): | |
1836 | """__del__(self)""" | |
1837 | try: | |
1838 | if self.thisown: destroy(self) | |
1839 | except: pass | |
1840 | ||
1841 | def ChangePathTo(*args, **kwargs): | |
1842 | """ChangePathTo(self, String location, bool is_dir=False)""" | |
1843 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) | |
1844 | ||
1845 | def GetPath(*args, **kwargs): | |
1846 | """GetPath(self) -> String""" | |
1847 | return _core_.FileSystem_GetPath(*args, **kwargs) | |
1848 | ||
1849 | def OpenFile(*args, **kwargs): | |
1850 | """OpenFile(self, String location) -> FSFile""" | |
1851 | return _core_.FileSystem_OpenFile(*args, **kwargs) | |
1852 | ||
1853 | def FindFirst(*args, **kwargs): | |
1854 | """FindFirst(self, String spec, int flags=0) -> String""" | |
1855 | return _core_.FileSystem_FindFirst(*args, **kwargs) | |
1856 | ||
1857 | def FindNext(*args, **kwargs): | |
1858 | """FindNext(self) -> String""" | |
1859 | return _core_.FileSystem_FindNext(*args, **kwargs) | |
1860 | ||
1861 | def AddHandler(*args, **kwargs): | |
c24da6d6 | 1862 | """AddHandler(CPPFileSystemHandler handler)""" |
d55e5bfc RD |
1863 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
1864 | ||
1865 | AddHandler = staticmethod(AddHandler) | |
1866 | def CleanUpHandlers(*args, **kwargs): | |
c24da6d6 | 1867 | """CleanUpHandlers()""" |
d55e5bfc RD |
1868 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
1869 | ||
1870 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1871 | def FileNameToURL(*args, **kwargs): | |
c24da6d6 | 1872 | """FileNameToURL(String filename) -> String""" |
d55e5bfc RD |
1873 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
1874 | ||
1875 | FileNameToURL = staticmethod(FileNameToURL) | |
ae8162c8 RD |
1876 | def URLToFileName(*args, **kwargs): |
1877 | """URLToFileName(String url) -> String""" | |
1878 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
1879 | ||
1880 | URLToFileName = staticmethod(URLToFileName) | |
d55e5bfc RD |
1881 | |
1882 | class FileSystemPtr(FileSystem): | |
1883 | def __init__(self, this): | |
1884 | self.this = this | |
1885 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1886 | self.__class__ = FileSystem | |
1887 | _core_.FileSystem_swigregister(FileSystemPtr) | |
1888 | ||
1889 | def FileSystem_AddHandler(*args, **kwargs): | |
1890 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" | |
1891 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
1892 | ||
1893 | def FileSystem_CleanUpHandlers(*args, **kwargs): | |
1894 | """FileSystem_CleanUpHandlers()""" | |
1895 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) | |
1896 | ||
1897 | def FileSystem_FileNameToURL(*args, **kwargs): | |
1898 | """FileSystem_FileNameToURL(String filename) -> String""" | |
1899 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
1900 | ||
d55e5bfc RD |
1901 | def FileSystem_URLToFileName(*args, **kwargs): |
1902 | """FileSystem_URLToFileName(String url) -> String""" | |
1903 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
ae8162c8 | 1904 | |
d55e5bfc | 1905 | class InternetFSHandler(CPPFileSystemHandler): |
093d3ff1 | 1906 | """Proxy of C++ InternetFSHandler class""" |
d55e5bfc RD |
1907 | def __repr__(self): |
1908 | return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1909 | def __init__(self, *args, **kwargs): | |
1910 | """__init__(self) -> InternetFSHandler""" | |
1911 | newobj = _core_.new_InternetFSHandler(*args, **kwargs) | |
1912 | self.this = newobj.this | |
1913 | self.thisown = 1 | |
1914 | del newobj.thisown | |
1915 | def CanOpen(*args, **kwargs): | |
1916 | """CanOpen(self, String location) -> bool""" | |
1917 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) | |
1918 | ||
1919 | def OpenFile(*args, **kwargs): | |
1920 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
1921 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) | |
1922 | ||
1923 | ||
1924 | class InternetFSHandlerPtr(InternetFSHandler): | |
1925 | def __init__(self, this): | |
1926 | self.this = this | |
1927 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1928 | self.__class__ = InternetFSHandler | |
1929 | _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr) | |
1930 | ||
1931 | class ZipFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1932 | """Proxy of C++ ZipFSHandler class""" |
d55e5bfc RD |
1933 | def __repr__(self): |
1934 | return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1935 | def __init__(self, *args, **kwargs): | |
1936 | """__init__(self) -> ZipFSHandler""" | |
1937 | newobj = _core_.new_ZipFSHandler(*args, **kwargs) | |
1938 | self.this = newobj.this | |
1939 | self.thisown = 1 | |
1940 | del newobj.thisown | |
1941 | def CanOpen(*args, **kwargs): | |
1942 | """CanOpen(self, String location) -> bool""" | |
1943 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) | |
1944 | ||
1945 | def OpenFile(*args, **kwargs): | |
1946 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
1947 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) | |
1948 | ||
1949 | def FindFirst(*args, **kwargs): | |
1950 | """FindFirst(self, String spec, int flags=0) -> String""" | |
1951 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) | |
1952 | ||
1953 | def FindNext(*args, **kwargs): | |
1954 | """FindNext(self) -> String""" | |
1955 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) | |
1956 | ||
1957 | ||
1958 | class ZipFSHandlerPtr(ZipFSHandler): | |
1959 | def __init__(self, this): | |
1960 | self.this = this | |
1961 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1962 | self.__class__ = ZipFSHandler | |
1963 | _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr) | |
1964 | ||
1965 | ||
1966 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): | |
1967 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" | |
1968 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
1969 | ||
1970 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): | |
1971 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" | |
1972 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
1973 | ||
1974 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): | |
1975 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" | |
1976 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
ae8162c8 RD |
1977 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
1978 | """ | |
1979 | Add 'file' to the memory filesystem. The dataItem parameter can | |
1980 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
1981 | arbitrary data. If a bitmap or image is used then the imgType | |
1982 | parameter should specify what kind of image file it should be | |
1983 | written as, wx.BITMAP_TYPE_PNG, etc. | |
1984 | """ | |
1985 | if isinstance(dataItem, wx.Image): | |
1986 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
1987 | elif isinstance(dataItem, wx.Bitmap): | |
1988 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
1989 | elif type(dataItem) == str: | |
1990 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
1991 | else: | |
1992 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d55e5bfc RD |
1993 | |
1994 | class MemoryFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1995 | """Proxy of C++ MemoryFSHandler class""" |
d55e5bfc RD |
1996 | def __repr__(self): |
1997 | return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1998 | def __init__(self, *args, **kwargs): | |
1999 | """__init__(self) -> MemoryFSHandler""" | |
2000 | newobj = _core_.new_MemoryFSHandler(*args, **kwargs) | |
2001 | self.this = newobj.this | |
2002 | self.thisown = 1 | |
2003 | del newobj.thisown | |
2004 | def RemoveFile(*args, **kwargs): | |
c24da6d6 | 2005 | """RemoveFile(String filename)""" |
d55e5bfc RD |
2006 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
2007 | ||
2008 | RemoveFile = staticmethod(RemoveFile) | |
2009 | AddFile = staticmethod(MemoryFSHandler_AddFile) | |
2010 | def CanOpen(*args, **kwargs): | |
2011 | """CanOpen(self, String location) -> bool""" | |
2012 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) | |
2013 | ||
2014 | def OpenFile(*args, **kwargs): | |
2015 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
2016 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) | |
2017 | ||
2018 | def FindFirst(*args, **kwargs): | |
2019 | """FindFirst(self, String spec, int flags=0) -> String""" | |
2020 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) | |
2021 | ||
2022 | def FindNext(*args, **kwargs): | |
2023 | """FindNext(self) -> String""" | |
2024 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) | |
2025 | ||
2026 | ||
2027 | class MemoryFSHandlerPtr(MemoryFSHandler): | |
2028 | def __init__(self, this): | |
2029 | self.this = this | |
2030 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2031 | self.__class__ = MemoryFSHandler | |
2032 | _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr) | |
2033 | ||
2034 | def MemoryFSHandler_RemoveFile(*args, **kwargs): | |
2035 | """MemoryFSHandler_RemoveFile(String filename)""" | |
2036 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
2037 | ||
57133d5c RD |
2038 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
2039 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
2040 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
d55e5bfc RD |
2041 | #--------------------------------------------------------------------------- |
2042 | ||
2043 | class ImageHandler(Object): | |
27fb7603 RD |
2044 | """ |
2045 | This is the base class for implementing image file loading/saving, and | |
2046 | image creation from data. It is used within `wx.Image` and is not | |
2047 | normally seen by the application. | |
2048 | """ | |
d55e5bfc RD |
2049 | def __init__(self): raise RuntimeError, "No constructor defined" |
2050 | def __repr__(self): | |
2051 | return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2052 | def GetName(*args, **kwargs): | |
2053 | """GetName(self) -> String""" | |
2054 | return _core_.ImageHandler_GetName(*args, **kwargs) | |
2055 | ||
2056 | def GetExtension(*args, **kwargs): | |
2057 | """GetExtension(self) -> String""" | |
2058 | return _core_.ImageHandler_GetExtension(*args, **kwargs) | |
2059 | ||
2060 | def GetType(*args, **kwargs): | |
2061 | """GetType(self) -> long""" | |
2062 | return _core_.ImageHandler_GetType(*args, **kwargs) | |
2063 | ||
2064 | def GetMimeType(*args, **kwargs): | |
2065 | """GetMimeType(self) -> String""" | |
2066 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) | |
2067 | ||
2068 | def CanRead(*args, **kwargs): | |
2069 | """CanRead(self, String name) -> bool""" | |
2070 | return _core_.ImageHandler_CanRead(*args, **kwargs) | |
2071 | ||
2072 | def SetName(*args, **kwargs): | |
2073 | """SetName(self, String name)""" | |
2074 | return _core_.ImageHandler_SetName(*args, **kwargs) | |
2075 | ||
2076 | def SetExtension(*args, **kwargs): | |
2077 | """SetExtension(self, String extension)""" | |
2078 | return _core_.ImageHandler_SetExtension(*args, **kwargs) | |
2079 | ||
2080 | def SetType(*args, **kwargs): | |
2081 | """SetType(self, long type)""" | |
2082 | return _core_.ImageHandler_SetType(*args, **kwargs) | |
2083 | ||
2084 | def SetMimeType(*args, **kwargs): | |
2085 | """SetMimeType(self, String mimetype)""" | |
2086 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) | |
2087 | ||
2088 | ||
2089 | class ImageHandlerPtr(ImageHandler): | |
2090 | def __init__(self, this): | |
2091 | self.this = this | |
2092 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2093 | self.__class__ = ImageHandler | |
2094 | _core_.ImageHandler_swigregister(ImageHandlerPtr) | |
2095 | ||
2096 | class ImageHistogram(object): | |
093d3ff1 | 2097 | """Proxy of C++ ImageHistogram class""" |
d55e5bfc RD |
2098 | def __repr__(self): |
2099 | return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2100 | def __init__(self, *args, **kwargs): | |
2101 | """__init__(self) -> ImageHistogram""" | |
2102 | newobj = _core_.new_ImageHistogram(*args, **kwargs) | |
2103 | self.this = newobj.this | |
2104 | self.thisown = 1 | |
2105 | del newobj.thisown | |
2106 | def MakeKey(*args, **kwargs): | |
2107 | """ | |
c24da6d6 | 2108 | MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long |
d55e5bfc RD |
2109 | |
2110 | Get the key in the histogram for the given RGB values | |
2111 | """ | |
2112 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) | |
2113 | ||
2114 | MakeKey = staticmethod(MakeKey) | |
2115 | def FindFirstUnusedColour(*args, **kwargs): | |
a8eff060 RD |
2116 | """ |
2117 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2118 | ||
2119 | Find first colour that is not used in the image and has higher RGB | |
2120 | values than startR, startG, startB. Returns a tuple consisting of a | |
2121 | success flag and rgb values. | |
2122 | """ | |
d55e5bfc RD |
2123 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
2124 | ||
f1cbd8fa RD |
2125 | def GetCount(*args, **kwargs): |
2126 | """ | |
2127 | GetCount(self, unsigned long key) -> unsigned long | |
2128 | ||
2129 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2130 | key value from a RGB tripple. | |
2131 | """ | |
2132 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
2133 | ||
2134 | def GetCountRGB(*args, **kwargs): | |
2135 | """ | |
2136 | GetCountRGB(self, unsigned char r, unsigned char g, unsigned char b) -> unsigned long | |
2137 | ||
2138 | Returns the pixel count for the given RGB values. | |
2139 | """ | |
2140 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2141 | ||
2142 | def GetCountColour(*args, **kwargs): | |
2143 | """ | |
2144 | GetCountColour(self, Colour colour) -> unsigned long | |
2145 | ||
2146 | Returns the pixel count for the given `wx.Colour` value. | |
2147 | """ | |
2148 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2149 | ||
d55e5bfc RD |
2150 | |
2151 | class ImageHistogramPtr(ImageHistogram): | |
2152 | def __init__(self, this): | |
2153 | self.this = this | |
2154 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2155 | self.__class__ = ImageHistogram | |
2156 | _core_.ImageHistogram_swigregister(ImageHistogramPtr) | |
2157 | ||
2158 | def ImageHistogram_MakeKey(*args, **kwargs): | |
2159 | """ | |
2160 | ImageHistogram_MakeKey(unsigned char r, unsigned char g, unsigned char b) -> unsigned long | |
2161 | ||
2162 | Get the key in the histogram for the given RGB values | |
2163 | """ | |
2164 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) | |
2165 | ||
2166 | class Image(Object): | |
093d3ff1 | 2167 | """Proxy of C++ Image class""" |
d55e5bfc RD |
2168 | def __repr__(self): |
2169 | return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2170 | def __init__(self, *args, **kwargs): | |
2171 | """__init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image""" | |
2172 | newobj = _core_.new_Image(*args, **kwargs) | |
2173 | self.this = newobj.this | |
2174 | self.thisown = 1 | |
2175 | del newobj.thisown | |
2176 | def __del__(self, destroy=_core_.delete_Image): | |
2177 | """__del__(self)""" | |
2178 | try: | |
2179 | if self.thisown: destroy(self) | |
2180 | except: pass | |
2181 | ||
2182 | def Create(*args, **kwargs): | |
2183 | """Create(self, int width, int height)""" | |
2184 | return _core_.Image_Create(*args, **kwargs) | |
2185 | ||
2186 | def Destroy(*args, **kwargs): | |
2187 | """ | |
2188 | Destroy(self) | |
2189 | ||
2190 | Deletes the C++ object this Python object is a proxy for. | |
2191 | """ | |
2192 | return _core_.Image_Destroy(*args, **kwargs) | |
2193 | ||
2194 | def Scale(*args, **kwargs): | |
2195 | """Scale(self, int width, int height) -> Image""" | |
2196 | return _core_.Image_Scale(*args, **kwargs) | |
2197 | ||
2198 | def ShrinkBy(*args, **kwargs): | |
2199 | """ShrinkBy(self, int xFactor, int yFactor) -> Image""" | |
2200 | return _core_.Image_ShrinkBy(*args, **kwargs) | |
2201 | ||
2202 | def Rescale(*args, **kwargs): | |
2203 | """Rescale(self, int width, int height) -> Image""" | |
2204 | return _core_.Image_Rescale(*args, **kwargs) | |
2205 | ||
aff4cc5c RD |
2206 | def Resize(*args, **kwargs): |
2207 | """Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image""" | |
2208 | return _core_.Image_Resize(*args, **kwargs) | |
2209 | ||
d55e5bfc RD |
2210 | def SetRGB(*args, **kwargs): |
2211 | """SetRGB(self, int x, int y, unsigned char r, unsigned char g, unsigned char b)""" | |
2212 | return _core_.Image_SetRGB(*args, **kwargs) | |
2213 | ||
aff4cc5c RD |
2214 | def SetRGBRect(*args, **kwargs): |
2215 | """SetRGBRect(self, Rect rect, unsigned char r, unsigned char g, unsigned char b)""" | |
2216 | return _core_.Image_SetRGBRect(*args, **kwargs) | |
2217 | ||
d55e5bfc RD |
2218 | def GetRed(*args, **kwargs): |
2219 | """GetRed(self, int x, int y) -> unsigned char""" | |
2220 | return _core_.Image_GetRed(*args, **kwargs) | |
2221 | ||
2222 | def GetGreen(*args, **kwargs): | |
2223 | """GetGreen(self, int x, int y) -> unsigned char""" | |
2224 | return _core_.Image_GetGreen(*args, **kwargs) | |
2225 | ||
2226 | def GetBlue(*args, **kwargs): | |
2227 | """GetBlue(self, int x, int y) -> unsigned char""" | |
2228 | return _core_.Image_GetBlue(*args, **kwargs) | |
2229 | ||
2230 | def SetAlpha(*args, **kwargs): | |
2231 | """SetAlpha(self, int x, int y, unsigned char alpha)""" | |
2232 | return _core_.Image_SetAlpha(*args, **kwargs) | |
2233 | ||
2234 | def GetAlpha(*args, **kwargs): | |
2235 | """GetAlpha(self, int x, int y) -> unsigned char""" | |
2236 | return _core_.Image_GetAlpha(*args, **kwargs) | |
2237 | ||
2238 | def HasAlpha(*args, **kwargs): | |
2239 | """HasAlpha(self) -> bool""" | |
2240 | return _core_.Image_HasAlpha(*args, **kwargs) | |
2241 | ||
68350608 RD |
2242 | def InitAlpha(*args, **kwargs): |
2243 | """ | |
2244 | InitAlpha(self) | |
2245 | ||
2246 | Initializes the image alpha channel data. It is an error to call it if | |
2247 | the image already has alpha data. If it doesn't, alpha data will be by | |
2248 | default initialized to all pixels being fully opaque. But if the image | |
2249 | has a a mask colour, all mask pixels will be completely transparent. | |
2250 | """ | |
2251 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2252 | ||
57133d5c RD |
2253 | def IsTransparent(*args, **kwargs): |
2254 | """ | |
2255 | IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool | |
2256 | ||
2257 | Returns True if this pixel is masked or has an alpha value less than | |
2258 | the spcified threshold. | |
2259 | """ | |
2260 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2261 | ||
d55e5bfc | 2262 | def FindFirstUnusedColour(*args, **kwargs): |
a8eff060 RD |
2263 | """ |
2264 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2265 | ||
2266 | Find first colour that is not used in the image and has higher RGB | |
2267 | values than startR, startG, startB. Returns a tuple consisting of a | |
2268 | success flag and rgb values. | |
2269 | """ | |
d55e5bfc RD |
2270 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
2271 | ||
4cf4100f RD |
2272 | def ConvertAlphaToMask(*args, **kwargs): |
2273 | """ | |
57133d5c | 2274 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f RD |
2275 | |
2276 | If the image has alpha channel, this method converts it to mask. All pixels | |
2277 | with alpha value less than ``threshold`` are replaced with mask colour and the | |
2278 | alpha channel is removed. Mask colour is chosen automatically using | |
2279 | `FindFirstUnusedColour`. | |
2280 | ||
2281 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2282 | nothing. | |
2283 | """ | |
2284 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
2285 | ||
8fb0e70a RD |
2286 | def ConvertColourToAlpha(*args, **kwargs): |
2287 | """ | |
2288 | ConvertColourToAlpha(self, unsigned char r, unsigned char g, unsigned char b) -> bool | |
2289 | ||
2290 | This method converts an image where the original alpha information is | |
2291 | only available as a shades of a colour (actually shades of grey) | |
2292 | typically when you draw anti-aliased text into a bitmap. The DC | |
2293 | drawing routines draw grey values on the black background although | |
2294 | they actually mean to draw white with differnt alpha values. This | |
2295 | method reverses it, assuming a black (!) background and white text. | |
2296 | The method will then fill up the whole image with the colour given. | |
2297 | """ | |
2298 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2299 | ||
d55e5bfc RD |
2300 | def SetMaskFromImage(*args, **kwargs): |
2301 | """SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool""" | |
2302 | return _core_.Image_SetMaskFromImage(*args, **kwargs) | |
2303 | ||
2304 | def CanRead(*args, **kwargs): | |
c24da6d6 | 2305 | """CanRead(String name) -> bool""" |
d55e5bfc RD |
2306 | return _core_.Image_CanRead(*args, **kwargs) |
2307 | ||
2308 | CanRead = staticmethod(CanRead) | |
2309 | def GetImageCount(*args, **kwargs): | |
c24da6d6 | 2310 | """GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int""" |
d55e5bfc RD |
2311 | return _core_.Image_GetImageCount(*args, **kwargs) |
2312 | ||
2313 | GetImageCount = staticmethod(GetImageCount) | |
2314 | def LoadFile(*args, **kwargs): | |
2315 | """LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool""" | |
2316 | return _core_.Image_LoadFile(*args, **kwargs) | |
2317 | ||
2318 | def LoadMimeFile(*args, **kwargs): | |
2319 | """LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool""" | |
2320 | return _core_.Image_LoadMimeFile(*args, **kwargs) | |
2321 | ||
2322 | def SaveFile(*args, **kwargs): | |
2323 | """SaveFile(self, String name, int type) -> bool""" | |
2324 | return _core_.Image_SaveFile(*args, **kwargs) | |
2325 | ||
2326 | def SaveMimeFile(*args, **kwargs): | |
2327 | """SaveMimeFile(self, String name, String mimetype) -> bool""" | |
2328 | return _core_.Image_SaveMimeFile(*args, **kwargs) | |
2329 | ||
2330 | def CanReadStream(*args, **kwargs): | |
c24da6d6 | 2331 | """CanReadStream(InputStream stream) -> bool""" |
d55e5bfc RD |
2332 | return _core_.Image_CanReadStream(*args, **kwargs) |
2333 | ||
2334 | CanReadStream = staticmethod(CanReadStream) | |
2335 | def LoadStream(*args, **kwargs): | |
2336 | """LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool""" | |
2337 | return _core_.Image_LoadStream(*args, **kwargs) | |
2338 | ||
2339 | def LoadMimeStream(*args, **kwargs): | |
2340 | """LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool""" | |
2341 | return _core_.Image_LoadMimeStream(*args, **kwargs) | |
2342 | ||
2343 | def Ok(*args, **kwargs): | |
2344 | """Ok(self) -> bool""" | |
2345 | return _core_.Image_Ok(*args, **kwargs) | |
2346 | ||
2347 | def GetWidth(*args, **kwargs): | |
2348 | """GetWidth(self) -> int""" | |
2349 | return _core_.Image_GetWidth(*args, **kwargs) | |
2350 | ||
2351 | def GetHeight(*args, **kwargs): | |
2352 | """GetHeight(self) -> int""" | |
2353 | return _core_.Image_GetHeight(*args, **kwargs) | |
2354 | ||
2355 | def GetSize(*args, **kwargs): | |
2356 | """GetSize(self) -> Size""" | |
2357 | return _core_.Image_GetSize(*args, **kwargs) | |
2358 | ||
2359 | def GetSubImage(*args, **kwargs): | |
2360 | """GetSubImage(self, Rect rect) -> Image""" | |
2361 | return _core_.Image_GetSubImage(*args, **kwargs) | |
2362 | ||
aff4cc5c RD |
2363 | def Size(*args, **kwargs): |
2364 | """Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image""" | |
2365 | return _core_.Image_Size(*args, **kwargs) | |
2366 | ||
d55e5bfc RD |
2367 | def Copy(*args, **kwargs): |
2368 | """Copy(self) -> Image""" | |
2369 | return _core_.Image_Copy(*args, **kwargs) | |
2370 | ||
2371 | def Paste(*args, **kwargs): | |
2372 | """Paste(self, Image image, int x, int y)""" | |
2373 | return _core_.Image_Paste(*args, **kwargs) | |
2374 | ||
2375 | def GetData(*args, **kwargs): | |
ea939623 RD |
2376 | """ |
2377 | GetData(self) -> PyObject | |
2378 | ||
2379 | Returns a string containing a copy of the RGB bytes of the image. | |
2380 | """ | |
d55e5bfc RD |
2381 | return _core_.Image_GetData(*args, **kwargs) |
2382 | ||
2383 | def SetData(*args, **kwargs): | |
ea939623 RD |
2384 | """ |
2385 | SetData(self, buffer data) | |
2386 | ||
2387 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2388 | either a string or a buffer object holding the data and the length of | |
2389 | the data must be width*height*3. | |
2390 | """ | |
d55e5bfc RD |
2391 | return _core_.Image_SetData(*args, **kwargs) |
2392 | ||
2393 | def GetDataBuffer(*args, **kwargs): | |
ea939623 RD |
2394 | """ |
2395 | GetDataBuffer(self) -> PyObject | |
2396 | ||
2397 | Returns a writable Python buffer object that is pointing at the RGB | |
2398 | image data buffer inside the wx.Image. | |
2399 | """ | |
d55e5bfc RD |
2400 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
2401 | ||
2402 | def SetDataBuffer(*args, **kwargs): | |
ea939623 RD |
2403 | """ |
2404 | SetDataBuffer(self, buffer data) | |
2405 | ||
2406 | Sets the internal image data pointer to point at a Python buffer | |
2407 | object. This can save a copy of the data but you must ensure that the | |
2408 | buffer object lives longer than the wx.Image does. | |
2409 | """ | |
d55e5bfc RD |
2410 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
2411 | ||
2412 | def GetAlphaData(*args, **kwargs): | |
ea939623 RD |
2413 | """ |
2414 | GetAlphaData(self) -> PyObject | |
2415 | ||
2416 | Returns a string containing a copy of the alpha bytes of the image. | |
2417 | """ | |
d55e5bfc RD |
2418 | return _core_.Image_GetAlphaData(*args, **kwargs) |
2419 | ||
2420 | def SetAlphaData(*args, **kwargs): | |
ea939623 RD |
2421 | """ |
2422 | SetAlphaData(self, buffer alpha) | |
2423 | ||
2424 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2425 | a string or a buffer object holding the data and the length of the | |
2426 | data must be width*height. | |
2427 | """ | |
d55e5bfc RD |
2428 | return _core_.Image_SetAlphaData(*args, **kwargs) |
2429 | ||
2430 | def GetAlphaBuffer(*args, **kwargs): | |
2431 | """GetAlphaBuffer(self) -> PyObject""" | |
2432 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) | |
2433 | ||
2434 | def SetAlphaBuffer(*args, **kwargs): | |
ea939623 | 2435 | """SetAlphaBuffer(self, buffer alpha)""" |
d55e5bfc RD |
2436 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
2437 | ||
2438 | def SetMaskColour(*args, **kwargs): | |
2439 | """SetMaskColour(self, unsigned char r, unsigned char g, unsigned char b)""" | |
2440 | return _core_.Image_SetMaskColour(*args, **kwargs) | |
2441 | ||
aff4cc5c RD |
2442 | def GetOrFindMaskColour(*args, **kwargs): |
2443 | """ | |
2444 | GetOrFindMaskColour() -> (r,g,b) | |
2445 | ||
2446 | Get the current mask colour or find a suitable colour. | |
2447 | """ | |
2448 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
2449 | ||
d55e5bfc RD |
2450 | def GetMaskRed(*args, **kwargs): |
2451 | """GetMaskRed(self) -> unsigned char""" | |
2452 | return _core_.Image_GetMaskRed(*args, **kwargs) | |
2453 | ||
2454 | def GetMaskGreen(*args, **kwargs): | |
2455 | """GetMaskGreen(self) -> unsigned char""" | |
2456 | return _core_.Image_GetMaskGreen(*args, **kwargs) | |
2457 | ||
2458 | def GetMaskBlue(*args, **kwargs): | |
2459 | """GetMaskBlue(self) -> unsigned char""" | |
2460 | return _core_.Image_GetMaskBlue(*args, **kwargs) | |
2461 | ||
2462 | def SetMask(*args, **kwargs): | |
2463 | """SetMask(self, bool mask=True)""" | |
2464 | return _core_.Image_SetMask(*args, **kwargs) | |
2465 | ||
2466 | def HasMask(*args, **kwargs): | |
2467 | """HasMask(self) -> bool""" | |
2468 | return _core_.Image_HasMask(*args, **kwargs) | |
2469 | ||
2470 | def Rotate(*args, **kwargs): | |
2471 | """ | |
2472 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, | |
2473 | Point offset_after_rotation=None) -> Image | |
2474 | """ | |
2475 | return _core_.Image_Rotate(*args, **kwargs) | |
2476 | ||
2477 | def Rotate90(*args, **kwargs): | |
2478 | """Rotate90(self, bool clockwise=True) -> Image""" | |
2479 | return _core_.Image_Rotate90(*args, **kwargs) | |
2480 | ||
2481 | def Mirror(*args, **kwargs): | |
2482 | """Mirror(self, bool horizontally=True) -> Image""" | |
2483 | return _core_.Image_Mirror(*args, **kwargs) | |
2484 | ||
2485 | def Replace(*args, **kwargs): | |
2486 | """ | |
2487 | Replace(self, unsigned char r1, unsigned char g1, unsigned char b1, | |
2488 | unsigned char r2, unsigned char g2, unsigned char b2) | |
2489 | """ | |
2490 | return _core_.Image_Replace(*args, **kwargs) | |
2491 | ||
2492 | def ConvertToMono(*args, **kwargs): | |
2493 | """ConvertToMono(self, unsigned char r, unsigned char g, unsigned char b) -> Image""" | |
2494 | return _core_.Image_ConvertToMono(*args, **kwargs) | |
2495 | ||
2496 | def SetOption(*args, **kwargs): | |
2497 | """SetOption(self, String name, String value)""" | |
2498 | return _core_.Image_SetOption(*args, **kwargs) | |
2499 | ||
2500 | def SetOptionInt(*args, **kwargs): | |
2501 | """SetOptionInt(self, String name, int value)""" | |
2502 | return _core_.Image_SetOptionInt(*args, **kwargs) | |
2503 | ||
2504 | def GetOption(*args, **kwargs): | |
2505 | """GetOption(self, String name) -> String""" | |
2506 | return _core_.Image_GetOption(*args, **kwargs) | |
2507 | ||
2508 | def GetOptionInt(*args, **kwargs): | |
2509 | """GetOptionInt(self, String name) -> int""" | |
2510 | return _core_.Image_GetOptionInt(*args, **kwargs) | |
2511 | ||
2512 | def HasOption(*args, **kwargs): | |
2513 | """HasOption(self, String name) -> bool""" | |
2514 | return _core_.Image_HasOption(*args, **kwargs) | |
2515 | ||
2516 | def CountColours(*args, **kwargs): | |
2517 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" | |
2518 | return _core_.Image_CountColours(*args, **kwargs) | |
2519 | ||
2520 | def ComputeHistogram(*args, **kwargs): | |
2521 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" | |
2522 | return _core_.Image_ComputeHistogram(*args, **kwargs) | |
2523 | ||
2524 | def AddHandler(*args, **kwargs): | |
c24da6d6 | 2525 | """AddHandler(ImageHandler handler)""" |
d55e5bfc RD |
2526 | return _core_.Image_AddHandler(*args, **kwargs) |
2527 | ||
2528 | AddHandler = staticmethod(AddHandler) | |
2529 | def InsertHandler(*args, **kwargs): | |
c24da6d6 | 2530 | """InsertHandler(ImageHandler handler)""" |
d55e5bfc RD |
2531 | return _core_.Image_InsertHandler(*args, **kwargs) |
2532 | ||
2533 | InsertHandler = staticmethod(InsertHandler) | |
2534 | def RemoveHandler(*args, **kwargs): | |
c24da6d6 | 2535 | """RemoveHandler(String name) -> bool""" |
d55e5bfc RD |
2536 | return _core_.Image_RemoveHandler(*args, **kwargs) |
2537 | ||
2538 | RemoveHandler = staticmethod(RemoveHandler) | |
2539 | def GetImageExtWildcard(*args, **kwargs): | |
c24da6d6 | 2540 | """GetImageExtWildcard() -> String""" |
d55e5bfc RD |
2541 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
2542 | ||
2543 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
2544 | def ConvertToBitmap(*args, **kwargs): | |
1fbf26be | 2545 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
d55e5bfc RD |
2546 | return _core_.Image_ConvertToBitmap(*args, **kwargs) |
2547 | ||
2548 | def ConvertToMonoBitmap(*args, **kwargs): | |
2549 | """ConvertToMonoBitmap(self, unsigned char red, unsigned char green, unsigned char blue) -> Bitmap""" | |
2550 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) | |
2551 | ||
2552 | def __nonzero__(self): return self.Ok() | |
2553 | ||
2554 | class ImagePtr(Image): | |
2555 | def __init__(self, this): | |
2556 | self.this = this | |
2557 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2558 | self.__class__ = Image | |
2559 | _core_.Image_swigregister(ImagePtr) | |
2560 | ||
2561 | def ImageFromMime(*args, **kwargs): | |
2562 | """ImageFromMime(String name, String mimetype, int index=-1) -> Image""" | |
2563 | val = _core_.new_ImageFromMime(*args, **kwargs) | |
2564 | val.thisown = 1 | |
2565 | return val | |
2566 | ||
2567 | def ImageFromStream(*args, **kwargs): | |
2568 | """ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image""" | |
2569 | val = _core_.new_ImageFromStream(*args, **kwargs) | |
2570 | val.thisown = 1 | |
2571 | return val | |
2572 | ||
2573 | def ImageFromStreamMime(*args, **kwargs): | |
2574 | """ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image""" | |
2575 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) | |
2576 | val.thisown = 1 | |
2577 | return val | |
2578 | ||
c24da6d6 | 2579 | def EmptyImage(*args, **kwargs): |
ea939623 RD |
2580 | """ |
2581 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
2582 | ||
2583 | Construct an empty image of a given size, optionally setting all | |
2584 | pixels to black. | |
2585 | """ | |
c24da6d6 | 2586 | val = _core_.new_EmptyImage(*args, **kwargs) |
d55e5bfc RD |
2587 | val.thisown = 1 |
2588 | return val | |
2589 | ||
2590 | def ImageFromBitmap(*args, **kwargs): | |
ea939623 RD |
2591 | """ |
2592 | ImageFromBitmap(Bitmap bitmap) -> Image | |
2593 | ||
2594 | Construct an Image from a `wx.Bitmap`. | |
2595 | """ | |
d55e5bfc RD |
2596 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
2597 | val.thisown = 1 | |
2598 | return val | |
2599 | ||
2600 | def ImageFromData(*args, **kwargs): | |
ea939623 RD |
2601 | """ |
2602 | ImageFromData(int width, int height, buffer data) -> Image | |
2603 | ||
2604 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
2605 | string or a buffer object holding the data and the length of the data | |
2606 | must be width*height*3. | |
2607 | """ | |
d55e5bfc RD |
2608 | val = _core_.new_ImageFromData(*args, **kwargs) |
2609 | val.thisown = 1 | |
2610 | return val | |
2611 | ||
c9c2cf70 | 2612 | def ImageFromDataWithAlpha(*args, **kwargs): |
ea939623 RD |
2613 | """ |
2614 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
2615 | ||
2616 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
2617 | Accepts either a string or a buffer object holding the data and the | |
2618 | length of the data must be width*height*3. | |
2619 | """ | |
c9c2cf70 RD |
2620 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
2621 | val.thisown = 1 | |
2622 | return val | |
2623 | ||
d55e5bfc RD |
2624 | def Image_CanRead(*args, **kwargs): |
2625 | """Image_CanRead(String name) -> bool""" | |
2626 | return _core_.Image_CanRead(*args, **kwargs) | |
2627 | ||
2628 | def Image_GetImageCount(*args, **kwargs): | |
2629 | """Image_GetImageCount(String name, long type=BITMAP_TYPE_ANY) -> int""" | |
2630 | return _core_.Image_GetImageCount(*args, **kwargs) | |
2631 | ||
2632 | def Image_CanReadStream(*args, **kwargs): | |
2633 | """Image_CanReadStream(InputStream stream) -> bool""" | |
2634 | return _core_.Image_CanReadStream(*args, **kwargs) | |
2635 | ||
2636 | def Image_AddHandler(*args, **kwargs): | |
2637 | """Image_AddHandler(ImageHandler handler)""" | |
2638 | return _core_.Image_AddHandler(*args, **kwargs) | |
2639 | ||
2640 | def Image_InsertHandler(*args, **kwargs): | |
2641 | """Image_InsertHandler(ImageHandler handler)""" | |
2642 | return _core_.Image_InsertHandler(*args, **kwargs) | |
2643 | ||
2644 | def Image_RemoveHandler(*args, **kwargs): | |
2645 | """Image_RemoveHandler(String name) -> bool""" | |
2646 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
2647 | ||
2648 | def Image_GetImageExtWildcard(*args, **kwargs): | |
2649 | """Image_GetImageExtWildcard() -> String""" | |
2650 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) | |
2651 | ||
a07a67e6 RD |
2652 | def InitAllImageHandlers(): |
2653 | """ | |
2654 | The former functionality of InitAllImageHanders is now done internal to | |
2655 | the _core_ extension module and so this function has become a simple NOP. | |
2656 | """ | |
2657 | pass | |
d55e5bfc | 2658 | |
d55e5bfc RD |
2659 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
2660 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
b9d6a5f3 RD |
2661 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR |
2662 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
2663 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
d55e5bfc RD |
2664 | BMP_24BPP = _core_.BMP_24BPP |
2665 | BMP_8BPP = _core_.BMP_8BPP | |
2666 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
2667 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
2668 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
2669 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
2670 | BMP_4BPP = _core_.BMP_4BPP | |
2671 | BMP_1BPP = _core_.BMP_1BPP | |
2672 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
2673 | class BMPHandler(ImageHandler): | |
27fb7603 | 2674 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
d55e5bfc RD |
2675 | def __repr__(self): |
2676 | return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2677 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2678 | """ |
2679 | __init__(self) -> BMPHandler | |
2680 | ||
2681 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
2682 | """ | |
d55e5bfc RD |
2683 | newobj = _core_.new_BMPHandler(*args, **kwargs) |
2684 | self.this = newobj.this | |
2685 | self.thisown = 1 | |
2686 | del newobj.thisown | |
2687 | ||
2688 | class BMPHandlerPtr(BMPHandler): | |
2689 | def __init__(self, this): | |
2690 | self.this = this | |
2691 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2692 | self.__class__ = BMPHandler | |
2693 | _core_.BMPHandler_swigregister(BMPHandlerPtr) | |
2694 | NullImage = cvar.NullImage | |
68350608 | 2695 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d55e5bfc RD |
2696 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
2697 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
2698 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
2699 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
68350608 RD |
2700 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
2701 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d55e5bfc | 2702 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 2703 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
68350608 RD |
2704 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
2705 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
2706 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
2707 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
b9d6a5f3 RD |
2708 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
2709 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d55e5bfc RD |
2710 | |
2711 | class ICOHandler(BMPHandler): | |
27fb7603 | 2712 | """A `wx.ImageHandler` for \*.ico icon files.""" |
d55e5bfc RD |
2713 | def __repr__(self): |
2714 | return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2715 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2716 | """ |
2717 | __init__(self) -> ICOHandler | |
2718 | ||
2719 | A `wx.ImageHandler` for \*.ico icon files. | |
2720 | """ | |
d55e5bfc RD |
2721 | newobj = _core_.new_ICOHandler(*args, **kwargs) |
2722 | self.this = newobj.this | |
2723 | self.thisown = 1 | |
2724 | del newobj.thisown | |
2725 | ||
2726 | class ICOHandlerPtr(ICOHandler): | |
2727 | def __init__(self, this): | |
2728 | self.this = this | |
2729 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2730 | self.__class__ = ICOHandler | |
2731 | _core_.ICOHandler_swigregister(ICOHandlerPtr) | |
2732 | ||
2733 | class CURHandler(ICOHandler): | |
27fb7603 | 2734 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
d55e5bfc RD |
2735 | def __repr__(self): |
2736 | return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2737 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2738 | """ |
2739 | __init__(self) -> CURHandler | |
2740 | ||
2741 | A `wx.ImageHandler` for \*.cur cursor files. | |
2742 | """ | |
d55e5bfc RD |
2743 | newobj = _core_.new_CURHandler(*args, **kwargs) |
2744 | self.this = newobj.this | |
2745 | self.thisown = 1 | |
2746 | del newobj.thisown | |
2747 | ||
2748 | class CURHandlerPtr(CURHandler): | |
2749 | def __init__(self, this): | |
2750 | self.this = this | |
2751 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2752 | self.__class__ = CURHandler | |
2753 | _core_.CURHandler_swigregister(CURHandlerPtr) | |
2754 | ||
2755 | class ANIHandler(CURHandler): | |
27fb7603 | 2756 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
d55e5bfc RD |
2757 | def __repr__(self): |
2758 | return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2759 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2760 | """ |
2761 | __init__(self) -> ANIHandler | |
2762 | ||
2763 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
2764 | """ | |
d55e5bfc RD |
2765 | newobj = _core_.new_ANIHandler(*args, **kwargs) |
2766 | self.this = newobj.this | |
2767 | self.thisown = 1 | |
2768 | del newobj.thisown | |
2769 | ||
2770 | class ANIHandlerPtr(ANIHandler): | |
2771 | def __init__(self, this): | |
2772 | self.this = this | |
2773 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2774 | self.__class__ = ANIHandler | |
2775 | _core_.ANIHandler_swigregister(ANIHandlerPtr) | |
2776 | ||
2777 | class PNGHandler(ImageHandler): | |
27fb7603 | 2778 | """A `wx.ImageHandler` for PNG image files.""" |
d55e5bfc RD |
2779 | def __repr__(self): |
2780 | return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2781 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2782 | """ |
2783 | __init__(self) -> PNGHandler | |
2784 | ||
2785 | A `wx.ImageHandler` for PNG image files. | |
2786 | """ | |
d55e5bfc RD |
2787 | newobj = _core_.new_PNGHandler(*args, **kwargs) |
2788 | self.this = newobj.this | |
2789 | self.thisown = 1 | |
2790 | del newobj.thisown | |
2791 | ||
2792 | class PNGHandlerPtr(PNGHandler): | |
2793 | def __init__(self, this): | |
2794 | self.this = this | |
2795 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2796 | self.__class__ = PNGHandler | |
2797 | _core_.PNGHandler_swigregister(PNGHandlerPtr) | |
2798 | ||
2799 | class GIFHandler(ImageHandler): | |
27fb7603 | 2800 | """A `wx.ImageHandler` for GIF image files.""" |
d55e5bfc RD |
2801 | def __repr__(self): |
2802 | return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2803 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2804 | """ |
2805 | __init__(self) -> GIFHandler | |
2806 | ||
2807 | A `wx.ImageHandler` for GIF image files. | |
2808 | """ | |
d55e5bfc RD |
2809 | newobj = _core_.new_GIFHandler(*args, **kwargs) |
2810 | self.this = newobj.this | |
2811 | self.thisown = 1 | |
2812 | del newobj.thisown | |
2813 | ||
2814 | class GIFHandlerPtr(GIFHandler): | |
2815 | def __init__(self, this): | |
2816 | self.this = this | |
2817 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2818 | self.__class__ = GIFHandler | |
2819 | _core_.GIFHandler_swigregister(GIFHandlerPtr) | |
2820 | ||
2821 | class PCXHandler(ImageHandler): | |
27fb7603 | 2822 | """A `wx.ImageHandler` for PCX imager files.""" |
d55e5bfc RD |
2823 | def __repr__(self): |
2824 | return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2825 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2826 | """ |
2827 | __init__(self) -> PCXHandler | |
2828 | ||
2829 | A `wx.ImageHandler` for PCX imager files. | |
2830 | """ | |
d55e5bfc RD |
2831 | newobj = _core_.new_PCXHandler(*args, **kwargs) |
2832 | self.this = newobj.this | |
2833 | self.thisown = 1 | |
2834 | del newobj.thisown | |
2835 | ||
2836 | class PCXHandlerPtr(PCXHandler): | |
2837 | def __init__(self, this): | |
2838 | self.this = this | |
2839 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2840 | self.__class__ = PCXHandler | |
2841 | _core_.PCXHandler_swigregister(PCXHandlerPtr) | |
2842 | ||
2843 | class JPEGHandler(ImageHandler): | |
27fb7603 | 2844 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
d55e5bfc RD |
2845 | def __repr__(self): |
2846 | return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2847 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2848 | """ |
2849 | __init__(self) -> JPEGHandler | |
2850 | ||
2851 | A `wx.ImageHandler` for JPEG/JPG image files. | |
2852 | """ | |
d55e5bfc RD |
2853 | newobj = _core_.new_JPEGHandler(*args, **kwargs) |
2854 | self.this = newobj.this | |
2855 | self.thisown = 1 | |
2856 | del newobj.thisown | |
2857 | ||
2858 | class JPEGHandlerPtr(JPEGHandler): | |
2859 | def __init__(self, this): | |
2860 | self.this = this | |
2861 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2862 | self.__class__ = JPEGHandler | |
2863 | _core_.JPEGHandler_swigregister(JPEGHandlerPtr) | |
2864 | ||
2865 | class PNMHandler(ImageHandler): | |
27fb7603 | 2866 | """A `wx.ImageHandler` for PNM image files.""" |
d55e5bfc RD |
2867 | def __repr__(self): |
2868 | return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2869 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2870 | """ |
2871 | __init__(self) -> PNMHandler | |
2872 | ||
2873 | A `wx.ImageHandler` for PNM image files. | |
2874 | """ | |
d55e5bfc RD |
2875 | newobj = _core_.new_PNMHandler(*args, **kwargs) |
2876 | self.this = newobj.this | |
2877 | self.thisown = 1 | |
2878 | del newobj.thisown | |
2879 | ||
2880 | class PNMHandlerPtr(PNMHandler): | |
2881 | def __init__(self, this): | |
2882 | self.this = this | |
2883 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2884 | self.__class__ = PNMHandler | |
2885 | _core_.PNMHandler_swigregister(PNMHandlerPtr) | |
2886 | ||
2887 | class XPMHandler(ImageHandler): | |
27fb7603 | 2888 | """A `wx.ImageHandler` for XPM image.""" |
d55e5bfc RD |
2889 | def __repr__(self): |
2890 | return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2891 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2892 | """ |
2893 | __init__(self) -> XPMHandler | |
2894 | ||
2895 | A `wx.ImageHandler` for XPM image. | |
2896 | """ | |
d55e5bfc RD |
2897 | newobj = _core_.new_XPMHandler(*args, **kwargs) |
2898 | self.this = newobj.this | |
2899 | self.thisown = 1 | |
2900 | del newobj.thisown | |
2901 | ||
2902 | class XPMHandlerPtr(XPMHandler): | |
2903 | def __init__(self, this): | |
2904 | self.this = this | |
2905 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2906 | self.__class__ = XPMHandler | |
2907 | _core_.XPMHandler_swigregister(XPMHandlerPtr) | |
2908 | ||
2909 | class TIFFHandler(ImageHandler): | |
27fb7603 | 2910 | """A `wx.ImageHandler` for TIFF image files.""" |
d55e5bfc RD |
2911 | def __repr__(self): |
2912 | return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2913 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
2914 | """ |
2915 | __init__(self) -> TIFFHandler | |
2916 | ||
2917 | A `wx.ImageHandler` for TIFF image files. | |
2918 | """ | |
d55e5bfc RD |
2919 | newobj = _core_.new_TIFFHandler(*args, **kwargs) |
2920 | self.this = newobj.this | |
2921 | self.thisown = 1 | |
2922 | del newobj.thisown | |
2923 | ||
2924 | class TIFFHandlerPtr(TIFFHandler): | |
2925 | def __init__(self, this): | |
2926 | self.this = this | |
2927 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2928 | self.__class__ = TIFFHandler | |
2929 | _core_.TIFFHandler_swigregister(TIFFHandlerPtr) | |
2930 | ||
c0de73ae RD |
2931 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
2932 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
2933 | class Quantize(object): | |
2934 | """Performs quantization, or colour reduction, on a wxImage.""" | |
2935 | def __init__(self): raise RuntimeError, "No constructor defined" | |
2936 | def __repr__(self): | |
2937 | return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2938 | def Quantize(*args, **kwargs): | |
2939 | """ | |
2940 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
2941 | ||
2942 | Reduce the colours in the source image and put the result into the | |
2943 | destination image, setting the palette in the destination if | |
2944 | needed. Both images may be the same, to overwrite the source image. | |
2945 | """ | |
2946 | return _core_.Quantize_Quantize(*args, **kwargs) | |
2947 | ||
2948 | Quantize = staticmethod(Quantize) | |
2949 | ||
2950 | class QuantizePtr(Quantize): | |
2951 | def __init__(self, this): | |
2952 | self.this = this | |
2953 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2954 | self.__class__ = Quantize | |
2955 | _core_.Quantize_swigregister(QuantizePtr) | |
2956 | ||
2957 | def Quantize_Quantize(*args, **kwargs): | |
2958 | """ | |
2959 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
2960 | ||
2961 | Reduce the colours in the source image and put the result into the | |
2962 | destination image, setting the palette in the destination if | |
2963 | needed. Both images may be the same, to overwrite the source image. | |
2964 | """ | |
2965 | return _core_.Quantize_Quantize(*args, **kwargs) | |
2966 | ||
d55e5bfc RD |
2967 | #--------------------------------------------------------------------------- |
2968 | ||
2969 | class EvtHandler(Object): | |
093d3ff1 | 2970 | """Proxy of C++ EvtHandler class""" |
d55e5bfc RD |
2971 | def __repr__(self): |
2972 | return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2973 | def __init__(self, *args, **kwargs): | |
2974 | """__init__(self) -> EvtHandler""" | |
2975 | newobj = _core_.new_EvtHandler(*args, **kwargs) | |
2976 | self.this = newobj.this | |
2977 | self.thisown = 1 | |
2978 | del newobj.thisown | |
2979 | def GetNextHandler(*args, **kwargs): | |
2980 | """GetNextHandler(self) -> EvtHandler""" | |
2981 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) | |
2982 | ||
2983 | def GetPreviousHandler(*args, **kwargs): | |
2984 | """GetPreviousHandler(self) -> EvtHandler""" | |
2985 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) | |
2986 | ||
2987 | def SetNextHandler(*args, **kwargs): | |
2988 | """SetNextHandler(self, EvtHandler handler)""" | |
2989 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) | |
2990 | ||
2991 | def SetPreviousHandler(*args, **kwargs): | |
2992 | """SetPreviousHandler(self, EvtHandler handler)""" | |
2993 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) | |
2994 | ||
2995 | def GetEvtHandlerEnabled(*args, **kwargs): | |
2996 | """GetEvtHandlerEnabled(self) -> bool""" | |
2997 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) | |
2998 | ||
2999 | def SetEvtHandlerEnabled(*args, **kwargs): | |
3000 | """SetEvtHandlerEnabled(self, bool enabled)""" | |
3001 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) | |
3002 | ||
3003 | def ProcessEvent(*args, **kwargs): | |
3004 | """ProcessEvent(self, Event event) -> bool""" | |
3005 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) | |
3006 | ||
3007 | def AddPendingEvent(*args, **kwargs): | |
3008 | """AddPendingEvent(self, Event event)""" | |
3009 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) | |
3010 | ||
3011 | def ProcessPendingEvents(*args, **kwargs): | |
3012 | """ProcessPendingEvents(self)""" | |
3013 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) | |
3014 | ||
3015 | def Connect(*args, **kwargs): | |
3016 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" | |
3017 | return _core_.EvtHandler_Connect(*args, **kwargs) | |
3018 | ||
3019 | def Disconnect(*args, **kwargs): | |
3020 | """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool""" | |
3021 | return _core_.EvtHandler_Disconnect(*args, **kwargs) | |
3022 | ||
3023 | def _setOORInfo(*args, **kwargs): | |
093d3ff1 | 3024 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
d55e5bfc RD |
3025 | return _core_.EvtHandler__setOORInfo(*args, **kwargs) |
3026 | ||
3027 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): | |
3028 | """ | |
3029 | Bind an event to an event handler. | |
3030 | ||
caef1a4d RD |
3031 | :param event: One of the EVT_* objects that specifies the |
3032 | type of event to bind, | |
d55e5bfc | 3033 | |
caef1a4d RD |
3034 | :param handler: A callable object to be invoked when the |
3035 | event is delivered to self. Pass None to | |
3036 | disconnect an event handler. | |
d55e5bfc | 3037 | |
caef1a4d RD |
3038 | :param source: Sometimes the event originates from a |
3039 | different window than self, but you still | |
3040 | want to catch it in self. (For example, a | |
3041 | button event delivered to a frame.) By | |
3042 | passing the source of the event, the event | |
3043 | handling system is able to differentiate | |
3044 | between the same event type from different | |
3045 | controls. | |
d55e5bfc | 3046 | |
caef1a4d RD |
3047 | :param id: Used to spcify the event source by ID instead |
3048 | of instance. | |
3049 | ||
3050 | :param id2: Used when it is desirable to bind a handler | |
3051 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d55e5bfc RD |
3052 | """ |
3053 | if source is not None: | |
3054 | id = source.GetId() | |
3055 | event.Bind(self, id, id2, handler) | |
3056 | ||
c24da6d6 RD |
3057 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3058 | """ | |
3059 | Disconencts the event handler binding for event from self. | |
3060 | Returns True if successful. | |
3061 | """ | |
3062 | if source is not None: | |
3063 | id = source.GetId() | |
3064 | return event.Unbind(self, id, id2) | |
d55e5bfc RD |
3065 | |
3066 | ||
3067 | class EvtHandlerPtr(EvtHandler): | |
3068 | def __init__(self, this): | |
3069 | self.this = this | |
3070 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3071 | self.__class__ = EvtHandler | |
3072 | _core_.EvtHandler_swigregister(EvtHandlerPtr) | |
3073 | ||
3074 | #--------------------------------------------------------------------------- | |
3075 | ||
3076 | class PyEventBinder(object): | |
3077 | """ | |
3078 | Instances of this class are used to bind specific events to event | |
3079 | handlers. | |
3080 | """ | |
3081 | def __init__(self, evtType, expectedIDs=0): | |
3082 | if expectedIDs not in [0, 1, 2]: | |
3083 | raise ValueError, "Invalid number of expectedIDs" | |
3084 | self.expectedIDs = expectedIDs | |
3085 | ||
3086 | if type(evtType) == list or type(evtType) == tuple: | |
3087 | self.evtType = evtType | |
3088 | else: | |
3089 | self.evtType = [evtType] | |
3090 | ||
3091 | ||
3092 | def Bind(self, target, id1, id2, function): | |
3093 | """Bind this set of event types to target.""" | |
3094 | for et in self.evtType: | |
3095 | target.Connect(id1, id2, et, function) | |
3096 | ||
c24da6d6 RD |
3097 | |
3098 | def Unbind(self, target, id1, id2): | |
3099 | """Remove an event binding.""" | |
3100 | success = 0 | |
3101 | for et in self.evtType: | |
3102 | success += target.Disconnect(id1, id2, et) | |
3103 | return success != 0 | |
3104 | ||
d55e5bfc RD |
3105 | |
3106 | def __call__(self, *args): | |
3107 | """ | |
3108 | For backwards compatibility with the old EVT_* functions. | |
3109 | Should be called with either (window, func), (window, ID, | |
3110 | func) or (window, ID1, ID2, func) parameters depending on the | |
3111 | type of the event. | |
3112 | """ | |
3113 | assert len(args) == 2 + self.expectedIDs | |
3114 | id1 = wx.ID_ANY | |
3115 | id2 = wx.ID_ANY | |
3116 | target = args[0] | |
3117 | if self.expectedIDs == 0: | |
3118 | func = args[1] | |
3119 | elif self.expectedIDs == 1: | |
3120 | id1 = args[1] | |
3121 | func = args[2] | |
3122 | elif self.expectedIDs == 2: | |
3123 | id1 = args[1] | |
3124 | id2 = args[2] | |
3125 | func = args[3] | |
3126 | else: | |
3127 | raise ValueError, "Unexpected number of IDs" | |
3128 | ||
3129 | self.Bind(target, id1, id2, func) | |
3130 | ||
3131 | ||
3132 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3133 | def EVT_COMMAND(win, id, cmd, func): | |
3134 | win.Connect(id, -1, cmd, func) | |
3135 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3136 | win.Connect(id1, id2, cmd, func) | |
3137 | ||
3138 | ||
3139 | #--------------------------------------------------------------------------- | |
3140 | ||
3141 | #--------------------------------------------------------------------------- | |
3142 | ||
3143 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE | |
3144 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
3145 | ||
3146 | def NewEventType(*args, **kwargs): | |
3147 | """NewEventType() -> wxEventType""" | |
3148 | return _core_.NewEventType(*args, **kwargs) | |
3149 | wxEVT_NULL = _core_.wxEVT_NULL | |
3150 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3151 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3152 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3153 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3154 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3155 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3156 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3157 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3158 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3159 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3160 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3161 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3162 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3163 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3164 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3165 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3166 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3167 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3168 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3169 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3170 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3171 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3172 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3173 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3174 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3175 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3176 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3177 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3178 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3179 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3180 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3181 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3182 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3183 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3184 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3185 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3186 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3187 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3188 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3189 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3190 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3191 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3192 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3193 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3194 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3195 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3196 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3197 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3198 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3199 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3200 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3201 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3202 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3203 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3204 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3205 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3206 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3207 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3208 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3209 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3210 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
3211 | wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL | |
3212 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP | |
3213 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3214 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3215 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3216 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3217 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3218 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3219 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3220 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3221 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3222 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3223 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3224 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3225 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
3226 | wxEVT_POWER = _core_.wxEVT_POWER | |
3227 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE | |
3228 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3229 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3230 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3231 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3232 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3233 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
3234 | wxEVT_PAINT = _core_.wxEVT_PAINT | |
3235 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3236 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3237 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3238 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3239 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3240 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3241 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3242 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3243 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3244 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3245 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3246 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3247 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3248 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3249 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3250 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3251 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3252 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3253 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3254 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3255 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
88c6b281 | 3256 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE |
d55e5bfc RD |
3257 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
3258 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3259 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3260 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3261 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3262 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3263 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
3264 | # | |
3265 | # Create some event binders | |
3266 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3267 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3268 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3269 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3270 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3271 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3272 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3273 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3274 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3275 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3276 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3277 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3278 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
3279 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) | |
3280 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) | |
3281 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3282 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3283 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3284 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3285 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3286 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3287 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3288 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3289 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
88c6b281 | 3290 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d55e5bfc RD |
3291 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3292 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3293 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3294 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3295 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3296 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3297 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3298 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3299 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3300 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3301 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3302 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3303 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3304 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3305 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3306 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
3307 | ||
3308 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3309 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3310 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3311 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3312 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3313 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3314 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3315 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3316 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3317 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3318 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3319 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3320 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3321 | ||
3322 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3323 | wxEVT_LEFT_UP, | |
3324 | wxEVT_MIDDLE_DOWN, | |
3325 | wxEVT_MIDDLE_UP, | |
3326 | wxEVT_RIGHT_DOWN, | |
3327 | wxEVT_RIGHT_UP, | |
3328 | wxEVT_MOTION, | |
3329 | wxEVT_LEFT_DCLICK, | |
3330 | wxEVT_MIDDLE_DCLICK, | |
3331 | wxEVT_RIGHT_DCLICK, | |
3332 | wxEVT_ENTER_WINDOW, | |
3333 | wxEVT_LEAVE_WINDOW, | |
3334 | wxEVT_MOUSEWHEEL | |
3335 | ]) | |
3336 | ||
3337 | ||
3338 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
3339 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, | |
3340 | wxEVT_SCROLLWIN_BOTTOM, | |
3341 | wxEVT_SCROLLWIN_LINEUP, | |
3342 | wxEVT_SCROLLWIN_LINEDOWN, | |
3343 | wxEVT_SCROLLWIN_PAGEUP, | |
3344 | wxEVT_SCROLLWIN_PAGEDOWN, | |
3345 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3346 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3347 | ]) | |
3348 | ||
3349 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3350 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3351 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3352 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3353 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3354 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3355 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3356 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3357 | ||
27fb7603 | 3358 | # Scrolling from wx.Slider and wx.ScrollBar |
d55e5bfc RD |
3359 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3360 | wxEVT_SCROLL_BOTTOM, | |
3361 | wxEVT_SCROLL_LINEUP, | |
3362 | wxEVT_SCROLL_LINEDOWN, | |
3363 | wxEVT_SCROLL_PAGEUP, | |
3364 | wxEVT_SCROLL_PAGEDOWN, | |
3365 | wxEVT_SCROLL_THUMBTRACK, | |
3366 | wxEVT_SCROLL_THUMBRELEASE, | |
3367 | wxEVT_SCROLL_ENDSCROLL, | |
3368 | ]) | |
3369 | ||
3370 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3371 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3372 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3373 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3374 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3375 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3376 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3377 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
3378 | EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL ) | |
3379 | ||
27fb7603 | 3380 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
d55e5bfc RD |
3381 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3382 | wxEVT_SCROLL_BOTTOM, | |
3383 | wxEVT_SCROLL_LINEUP, | |
3384 | wxEVT_SCROLL_LINEDOWN, | |
3385 | wxEVT_SCROLL_PAGEUP, | |
3386 | wxEVT_SCROLL_PAGEDOWN, | |
3387 | wxEVT_SCROLL_THUMBTRACK, | |
3388 | wxEVT_SCROLL_THUMBRELEASE, | |
3389 | wxEVT_SCROLL_ENDSCROLL, | |
3390 | ], 1) | |
3391 | ||
3392 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3393 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3394 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3395 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3396 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3397 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3398 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3399 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
3400 | EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1) | |
3401 | ||
3402 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) | |
3403 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3404 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3405 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3406 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3407 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3408 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3409 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3410 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3411 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3412 | ||
3413 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3414 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3415 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3416 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3417 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3418 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3419 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3420 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3421 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3422 | ||
3423 | ||
3424 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3425 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3426 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3427 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3428 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3429 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3430 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3431 | ||
3432 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
3433 | ||
3434 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
3435 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
3436 | ||
3437 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
3438 | ||
3439 | ||
3440 | ||
3441 | #--------------------------------------------------------------------------- | |
3442 | ||
3443 | class Event(Object): | |
27fb7603 RD |
3444 | """ |
3445 | An event is a structure holding information about an event passed to a | |
3446 | callback or member function. wx.Event is an abstract base class for | |
3447 | other event classes | |
3448 | """ | |
d55e5bfc RD |
3449 | def __init__(self): raise RuntimeError, "No constructor defined" |
3450 | def __repr__(self): | |
3451 | return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3452 | def __del__(self, destroy=_core_.delete_Event): | |
3453 | """__del__(self)""" | |
3454 | try: | |
3455 | if self.thisown: destroy(self) | |
3456 | except: pass | |
3457 | ||
3458 | def SetEventType(*args, **kwargs): | |
27fb7603 RD |
3459 | """ |
3460 | SetEventType(self, wxEventType typ) | |
3461 | ||
3462 | Sets the specific type of the event. | |
3463 | """ | |
d55e5bfc RD |
3464 | return _core_.Event_SetEventType(*args, **kwargs) |
3465 | ||
3466 | def GetEventType(*args, **kwargs): | |
27fb7603 RD |
3467 | """ |
3468 | GetEventType(self) -> wxEventType | |
3469 | ||
3470 | Returns the identifier of the given event type, such as | |
3471 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
3472 | """ | |
d55e5bfc RD |
3473 | return _core_.Event_GetEventType(*args, **kwargs) |
3474 | ||
3475 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
3476 | """ |
3477 | GetEventObject(self) -> Object | |
3478 | ||
3479 | Returns the object (usually a window) associated with the event, if | |
3480 | any. | |
3481 | """ | |
d55e5bfc RD |
3482 | return _core_.Event_GetEventObject(*args, **kwargs) |
3483 | ||
3484 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
3485 | """ |
3486 | SetEventObject(self, Object obj) | |
3487 | ||
3488 | Sets the originating object, or in other words, obj is normally the | |
3489 | object that is sending the event. | |
3490 | """ | |
d55e5bfc RD |
3491 | return _core_.Event_SetEventObject(*args, **kwargs) |
3492 | ||
3493 | def GetTimestamp(*args, **kwargs): | |
3494 | """GetTimestamp(self) -> long""" | |
3495 | return _core_.Event_GetTimestamp(*args, **kwargs) | |
3496 | ||
3497 | def SetTimestamp(*args, **kwargs): | |
3498 | """SetTimestamp(self, long ts=0)""" | |
3499 | return _core_.Event_SetTimestamp(*args, **kwargs) | |
3500 | ||
3501 | def GetId(*args, **kwargs): | |
27fb7603 RD |
3502 | """ |
3503 | GetId(self) -> int | |
3504 | ||
3505 | Returns the identifier associated with this event, such as a button | |
3506 | command id. | |
3507 | """ | |
d55e5bfc RD |
3508 | return _core_.Event_GetId(*args, **kwargs) |
3509 | ||
3510 | def SetId(*args, **kwargs): | |
27fb7603 RD |
3511 | """ |
3512 | SetId(self, int Id) | |
3513 | ||
3514 | Set's the ID for the event. This is usually the ID of the window that | |
3515 | is sending the event, but it can also be a command id from a menu | |
3516 | item, etc. | |
3517 | """ | |
d55e5bfc RD |
3518 | return _core_.Event_SetId(*args, **kwargs) |
3519 | ||
3520 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
3521 | """ |
3522 | IsCommandEvent(self) -> bool | |
3523 | ||
3524 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
3525 | it returns false. Note: Exists only for optimization purposes. | |
3526 | """ | |
d55e5bfc RD |
3527 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
3528 | ||
3529 | def Skip(*args, **kwargs): | |
51b83b37 RD |
3530 | """ |
3531 | Skip(self, bool skip=True) | |
3532 | ||
3533 | Called by an event handler, it controls whether additional event | |
3534 | handlers bound to this event will be called after the current event | |
3535 | handler returns. Skip(false) (the default setting) will prevent | |
3536 | additional event handlers from being called and control will be | |
3537 | returned to the sender of the event immediately after the current | |
3538 | handler has finished. Skip(True) will cause the event processing | |
3539 | system to continue searching for a handler function for this event. | |
3540 | ||
3541 | """ | |
d55e5bfc RD |
3542 | return _core_.Event_Skip(*args, **kwargs) |
3543 | ||
3544 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
3545 | """ |
3546 | GetSkipped(self) -> bool | |
3547 | ||
3548 | Returns true if the event handler should be skipped, false otherwise. | |
3549 | :see: `Skip` | |
3550 | """ | |
d55e5bfc RD |
3551 | return _core_.Event_GetSkipped(*args, **kwargs) |
3552 | ||
3553 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
3554 | """ |
3555 | ShouldPropagate(self) -> bool | |
3556 | ||
3557 | Test if this event should be propagated to the parent window or not, | |
3558 | i.e. if the propagation level is currently greater than 0. | |
3559 | """ | |
d55e5bfc RD |
3560 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
3561 | ||
3562 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
3563 | """ |
3564 | StopPropagation(self) -> int | |
3565 | ||
3566 | Stop the event from propagating to its parent window. Returns the old | |
3567 | propagation level value which may be later passed to | |
3568 | `ResumePropagation` to allow propagating the event again. | |
3569 | """ | |
d55e5bfc RD |
3570 | return _core_.Event_StopPropagation(*args, **kwargs) |
3571 | ||
3572 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
3573 | """ |
3574 | ResumePropagation(self, int propagationLevel) | |
3575 | ||
3576 | Resume the event propagation by restoring the propagation level. (For | |
3577 | example, you can use the value returned by an earlier call to | |
3578 | `StopPropagation`.) | |
3579 | ||
3580 | """ | |
d55e5bfc RD |
3581 | return _core_.Event_ResumePropagation(*args, **kwargs) |
3582 | ||
3583 | def Clone(*args, **kwargs): | |
3584 | """Clone(self) -> Event""" | |
3585 | return _core_.Event_Clone(*args, **kwargs) | |
3586 | ||
3587 | ||
3588 | class EventPtr(Event): | |
3589 | def __init__(self, this): | |
3590 | self.this = this | |
3591 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3592 | self.__class__ = Event | |
3593 | _core_.Event_swigregister(EventPtr) | |
3594 | ||
3595 | #--------------------------------------------------------------------------- | |
3596 | ||
3597 | class PropagationDisabler(object): | |
27fb7603 RD |
3598 | """ |
3599 | Helper class to temporarily change an event not to propagate. Simply | |
3600 | create an instance of this class and then whe it is destroyed the | |
3601 | propogation of the event will be restored. | |
3602 | """ | |
d55e5bfc RD |
3603 | def __repr__(self): |
3604 | return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3605 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3606 | """ |
3607 | __init__(self, Event event) -> PropagationDisabler | |
3608 | ||
3609 | Helper class to temporarily change an event not to propagate. Simply | |
3610 | create an instance of this class and then whe it is destroyed the | |
3611 | propogation of the event will be restored. | |
3612 | """ | |
d55e5bfc RD |
3613 | newobj = _core_.new_PropagationDisabler(*args, **kwargs) |
3614 | self.this = newobj.this | |
3615 | self.thisown = 1 | |
3616 | del newobj.thisown | |
3617 | def __del__(self, destroy=_core_.delete_PropagationDisabler): | |
3618 | """__del__(self)""" | |
3619 | try: | |
3620 | if self.thisown: destroy(self) | |
3621 | except: pass | |
3622 | ||
3623 | ||
3624 | class PropagationDisablerPtr(PropagationDisabler): | |
3625 | def __init__(self, this): | |
3626 | self.this = this | |
3627 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3628 | self.__class__ = PropagationDisabler | |
3629 | _core_.PropagationDisabler_swigregister(PropagationDisablerPtr) | |
3630 | ||
3631 | class PropagateOnce(object): | |
27fb7603 RD |
3632 | """ |
3633 | A helper class that will temporarily lower propagation level of an | |
3634 | event. Simply create an instance of this class and then whe it is | |
3635 | destroyed the propogation of the event will be restored. | |
3636 | """ | |
d55e5bfc RD |
3637 | def __repr__(self): |
3638 | return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3639 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3640 | """ |
3641 | __init__(self, Event event) -> PropagateOnce | |
3642 | ||
3643 | A helper class that will temporarily lower propagation level of an | |
3644 | event. Simply create an instance of this class and then whe it is | |
3645 | destroyed the propogation of the event will be restored. | |
3646 | """ | |
d55e5bfc RD |
3647 | newobj = _core_.new_PropagateOnce(*args, **kwargs) |
3648 | self.this = newobj.this | |
3649 | self.thisown = 1 | |
3650 | del newobj.thisown | |
3651 | def __del__(self, destroy=_core_.delete_PropagateOnce): | |
3652 | """__del__(self)""" | |
3653 | try: | |
3654 | if self.thisown: destroy(self) | |
3655 | except: pass | |
3656 | ||
3657 | ||
3658 | class PropagateOncePtr(PropagateOnce): | |
3659 | def __init__(self, this): | |
3660 | self.this = this | |
3661 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3662 | self.__class__ = PropagateOnce | |
3663 | _core_.PropagateOnce_swigregister(PropagateOncePtr) | |
3664 | ||
3665 | #--------------------------------------------------------------------------- | |
3666 | ||
3667 | class CommandEvent(Event): | |
27fb7603 RD |
3668 | """ |
3669 | This event class contains information about command events, which | |
3670 | originate from a variety of simple controls, as well as menus and | |
3671 | toolbars. | |
3672 | """ | |
d55e5bfc RD |
3673 | def __repr__(self): |
3674 | return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3675 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3676 | """ |
3677 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent | |
3678 | ||
3679 | This event class contains information about command events, which | |
3680 | originate from a variety of simple controls, as well as menus and | |
3681 | toolbars. | |
3682 | """ | |
d55e5bfc RD |
3683 | newobj = _core_.new_CommandEvent(*args, **kwargs) |
3684 | self.this = newobj.this | |
3685 | self.thisown = 1 | |
3686 | del newobj.thisown | |
3687 | def GetSelection(*args, **kwargs): | |
27fb7603 RD |
3688 | """ |
3689 | GetSelection(self) -> int | |
3690 | ||
3691 | Returns item index for a listbox or choice selection event (not valid | |
3692 | for a deselection). | |
3693 | """ | |
d55e5bfc RD |
3694 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
3695 | ||
3696 | def SetString(*args, **kwargs): | |
3697 | """SetString(self, String s)""" | |
3698 | return _core_.CommandEvent_SetString(*args, **kwargs) | |
3699 | ||
3700 | def GetString(*args, **kwargs): | |
27fb7603 RD |
3701 | """ |
3702 | GetString(self) -> String | |
3703 | ||
3704 | Returns item string for a listbox or choice selection event (not valid | |
3705 | for a deselection). | |
3706 | """ | |
d55e5bfc RD |
3707 | return _core_.CommandEvent_GetString(*args, **kwargs) |
3708 | ||
3709 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
3710 | """ |
3711 | IsChecked(self) -> bool | |
3712 | ||
3713 | This method can be used with checkbox and menu events: for the | |
3714 | checkboxes, the method returns true for a selection event and false | |
3715 | for a deselection one. For the menu events, this method indicates if | |
3716 | the menu item just has become checked or unchecked (and thus only | |
3717 | makes sense for checkable menu items). | |
3718 | """ | |
d55e5bfc RD |
3719 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
3720 | ||
3721 | Checked = IsChecked | |
3722 | def IsSelection(*args, **kwargs): | |
27fb7603 RD |
3723 | """ |
3724 | IsSelection(self) -> bool | |
3725 | ||
3726 | For a listbox or similar event, returns true if it is a selection, | |
3727 | false if it is a deselection. | |
3728 | """ | |
d55e5bfc RD |
3729 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
3730 | ||
3731 | def SetExtraLong(*args, **kwargs): | |
3732 | """SetExtraLong(self, long extraLong)""" | |
3733 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) | |
3734 | ||
3735 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
3736 | """ |
3737 | GetExtraLong(self) -> long | |
3738 | ||
3739 | Returns extra information dependant on the event objects type. If the event | |
3740 | comes from a listbox selection, it is a boolean determining whether the event | |
3741 | was a selection (true) or a deselection (false). A listbox deselection only | |
3742 | occurs for multiple-selection boxes, and in this case the index and string | |
3743 | values are indeterminate and the listbox must be examined by the application. | |
3744 | """ | |
d55e5bfc RD |
3745 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
3746 | ||
3747 | def SetInt(*args, **kwargs): | |
3748 | """SetInt(self, int i)""" | |
3749 | return _core_.CommandEvent_SetInt(*args, **kwargs) | |
3750 | ||
3751 | def GetInt(*args, **kwargs): | |
27fb7603 RD |
3752 | """ |
3753 | GetInt(self) -> long | |
3754 | ||
3755 | Returns the integer identifier corresponding to a listbox, choice or radiobox | |
3756 | selection (only if the event was a selection, not a deselection), or a boolean | |
3757 | value representing the value of a checkbox. | |
3758 | """ | |
d55e5bfc RD |
3759 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
3760 | ||
3761 | def Clone(*args, **kwargs): | |
3762 | """Clone(self) -> Event""" | |
3763 | return _core_.CommandEvent_Clone(*args, **kwargs) | |
3764 | ||
3765 | ||
3766 | class CommandEventPtr(CommandEvent): | |
3767 | def __init__(self, this): | |
3768 | self.this = this | |
3769 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3770 | self.__class__ = CommandEvent | |
3771 | _core_.CommandEvent_swigregister(CommandEventPtr) | |
3772 | ||
3773 | #--------------------------------------------------------------------------- | |
3774 | ||
3775 | class NotifyEvent(CommandEvent): | |
27fb7603 RD |
3776 | """ |
3777 | An instance of this class (or one of its derived classes) is sent from | |
3778 | a control when the control's state is being changed and the control | |
3779 | allows that change to be prevented from happening. The event handler | |
3780 | can call `Veto` or `Allow` to tell the control what to do. | |
3781 | """ | |
d55e5bfc RD |
3782 | def __repr__(self): |
3783 | return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3784 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3785 | """ |
3786 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent | |
3787 | ||
3788 | An instance of this class (or one of its derived classes) is sent from | |
3789 | a control when the control's state is being changed and the control | |
3790 | allows that change to be prevented from happening. The event handler | |
3791 | can call `Veto` or `Allow` to tell the control what to do. | |
3792 | """ | |
d55e5bfc RD |
3793 | newobj = _core_.new_NotifyEvent(*args, **kwargs) |
3794 | self.this = newobj.this | |
3795 | self.thisown = 1 | |
3796 | del newobj.thisown | |
3797 | def Veto(*args, **kwargs): | |
27fb7603 RD |
3798 | """ |
3799 | Veto(self) | |
3800 | ||
3801 | Prevents the change announced by this event from happening. | |
3802 | ||
3803 | It is in general a good idea to notify the user about the reasons for | |
3804 | vetoing the change because otherwise the applications behaviour (which | |
3805 | just refuses to do what the user wants) might be quite surprising. | |
3806 | """ | |
d55e5bfc RD |
3807 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
3808 | ||
3809 | def Allow(*args, **kwargs): | |
27fb7603 RD |
3810 | """ |
3811 | Allow(self) | |
3812 | ||
3813 | This is the opposite of `Veto`: it explicitly allows the event to be | |
3814 | processed. For most events it is not necessary to call this method as | |
3815 | the events are allowed anyhow but some are forbidden by default (this | |
3816 | will be mentioned in the corresponding event description). | |
3817 | """ | |
d55e5bfc RD |
3818 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
3819 | ||
3820 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
3821 | """ |
3822 | IsAllowed(self) -> bool | |
3823 | ||
3824 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
3825 | false otherwise (if it was). | |
3826 | """ | |
d55e5bfc RD |
3827 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
3828 | ||
3829 | ||
3830 | class NotifyEventPtr(NotifyEvent): | |
3831 | def __init__(self, this): | |
3832 | self.this = this | |
3833 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3834 | self.__class__ = NotifyEvent | |
3835 | _core_.NotifyEvent_swigregister(NotifyEventPtr) | |
3836 | ||
3837 | #--------------------------------------------------------------------------- | |
3838 | ||
3839 | class ScrollEvent(CommandEvent): | |
27fb7603 RD |
3840 | """ |
3841 | A scroll event holds information about events sent from stand-alone | |
3842 | scrollbars and sliders. Note that scrolled windows do not send | |
3843 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
3844 | instead. | |
3845 | """ | |
d55e5bfc RD |
3846 | def __repr__(self): |
3847 | return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3848 | def __init__(self, *args, **kwargs): | |
3849 | """ | |
3850 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0, | |
3851 | int orient=0) -> ScrollEvent | |
3852 | """ | |
3853 | newobj = _core_.new_ScrollEvent(*args, **kwargs) | |
3854 | self.this = newobj.this | |
3855 | self.thisown = 1 | |
3856 | del newobj.thisown | |
3857 | def GetOrientation(*args, **kwargs): | |
27fb7603 RD |
3858 | """ |
3859 | GetOrientation(self) -> int | |
3860 | ||
3861 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
3862 | the scrollbar. | |
3863 | """ | |
d55e5bfc RD |
3864 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
3865 | ||
3866 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
3867 | """ |
3868 | GetPosition(self) -> int | |
3869 | ||
3870 | Returns the position of the scrollbar. | |
3871 | """ | |
d55e5bfc RD |
3872 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
3873 | ||
3874 | def SetOrientation(*args, **kwargs): | |
3875 | """SetOrientation(self, int orient)""" | |
3876 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) | |
3877 | ||
3878 | def SetPosition(*args, **kwargs): | |
3879 | """SetPosition(self, int pos)""" | |
3880 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) | |
3881 | ||
3882 | ||
3883 | class ScrollEventPtr(ScrollEvent): | |
3884 | def __init__(self, this): | |
3885 | self.this = this | |
3886 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3887 | self.__class__ = ScrollEvent | |
3888 | _core_.ScrollEvent_swigregister(ScrollEventPtr) | |
3889 | ||
3890 | #--------------------------------------------------------------------------- | |
3891 | ||
3892 | class ScrollWinEvent(Event): | |
27fb7603 RD |
3893 | """ |
3894 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
3895 | scrolling windows. | |
3896 | """ | |
d55e5bfc RD |
3897 | def __repr__(self): |
3898 | return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3899 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3900 | """ |
3901 | __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent | |
3902 | ||
3903 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
3904 | scrolling windows. | |
3905 | """ | |
d55e5bfc RD |
3906 | newobj = _core_.new_ScrollWinEvent(*args, **kwargs) |
3907 | self.this = newobj.this | |
3908 | self.thisown = 1 | |
3909 | del newobj.thisown | |
3910 | def GetOrientation(*args, **kwargs): | |
27fb7603 RD |
3911 | """ |
3912 | GetOrientation(self) -> int | |
3913 | ||
3914 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
3915 | the scrollbar. | |
3916 | """ | |
d55e5bfc RD |
3917 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
3918 | ||
3919 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
3920 | """ |
3921 | GetPosition(self) -> int | |
3922 | ||
3923 | Returns the position of the scrollbar for the thumb track and release | |
3924 | events. Note that this field can't be used for the other events, you | |
3925 | need to query the window itself for the current position in that case. | |
3926 | """ | |
d55e5bfc RD |
3927 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
3928 | ||
3929 | def SetOrientation(*args, **kwargs): | |
3930 | """SetOrientation(self, int orient)""" | |
3931 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) | |
3932 | ||
3933 | def SetPosition(*args, **kwargs): | |
3934 | """SetPosition(self, int pos)""" | |
3935 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) | |
3936 | ||
3937 | ||
3938 | class ScrollWinEventPtr(ScrollWinEvent): | |
3939 | def __init__(self, this): | |
3940 | self.this = this | |
3941 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3942 | self.__class__ = ScrollWinEvent | |
3943 | _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr) | |
3944 | ||
3945 | #--------------------------------------------------------------------------- | |
3946 | ||
3947 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY | |
3948 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
3949 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
3950 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
3951 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
3952 | class MouseEvent(Event): | |
27fb7603 RD |
3953 | """ |
3954 | This event class contains information about the events generated by | |
3955 | the mouse: they include mouse buttons press and release events and | |
3956 | mouse move events. | |
3957 | ||
3958 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
3959 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
3960 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
3961 | a middle button so a portable application should avoid relying on the | |
3962 | events from it. | |
3963 | ||
3964 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
3965 | the former returns true when the event corresponds to the left mouse | |
3966 | button click while the latter returns true if the left mouse button is | |
3967 | currently being pressed. For example, when the user is dragging the | |
3968 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
3969 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
3970 | `LeftIsDown` will also return true in wxWidgets whatever the | |
3971 | underlying GUI behaviour is (which is platform-dependent). The same | |
3972 | applies, of course, to other mouse buttons as well. | |
3973 | """ | |
d55e5bfc RD |
3974 | def __repr__(self): |
3975 | return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3976 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3977 | """ |
3978 | __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent | |
3979 | ||
3980 | Constructs a wx.MouseEvent. Valid event types are: | |
3981 | ||
3982 | * wxEVT_ENTER_WINDOW | |
3983 | * wxEVT_LEAVE_WINDOW | |
3984 | * wxEVT_LEFT_DOWN | |
3985 | * wxEVT_LEFT_UP | |
3986 | * wxEVT_LEFT_DCLICK | |
3987 | * wxEVT_MIDDLE_DOWN | |
3988 | * wxEVT_MIDDLE_UP | |
3989 | * wxEVT_MIDDLE_DCLICK | |
3990 | * wxEVT_RIGHT_DOWN | |
3991 | * wxEVT_RIGHT_UP | |
3992 | * wxEVT_RIGHT_DCLICK | |
3993 | * wxEVT_MOTION | |
3994 | * wxEVT_MOUSEWHEEL | |
3995 | """ | |
d55e5bfc RD |
3996 | newobj = _core_.new_MouseEvent(*args, **kwargs) |
3997 | self.this = newobj.this | |
3998 | self.thisown = 1 | |
3999 | del newobj.thisown | |
4000 | def IsButton(*args, **kwargs): | |
27fb7603 RD |
4001 | """ |
4002 | IsButton(self) -> bool | |
4003 | ||
4004 | Returns true if the event was a mouse button event (not necessarily a | |
4005 | button down event - that may be tested using `ButtonDown`). | |
4006 | """ | |
d55e5bfc RD |
4007 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
4008 | ||
4009 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4010 | """ |
4011 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4012 | ||
4013 | If the argument is omitted, this returns true if the event was any mouse | |
4014 | button down event. Otherwise the argument specifies which button-down | |
4015 | event shold be checked for (see `Button` for the possible values). | |
4016 | """ | |
d55e5bfc RD |
4017 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
4018 | ||
4019 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4020 | """ |
4021 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4022 | ||
4023 | If the argument is omitted, this returns true if the event was any | |
4024 | mouse double click event. Otherwise the argument specifies which | |
4025 | double click event to check for (see `Button` for the possible | |
4026 | values). | |
4027 | """ | |
d55e5bfc RD |
4028 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
4029 | ||
4030 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4031 | """ |
4032 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4033 | ||
4034 | If the argument is omitted, this returns true if the event was any | |
4035 | mouse button up event. Otherwise the argument specifies which | |
4036 | button up event to check for (see `Button` for the possible values). | |
4037 | """ | |
d55e5bfc RD |
4038 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
4039 | ||
4040 | def Button(*args, **kwargs): | |
27fb7603 RD |
4041 | """ |
4042 | Button(self, int button) -> bool | |
4043 | ||
4044 | Returns true if the identified mouse button is changing state. Valid | |
4045 | values of button are: | |
4046 | ||
4047 | ==================== ===================================== | |
4048 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4049 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4050 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4051 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4052 | ==================== ===================================== | |
4053 | ||
4054 | """ | |
d55e5bfc RD |
4055 | return _core_.MouseEvent_Button(*args, **kwargs) |
4056 | ||
4057 | def ButtonIsDown(*args, **kwargs): | |
4058 | """ButtonIsDown(self, int but) -> bool""" | |
4059 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) | |
4060 | ||
4061 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4062 | """ |
4063 | GetButton(self) -> int | |
4064 | ||
4065 | Returns the mouse button which generated this event or | |
4066 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4067 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4068 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4069 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4070 | right buttons respectively. | |
4071 | """ | |
d55e5bfc RD |
4072 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
4073 | ||
4074 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4075 | """ |
4076 | ControlDown(self) -> bool | |
4077 | ||
4078 | Returns true if the control key was down at the time of the event. | |
4079 | """ | |
d55e5bfc RD |
4080 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
4081 | ||
4082 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4083 | """ |
4084 | MetaDown(self) -> bool | |
4085 | ||
4086 | Returns true if the Meta key was down at the time of the event. | |
4087 | """ | |
d55e5bfc RD |
4088 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
4089 | ||
4090 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4091 | """ |
4092 | AltDown(self) -> bool | |
4093 | ||
4094 | Returns true if the Alt key was down at the time of the event. | |
4095 | """ | |
d55e5bfc RD |
4096 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
4097 | ||
4098 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4099 | """ |
4100 | ShiftDown(self) -> bool | |
4101 | ||
4102 | Returns true if the Shift key was down at the time of the event. | |
4103 | """ | |
d55e5bfc RD |
4104 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
4105 | ||
412d302d RD |
4106 | def CmdDown(*args, **kwargs): |
4107 | """ | |
4108 | CmdDown(self) -> bool | |
4109 | ||
4110 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4111 | platforms but the special "Apple" (a.k.a as "Command") key on | |
27fb7603 | 4112 | Macs: it often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4113 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4114 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4115 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4116 | and Macs this is the same as `MetaDown`. | |
4117 | """ | |
4118 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4119 | ||
d55e5bfc | 4120 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4121 | """ |
4122 | LeftDown(self) -> bool | |
4123 | ||
4124 | Returns true if the left mouse button state changed to down. | |
4125 | """ | |
d55e5bfc RD |
4126 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
4127 | ||
4128 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4129 | """ |
4130 | MiddleDown(self) -> bool | |
4131 | ||
4132 | Returns true if the middle mouse button state changed to down. | |
4133 | """ | |
d55e5bfc RD |
4134 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
4135 | ||
4136 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4137 | """ |
4138 | RightDown(self) -> bool | |
4139 | ||
4140 | Returns true if the right mouse button state changed to down. | |
4141 | """ | |
d55e5bfc RD |
4142 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
4143 | ||
4144 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4145 | """ |
4146 | LeftUp(self) -> bool | |
4147 | ||
4148 | Returns true if the left mouse button state changed to up. | |
4149 | """ | |
d55e5bfc RD |
4150 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
4151 | ||
4152 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4153 | """ |
4154 | MiddleUp(self) -> bool | |
4155 | ||
4156 | Returns true if the middle mouse button state changed to up. | |
4157 | """ | |
d55e5bfc RD |
4158 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
4159 | ||
4160 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4161 | """ |
4162 | RightUp(self) -> bool | |
4163 | ||
4164 | Returns true if the right mouse button state changed to up. | |
4165 | """ | |
d55e5bfc RD |
4166 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
4167 | ||
4168 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4169 | """ |
4170 | LeftDClick(self) -> bool | |
4171 | ||
4172 | Returns true if the event was a left button double click. | |
4173 | """ | |
d55e5bfc RD |
4174 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
4175 | ||
4176 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4177 | """ |
4178 | MiddleDClick(self) -> bool | |
4179 | ||
4180 | Returns true if the event was a middle button double click. | |
4181 | """ | |
d55e5bfc RD |
4182 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
4183 | ||
4184 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4185 | """ |
4186 | RightDClick(self) -> bool | |
4187 | ||
4188 | Returns true if the event was a right button double click. | |
4189 | """ | |
d55e5bfc RD |
4190 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
4191 | ||
4192 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4193 | """ |
4194 | LeftIsDown(self) -> bool | |
4195 | ||
4196 | Returns true if the left mouse button is currently down, independent | |
4197 | of the current event type. | |
4198 | ||
4199 | Please notice that it is not the same as LeftDown which returns true | |
4200 | if the left mouse button was just pressed. Rather, it describes the | |
4201 | state of the mouse button before the event happened. | |
4202 | ||
4203 | This event is usually used in the mouse event handlers which process | |
4204 | "move mouse" messages to determine whether the user is (still) | |
4205 | dragging the mouse. | |
4206 | """ | |
d55e5bfc RD |
4207 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
4208 | ||
4209 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4210 | """ |
4211 | MiddleIsDown(self) -> bool | |
4212 | ||
4213 | Returns true if the middle mouse button is currently down, independent | |
4214 | of the current event type. | |
4215 | """ | |
d55e5bfc RD |
4216 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
4217 | ||
4218 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4219 | """ |
4220 | RightIsDown(self) -> bool | |
4221 | ||
4222 | Returns true if the right mouse button is currently down, independent | |
4223 | of the current event type. | |
4224 | """ | |
d55e5bfc RD |
4225 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
4226 | ||
4227 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4228 | """ |
4229 | Dragging(self) -> bool | |
4230 | ||
4231 | Returns true if this was a dragging event (motion while a button is | |
4232 | depressed). | |
4233 | """ | |
d55e5bfc RD |
4234 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
4235 | ||
4236 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4237 | """ |
4238 | Moving(self) -> bool | |
4239 | ||
4240 | Returns true if this was a motion event and no mouse buttons were | |
4241 | pressed. If any mouse button is held pressed, then this method returns | |
4242 | false and Dragging returns true. | |
4243 | """ | |
d55e5bfc RD |
4244 | return _core_.MouseEvent_Moving(*args, **kwargs) |
4245 | ||
4246 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4247 | """ |
4248 | Entering(self) -> bool | |
4249 | ||
4250 | Returns true if the mouse was entering the window. | |
4251 | """ | |
d55e5bfc RD |
4252 | return _core_.MouseEvent_Entering(*args, **kwargs) |
4253 | ||
4254 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4255 | """ |
4256 | Leaving(self) -> bool | |
4257 | ||
4258 | Returns true if the mouse was leaving the window. | |
4259 | """ | |
d55e5bfc RD |
4260 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
4261 | ||
4262 | def GetPosition(*args, **kwargs): | |
4263 | """ | |
4264 | GetPosition(self) -> Point | |
4265 | ||
27fb7603 RD |
4266 | Returns the pixel position of the mouse in window coordinates when the |
4267 | event happened. | |
d55e5bfc RD |
4268 | """ |
4269 | return _core_.MouseEvent_GetPosition(*args, **kwargs) | |
4270 | ||
4271 | def GetPositionTuple(*args, **kwargs): | |
4272 | """ | |
4273 | GetPositionTuple() -> (x,y) | |
4274 | ||
27fb7603 RD |
4275 | Returns the pixel position of the mouse in window coordinates when the |
4276 | event happened. | |
d55e5bfc RD |
4277 | """ |
4278 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) | |
4279 | ||
4280 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4281 | """ |
4282 | GetLogicalPosition(self, DC dc) -> Point | |
4283 | ||
4284 | Returns the logical mouse position in pixels (i.e. translated | |
4285 | according to the translation set for the DC, which usually indicates | |
4286 | that the window has been scrolled). | |
4287 | """ | |
d55e5bfc RD |
4288 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
4289 | ||
4290 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4291 | """ |
4292 | GetX(self) -> int | |
4293 | ||
4294 | Returns X coordinate of the physical mouse event position. | |
4295 | """ | |
d55e5bfc RD |
4296 | return _core_.MouseEvent_GetX(*args, **kwargs) |
4297 | ||
4298 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4299 | """ |
4300 | GetY(self) -> int | |
4301 | ||
4302 | Returns Y coordinate of the physical mouse event position. | |
4303 | """ | |
d55e5bfc RD |
4304 | return _core_.MouseEvent_GetY(*args, **kwargs) |
4305 | ||
4306 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4307 | """ |
4308 | GetWheelRotation(self) -> int | |
4309 | ||
4310 | Get wheel rotation, positive or negative indicates direction of | |
4311 | rotation. Current devices all send an event when rotation is equal to | |
4312 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4313 | created in the future. Because of this you shouldn't assume that one | |
4314 | event is equal to 1 line or whatever, but you should be able to either | |
4315 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4316 | have been accumulated before scrolling. | |
4317 | """ | |
d55e5bfc RD |
4318 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
4319 | ||
4320 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4321 | """ |
4322 | GetWheelDelta(self) -> int | |
4323 | ||
4324 | Get wheel delta, normally 120. This is the threshold for action to be | |
4325 | taken, and one such action (for example, scrolling one increment) | |
4326 | should occur for each delta. | |
4327 | """ | |
d55e5bfc RD |
4328 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
4329 | ||
4330 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4331 | """ |
4332 | GetLinesPerAction(self) -> int | |
4333 | ||
4334 | Returns the configured number of lines (or whatever) to be scrolled | |
4335 | per wheel action. Defaults to three. | |
4336 | """ | |
d55e5bfc RD |
4337 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
4338 | ||
4339 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4340 | """ |
4341 | IsPageScroll(self) -> bool | |
4342 | ||
4343 | Returns true if the system has been setup to do page scrolling with | |
4344 | the mouse wheel instead of line scrolling. | |
4345 | """ | |
d55e5bfc RD |
4346 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4347 | ||
4348 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4349 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4350 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4351 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4352 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4353 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4354 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4355 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4356 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4357 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4358 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4359 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
4360 | ||
4361 | class MouseEventPtr(MouseEvent): | |
4362 | def __init__(self, this): | |
4363 | self.this = this | |
4364 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4365 | self.__class__ = MouseEvent | |
4366 | _core_.MouseEvent_swigregister(MouseEventPtr) | |
4367 | ||
4368 | #--------------------------------------------------------------------------- | |
4369 | ||
4370 | class SetCursorEvent(Event): | |
093d3ff1 | 4371 | """Proxy of C++ SetCursorEvent class""" |
d55e5bfc RD |
4372 | def __repr__(self): |
4373 | return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4374 | def __init__(self, *args, **kwargs): | |
4375 | """__init__(self, int x=0, int y=0) -> SetCursorEvent""" | |
4376 | newobj = _core_.new_SetCursorEvent(*args, **kwargs) | |
4377 | self.this = newobj.this | |
4378 | self.thisown = 1 | |
4379 | del newobj.thisown | |
4380 | def GetX(*args, **kwargs): | |
4381 | """GetX(self) -> int""" | |
4382 | return _core_.SetCursorEvent_GetX(*args, **kwargs) | |
4383 | ||
4384 | def GetY(*args, **kwargs): | |
4385 | """GetY(self) -> int""" | |
4386 | return _core_.SetCursorEvent_GetY(*args, **kwargs) | |
4387 | ||
4388 | def SetCursor(*args, **kwargs): | |
4389 | """SetCursor(self, Cursor cursor)""" | |
4390 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) | |
4391 | ||
4392 | def GetCursor(*args, **kwargs): | |
4393 | """GetCursor(self) -> Cursor""" | |
4394 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) | |
4395 | ||
4396 | def HasCursor(*args, **kwargs): | |
4397 | """HasCursor(self) -> bool""" | |
4398 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) | |
4399 | ||
4400 | ||
4401 | class SetCursorEventPtr(SetCursorEvent): | |
4402 | def __init__(self, this): | |
4403 | self.this = this | |
4404 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4405 | self.__class__ = SetCursorEvent | |
4406 | _core_.SetCursorEvent_swigregister(SetCursorEventPtr) | |
4407 | ||
4408 | #--------------------------------------------------------------------------- | |
4409 | ||
4410 | class KeyEvent(Event): | |
093d3ff1 | 4411 | """Proxy of C++ KeyEvent class""" |
d55e5bfc RD |
4412 | def __repr__(self): |
4413 | return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4414 | def __init__(self, *args, **kwargs): | |
4415 | """__init__(self, wxEventType keyType=wxEVT_NULL) -> KeyEvent""" | |
4416 | newobj = _core_.new_KeyEvent(*args, **kwargs) | |
4417 | self.this = newobj.this | |
4418 | self.thisown = 1 | |
4419 | del newobj.thisown | |
4420 | def ControlDown(*args, **kwargs): | |
4421 | """ControlDown(self) -> bool""" | |
4422 | return _core_.KeyEvent_ControlDown(*args, **kwargs) | |
4423 | ||
4424 | def MetaDown(*args, **kwargs): | |
4425 | """MetaDown(self) -> bool""" | |
4426 | return _core_.KeyEvent_MetaDown(*args, **kwargs) | |
4427 | ||
4428 | def AltDown(*args, **kwargs): | |
4429 | """AltDown(self) -> bool""" | |
4430 | return _core_.KeyEvent_AltDown(*args, **kwargs) | |
4431 | ||
4432 | def ShiftDown(*args, **kwargs): | |
4433 | """ShiftDown(self) -> bool""" | |
4434 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) | |
4435 | ||
412d302d RD |
4436 | def CmdDown(*args, **kwargs): |
4437 | """ | |
4438 | CmdDown(self) -> bool | |
4439 | ||
4440 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4441 | platforms but the special "Apple" (a.k.a as "Command") key on | |
4442 | Macs: it makes often sense to use it instead of, say, `ControlDown` | |
4443 | because Cmd key is used for the same thing under Mac as Ctrl | |
4444 | elsewhere. The Ctrl still exists, it's just not used for this | |
4445 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
4446 | and Macs this is the same as `MetaDown`. | |
4447 | """ | |
4448 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
4449 | ||
d55e5bfc RD |
4450 | def HasModifiers(*args, **kwargs): |
4451 | """HasModifiers(self) -> bool""" | |
4452 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) | |
4453 | ||
4454 | def GetKeyCode(*args, **kwargs): | |
4455 | """GetKeyCode(self) -> int""" | |
4456 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) | |
4457 | ||
4458 | KeyCode = GetKeyCode | |
19272049 RD |
4459 | def GetUnicodeKey(*args, **kwargs): |
4460 | """GetUnicodeKey(self) -> int""" | |
4461 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) | |
d55e5bfc | 4462 | |
19272049 | 4463 | GetUniChar = GetUnicodeKey |
d55e5bfc RD |
4464 | def GetRawKeyCode(*args, **kwargs): |
4465 | """GetRawKeyCode(self) -> unsigned int""" | |
4466 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) | |
4467 | ||
4468 | def GetRawKeyFlags(*args, **kwargs): | |
4469 | """GetRawKeyFlags(self) -> unsigned int""" | |
4470 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) | |
4471 | ||
4472 | def GetPosition(*args, **kwargs): | |
4473 | """ | |
4474 | GetPosition(self) -> Point | |
4475 | ||
4476 | Find the position of the event. | |
4477 | """ | |
4478 | return _core_.KeyEvent_GetPosition(*args, **kwargs) | |
4479 | ||
4480 | def GetPositionTuple(*args, **kwargs): | |
4481 | """ | |
4482 | GetPositionTuple() -> (x,y) | |
4483 | ||
4484 | Find the position of the event. | |
4485 | """ | |
4486 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) | |
4487 | ||
4488 | def GetX(*args, **kwargs): | |
4489 | """GetX(self) -> int""" | |
4490 | return _core_.KeyEvent_GetX(*args, **kwargs) | |
4491 | ||
4492 | def GetY(*args, **kwargs): | |
4493 | """GetY(self) -> int""" | |
4494 | return _core_.KeyEvent_GetY(*args, **kwargs) | |
4495 | ||
4496 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
4497 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
4498 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
4499 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
4500 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
4501 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
4502 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
4503 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
4504 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
4505 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
4506 | ||
4507 | class KeyEventPtr(KeyEvent): | |
4508 | def __init__(self, this): | |
4509 | self.this = this | |
4510 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4511 | self.__class__ = KeyEvent | |
4512 | _core_.KeyEvent_swigregister(KeyEventPtr) | |
4513 | ||
4514 | #--------------------------------------------------------------------------- | |
4515 | ||
4516 | class SizeEvent(Event): | |
093d3ff1 | 4517 | """Proxy of C++ SizeEvent class""" |
d55e5bfc RD |
4518 | def __repr__(self): |
4519 | return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4520 | def __init__(self, *args, **kwargs): | |
4521 | """__init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent""" | |
4522 | newobj = _core_.new_SizeEvent(*args, **kwargs) | |
4523 | self.this = newobj.this | |
4524 | self.thisown = 1 | |
4525 | del newobj.thisown | |
4526 | def GetSize(*args, **kwargs): | |
4527 | """GetSize(self) -> Size""" | |
4528 | return _core_.SizeEvent_GetSize(*args, **kwargs) | |
4529 | ||
4530 | def GetRect(*args, **kwargs): | |
4531 | """GetRect(self) -> Rect""" | |
4532 | return _core_.SizeEvent_GetRect(*args, **kwargs) | |
4533 | ||
4534 | def SetRect(*args, **kwargs): | |
4535 | """SetRect(self, Rect rect)""" | |
4536 | return _core_.SizeEvent_SetRect(*args, **kwargs) | |
4537 | ||
4538 | def SetSize(*args, **kwargs): | |
4539 | """SetSize(self, Size size)""" | |
4540 | return _core_.SizeEvent_SetSize(*args, **kwargs) | |
4541 | ||
4542 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) | |
4543 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
4544 | ||
4545 | class SizeEventPtr(SizeEvent): | |
4546 | def __init__(self, this): | |
4547 | self.this = this | |
4548 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4549 | self.__class__ = SizeEvent | |
4550 | _core_.SizeEvent_swigregister(SizeEventPtr) | |
4551 | ||
4552 | #--------------------------------------------------------------------------- | |
4553 | ||
4554 | class MoveEvent(Event): | |
093d3ff1 | 4555 | """Proxy of C++ MoveEvent class""" |
d55e5bfc RD |
4556 | def __repr__(self): |
4557 | return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4558 | def __init__(self, *args, **kwargs): | |
4559 | """__init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent""" | |
4560 | newobj = _core_.new_MoveEvent(*args, **kwargs) | |
4561 | self.this = newobj.this | |
4562 | self.thisown = 1 | |
4563 | del newobj.thisown | |
4564 | def GetPosition(*args, **kwargs): | |
4565 | """GetPosition(self) -> Point""" | |
4566 | return _core_.MoveEvent_GetPosition(*args, **kwargs) | |
4567 | ||
4568 | def GetRect(*args, **kwargs): | |
4569 | """GetRect(self) -> Rect""" | |
4570 | return _core_.MoveEvent_GetRect(*args, **kwargs) | |
4571 | ||
4572 | def SetRect(*args, **kwargs): | |
4573 | """SetRect(self, Rect rect)""" | |
4574 | return _core_.MoveEvent_SetRect(*args, **kwargs) | |
4575 | ||
4576 | def SetPosition(*args, **kwargs): | |
4577 | """SetPosition(self, Point pos)""" | |
4578 | return _core_.MoveEvent_SetPosition(*args, **kwargs) | |
4579 | ||
fef4c27a RD |
4580 | m_pos = property(GetPosition, SetPosition) |
4581 | m_rect = property(GetRect, SetRect) | |
4582 | ||
d55e5bfc RD |
4583 | |
4584 | class MoveEventPtr(MoveEvent): | |
4585 | def __init__(self, this): | |
4586 | self.this = this | |
4587 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4588 | self.__class__ = MoveEvent | |
4589 | _core_.MoveEvent_swigregister(MoveEventPtr) | |
4590 | ||
4591 | #--------------------------------------------------------------------------- | |
4592 | ||
4593 | class PaintEvent(Event): | |
093d3ff1 | 4594 | """Proxy of C++ PaintEvent class""" |
d55e5bfc RD |
4595 | def __repr__(self): |
4596 | return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4597 | def __init__(self, *args, **kwargs): | |
4598 | """__init__(self, int Id=0) -> PaintEvent""" | |
4599 | newobj = _core_.new_PaintEvent(*args, **kwargs) | |
4600 | self.this = newobj.this | |
4601 | self.thisown = 1 | |
4602 | del newobj.thisown | |
4603 | ||
4604 | class PaintEventPtr(PaintEvent): | |
4605 | def __init__(self, this): | |
4606 | self.this = this | |
4607 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4608 | self.__class__ = PaintEvent | |
4609 | _core_.PaintEvent_swigregister(PaintEventPtr) | |
4610 | ||
4611 | class NcPaintEvent(Event): | |
093d3ff1 | 4612 | """Proxy of C++ NcPaintEvent class""" |
d55e5bfc RD |
4613 | def __repr__(self): |
4614 | return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4615 | def __init__(self, *args, **kwargs): | |
4616 | """__init__(self, int winid=0) -> NcPaintEvent""" | |
4617 | newobj = _core_.new_NcPaintEvent(*args, **kwargs) | |
4618 | self.this = newobj.this | |
4619 | self.thisown = 1 | |
4620 | del newobj.thisown | |
4621 | ||
4622 | class NcPaintEventPtr(NcPaintEvent): | |
4623 | def __init__(self, this): | |
4624 | self.this = this | |
4625 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4626 | self.__class__ = NcPaintEvent | |
4627 | _core_.NcPaintEvent_swigregister(NcPaintEventPtr) | |
4628 | ||
4629 | #--------------------------------------------------------------------------- | |
4630 | ||
4631 | class EraseEvent(Event): | |
093d3ff1 | 4632 | """Proxy of C++ EraseEvent class""" |
d55e5bfc RD |
4633 | def __repr__(self): |
4634 | return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4635 | def __init__(self, *args, **kwargs): | |
4636 | """__init__(self, int Id=0, DC dc=(wxDC *) NULL) -> EraseEvent""" | |
4637 | newobj = _core_.new_EraseEvent(*args, **kwargs) | |
4638 | self.this = newobj.this | |
4639 | self.thisown = 1 | |
4640 | del newobj.thisown | |
4641 | def GetDC(*args, **kwargs): | |
4642 | """GetDC(self) -> DC""" | |
4643 | return _core_.EraseEvent_GetDC(*args, **kwargs) | |
4644 | ||
4645 | ||
4646 | class EraseEventPtr(EraseEvent): | |
4647 | def __init__(self, this): | |
4648 | self.this = this | |
4649 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4650 | self.__class__ = EraseEvent | |
4651 | _core_.EraseEvent_swigregister(EraseEventPtr) | |
4652 | ||
4653 | #--------------------------------------------------------------------------- | |
4654 | ||
4655 | class FocusEvent(Event): | |
093d3ff1 | 4656 | """Proxy of C++ FocusEvent class""" |
d55e5bfc RD |
4657 | def __repr__(self): |
4658 | return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4659 | def __init__(self, *args, **kwargs): | |
4660 | """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent""" | |
4661 | newobj = _core_.new_FocusEvent(*args, **kwargs) | |
4662 | self.this = newobj.this | |
4663 | self.thisown = 1 | |
4664 | del newobj.thisown | |
4665 | def GetWindow(*args, **kwargs): | |
4666 | """GetWindow(self) -> Window""" | |
4667 | return _core_.FocusEvent_GetWindow(*args, **kwargs) | |
4668 | ||
4669 | def SetWindow(*args, **kwargs): | |
4670 | """SetWindow(self, Window win)""" | |
4671 | return _core_.FocusEvent_SetWindow(*args, **kwargs) | |
4672 | ||
4673 | ||
4674 | class FocusEventPtr(FocusEvent): | |
4675 | def __init__(self, this): | |
4676 | self.this = this | |
4677 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4678 | self.__class__ = FocusEvent | |
4679 | _core_.FocusEvent_swigregister(FocusEventPtr) | |
4680 | ||
4681 | #--------------------------------------------------------------------------- | |
4682 | ||
4683 | class ChildFocusEvent(CommandEvent): | |
093d3ff1 | 4684 | """Proxy of C++ ChildFocusEvent class""" |
d55e5bfc RD |
4685 | def __repr__(self): |
4686 | return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4687 | def __init__(self, *args, **kwargs): | |
4688 | """__init__(self, Window win=None) -> ChildFocusEvent""" | |
4689 | newobj = _core_.new_ChildFocusEvent(*args, **kwargs) | |
4690 | self.this = newobj.this | |
4691 | self.thisown = 1 | |
4692 | del newobj.thisown | |
4693 | def GetWindow(*args, **kwargs): | |
4694 | """GetWindow(self) -> Window""" | |
4695 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) | |
4696 | ||
4697 | ||
4698 | class ChildFocusEventPtr(ChildFocusEvent): | |
4699 | def __init__(self, this): | |
4700 | self.this = this | |
4701 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4702 | self.__class__ = ChildFocusEvent | |
4703 | _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr) | |
4704 | ||
4705 | #--------------------------------------------------------------------------- | |
4706 | ||
4707 | class ActivateEvent(Event): | |
093d3ff1 | 4708 | """Proxy of C++ ActivateEvent class""" |
d55e5bfc RD |
4709 | def __repr__(self): |
4710 | return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4711 | def __init__(self, *args, **kwargs): | |
4712 | """__init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent""" | |
4713 | newobj = _core_.new_ActivateEvent(*args, **kwargs) | |
4714 | self.this = newobj.this | |
4715 | self.thisown = 1 | |
4716 | del newobj.thisown | |
4717 | def GetActive(*args, **kwargs): | |
4718 | """GetActive(self) -> bool""" | |
4719 | return _core_.ActivateEvent_GetActive(*args, **kwargs) | |
4720 | ||
4721 | ||
4722 | class ActivateEventPtr(ActivateEvent): | |
4723 | def __init__(self, this): | |
4724 | self.this = this | |
4725 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4726 | self.__class__ = ActivateEvent | |
4727 | _core_.ActivateEvent_swigregister(ActivateEventPtr) | |
4728 | ||
4729 | #--------------------------------------------------------------------------- | |
4730 | ||
4731 | class InitDialogEvent(Event): | |
093d3ff1 | 4732 | """Proxy of C++ InitDialogEvent class""" |
d55e5bfc RD |
4733 | def __repr__(self): |
4734 | return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4735 | def __init__(self, *args, **kwargs): | |
4736 | """__init__(self, int Id=0) -> InitDialogEvent""" | |
4737 | newobj = _core_.new_InitDialogEvent(*args, **kwargs) | |
4738 | self.this = newobj.this | |
4739 | self.thisown = 1 | |
4740 | del newobj.thisown | |
4741 | ||
4742 | class InitDialogEventPtr(InitDialogEvent): | |
4743 | def __init__(self, this): | |
4744 | self.this = this | |
4745 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4746 | self.__class__ = InitDialogEvent | |
4747 | _core_.InitDialogEvent_swigregister(InitDialogEventPtr) | |
4748 | ||
4749 | #--------------------------------------------------------------------------- | |
4750 | ||
4751 | class MenuEvent(Event): | |
093d3ff1 | 4752 | """Proxy of C++ MenuEvent class""" |
d55e5bfc RD |
4753 | def __repr__(self): |
4754 | return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4755 | def __init__(self, *args, **kwargs): | |
4756 | """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent""" | |
4757 | newobj = _core_.new_MenuEvent(*args, **kwargs) | |
4758 | self.this = newobj.this | |
4759 | self.thisown = 1 | |
4760 | del newobj.thisown | |
4761 | def GetMenuId(*args, **kwargs): | |
4762 | """GetMenuId(self) -> int""" | |
4763 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) | |
4764 | ||
4765 | def IsPopup(*args, **kwargs): | |
4766 | """IsPopup(self) -> bool""" | |
4767 | return _core_.MenuEvent_IsPopup(*args, **kwargs) | |
4768 | ||
4769 | def GetMenu(*args, **kwargs): | |
4770 | """GetMenu(self) -> Menu""" | |
4771 | return _core_.MenuEvent_GetMenu(*args, **kwargs) | |
4772 | ||
4773 | ||
4774 | class MenuEventPtr(MenuEvent): | |
4775 | def __init__(self, this): | |
4776 | self.this = this | |
4777 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4778 | self.__class__ = MenuEvent | |
4779 | _core_.MenuEvent_swigregister(MenuEventPtr) | |
4780 | ||
4781 | #--------------------------------------------------------------------------- | |
4782 | ||
4783 | class CloseEvent(Event): | |
093d3ff1 | 4784 | """Proxy of C++ CloseEvent class""" |
d55e5bfc RD |
4785 | def __repr__(self): |
4786 | return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4787 | def __init__(self, *args, **kwargs): | |
4788 | """__init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent""" | |
4789 | newobj = _core_.new_CloseEvent(*args, **kwargs) | |
4790 | self.this = newobj.this | |
4791 | self.thisown = 1 | |
4792 | del newobj.thisown | |
4793 | def SetLoggingOff(*args, **kwargs): | |
4794 | """SetLoggingOff(self, bool logOff)""" | |
4795 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) | |
4796 | ||
4797 | def GetLoggingOff(*args, **kwargs): | |
4798 | """GetLoggingOff(self) -> bool""" | |
4799 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) | |
4800 | ||
4801 | def Veto(*args, **kwargs): | |
4802 | """Veto(self, bool veto=True)""" | |
4803 | return _core_.CloseEvent_Veto(*args, **kwargs) | |
4804 | ||
4805 | def SetCanVeto(*args, **kwargs): | |
4806 | """SetCanVeto(self, bool canVeto)""" | |
4807 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) | |
4808 | ||
4809 | def CanVeto(*args, **kwargs): | |
4810 | """CanVeto(self) -> bool""" | |
4811 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
4812 | ||
4813 | def GetVeto(*args, **kwargs): | |
4814 | """GetVeto(self) -> bool""" | |
4815 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
4816 | ||
4817 | ||
4818 | class CloseEventPtr(CloseEvent): | |
4819 | def __init__(self, this): | |
4820 | self.this = this | |
4821 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4822 | self.__class__ = CloseEvent | |
4823 | _core_.CloseEvent_swigregister(CloseEventPtr) | |
4824 | ||
4825 | #--------------------------------------------------------------------------- | |
4826 | ||
4827 | class ShowEvent(Event): | |
093d3ff1 | 4828 | """Proxy of C++ ShowEvent class""" |
d55e5bfc RD |
4829 | def __repr__(self): |
4830 | return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4831 | def __init__(self, *args, **kwargs): | |
4832 | """__init__(self, int winid=0, bool show=False) -> ShowEvent""" | |
4833 | newobj = _core_.new_ShowEvent(*args, **kwargs) | |
4834 | self.this = newobj.this | |
4835 | self.thisown = 1 | |
4836 | del newobj.thisown | |
4837 | def SetShow(*args, **kwargs): | |
4838 | """SetShow(self, bool show)""" | |
4839 | return _core_.ShowEvent_SetShow(*args, **kwargs) | |
4840 | ||
4841 | def GetShow(*args, **kwargs): | |
4842 | """GetShow(self) -> bool""" | |
4843 | return _core_.ShowEvent_GetShow(*args, **kwargs) | |
4844 | ||
4845 | ||
4846 | class ShowEventPtr(ShowEvent): | |
4847 | def __init__(self, this): | |
4848 | self.this = this | |
4849 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4850 | self.__class__ = ShowEvent | |
4851 | _core_.ShowEvent_swigregister(ShowEventPtr) | |
4852 | ||
4853 | #--------------------------------------------------------------------------- | |
4854 | ||
4855 | class IconizeEvent(Event): | |
093d3ff1 | 4856 | """Proxy of C++ IconizeEvent class""" |
d55e5bfc RD |
4857 | def __repr__(self): |
4858 | return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4859 | def __init__(self, *args, **kwargs): | |
4860 | """__init__(self, int id=0, bool iconized=True) -> IconizeEvent""" | |
4861 | newobj = _core_.new_IconizeEvent(*args, **kwargs) | |
4862 | self.this = newobj.this | |
4863 | self.thisown = 1 | |
4864 | del newobj.thisown | |
4865 | def Iconized(*args, **kwargs): | |
4866 | """Iconized(self) -> bool""" | |
4867 | return _core_.IconizeEvent_Iconized(*args, **kwargs) | |
4868 | ||
4869 | ||
4870 | class IconizeEventPtr(IconizeEvent): | |
4871 | def __init__(self, this): | |
4872 | self.this = this | |
4873 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4874 | self.__class__ = IconizeEvent | |
4875 | _core_.IconizeEvent_swigregister(IconizeEventPtr) | |
4876 | ||
4877 | #--------------------------------------------------------------------------- | |
4878 | ||
4879 | class MaximizeEvent(Event): | |
093d3ff1 | 4880 | """Proxy of C++ MaximizeEvent class""" |
d55e5bfc RD |
4881 | def __repr__(self): |
4882 | return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4883 | def __init__(self, *args, **kwargs): | |
4884 | """__init__(self, int id=0) -> MaximizeEvent""" | |
4885 | newobj = _core_.new_MaximizeEvent(*args, **kwargs) | |
4886 | self.this = newobj.this | |
4887 | self.thisown = 1 | |
4888 | del newobj.thisown | |
4889 | ||
4890 | class MaximizeEventPtr(MaximizeEvent): | |
4891 | def __init__(self, this): | |
4892 | self.this = this | |
4893 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4894 | self.__class__ = MaximizeEvent | |
4895 | _core_.MaximizeEvent_swigregister(MaximizeEventPtr) | |
4896 | ||
4897 | #--------------------------------------------------------------------------- | |
4898 | ||
4899 | class DropFilesEvent(Event): | |
093d3ff1 | 4900 | """Proxy of C++ DropFilesEvent class""" |
d55e5bfc RD |
4901 | def __init__(self): raise RuntimeError, "No constructor defined" |
4902 | def __repr__(self): | |
4903 | return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4904 | def GetPosition(*args, **kwargs): | |
4905 | """GetPosition(self) -> Point""" | |
4906 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) | |
4907 | ||
4908 | def GetNumberOfFiles(*args, **kwargs): | |
4909 | """GetNumberOfFiles(self) -> int""" | |
4910 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) | |
4911 | ||
4912 | def GetFiles(*args, **kwargs): | |
4913 | """GetFiles(self) -> PyObject""" | |
4914 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) | |
4915 | ||
4916 | ||
4917 | class DropFilesEventPtr(DropFilesEvent): | |
4918 | def __init__(self, this): | |
4919 | self.this = this | |
4920 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4921 | self.__class__ = DropFilesEvent | |
4922 | _core_.DropFilesEvent_swigregister(DropFilesEventPtr) | |
4923 | ||
4924 | #--------------------------------------------------------------------------- | |
4925 | ||
4926 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL | |
4927 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
4928 | class UpdateUIEvent(CommandEvent): | |
093d3ff1 | 4929 | """Proxy of C++ UpdateUIEvent class""" |
d55e5bfc RD |
4930 | def __repr__(self): |
4931 | return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4932 | def __init__(self, *args, **kwargs): | |
4933 | """__init__(self, int commandId=0) -> UpdateUIEvent""" | |
4934 | newobj = _core_.new_UpdateUIEvent(*args, **kwargs) | |
4935 | self.this = newobj.this | |
4936 | self.thisown = 1 | |
4937 | del newobj.thisown | |
4938 | def GetChecked(*args, **kwargs): | |
4939 | """GetChecked(self) -> bool""" | |
4940 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) | |
4941 | ||
4942 | def GetEnabled(*args, **kwargs): | |
4943 | """GetEnabled(self) -> bool""" | |
4944 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) | |
4945 | ||
4946 | def GetText(*args, **kwargs): | |
4947 | """GetText(self) -> String""" | |
4948 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) | |
4949 | ||
4950 | def GetSetText(*args, **kwargs): | |
4951 | """GetSetText(self) -> bool""" | |
4952 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) | |
4953 | ||
4954 | def GetSetChecked(*args, **kwargs): | |
4955 | """GetSetChecked(self) -> bool""" | |
4956 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) | |
4957 | ||
4958 | def GetSetEnabled(*args, **kwargs): | |
4959 | """GetSetEnabled(self) -> bool""" | |
4960 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) | |
4961 | ||
4962 | def Check(*args, **kwargs): | |
4963 | """Check(self, bool check)""" | |
4964 | return _core_.UpdateUIEvent_Check(*args, **kwargs) | |
4965 | ||
4966 | def Enable(*args, **kwargs): | |
4967 | """Enable(self, bool enable)""" | |
4968 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) | |
4969 | ||
4970 | def SetText(*args, **kwargs): | |
4971 | """SetText(self, String text)""" | |
4972 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) | |
4973 | ||
4974 | def SetUpdateInterval(*args, **kwargs): | |
c24da6d6 | 4975 | """SetUpdateInterval(long updateInterval)""" |
d55e5bfc RD |
4976 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
4977 | ||
4978 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
4979 | def GetUpdateInterval(*args, **kwargs): | |
c24da6d6 | 4980 | """GetUpdateInterval() -> long""" |
d55e5bfc RD |
4981 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
4982 | ||
4983 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
4984 | def CanUpdate(*args, **kwargs): | |
c24da6d6 | 4985 | """CanUpdate(Window win) -> bool""" |
d55e5bfc RD |
4986 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
4987 | ||
4988 | CanUpdate = staticmethod(CanUpdate) | |
4989 | def ResetUpdateTime(*args, **kwargs): | |
c24da6d6 | 4990 | """ResetUpdateTime()""" |
d55e5bfc RD |
4991 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
4992 | ||
4993 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
4994 | def SetMode(*args, **kwargs): | |
c24da6d6 | 4995 | """SetMode(int mode)""" |
d55e5bfc RD |
4996 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
4997 | ||
4998 | SetMode = staticmethod(SetMode) | |
4999 | def GetMode(*args, **kwargs): | |
c24da6d6 | 5000 | """GetMode() -> int""" |
d55e5bfc RD |
5001 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
5002 | ||
5003 | GetMode = staticmethod(GetMode) | |
5004 | ||
5005 | class UpdateUIEventPtr(UpdateUIEvent): | |
5006 | def __init__(self, this): | |
5007 | self.this = this | |
5008 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5009 | self.__class__ = UpdateUIEvent | |
5010 | _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr) | |
5011 | ||
5012 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): | |
5013 | """UpdateUIEvent_SetUpdateInterval(long updateInterval)""" | |
5014 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) | |
5015 | ||
5016 | def UpdateUIEvent_GetUpdateInterval(*args, **kwargs): | |
5017 | """UpdateUIEvent_GetUpdateInterval() -> long""" | |
5018 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) | |
5019 | ||
5020 | def UpdateUIEvent_CanUpdate(*args, **kwargs): | |
5021 | """UpdateUIEvent_CanUpdate(Window win) -> bool""" | |
5022 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) | |
5023 | ||
5024 | def UpdateUIEvent_ResetUpdateTime(*args, **kwargs): | |
5025 | """UpdateUIEvent_ResetUpdateTime()""" | |
5026 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) | |
5027 | ||
5028 | def UpdateUIEvent_SetMode(*args, **kwargs): | |
5029 | """UpdateUIEvent_SetMode(int mode)""" | |
5030 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) | |
5031 | ||
5032 | def UpdateUIEvent_GetMode(*args, **kwargs): | |
5033 | """UpdateUIEvent_GetMode() -> int""" | |
5034 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) | |
5035 | ||
5036 | #--------------------------------------------------------------------------- | |
5037 | ||
5038 | class SysColourChangedEvent(Event): | |
093d3ff1 | 5039 | """Proxy of C++ SysColourChangedEvent class""" |
d55e5bfc RD |
5040 | def __repr__(self): |
5041 | return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5042 | def __init__(self, *args, **kwargs): | |
5043 | """__init__(self) -> SysColourChangedEvent""" | |
5044 | newobj = _core_.new_SysColourChangedEvent(*args, **kwargs) | |
5045 | self.this = newobj.this | |
5046 | self.thisown = 1 | |
5047 | del newobj.thisown | |
5048 | ||
5049 | class SysColourChangedEventPtr(SysColourChangedEvent): | |
5050 | def __init__(self, this): | |
5051 | self.this = this | |
5052 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5053 | self.__class__ = SysColourChangedEvent | |
5054 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr) | |
5055 | ||
5056 | #--------------------------------------------------------------------------- | |
5057 | ||
5058 | class MouseCaptureChangedEvent(Event): | |
093d3ff1 | 5059 | """Proxy of C++ MouseCaptureChangedEvent class""" |
d55e5bfc RD |
5060 | def __repr__(self): |
5061 | return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5062 | def __init__(self, *args, **kwargs): | |
5063 | """__init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent""" | |
5064 | newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs) | |
5065 | self.this = newobj.this | |
5066 | self.thisown = 1 | |
5067 | del newobj.thisown | |
5068 | def GetCapturedWindow(*args, **kwargs): | |
5069 | """GetCapturedWindow(self) -> Window""" | |
5070 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) | |
5071 | ||
5072 | ||
5073 | class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent): | |
5074 | def __init__(self, this): | |
5075 | self.this = this | |
5076 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5077 | self.__class__ = MouseCaptureChangedEvent | |
5078 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr) | |
5079 | ||
5080 | #--------------------------------------------------------------------------- | |
5081 | ||
5082 | class DisplayChangedEvent(Event): | |
093d3ff1 | 5083 | """Proxy of C++ DisplayChangedEvent class""" |
d55e5bfc RD |
5084 | def __repr__(self): |
5085 | return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5086 | def __init__(self, *args, **kwargs): | |
5087 | """__init__(self) -> DisplayChangedEvent""" | |
5088 | newobj = _core_.new_DisplayChangedEvent(*args, **kwargs) | |
5089 | self.this = newobj.this | |
5090 | self.thisown = 1 | |
5091 | del newobj.thisown | |
5092 | ||
5093 | class DisplayChangedEventPtr(DisplayChangedEvent): | |
5094 | def __init__(self, this): | |
5095 | self.this = this | |
5096 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5097 | self.__class__ = DisplayChangedEvent | |
5098 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr) | |
5099 | ||
5100 | #--------------------------------------------------------------------------- | |
5101 | ||
5102 | class PaletteChangedEvent(Event): | |
093d3ff1 | 5103 | """Proxy of C++ PaletteChangedEvent class""" |
d55e5bfc RD |
5104 | def __repr__(self): |
5105 | return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5106 | def __init__(self, *args, **kwargs): | |
5107 | """__init__(self, int id=0) -> PaletteChangedEvent""" | |
5108 | newobj = _core_.new_PaletteChangedEvent(*args, **kwargs) | |
5109 | self.this = newobj.this | |
5110 | self.thisown = 1 | |
5111 | del newobj.thisown | |
5112 | def SetChangedWindow(*args, **kwargs): | |
5113 | """SetChangedWindow(self, Window win)""" | |
5114 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) | |
5115 | ||
5116 | def GetChangedWindow(*args, **kwargs): | |
5117 | """GetChangedWindow(self) -> Window""" | |
5118 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) | |
5119 | ||
5120 | ||
5121 | class PaletteChangedEventPtr(PaletteChangedEvent): | |
5122 | def __init__(self, this): | |
5123 | self.this = this | |
5124 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5125 | self.__class__ = PaletteChangedEvent | |
5126 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr) | |
5127 | ||
5128 | #--------------------------------------------------------------------------- | |
5129 | ||
5130 | class QueryNewPaletteEvent(Event): | |
093d3ff1 | 5131 | """Proxy of C++ QueryNewPaletteEvent class""" |
d55e5bfc RD |
5132 | def __repr__(self): |
5133 | return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5134 | def __init__(self, *args, **kwargs): | |
5135 | """__init__(self, int winid=0) -> QueryNewPaletteEvent""" | |
5136 | newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs) | |
5137 | self.this = newobj.this | |
5138 | self.thisown = 1 | |
5139 | del newobj.thisown | |
5140 | def SetPaletteRealized(*args, **kwargs): | |
5141 | """SetPaletteRealized(self, bool realized)""" | |
5142 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) | |
5143 | ||
5144 | def GetPaletteRealized(*args, **kwargs): | |
5145 | """GetPaletteRealized(self) -> bool""" | |
5146 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) | |
5147 | ||
5148 | ||
5149 | class QueryNewPaletteEventPtr(QueryNewPaletteEvent): | |
5150 | def __init__(self, this): | |
5151 | self.this = this | |
5152 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5153 | self.__class__ = QueryNewPaletteEvent | |
5154 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr) | |
5155 | ||
5156 | #--------------------------------------------------------------------------- | |
5157 | ||
5158 | class NavigationKeyEvent(Event): | |
093d3ff1 | 5159 | """Proxy of C++ NavigationKeyEvent class""" |
d55e5bfc RD |
5160 | def __repr__(self): |
5161 | return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5162 | def __init__(self, *args, **kwargs): | |
5163 | """__init__(self) -> NavigationKeyEvent""" | |
5164 | newobj = _core_.new_NavigationKeyEvent(*args, **kwargs) | |
5165 | self.this = newobj.this | |
5166 | self.thisown = 1 | |
5167 | del newobj.thisown | |
5168 | def GetDirection(*args, **kwargs): | |
5169 | """GetDirection(self) -> bool""" | |
5170 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) | |
5171 | ||
5172 | def SetDirection(*args, **kwargs): | |
908b74cd | 5173 | """SetDirection(self, bool forward)""" |
d55e5bfc RD |
5174 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
5175 | ||
5176 | def IsWindowChange(*args, **kwargs): | |
5177 | """IsWindowChange(self) -> bool""" | |
5178 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) | |
5179 | ||
5180 | def SetWindowChange(*args, **kwargs): | |
908b74cd | 5181 | """SetWindowChange(self, bool ischange)""" |
d55e5bfc RD |
5182 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
5183 | ||
68350608 RD |
5184 | def IsFromTab(*args, **kwargs): |
5185 | """IsFromTab(self) -> bool""" | |
5186 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) | |
5187 | ||
5188 | def SetFromTab(*args, **kwargs): | |
5189 | """SetFromTab(self, bool bIs)""" | |
5190 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) | |
5191 | ||
908b74cd RD |
5192 | def SetFlags(*args, **kwargs): |
5193 | """SetFlags(self, long flags)""" | |
5194 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) | |
5195 | ||
d55e5bfc RD |
5196 | def GetCurrentFocus(*args, **kwargs): |
5197 | """GetCurrentFocus(self) -> Window""" | |
5198 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) | |
5199 | ||
5200 | def SetCurrentFocus(*args, **kwargs): | |
5201 | """SetCurrentFocus(self, Window win)""" | |
5202 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) | |
5203 | ||
b0f7404b | 5204 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
908b74cd RD |
5205 | IsForward = _core_.NavigationKeyEvent_IsForward |
5206 | WinChange = _core_.NavigationKeyEvent_WinChange | |
68350608 | 5207 | FromTab = _core_.NavigationKeyEvent_FromTab |
d55e5bfc RD |
5208 | |
5209 | class NavigationKeyEventPtr(NavigationKeyEvent): | |
5210 | def __init__(self, this): | |
5211 | self.this = this | |
5212 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5213 | self.__class__ = NavigationKeyEvent | |
5214 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr) | |
5215 | ||
5216 | #--------------------------------------------------------------------------- | |
5217 | ||
5218 | class WindowCreateEvent(CommandEvent): | |
093d3ff1 | 5219 | """Proxy of C++ WindowCreateEvent class""" |
d55e5bfc RD |
5220 | def __repr__(self): |
5221 | return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5222 | def __init__(self, *args, **kwargs): | |
5223 | """__init__(self, Window win=None) -> WindowCreateEvent""" | |
5224 | newobj = _core_.new_WindowCreateEvent(*args, **kwargs) | |
5225 | self.this = newobj.this | |
5226 | self.thisown = 1 | |
5227 | del newobj.thisown | |
5228 | def GetWindow(*args, **kwargs): | |
5229 | """GetWindow(self) -> Window""" | |
5230 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) | |
5231 | ||
5232 | ||
5233 | class WindowCreateEventPtr(WindowCreateEvent): | |
5234 | def __init__(self, this): | |
5235 | self.this = this | |
5236 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5237 | self.__class__ = WindowCreateEvent | |
5238 | _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr) | |
5239 | ||
5240 | class WindowDestroyEvent(CommandEvent): | |
093d3ff1 | 5241 | """Proxy of C++ WindowDestroyEvent class""" |
d55e5bfc RD |
5242 | def __repr__(self): |
5243 | return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5244 | def __init__(self, *args, **kwargs): | |
5245 | """__init__(self, Window win=None) -> WindowDestroyEvent""" | |
5246 | newobj = _core_.new_WindowDestroyEvent(*args, **kwargs) | |
5247 | self.this = newobj.this | |
5248 | self.thisown = 1 | |
5249 | del newobj.thisown | |
5250 | def GetWindow(*args, **kwargs): | |
5251 | """GetWindow(self) -> Window""" | |
5252 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) | |
5253 | ||
5254 | ||
5255 | class WindowDestroyEventPtr(WindowDestroyEvent): | |
5256 | def __init__(self, this): | |
5257 | self.this = this | |
5258 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5259 | self.__class__ = WindowDestroyEvent | |
5260 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr) | |
5261 | ||
5262 | #--------------------------------------------------------------------------- | |
5263 | ||
5264 | class ContextMenuEvent(CommandEvent): | |
093d3ff1 | 5265 | """Proxy of C++ ContextMenuEvent class""" |
d55e5bfc RD |
5266 | def __repr__(self): |
5267 | return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5268 | def __init__(self, *args, **kwargs): | |
5269 | """__init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent""" | |
5270 | newobj = _core_.new_ContextMenuEvent(*args, **kwargs) | |
5271 | self.this = newobj.this | |
5272 | self.thisown = 1 | |
5273 | del newobj.thisown | |
5274 | def GetPosition(*args, **kwargs): | |
5275 | """GetPosition(self) -> Point""" | |
5276 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) | |
5277 | ||
5278 | def SetPosition(*args, **kwargs): | |
5279 | """SetPosition(self, Point pos)""" | |
5280 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) | |
5281 | ||
5282 | ||
5283 | class ContextMenuEventPtr(ContextMenuEvent): | |
5284 | def __init__(self, this): | |
5285 | self.this = this | |
5286 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5287 | self.__class__ = ContextMenuEvent | |
5288 | _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr) | |
5289 | ||
5290 | #--------------------------------------------------------------------------- | |
5291 | ||
5292 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL | |
5293 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
5294 | class IdleEvent(Event): | |
093d3ff1 | 5295 | """Proxy of C++ IdleEvent class""" |
d55e5bfc RD |
5296 | def __repr__(self): |
5297 | return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5298 | def __init__(self, *args, **kwargs): | |
5299 | """__init__(self) -> IdleEvent""" | |
5300 | newobj = _core_.new_IdleEvent(*args, **kwargs) | |
5301 | self.this = newobj.this | |
5302 | self.thisown = 1 | |
5303 | del newobj.thisown | |
5304 | def RequestMore(*args, **kwargs): | |
5305 | """RequestMore(self, bool needMore=True)""" | |
5306 | return _core_.IdleEvent_RequestMore(*args, **kwargs) | |
5307 | ||
5308 | def MoreRequested(*args, **kwargs): | |
5309 | """MoreRequested(self) -> bool""" | |
5310 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) | |
5311 | ||
5312 | def SetMode(*args, **kwargs): | |
c24da6d6 | 5313 | """SetMode(int mode)""" |
d55e5bfc RD |
5314 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
5315 | ||
5316 | SetMode = staticmethod(SetMode) | |
5317 | def GetMode(*args, **kwargs): | |
c24da6d6 | 5318 | """GetMode() -> int""" |
d55e5bfc RD |
5319 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
5320 | ||
5321 | GetMode = staticmethod(GetMode) | |
5322 | def CanSend(*args, **kwargs): | |
c24da6d6 | 5323 | """CanSend(Window win) -> bool""" |
d55e5bfc RD |
5324 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
5325 | ||
5326 | CanSend = staticmethod(CanSend) | |
5327 | ||
5328 | class IdleEventPtr(IdleEvent): | |
5329 | def __init__(self, this): | |
5330 | self.this = this | |
5331 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5332 | self.__class__ = IdleEvent | |
5333 | _core_.IdleEvent_swigregister(IdleEventPtr) | |
5334 | ||
5335 | def IdleEvent_SetMode(*args, **kwargs): | |
5336 | """IdleEvent_SetMode(int mode)""" | |
5337 | return _core_.IdleEvent_SetMode(*args, **kwargs) | |
5338 | ||
5339 | def IdleEvent_GetMode(*args, **kwargs): | |
5340 | """IdleEvent_GetMode() -> int""" | |
5341 | return _core_.IdleEvent_GetMode(*args, **kwargs) | |
5342 | ||
5343 | def IdleEvent_CanSend(*args, **kwargs): | |
5344 | """IdleEvent_CanSend(Window win) -> bool""" | |
5345 | return _core_.IdleEvent_CanSend(*args, **kwargs) | |
5346 | ||
5347 | #--------------------------------------------------------------------------- | |
5348 | ||
5349 | class PyEvent(Event): | |
093d3ff1 | 5350 | """Proxy of C++ PyEvent class""" |
d55e5bfc RD |
5351 | def __repr__(self): |
5352 | return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5353 | def __init__(self, *args, **kwargs): | |
5354 | """__init__(self, int winid=0, wxEventType commandType=wxEVT_NULL) -> PyEvent""" | |
5355 | newobj = _core_.new_PyEvent(*args, **kwargs) | |
5356 | self.this = newobj.this | |
5357 | self.thisown = 1 | |
5358 | del newobj.thisown | |
5359 | self.SetSelf(self) | |
5360 | ||
5361 | def __del__(self, destroy=_core_.delete_PyEvent): | |
5362 | """__del__(self)""" | |
5363 | try: | |
5364 | if self.thisown: destroy(self) | |
5365 | except: pass | |
5366 | ||
5367 | def SetSelf(*args, **kwargs): | |
5368 | """SetSelf(self, PyObject self)""" | |
5369 | return _core_.PyEvent_SetSelf(*args, **kwargs) | |
5370 | ||
5371 | def GetSelf(*args, **kwargs): | |
5372 | """GetSelf(self) -> PyObject""" | |
5373 | return _core_.PyEvent_GetSelf(*args, **kwargs) | |
5374 | ||
5375 | ||
5376 | class PyEventPtr(PyEvent): | |
5377 | def __init__(self, this): | |
5378 | self.this = this | |
5379 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5380 | self.__class__ = PyEvent | |
5381 | _core_.PyEvent_swigregister(PyEventPtr) | |
5382 | ||
5383 | class PyCommandEvent(CommandEvent): | |
093d3ff1 | 5384 | """Proxy of C++ PyCommandEvent class""" |
d55e5bfc RD |
5385 | def __repr__(self): |
5386 | return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5387 | def __init__(self, *args, **kwargs): | |
5388 | """__init__(self, wxEventType commandType=wxEVT_NULL, int id=0) -> PyCommandEvent""" | |
5389 | newobj = _core_.new_PyCommandEvent(*args, **kwargs) | |
5390 | self.this = newobj.this | |
5391 | self.thisown = 1 | |
5392 | del newobj.thisown | |
5393 | self.SetSelf(self) | |
5394 | ||
5395 | def __del__(self, destroy=_core_.delete_PyCommandEvent): | |
5396 | """__del__(self)""" | |
5397 | try: | |
5398 | if self.thisown: destroy(self) | |
5399 | except: pass | |
5400 | ||
5401 | def SetSelf(*args, **kwargs): | |
5402 | """SetSelf(self, PyObject self)""" | |
5403 | return _core_.PyCommandEvent_SetSelf(*args, **kwargs) | |
5404 | ||
5405 | def GetSelf(*args, **kwargs): | |
5406 | """GetSelf(self) -> PyObject""" | |
5407 | return _core_.PyCommandEvent_GetSelf(*args, **kwargs) | |
5408 | ||
5409 | ||
5410 | class PyCommandEventPtr(PyCommandEvent): | |
5411 | def __init__(self, this): | |
5412 | self.this = this | |
5413 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5414 | self.__class__ = PyCommandEvent | |
5415 | _core_.PyCommandEvent_swigregister(PyCommandEventPtr) | |
5416 | ||
53aa7709 RD |
5417 | class DateEvent(CommandEvent): |
5418 | """Proxy of C++ DateEvent class""" | |
5419 | def __repr__(self): | |
5420 | return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5421 | def __init__(self, *args, **kwargs): | |
5422 | """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent""" | |
5423 | newobj = _core_.new_DateEvent(*args, **kwargs) | |
5424 | self.this = newobj.this | |
5425 | self.thisown = 1 | |
5426 | del newobj.thisown | |
5427 | def GetDate(*args, **kwargs): | |
5428 | """GetDate(self) -> DateTime""" | |
5429 | return _core_.DateEvent_GetDate(*args, **kwargs) | |
5430 | ||
5431 | def SetDate(*args, **kwargs): | |
5432 | """SetDate(self, DateTime date)""" | |
5433 | return _core_.DateEvent_SetDate(*args, **kwargs) | |
5434 | ||
5435 | ||
5436 | class DateEventPtr(DateEvent): | |
5437 | def __init__(self, this): | |
5438 | self.this = this | |
5439 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5440 | self.__class__ = DateEvent | |
5441 | _core_.DateEvent_swigregister(DateEventPtr) | |
5442 | ||
5443 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
5444 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
5445 | ||
d55e5bfc RD |
5446 | #--------------------------------------------------------------------------- |
5447 | ||
5448 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS | |
5449 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
5450 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
5451 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
5452 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
5453 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
5454 | class PyApp(EvtHandler): | |
c24da6d6 RD |
5455 | """ |
5456 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
5457 | `wx.App` class (or some other derived class) instead. | |
5458 | """ | |
d55e5bfc RD |
5459 | def __repr__(self): |
5460 | return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5461 | def __init__(self, *args, **kwargs): | |
5462 | """ | |
5463 | __init__(self) -> PyApp | |
5464 | ||
5465 | Create a new application object, starting the bootstrap process. | |
5466 | """ | |
5467 | newobj = _core_.new_PyApp(*args, **kwargs) | |
5468 | self.this = newobj.this | |
5469 | self.thisown = 1 | |
5470 | del newobj.thisown | |
70b7a5fe RD |
5471 | self._setCallbackInfo(self, PyApp, False) |
5472 | self._setOORInfo(self, False) | |
d55e5bfc RD |
5473 | |
5474 | def __del__(self, destroy=_core_.delete_PyApp): | |
5475 | """__del__(self)""" | |
5476 | try: | |
5477 | if self.thisown: destroy(self) | |
5478 | except: pass | |
5479 | ||
5480 | def _setCallbackInfo(*args, **kwargs): | |
70b7a5fe | 5481 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
d55e5bfc RD |
5482 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
5483 | ||
5484 | def GetAppName(*args, **kwargs): | |
5485 | """ | |
5486 | GetAppName(self) -> String | |
5487 | ||
5488 | Get the application name. | |
5489 | """ | |
5490 | return _core_.PyApp_GetAppName(*args, **kwargs) | |
5491 | ||
5492 | def SetAppName(*args, **kwargs): | |
5493 | """ | |
5494 | SetAppName(self, String name) | |
5495 | ||
c24da6d6 RD |
5496 | Set the application name. This value may be used automatically by |
5497 | `wx.Config` and such. | |
d55e5bfc RD |
5498 | """ |
5499 | return _core_.PyApp_SetAppName(*args, **kwargs) | |
5500 | ||
5501 | def GetClassName(*args, **kwargs): | |
5502 | """ | |
5503 | GetClassName(self) -> String | |
5504 | ||
5505 | Get the application's class name. | |
5506 | """ | |
5507 | return _core_.PyApp_GetClassName(*args, **kwargs) | |
5508 | ||
5509 | def SetClassName(*args, **kwargs): | |
5510 | """ | |
5511 | SetClassName(self, String name) | |
5512 | ||
c24da6d6 RD |
5513 | Set the application's class name. This value may be used for |
5514 | X-resources if applicable for the platform | |
d55e5bfc RD |
5515 | """ |
5516 | return _core_.PyApp_SetClassName(*args, **kwargs) | |
5517 | ||
5518 | def GetVendorName(*args, **kwargs): | |
5519 | """ | |
5520 | GetVendorName(self) -> String | |
5521 | ||
5522 | Get the application's vendor name. | |
5523 | """ | |
5524 | return _core_.PyApp_GetVendorName(*args, **kwargs) | |
5525 | ||
5526 | def SetVendorName(*args, **kwargs): | |
5527 | """ | |
5528 | SetVendorName(self, String name) | |
5529 | ||
c24da6d6 RD |
5530 | Set the application's vendor name. This value may be used |
5531 | automatically by `wx.Config` and such. | |
d55e5bfc RD |
5532 | """ |
5533 | return _core_.PyApp_SetVendorName(*args, **kwargs) | |
5534 | ||
5535 | def GetTraits(*args, **kwargs): | |
5536 | """ | |
5537 | GetTraits(self) -> wxAppTraits | |
5538 | ||
c24da6d6 RD |
5539 | Return (and create if necessary) the app traits object to which we |
5540 | delegate for everything which either should be configurable by the | |
5541 | user (then he can change the default behaviour simply by overriding | |
5542 | CreateTraits() and returning his own traits object) or which is | |
5543 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
5544 | differences behind the common facade. | |
5545 | ||
5546 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
d55e5bfc RD |
5547 | """ |
5548 | return _core_.PyApp_GetTraits(*args, **kwargs) | |
5549 | ||
5550 | def ProcessPendingEvents(*args, **kwargs): | |
5551 | """ | |
5552 | ProcessPendingEvents(self) | |
5553 | ||
c24da6d6 RD |
5554 | Process all events in the Pending Events list -- it is necessary to |
5555 | call this function to process posted events. This normally happens | |
5556 | during each event loop iteration. | |
d55e5bfc RD |
5557 | """ |
5558 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) | |
5559 | ||
5560 | def Yield(*args, **kwargs): | |
5561 | """ | |
5562 | Yield(self, bool onlyIfNeeded=False) -> bool | |
5563 | ||
c24da6d6 RD |
5564 | Process all currently pending events right now, instead of waiting |
5565 | until return to the event loop. It is an error to call ``Yield`` | |
5566 | recursively unless the value of ``onlyIfNeeded`` is True. | |
d55e5bfc | 5567 | |
c24da6d6 | 5568 | :warning: This function is dangerous as it can lead to unexpected |
79fccf9d RD |
5569 | reentrancies (i.e. when called from an event handler it may |
5570 | result in calling the same event handler again), use with | |
5571 | extreme care or, better, don't use at all! | |
d55e5bfc | 5572 | |
c24da6d6 | 5573 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
79fccf9d | 5574 | |
d55e5bfc RD |
5575 | """ |
5576 | return _core_.PyApp_Yield(*args, **kwargs) | |
5577 | ||
5578 | def WakeUpIdle(*args, **kwargs): | |
5579 | """ | |
5580 | WakeUpIdle(self) | |
5581 | ||
c24da6d6 RD |
5582 | Make sure that idle events are sent again. |
5583 | :see: `wx.WakeUpIdle` | |
d55e5bfc RD |
5584 | """ |
5585 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) | |
5586 | ||
84f85550 RD |
5587 | def IsMainLoopRunning(*args, **kwargs): |
5588 | """ | |
5589 | IsMainLoopRunning() -> bool | |
5590 | ||
5591 | Returns True if we're running the main loop, i.e. if the events can | |
5592 | currently be dispatched. | |
5593 | """ | |
5594 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
5595 | ||
5596 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
d55e5bfc RD |
5597 | def MainLoop(*args, **kwargs): |
5598 | """ | |
5599 | MainLoop(self) -> int | |
5600 | ||
c24da6d6 RD |
5601 | Execute the main GUI loop, the function doesn't normally return until |
5602 | all top level windows have been closed and destroyed. | |
d55e5bfc RD |
5603 | """ |
5604 | return _core_.PyApp_MainLoop(*args, **kwargs) | |
5605 | ||
5606 | def Exit(*args, **kwargs): | |
5607 | """ | |
5608 | Exit(self) | |
5609 | ||
5610 | Exit the main loop thus terminating the application. | |
c24da6d6 | 5611 | :see: `wx.Exit` |
d55e5bfc RD |
5612 | """ |
5613 | return _core_.PyApp_Exit(*args, **kwargs) | |
5614 | ||
5615 | def ExitMainLoop(*args, **kwargs): | |
5616 | """ | |
5617 | ExitMainLoop(self) | |
5618 | ||
c24da6d6 RD |
5619 | Exit the main GUI loop during the next iteration of the main |
5620 | loop, (i.e. it does not stop the program immediately!) | |
d55e5bfc RD |
5621 | """ |
5622 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) | |
5623 | ||
5624 | def Pending(*args, **kwargs): | |
5625 | """ | |
5626 | Pending(self) -> bool | |
5627 | ||
5628 | Returns True if there are unprocessed events in the event queue. | |
5629 | """ | |
5630 | return _core_.PyApp_Pending(*args, **kwargs) | |
5631 | ||
5632 | def Dispatch(*args, **kwargs): | |
5633 | """ | |
5634 | Dispatch(self) -> bool | |
5635 | ||
5636 | Process the first event in the event queue (blocks until an event | |
5637 | appears if there are none currently) | |
5638 | """ | |
5639 | return _core_.PyApp_Dispatch(*args, **kwargs) | |
5640 | ||
5641 | def ProcessIdle(*args, **kwargs): | |
5642 | """ | |
5643 | ProcessIdle(self) -> bool | |
5644 | ||
c24da6d6 RD |
5645 | Called from the MainLoop when the application becomes idle (there are |
5646 | no pending events) and sends a `wx.IdleEvent` to all interested | |
5647 | parties. Returns True if more idle events are needed, False if not. | |
d55e5bfc RD |
5648 | """ |
5649 | return _core_.PyApp_ProcessIdle(*args, **kwargs) | |
5650 | ||
5651 | def SendIdleEvents(*args, **kwargs): | |
5652 | """ | |
5653 | SendIdleEvents(self, Window win, IdleEvent event) -> bool | |
5654 | ||
c24da6d6 RD |
5655 | Send idle event to window and all subwindows. Returns True if more |
5656 | idle time is requested. | |
d55e5bfc RD |
5657 | """ |
5658 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) | |
5659 | ||
5660 | def IsActive(*args, **kwargs): | |
5661 | """ | |
5662 | IsActive(self) -> bool | |
5663 | ||
5664 | Return True if our app has focus. | |
5665 | """ | |
5666 | return _core_.PyApp_IsActive(*args, **kwargs) | |
5667 | ||
5668 | def SetTopWindow(*args, **kwargs): | |
5669 | """ | |
5670 | SetTopWindow(self, Window win) | |
5671 | ||
c24da6d6 | 5672 | Set the *main* top level window |
d55e5bfc RD |
5673 | """ |
5674 | return _core_.PyApp_SetTopWindow(*args, **kwargs) | |
5675 | ||
5676 | def GetTopWindow(*args, **kwargs): | |
5677 | """ | |
5678 | GetTopWindow(self) -> Window | |
5679 | ||
c24da6d6 RD |
5680 | Return the *main* top level window (if it hadn't been set previously |
5681 | with SetTopWindow(), will return just some top level window and, if | |
5682 | there not any, will return None) | |
d55e5bfc RD |
5683 | """ |
5684 | return _core_.PyApp_GetTopWindow(*args, **kwargs) | |
5685 | ||
5686 | def SetExitOnFrameDelete(*args, **kwargs): | |
5687 | """ | |
5688 | SetExitOnFrameDelete(self, bool flag) | |
5689 | ||
c24da6d6 RD |
5690 | Control the exit behaviour: by default, the program will exit the main |
5691 | loop (and so, usually, terminate) when the last top-level program | |
5692 | window is deleted. Beware that if you disable this behaviour (with | |
5693 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
5694 | explicitly from somewhere. | |
d55e5bfc RD |
5695 | """ |
5696 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) | |
5697 | ||
5698 | def GetExitOnFrameDelete(*args, **kwargs): | |
5699 | """ | |
5700 | GetExitOnFrameDelete(self) -> bool | |
5701 | ||
5702 | Get the current exit behaviour setting. | |
5703 | """ | |
5704 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) | |
5705 | ||
5706 | def SetUseBestVisual(*args, **kwargs): | |
5707 | """ | |
5708 | SetUseBestVisual(self, bool flag) | |
5709 | ||
c24da6d6 RD |
5710 | Set whether the app should try to use the best available visual on |
5711 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
d55e5bfc RD |
5712 | """ |
5713 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) | |
5714 | ||
5715 | def GetUseBestVisual(*args, **kwargs): | |
5716 | """ | |
5717 | GetUseBestVisual(self) -> bool | |
5718 | ||
5719 | Get current UseBestVisual setting. | |
5720 | """ | |
5721 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) | |
5722 | ||
5723 | def SetPrintMode(*args, **kwargs): | |
5724 | """SetPrintMode(self, int mode)""" | |
5725 | return _core_.PyApp_SetPrintMode(*args, **kwargs) | |
5726 | ||
5727 | def GetPrintMode(*args, **kwargs): | |
5728 | """GetPrintMode(self) -> int""" | |
5729 | return _core_.PyApp_GetPrintMode(*args, **kwargs) | |
5730 | ||
5731 | def SetAssertMode(*args, **kwargs): | |
5732 | """ | |
5733 | SetAssertMode(self, int mode) | |
5734 | ||
79fccf9d | 5735 | Set the OnAssert behaviour for debug and hybrid builds. |
d55e5bfc RD |
5736 | """ |
5737 | return _core_.PyApp_SetAssertMode(*args, **kwargs) | |
5738 | ||
5739 | def GetAssertMode(*args, **kwargs): | |
5740 | """ | |
5741 | GetAssertMode(self) -> int | |
5742 | ||
5743 | Get the current OnAssert behaviour setting. | |
5744 | """ | |
5745 | return _core_.PyApp_GetAssertMode(*args, **kwargs) | |
5746 | ||
5747 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): | |
c24da6d6 | 5748 | """GetMacSupportPCMenuShortcuts() -> bool""" |
d55e5bfc RD |
5749 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
5750 | ||
5751 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
5752 | def GetMacAboutMenuItemId(*args, **kwargs): | |
c24da6d6 | 5753 | """GetMacAboutMenuItemId() -> long""" |
d55e5bfc RD |
5754 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
5755 | ||
5756 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
5757 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
c24da6d6 | 5758 | """GetMacPreferencesMenuItemId() -> long""" |
d55e5bfc RD |
5759 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
5760 | ||
5761 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
5762 | def GetMacExitMenuItemId(*args, **kwargs): | |
c24da6d6 | 5763 | """GetMacExitMenuItemId() -> long""" |
d55e5bfc RD |
5764 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
5765 | ||
5766 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
5767 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
c24da6d6 | 5768 | """GetMacHelpMenuTitleName() -> String""" |
d55e5bfc RD |
5769 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
5770 | ||
5771 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
5772 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
c24da6d6 | 5773 | """SetMacSupportPCMenuShortcuts(bool val)""" |
d55e5bfc RD |
5774 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
5775 | ||
5776 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
5777 | def SetMacAboutMenuItemId(*args, **kwargs): | |
c24da6d6 | 5778 | """SetMacAboutMenuItemId(long val)""" |
d55e5bfc RD |
5779 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
5780 | ||
5781 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
5782 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
c24da6d6 | 5783 | """SetMacPreferencesMenuItemId(long val)""" |
d55e5bfc RD |
5784 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
5785 | ||
5786 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
5787 | def SetMacExitMenuItemId(*args, **kwargs): | |
c24da6d6 | 5788 | """SetMacExitMenuItemId(long val)""" |
d55e5bfc RD |
5789 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
5790 | ||
5791 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
5792 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
c24da6d6 | 5793 | """SetMacHelpMenuTitleName(String val)""" |
d55e5bfc RD |
5794 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
5795 | ||
5796 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
5797 | def _BootstrapApp(*args, **kwargs): | |
5798 | """ | |
5799 | _BootstrapApp(self) | |
5800 | ||
5801 | For internal use only | |
5802 | """ | |
5803 | return _core_.PyApp__BootstrapApp(*args, **kwargs) | |
5804 | ||
5805 | def GetComCtl32Version(*args, **kwargs): | |
5806 | """ | |
c24da6d6 | 5807 | GetComCtl32Version() -> int |
d55e5bfc | 5808 | |
c24da6d6 RD |
5809 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
5810 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc RD |
5811 | """ |
5812 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) | |
5813 | ||
5814 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
5815 | ||
5816 | class PyAppPtr(PyApp): | |
5817 | def __init__(self, this): | |
5818 | self.this = this | |
5819 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5820 | self.__class__ = PyApp | |
5821 | _core_.PyApp_swigregister(PyAppPtr) | |
5822 | ||
84f85550 RD |
5823 | def PyApp_IsMainLoopRunning(*args, **kwargs): |
5824 | """ | |
5825 | PyApp_IsMainLoopRunning() -> bool | |
5826 | ||
5827 | Returns True if we're running the main loop, i.e. if the events can | |
5828 | currently be dispatched. | |
5829 | """ | |
5830 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
5831 | ||
d55e5bfc RD |
5832 | def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs): |
5833 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
5834 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) | |
5835 | ||
5836 | def PyApp_GetMacAboutMenuItemId(*args, **kwargs): | |
5837 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
5838 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) | |
5839 | ||
5840 | def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs): | |
5841 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
5842 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) | |
5843 | ||
5844 | def PyApp_GetMacExitMenuItemId(*args, **kwargs): | |
5845 | """PyApp_GetMacExitMenuItemId() -> long""" | |
5846 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) | |
5847 | ||
5848 | def PyApp_GetMacHelpMenuTitleName(*args, **kwargs): | |
5849 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
5850 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) | |
5851 | ||
5852 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
5853 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" | |
5854 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
5855 | ||
5856 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): | |
5857 | """PyApp_SetMacAboutMenuItemId(long val)""" | |
5858 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
5859 | ||
5860 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): | |
5861 | """PyApp_SetMacPreferencesMenuItemId(long val)""" | |
5862 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
5863 | ||
5864 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): | |
5865 | """PyApp_SetMacExitMenuItemId(long val)""" | |
5866 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
5867 | ||
5868 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): | |
5869 | """PyApp_SetMacHelpMenuTitleName(String val)""" | |
5870 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
5871 | ||
5872 | def PyApp_GetComCtl32Version(*args, **kwargs): | |
5873 | """ | |
5874 | PyApp_GetComCtl32Version() -> int | |
5875 | ||
c24da6d6 RD |
5876 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
5877 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc RD |
5878 | """ |
5879 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) | |
5880 | ||
5881 | #--------------------------------------------------------------------------- | |
5882 | ||
5883 | ||
5884 | def Exit(*args, **kwargs): | |
5885 | """ | |
5886 | Exit() | |
5887 | ||
5888 | Force an exit of the application. Convenience for wx.GetApp().Exit() | |
5889 | """ | |
5890 | return _core_.Exit(*args, **kwargs) | |
5891 | ||
5892 | def Yield(*args, **kwargs): | |
5893 | """ | |
5894 | Yield() -> bool | |
5895 | ||
5896 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() | |
5897 | """ | |
5898 | return _core_.Yield(*args, **kwargs) | |
5899 | ||
5900 | def YieldIfNeeded(*args, **kwargs): | |
5901 | """ | |
5902 | YieldIfNeeded() -> bool | |
5903 | ||
5904 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) | |
5905 | """ | |
5906 | return _core_.YieldIfNeeded(*args, **kwargs) | |
5907 | ||
5908 | def SafeYield(*args, **kwargs): | |
5909 | """ | |
5910 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool | |
5911 | ||
c24da6d6 RD |
5912 | This function is similar to `wx.Yield`, except that it disables the |
5913 | user input to all program windows before calling `wx.Yield` and | |
5914 | re-enables it again afterwards. If ``win`` is not None, this window | |
5915 | will remain enabled, allowing the implementation of some limited user | |
5916 | interaction. | |
d55e5bfc | 5917 | |
c24da6d6 | 5918 | :Returns: the result of the call to `wx.Yield`. |
d55e5bfc RD |
5919 | """ |
5920 | return _core_.SafeYield(*args, **kwargs) | |
5921 | ||
5922 | def WakeUpIdle(*args, **kwargs): | |
5923 | """ | |
5924 | WakeUpIdle() | |
5925 | ||
c24da6d6 RD |
5926 | Cause the message queue to become empty again, so idle events will be |
5927 | sent. | |
d55e5bfc RD |
5928 | """ |
5929 | return _core_.WakeUpIdle(*args, **kwargs) | |
5930 | ||
5931 | def PostEvent(*args, **kwargs): | |
5932 | """ | |
5933 | PostEvent(EvtHandler dest, Event event) | |
5934 | ||
c24da6d6 RD |
5935 | Send an event to a window or other wx.EvtHandler to be processed |
5936 | later. | |
d55e5bfc RD |
5937 | """ |
5938 | return _core_.PostEvent(*args, **kwargs) | |
5939 | ||
5940 | def App_CleanUp(*args, **kwargs): | |
5941 | """ | |
5942 | App_CleanUp() | |
5943 | ||
79fccf9d | 5944 | For internal use only, it is used to cleanup after wxWidgets when |
c24da6d6 | 5945 | Python shuts down. |
d55e5bfc RD |
5946 | """ |
5947 | return _core_.App_CleanUp(*args, **kwargs) | |
5948 | ||
5949 | def GetApp(*args, **kwargs): | |
5950 | """ | |
5951 | GetApp() -> PyApp | |
5952 | ||
5953 | Return a reference to the current wx.App object. | |
5954 | """ | |
5955 | return _core_.GetApp(*args, **kwargs) | |
5cbf236d RD |
5956 | |
5957 | def SetDefaultPyEncoding(*args, **kwargs): | |
5958 | """ | |
5959 | SetDefaultPyEncoding(string encoding) | |
5960 | ||
5961 | Sets the encoding that wxPython will use when it needs to convert a | |
5962 | Python string or unicode object to or from a wxString. | |
62d32a5f RD |
5963 | |
5964 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
5965 | but please be aware that the default encoding within the same locale | |
5966 | may be slightly different on different platforms. For example, please | |
5967 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
5968 | between the common latin/roman encodings. | |
5cbf236d RD |
5969 | """ |
5970 | return _core_.SetDefaultPyEncoding(*args, **kwargs) | |
5971 | ||
5972 | def GetDefaultPyEncoding(*args, **kwargs): | |
5973 | """ | |
5974 | GetDefaultPyEncoding() -> string | |
5975 | ||
5976 | Gets the current encoding that wxPython will use when it needs to | |
5977 | convert a Python string or unicode object to or from a wxString. | |
5978 | """ | |
5979 | return _core_.GetDefaultPyEncoding(*args, **kwargs) | |
d55e5bfc RD |
5980 | #---------------------------------------------------------------------- |
5981 | ||
5982 | class PyOnDemandOutputWindow: | |
5983 | """ | |
5984 | A class that can be used for redirecting Python's stdout and | |
5985 | stderr streams. It will do nothing until something is wrriten to | |
5986 | the stream at which point it will create a Frame with a text area | |
5987 | and write the text there. | |
5988 | """ | |
5989 | def __init__(self, title = "wxPython: stdout/stderr"): | |
5990 | self.frame = None | |
5991 | self.title = title | |
412d302d RD |
5992 | self.pos = wx.DefaultPosition |
5993 | self.size = (450, 300) | |
d55e5bfc RD |
5994 | self.parent = None |
5995 | ||
5996 | def SetParent(self, parent): | |
5997 | """Set the window to be used as the popup Frame's parent.""" | |
5998 | self.parent = parent | |
5999 | ||
6000 | ||
6001 | def CreateOutputWindow(self, st): | |
412d302d RD |
6002 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
6003 | style=wx.DEFAULT_FRAME_STYLE) | |
d55e5bfc | 6004 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 6005 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d55e5bfc | 6006 | self.text.AppendText(st) |
d55e5bfc RD |
6007 | self.frame.Show(True) |
6008 | EVT_CLOSE(self.frame, self.OnCloseWindow) | |
6009 | ||
6010 | ||
6011 | def OnCloseWindow(self, event): | |
6012 | if self.frame is not None: | |
6013 | self.frame.Destroy() | |
6014 | self.frame = None | |
6015 | self.text = None | |
6016 | ||
6017 | ||
6018 | # These methods provide the file-like output behaviour. | |
6019 | def write(self, text): | |
6020 | """ | |
6021 | Create the output window if needed and write the string to it. | |
6022 | If not called in the context of the gui thread then uses | |
6023 | CallAfter to do the work there. | |
6024 | """ | |
6025 | if self.frame is None: | |
6026 | if not wx.Thread_IsMain(): | |
6027 | wx.CallAfter(self.CreateOutputWindow, text) | |
6028 | else: | |
6029 | self.CreateOutputWindow(text) | |
6030 | else: | |
6031 | if not wx.Thread_IsMain(): | |
6032 | wx.CallAfter(self.text.AppendText, text) | |
6033 | else: | |
6034 | self.text.AppendText(text) | |
6035 | ||
6036 | ||
6037 | def close(self): | |
6038 | if self.frame is not None: | |
6039 | wx.CallAfter(self.frame.Close) | |
6040 | ||
6041 | ||
19272049 RD |
6042 | def flush(self): |
6043 | pass | |
6044 | ||
6045 | ||
d55e5bfc RD |
6046 | |
6047 | #---------------------------------------------------------------------- | |
6048 | ||
6049 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
6050 | ||
6051 | class App(wx.PyApp): | |
6052 | """ | |
c24da6d6 RD |
6053 | The ``wx.App`` class represents the application and is used to: |
6054 | ||
6055 | * bootstrap the wxPython system and initialize the underlying | |
6056 | gui toolkit | |
6057 | * set and get application-wide properties | |
6058 | * implement the windowing system main message or event loop, | |
6059 | and to dispatch events to window instances | |
6060 | * etc. | |
6061 | ||
6062 | Every application must have a ``wx.App`` instance, and all | |
6063 | creation of UI objects should be delayed until after the | |
6064 | ``wx.App`` object has been created in order to ensure that the gui | |
6065 | platform and wxWidgets have been fully initialized. | |
6066 | ||
6067 | Normally you would derive from this class and implement an | |
6068 | ``OnInit`` method that creates a frame and then calls | |
6069 | ``self.SetTopWindow(frame)``. | |
6070 | ||
6071 | :see: `wx.PySimpleApp` for a simpler app class that can be used | |
79fccf9d | 6072 | directly. |
d55e5bfc | 6073 | """ |
c24da6d6 | 6074 | |
d55e5bfc RD |
6075 | outputWindowClass = PyOnDemandOutputWindow |
6076 | ||
c24da6d6 RD |
6077 | def __init__(self, redirect=_defRedirect, filename=None, |
6078 | useBestVisual=False, clearSigInt=True): | |
6079 | """ | |
6080 | Construct a ``wx.App`` object. | |
6081 | ||
6082 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be | |
6083 | redirected? Defaults to True on Windows and Mac, False | |
6084 | otherwise. If `filename` is None then output will be | |
6085 | redirected to a window that pops up as needed. (You can | |
6086 | control what kind of window is created for the output by | |
6087 | resetting the class variable ``outputWindowClass`` to a | |
6088 | class of your choosing.) | |
6089 | ||
6090 | :param filename: The name of a file to redirect output to, if | |
6091 | redirect is True. | |
6092 | ||
6093 | :param useBestVisual: Should the app try to use the best | |
6094 | available visual provided by the system (only relevant on | |
6095 | systems that have more than one visual.) This parameter | |
6096 | must be used instead of calling `SetUseBestVisual` later | |
6097 | on because it must be set before the underlying GUI | |
6098 | toolkit is initialized. | |
6099 | ||
6100 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
6101 | app to terminate upon a Ctrl-C in the console like other | |
6102 | GUI apps will. | |
6103 | ||
6104 | :note: You should override OnInit to do applicaition | |
6105 | initialization to ensure that the system, toolkit and | |
6106 | wxWidgets are fully initialized. | |
6107 | """ | |
d55e5bfc RD |
6108 | wx.PyApp.__init__(self) |
6109 | ||
6110 | if wx.Platform == "__WXMAC__": | |
6111 | try: | |
6112 | import MacOS | |
6113 | if not MacOS.WMAvailable(): | |
6114 | print """\ | |
6115 | This program needs access to the screen. Please run with 'pythonw', | |
6116 | not 'python', and only when you are logged in on the main display of | |
6117 | your Mac.""" | |
6118 | _sys.exit(1) | |
b1f29bf7 RD |
6119 | except SystemExit: |
6120 | raise | |
d55e5bfc RD |
6121 | except: |
6122 | pass | |
6123 | ||
6124 | # This has to be done before OnInit | |
6125 | self.SetUseBestVisual(useBestVisual) | |
6126 | ||
6127 | # Set the default handler for SIGINT. This fixes a problem | |
6128 | # where if Ctrl-C is pressed in the console that started this | |
6129 | # app then it will not appear to do anything, (not even send | |
6130 | # KeyboardInterrupt???) but will later segfault on exit. By | |
6131 | # setting the default handler then the app will exit, as | |
6132 | # expected (depending on platform.) | |
c24da6d6 RD |
6133 | if clearSigInt: |
6134 | try: | |
6135 | import signal | |
6136 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
6137 | except: | |
6138 | pass | |
d55e5bfc RD |
6139 | |
6140 | # Save and redirect the stdio to a window? | |
6141 | self.stdioWin = None | |
6142 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
6143 | if redirect: | |
6144 | self.RedirectStdio(filename) | |
6145 | ||
8fb0e70a RD |
6146 | # Use Python's install prefix as the default |
6147 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
6148 | ||
d55e5bfc RD |
6149 | # This finishes the initialization of wxWindows and then calls |
6150 | # the OnInit that should be present in the derived class | |
6151 | self._BootstrapApp() | |
6152 | ||
6153 | ||
66af7a75 RD |
6154 | def __del__(self, destroy=wx.PyApp.__del__): |
6155 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
6156 | destroy(self) | |
d55e5bfc | 6157 | |
70b7a5fe RD |
6158 | def Destroy(self): |
6159 | wx.PyApp.Destroy(self) | |
6160 | self.thisown = 0 | |
d55e5bfc RD |
6161 | |
6162 | def SetTopWindow(self, frame): | |
6163 | """Set the \"main\" top level window""" | |
6164 | if self.stdioWin: | |
6165 | self.stdioWin.SetParent(frame) | |
6166 | wx.PyApp.SetTopWindow(self, frame) | |
6167 | ||
6168 | ||
6169 | def MainLoop(self): | |
6170 | """Execute the main GUI event loop""" | |
6171 | wx.PyApp.MainLoop(self) | |
6172 | self.RestoreStdio() | |
6173 | ||
6174 | ||
6175 | def RedirectStdio(self, filename=None): | |
6176 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" | |
6177 | if filename: | |
6178 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
6179 | else: | |
6180 | self.stdioWin = self.outputWindowClass() | |
6181 | _sys.stdout = _sys.stderr = self.stdioWin | |
6182 | ||
6183 | ||
6184 | def RestoreStdio(self): | |
66af7a75 RD |
6185 | try: |
6186 | _sys.stdout, _sys.stderr = self.saveStdio | |
6187 | except: | |
6188 | pass | |
d55e5bfc RD |
6189 | |
6190 | ||
412d302d RD |
6191 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
6192 | """ | |
6193 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
6194 | the stdio has been redirected. This should be called before |
6195 | any output would cause the output window to be created. | |
412d302d RD |
6196 | """ |
6197 | if self.stdioWin: | |
6198 | if title is not None: | |
6199 | self.stdioWin.title = title | |
6200 | if pos is not None: | |
6201 | self.stdioWin.pos = pos | |
6202 | if size is not None: | |
6203 | self.stdioWin.size = size | |
6204 | ||
6205 | ||
6206 | ||
d55e5bfc | 6207 | |
c24da6d6 | 6208 | # change from wx.PyApp_XX to wx.App_XX |
d55e5bfc RD |
6209 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
6210 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
6211 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
6212 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
6213 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
6214 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
6215 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
6216 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
6217 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
6218 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
6219 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
6220 | ||
6221 | #---------------------------------------------------------------------------- | |
6222 | ||
6223 | class PySimpleApp(wx.App): | |
6224 | """ | |
6225 | A simple application class. You can just create one of these and | |
6226 | then then make your top level windows later, and not have to worry | |
c24da6d6 | 6227 | about OnInit. For example:: |
d55e5bfc | 6228 | |
c24da6d6 RD |
6229 | app = wx.PySimpleApp() |
6230 | frame = wx.Frame(None, title='Hello World') | |
6231 | frame.Show() | |
6232 | app.MainLoop() | |
6233 | ||
6234 | :see: `wx.App` | |
6235 | """ | |
6236 | ||
6237 | def __init__(self, redirect=False, filename=None, | |
6238 | useBestVisual=False, clearSigInt=True): | |
6239 | """ | |
6240 | :see: `wx.App.__init__` | |
6241 | """ | |
6242 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) | |
d55e5bfc RD |
6243 | |
6244 | def OnInit(self): | |
d55e5bfc RD |
6245 | return True |
6246 | ||
6247 | ||
c24da6d6 | 6248 | |
d55e5bfc RD |
6249 | # Is anybody using this one? |
6250 | class PyWidgetTester(wx.App): | |
6251 | def __init__(self, size = (250, 100)): | |
6252 | self.size = size | |
6253 | wx.App.__init__(self, 0) | |
6254 | ||
6255 | def OnInit(self): | |
6256 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) | |
6257 | self.SetTopWindow(self.frame) | |
6258 | return True | |
6259 | ||
c24da6d6 RD |
6260 | def SetWidget(self, widgetClass, *args, **kwargs): |
6261 | w = widgetClass(self.frame, *args, **kwargs) | |
d55e5bfc RD |
6262 | self.frame.Show(True) |
6263 | ||
6264 | #---------------------------------------------------------------------------- | |
6265 | # DO NOT hold any other references to this object. This is how we | |
c24da6d6 | 6266 | # know when to cleanup system resources that wxWidgets is holding. When |
d55e5bfc | 6267 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
c24da6d6 | 6268 | # goes to zero and it calls the wx.App_CleanUp function. |
d55e5bfc RD |
6269 | |
6270 | class __wxPyCleanup: | |
6271 | def __init__(self): | |
6272 | self.cleanup = _core_.App_CleanUp | |
6273 | def __del__(self): | |
6274 | self.cleanup() | |
6275 | ||
6276 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
6277 | ||
6278 | ## # another possible solution, but it gets called too early... | |
c24da6d6 RD |
6279 | ## import atexit |
6280 | ## atexit.register(_core_.wxApp_CleanUp) | |
d55e5bfc RD |
6281 | |
6282 | ||
6283 | #---------------------------------------------------------------------------- | |
6284 | ||
6285 | #--------------------------------------------------------------------------- | |
6286 | ||
ae8162c8 | 6287 | class EventLoop(object): |
093d3ff1 | 6288 | """Proxy of C++ EventLoop class""" |
ae8162c8 RD |
6289 | def __repr__(self): |
6290 | return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6291 | def __init__(self, *args, **kwargs): | |
6292 | """__init__(self) -> EventLoop""" | |
6293 | newobj = _core_.new_EventLoop(*args, **kwargs) | |
6294 | self.this = newobj.this | |
6295 | self.thisown = 1 | |
6296 | del newobj.thisown | |
6297 | def __del__(self, destroy=_core_.delete_EventLoop): | |
6298 | """__del__(self)""" | |
6299 | try: | |
6300 | if self.thisown: destroy(self) | |
6301 | except: pass | |
6302 | ||
6303 | def Run(*args, **kwargs): | |
6304 | """Run(self) -> int""" | |
6305 | return _core_.EventLoop_Run(*args, **kwargs) | |
6306 | ||
6307 | def Exit(*args, **kwargs): | |
6308 | """Exit(self, int rc=0)""" | |
6309 | return _core_.EventLoop_Exit(*args, **kwargs) | |
6310 | ||
6311 | def Pending(*args, **kwargs): | |
6312 | """Pending(self) -> bool""" | |
6313 | return _core_.EventLoop_Pending(*args, **kwargs) | |
6314 | ||
6315 | def Dispatch(*args, **kwargs): | |
6316 | """Dispatch(self) -> bool""" | |
6317 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
6318 | ||
6319 | def IsRunning(*args, **kwargs): | |
6320 | """IsRunning(self) -> bool""" | |
6321 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
6322 | ||
6323 | def GetActive(*args, **kwargs): | |
6324 | """GetActive() -> EventLoop""" | |
6325 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
6326 | ||
6327 | GetActive = staticmethod(GetActive) | |
6328 | def SetActive(*args, **kwargs): | |
6329 | """SetActive(EventLoop loop)""" | |
6330 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
6331 | ||
6332 | SetActive = staticmethod(SetActive) | |
6333 | ||
6334 | class EventLoopPtr(EventLoop): | |
6335 | def __init__(self, this): | |
6336 | self.this = this | |
6337 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6338 | self.__class__ = EventLoop | |
6339 | _core_.EventLoop_swigregister(EventLoopPtr) | |
6340 | ||
6341 | def EventLoop_GetActive(*args, **kwargs): | |
6342 | """EventLoop_GetActive() -> EventLoop""" | |
6343 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
6344 | ||
6345 | def EventLoop_SetActive(*args, **kwargs): | |
6346 | """EventLoop_SetActive(EventLoop loop)""" | |
6347 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
6348 | ||
6349 | #--------------------------------------------------------------------------- | |
6350 | ||
d55e5bfc | 6351 | class AcceleratorEntry(object): |
c24da6d6 RD |
6352 | """ |
6353 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
6354 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
6355 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
79fccf9d | 6356 | as well. See `__init__` for of the tuple values. |
c24da6d6 RD |
6357 | |
6358 | :see: `wx.AcceleratorTable` | |
6359 | """ | |
d55e5bfc RD |
6360 | def __repr__(self): |
6361 | return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6362 | def __init__(self, *args, **kwargs): | |
c24da6d6 RD |
6363 | """ |
6364 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
6365 | ||
6366 | Construct a wx.AcceleratorEntry. | |
c24da6d6 | 6367 | """ |
d55e5bfc RD |
6368 | newobj = _core_.new_AcceleratorEntry(*args, **kwargs) |
6369 | self.this = newobj.this | |
6370 | self.thisown = 1 | |
6371 | del newobj.thisown | |
6372 | def __del__(self, destroy=_core_.delete_AcceleratorEntry): | |
6373 | """__del__(self)""" | |
6374 | try: | |
6375 | if self.thisown: destroy(self) | |
6376 | except: pass | |
6377 | ||
6378 | def Set(*args, **kwargs): | |
c24da6d6 RD |
6379 | """ |
6380 | Set(self, int flags, int keyCode, int cmd) | |
d55e5bfc | 6381 | |
c24da6d6 RD |
6382 | (Re)set the attributes of a wx.AcceleratorEntry. |
6383 | :see `__init__` | |
6384 | """ | |
6385 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
d55e5bfc RD |
6386 | |
6387 | def GetFlags(*args, **kwargs): | |
c24da6d6 RD |
6388 | """ |
6389 | GetFlags(self) -> int | |
6390 | ||
6391 | Get the AcceleratorEntry's flags. | |
6392 | """ | |
d55e5bfc RD |
6393 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
6394 | ||
6395 | def GetKeyCode(*args, **kwargs): | |
c24da6d6 RD |
6396 | """ |
6397 | GetKeyCode(self) -> int | |
6398 | ||
6399 | Get the AcceleratorEntry's keycode. | |
6400 | """ | |
d55e5bfc RD |
6401 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
6402 | ||
6403 | def GetCommand(*args, **kwargs): | |
c24da6d6 RD |
6404 | """ |
6405 | GetCommand(self) -> int | |
6406 | ||
6407 | Get the AcceleratorEntry's command ID. | |
6408 | """ | |
d55e5bfc RD |
6409 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
6410 | ||
6411 | ||
6412 | class AcceleratorEntryPtr(AcceleratorEntry): | |
6413 | def __init__(self, this): | |
6414 | self.this = this | |
6415 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6416 | self.__class__ = AcceleratorEntry | |
6417 | _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr) | |
6418 | ||
6419 | class AcceleratorTable(Object): | |
c24da6d6 RD |
6420 | """ |
6421 | An accelerator table allows the application to specify a table of | |
6422 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
6423 | button commands are supported; on GTK, only menu commands are | |
6424 | supported. | |
c24da6d6 | 6425 | """ |
d55e5bfc RD |
6426 | def __repr__(self): |
6427 | return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6428 | def __init__(self, *args, **kwargs): | |
6429 | """ | |
6430 | __init__(entries) -> AcceleratorTable | |
6431 | ||
c24da6d6 RD |
6432 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
6433 | items or or of 3-tuples (flags, keyCode, cmdID) | |
6434 | ||
6435 | :see: `wx.AcceleratorEntry` | |
d55e5bfc RD |
6436 | """ |
6437 | newobj = _core_.new_AcceleratorTable(*args, **kwargs) | |
6438 | self.this = newobj.this | |
6439 | self.thisown = 1 | |
6440 | del newobj.thisown | |
6441 | def __del__(self, destroy=_core_.delete_AcceleratorTable): | |
6442 | """__del__(self)""" | |
6443 | try: | |
6444 | if self.thisown: destroy(self) | |
6445 | except: pass | |
6446 | ||
6447 | def Ok(*args, **kwargs): | |
6448 | """Ok(self) -> bool""" | |
6449 | return _core_.AcceleratorTable_Ok(*args, **kwargs) | |
6450 | ||
6451 | ||
6452 | class AcceleratorTablePtr(AcceleratorTable): | |
6453 | def __init__(self, this): | |
6454 | self.this = this | |
6455 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6456 | self.__class__ = AcceleratorTable | |
6457 | _core_.AcceleratorTable_swigregister(AcceleratorTablePtr) | |
6458 | ||
6459 | ||
6460 | def GetAccelFromString(*args, **kwargs): | |
6461 | """GetAccelFromString(String label) -> AcceleratorEntry""" | |
6462 | return _core_.GetAccelFromString(*args, **kwargs) | |
6463 | #--------------------------------------------------------------------------- | |
6464 | ||
6465 | class VisualAttributes(object): | |
6466 | """struct containing all the visual attributes of a control""" | |
6467 | def __repr__(self): | |
6468 | return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6469 | def __init__(self, *args, **kwargs): | |
6470 | """ | |
6471 | __init__(self) -> VisualAttributes | |
6472 | ||
6473 | struct containing all the visual attributes of a control | |
6474 | """ | |
6475 | newobj = _core_.new_VisualAttributes(*args, **kwargs) | |
6476 | self.this = newobj.this | |
6477 | self.thisown = 1 | |
6478 | del newobj.thisown | |
6479 | def __del__(self, destroy=_core_.delete_VisualAttributes): | |
6480 | """__del__(self)""" | |
6481 | try: | |
6482 | if self.thisown: destroy(self) | |
6483 | except: pass | |
6484 | ||
6485 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) | |
6486 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
6487 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
6488 | ||
6489 | class VisualAttributesPtr(VisualAttributes): | |
6490 | def __init__(self, this): | |
6491 | self.this = this | |
6492 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6493 | self.__class__ = VisualAttributes | |
6494 | _core_.VisualAttributes_swigregister(VisualAttributesPtr) | |
6495 | NullAcceleratorTable = cvar.NullAcceleratorTable | |
6496 | PanelNameStr = cvar.PanelNameStr | |
6497 | ||
6498 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL | |
6499 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
6500 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
6501 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
6502 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
6503 | class Window(EvtHandler): | |
6504 | """ | |
6505 | wx.Window is the base class for all windows and represents any visible | |
6506 | object on the screen. All controls, top level windows and so on are | |
6507 | wx.Windows. Sizers and device contexts are not however, as they don't | |
6508 | appear on screen themselves. | |
6509 | ||
6510 | """ | |
6511 | def __repr__(self): | |
6512 | return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6513 | def __init__(self, *args, **kwargs): | |
6514 | """ | |
6515 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, | |
6516 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window | |
6517 | ||
6518 | Construct and show a generic Window. | |
6519 | """ | |
6520 | newobj = _core_.new_Window(*args, **kwargs) | |
6521 | self.this = newobj.this | |
6522 | self.thisown = 1 | |
6523 | del newobj.thisown | |
6524 | self._setOORInfo(self) | |
6525 | ||
6526 | def Create(*args, **kwargs): | |
6527 | """ | |
6528 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, | |
6529 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool | |
6530 | ||
6531 | Create the GUI part of the Window for 2-phase creation mode. | |
6532 | """ | |
6533 | return _core_.Window_Create(*args, **kwargs) | |
6534 | ||
6535 | def Close(*args, **kwargs): | |
6536 | """ | |
6537 | Close(self, bool force=False) -> bool | |
6538 | ||
6539 | This function simply generates a EVT_CLOSE event whose handler usually | |
6540 | tries to close the window. It doesn't close the window itself, | |
6541 | however. If force is False (the default) then the window's close | |
6542 | handler will be allowed to veto the destruction of the window. | |
d55e5bfc RD |
6543 | """ |
6544 | return _core_.Window_Close(*args, **kwargs) | |
6545 | ||
6546 | def Destroy(*args, **kwargs): | |
6547 | """ | |
6548 | Destroy(self) -> bool | |
6549 | ||
6550 | Destroys the window safely. Frames and dialogs are not destroyed | |
6551 | immediately when this function is called -- they are added to a list | |
6552 | of windows to be deleted on idle time, when all the window's events | |
6553 | have been processed. This prevents problems with events being sent to | |
6554 | non-existent windows. | |
6555 | ||
6556 | Returns True if the window has either been successfully deleted, or it | |
6557 | has been added to the list of windows pending real deletion. | |
6558 | """ | |
6559 | return _core_.Window_Destroy(*args, **kwargs) | |
6560 | ||
6561 | def DestroyChildren(*args, **kwargs): | |
6562 | """ | |
6563 | DestroyChildren(self) -> bool | |
6564 | ||
79fccf9d RD |
6565 | Destroys all children of a window. Called automatically by the |
6566 | destructor. | |
d55e5bfc RD |
6567 | """ |
6568 | return _core_.Window_DestroyChildren(*args, **kwargs) | |
6569 | ||
6570 | def IsBeingDeleted(*args, **kwargs): | |
6571 | """ | |
6572 | IsBeingDeleted(self) -> bool | |
6573 | ||
6574 | Is the window in the process of being deleted? | |
6575 | """ | |
6576 | return _core_.Window_IsBeingDeleted(*args, **kwargs) | |
6577 | ||
6578 | def SetTitle(*args, **kwargs): | |
6579 | """ | |
6580 | SetTitle(self, String title) | |
6581 | ||
6582 | Sets the window's title. Applicable only to frames and dialogs. | |
6583 | """ | |
6584 | return _core_.Window_SetTitle(*args, **kwargs) | |
6585 | ||
6586 | def GetTitle(*args, **kwargs): | |
6587 | """ | |
6588 | GetTitle(self) -> String | |
6589 | ||
6590 | Gets the window's title. Applicable only to frames and dialogs. | |
6591 | """ | |
6592 | return _core_.Window_GetTitle(*args, **kwargs) | |
6593 | ||
6594 | def SetLabel(*args, **kwargs): | |
6595 | """ | |
6596 | SetLabel(self, String label) | |
6597 | ||
6598 | Set the text which the window shows in its label if applicable. | |
6599 | """ | |
6600 | return _core_.Window_SetLabel(*args, **kwargs) | |
6601 | ||
6602 | def GetLabel(*args, **kwargs): | |
6603 | """ | |
6604 | GetLabel(self) -> String | |
6605 | ||
79fccf9d RD |
6606 | Generic way of getting a label from any window, for identification |
6607 | purposes. The interpretation of this function differs from class to | |
6608 | class. For frames and dialogs, the value returned is the title. For | |
6609 | buttons or static text controls, it is the button text. This function | |
6610 | can be useful for meta-programs such as testing tools or special-needs | |
6611 | access programs)which need to identify windows by name. | |
d55e5bfc RD |
6612 | """ |
6613 | return _core_.Window_GetLabel(*args, **kwargs) | |
6614 | ||
6615 | def SetName(*args, **kwargs): | |
6616 | """ | |
6617 | SetName(self, String name) | |
6618 | ||
79fccf9d RD |
6619 | Sets the window's name. The window name is used for ressource setting |
6620 | in X, it is not the same as the window title/label | |
d55e5bfc RD |
6621 | """ |
6622 | return _core_.Window_SetName(*args, **kwargs) | |
6623 | ||
6624 | def GetName(*args, **kwargs): | |
6625 | """ | |
6626 | GetName(self) -> String | |
6627 | ||
79fccf9d RD |
6628 | Returns the windows name. This name is not guaranteed to be unique; |
6629 | it is up to the programmer to supply an appropriate name in the window | |
6630 | constructor or via wx.Window.SetName. | |
d55e5bfc RD |
6631 | """ |
6632 | return _core_.Window_GetName(*args, **kwargs) | |
6633 | ||
6634 | def SetWindowVariant(*args, **kwargs): | |
6635 | """ | |
6636 | SetWindowVariant(self, int variant) | |
6637 | ||
79fccf9d RD |
6638 | Sets the variant of the window/font size to use for this window, if |
6639 | the platform supports variants, for example, wxMac. | |
d55e5bfc RD |
6640 | """ |
6641 | return _core_.Window_SetWindowVariant(*args, **kwargs) | |
6642 | ||
6643 | def GetWindowVariant(*args, **kwargs): | |
6644 | """GetWindowVariant(self) -> int""" | |
6645 | return _core_.Window_GetWindowVariant(*args, **kwargs) | |
6646 | ||
6647 | def SetId(*args, **kwargs): | |
6648 | """ | |
6649 | SetId(self, int winid) | |
6650 | ||
6651 | Sets the identifier of the window. Each window has an integer | |
6652 | identifier. If the application has not provided one, an identifier | |
6653 | will be generated. Normally, the identifier should be provided on | |
6654 | creation and should not be modified subsequently. | |
6655 | """ | |
6656 | return _core_.Window_SetId(*args, **kwargs) | |
6657 | ||
6658 | def GetId(*args, **kwargs): | |
6659 | """ | |
6660 | GetId(self) -> int | |
6661 | ||
6662 | Returns the identifier of the window. Each window has an integer | |
6663 | identifier. If the application has not provided one (or the default Id | |
6664 | -1 is used) then an unique identifier with a negative value will be | |
6665 | generated. | |
6666 | """ | |
6667 | return _core_.Window_GetId(*args, **kwargs) | |
6668 | ||
6669 | def NewControlId(*args, **kwargs): | |
6670 | """ | |
c24da6d6 | 6671 | NewControlId() -> int |
d55e5bfc RD |
6672 | |
6673 | Generate a control id for the controls which were not given one. | |
6674 | """ | |
6675 | return _core_.Window_NewControlId(*args, **kwargs) | |
6676 | ||
6677 | NewControlId = staticmethod(NewControlId) | |
6678 | def NextControlId(*args, **kwargs): | |
6679 | """ | |
c24da6d6 | 6680 | NextControlId(int winid) -> int |
d55e5bfc RD |
6681 | |
6682 | Get the id of the control following the one with the given | |
79fccf9d | 6683 | autogenerated) id |
d55e5bfc RD |
6684 | """ |
6685 | return _core_.Window_NextControlId(*args, **kwargs) | |
6686 | ||
6687 | NextControlId = staticmethod(NextControlId) | |
6688 | def PrevControlId(*args, **kwargs): | |
6689 | """ | |
c24da6d6 | 6690 | PrevControlId(int winid) -> int |
d55e5bfc RD |
6691 | |
6692 | Get the id of the control preceding the one with the given | |
79fccf9d | 6693 | autogenerated) id |
d55e5bfc RD |
6694 | """ |
6695 | return _core_.Window_PrevControlId(*args, **kwargs) | |
6696 | ||
6697 | PrevControlId = staticmethod(PrevControlId) | |
6698 | def SetSize(*args, **kwargs): | |
6699 | """ | |
6700 | SetSize(self, Size size) | |
6701 | ||
6702 | Sets the size of the window in pixels. | |
6703 | """ | |
6704 | return _core_.Window_SetSize(*args, **kwargs) | |
6705 | ||
6706 | def SetDimensions(*args, **kwargs): | |
6707 | """ | |
6708 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) | |
6709 | ||
6710 | Sets the position and size of the window in pixels. The sizeFlags | |
6711 | parameter indicates the interpretation of the other params if they are | |
62d32a5f RD |
6712 | equal to -1. |
6713 | ||
6714 | ======================== ====================================== | |
6715 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
6716 | default should be used. | |
6717 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
6718 | -1 values are supplied. | |
6719 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
6720 | interpreted as real dimensions, not | |
6721 | default values. | |
6722 | ======================== ====================================== | |
6723 | ||
d55e5bfc RD |
6724 | """ |
6725 | return _core_.Window_SetDimensions(*args, **kwargs) | |
6726 | ||
6727 | def SetRect(*args, **kwargs): | |
6728 | """ | |
6729 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) | |
6730 | ||
6731 | Sets the position and size of the window in pixels using a wx.Rect. | |
6732 | """ | |
6733 | return _core_.Window_SetRect(*args, **kwargs) | |
6734 | ||
6735 | def SetSizeWH(*args, **kwargs): | |
6736 | """ | |
6737 | SetSizeWH(self, int width, int height) | |
6738 | ||
6739 | Sets the size of the window in pixels. | |
6740 | """ | |
6741 | return _core_.Window_SetSizeWH(*args, **kwargs) | |
6742 | ||
6743 | def Move(*args, **kwargs): | |
6744 | """ | |
6745 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) | |
6746 | ||
6747 | Moves the window to the given position. | |
6748 | """ | |
6749 | return _core_.Window_Move(*args, **kwargs) | |
6750 | ||
6751 | SetPosition = Move | |
6752 | def MoveXY(*args, **kwargs): | |
6753 | """ | |
6754 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) | |
6755 | ||
6756 | Moves the window to the given position. | |
6757 | """ | |
6758 | return _core_.Window_MoveXY(*args, **kwargs) | |
6759 | ||
f8167d6e RD |
6760 | def SetBestFittingSize(*args, **kwargs): |
6761 | """ | |
6762 | SetBestFittingSize(self, Size size=DefaultSize) | |
6763 | ||
6764 | A 'Smart' SetSize that will fill in default size components with the | |
6765 | window's *best size* values. Also set's the minsize for use with sizers. | |
6766 | """ | |
6767 | return _core_.Window_SetBestFittingSize(*args, **kwargs) | |
6768 | ||
d55e5bfc RD |
6769 | def Raise(*args, **kwargs): |
6770 | """ | |
6771 | Raise(self) | |
6772 | ||
6773 | Raises the window to the top of the window hierarchy if it is a | |
6774 | managed window (dialog or frame). | |
6775 | """ | |
6776 | return _core_.Window_Raise(*args, **kwargs) | |
6777 | ||
6778 | def Lower(*args, **kwargs): | |
6779 | """ | |
6780 | Lower(self) | |
6781 | ||
6782 | Lowers the window to the bottom of the window hierarchy if it is a | |
6783 | managed window (dialog or frame). | |
6784 | """ | |
6785 | return _core_.Window_Lower(*args, **kwargs) | |
6786 | ||
6787 | def SetClientSize(*args, **kwargs): | |
6788 | """ | |
6789 | SetClientSize(self, Size size) | |
6790 | ||
6791 | This sets the size of the window client area in pixels. Using this | |
6792 | function to size a window tends to be more device-independent than | |
6793 | wx.Window.SetSize, since the application need not worry about what | |
6794 | dimensions the border or title bar have when trying to fit the window | |
6795 | around panel items, for example. | |
6796 | """ | |
6797 | return _core_.Window_SetClientSize(*args, **kwargs) | |
6798 | ||
6799 | def SetClientSizeWH(*args, **kwargs): | |
6800 | """ | |
6801 | SetClientSizeWH(self, int width, int height) | |
6802 | ||
6803 | This sets the size of the window client area in pixels. Using this | |
6804 | function to size a window tends to be more device-independent than | |
6805 | wx.Window.SetSize, since the application need not worry about what | |
6806 | dimensions the border or title bar have when trying to fit the window | |
6807 | around panel items, for example. | |
6808 | """ | |
6809 | return _core_.Window_SetClientSizeWH(*args, **kwargs) | |
6810 | ||
6811 | def SetClientRect(*args, **kwargs): | |
6812 | """ | |
6813 | SetClientRect(self, Rect rect) | |
6814 | ||
6815 | This sets the size of the window client area in pixels. Using this | |
6816 | function to size a window tends to be more device-independent than | |
6817 | wx.Window.SetSize, since the application need not worry about what | |
6818 | dimensions the border or title bar have when trying to fit the window | |
6819 | around panel items, for example. | |
6820 | """ | |
6821 | return _core_.Window_SetClientRect(*args, **kwargs) | |
6822 | ||
6823 | def GetPosition(*args, **kwargs): | |
6824 | """ | |
6825 | GetPosition(self) -> Point | |
6826 | ||
6827 | Get the window's position. | |
6828 | """ | |
6829 | return _core_.Window_GetPosition(*args, **kwargs) | |
6830 | ||
6831 | def GetPositionTuple(*args, **kwargs): | |
6832 | """ | |
6833 | GetPositionTuple() -> (x,y) | |
6834 | ||
6835 | Get the window's position. | |
6836 | """ | |
6837 | return _core_.Window_GetPositionTuple(*args, **kwargs) | |
6838 | ||
6839 | def GetSize(*args, **kwargs): | |
6840 | """ | |
6841 | GetSize(self) -> Size | |
6842 | ||
6843 | Get the window size. | |
6844 | """ | |
6845 | return _core_.Window_GetSize(*args, **kwargs) | |
6846 | ||
6847 | def GetSizeTuple(*args, **kwargs): | |
6848 | """ | |
6849 | GetSizeTuple() -> (width, height) | |
6850 | ||
6851 | Get the window size. | |
6852 | """ | |
6853 | return _core_.Window_GetSizeTuple(*args, **kwargs) | |
6854 | ||
6855 | def GetRect(*args, **kwargs): | |
6856 | """ | |
6857 | GetRect(self) -> Rect | |
6858 | ||
6859 | Returns the size and position of the window as a wx.Rect object. | |
6860 | """ | |
6861 | return _core_.Window_GetRect(*args, **kwargs) | |
6862 | ||
6863 | def GetClientSize(*args, **kwargs): | |
6864 | """ | |
6865 | GetClientSize(self) -> Size | |
6866 | ||
6867 | This gets the size of the window's 'client area' in pixels. The client | |
6868 | area is the area which may be drawn on by the programmer, excluding | |
6869 | title bar, border, scrollbars, etc. | |
6870 | """ | |
6871 | return _core_.Window_GetClientSize(*args, **kwargs) | |
6872 | ||
6873 | def GetClientSizeTuple(*args, **kwargs): | |
6874 | """ | |
6875 | GetClientSizeTuple() -> (width, height) | |
6876 | ||
6877 | This gets the size of the window's 'client area' in pixels. The client | |
6878 | area is the area which may be drawn on by the programmer, excluding | |
6879 | title bar, border, scrollbars, etc. | |
6880 | """ | |
6881 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) | |
6882 | ||
6883 | def GetClientAreaOrigin(*args, **kwargs): | |
6884 | """ | |
6885 | GetClientAreaOrigin(self) -> Point | |
6886 | ||
6887 | Get the origin of the client area of the window relative to the | |
6888 | window's top left corner (the client area may be shifted because of | |
6889 | the borders, scrollbars, other decorations...) | |
6890 | """ | |
6891 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) | |
6892 | ||
6893 | def GetClientRect(*args, **kwargs): | |
6894 | """ | |
6895 | GetClientRect(self) -> Rect | |
6896 | ||
629f3c1b | 6897 | Get the client area position and size as a `wx.Rect` object. |
d55e5bfc RD |
6898 | """ |
6899 | return _core_.Window_GetClientRect(*args, **kwargs) | |
6900 | ||
6901 | def GetBestSize(*args, **kwargs): | |
6902 | """ | |
6903 | GetBestSize(self) -> Size | |
6904 | ||
248ed943 | 6905 | This function returns the best acceptable minimal size for the |
79fccf9d RD |
6906 | window, if applicable. For example, for a static text control, it will |
6907 | be the minimal size such that the control label is not truncated. For | |
6908 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
6909 | this function will be the same as the size the window would have had | |
6910 | after calling Fit. | |
d55e5bfc RD |
6911 | """ |
6912 | return _core_.Window_GetBestSize(*args, **kwargs) | |
6913 | ||
6914 | def GetBestSizeTuple(*args, **kwargs): | |
6915 | """ | |
6916 | GetBestSizeTuple() -> (width, height) | |
6917 | ||
248ed943 | 6918 | This function returns the best acceptable minimal size for the |
79fccf9d RD |
6919 | window, if applicable. For example, for a static text control, it will |
6920 | be the minimal size such that the control label is not truncated. For | |
6921 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
6922 | this function will be the same as the size the window would have had | |
6923 | after calling Fit. | |
d55e5bfc RD |
6924 | """ |
6925 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) | |
6926 | ||
a001823c RD |
6927 | def InvalidateBestSize(*args, **kwargs): |
6928 | """ | |
6929 | InvalidateBestSize(self) | |
6930 | ||
6931 | Reset the cached best size value so it will be recalculated the next | |
6932 | time it is needed. | |
6933 | """ | |
6934 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
6935 | ||
6936 | def GetBestFittingSize(*args, **kwargs): | |
6937 | """ | |
6938 | GetBestFittingSize(self) -> Size | |
6939 | ||
6940 | This function will merge the window's best size into the window's | |
6941 | minimum size, giving priority to the min size components, and returns | |
6942 | the results. | |
6943 | ||
6944 | """ | |
6945 | return _core_.Window_GetBestFittingSize(*args, **kwargs) | |
6946 | ||
d55e5bfc RD |
6947 | def GetAdjustedBestSize(*args, **kwargs): |
6948 | """ | |
6949 | GetAdjustedBestSize(self) -> Size | |
6950 | ||
6951 | This method is similar to GetBestSize, except in one | |
6952 | thing. GetBestSize should return the minimum untruncated size of the | |
6953 | window, while this method will return the largest of BestSize and any | |
6954 | user specified minimum size. ie. it is the minimum size the window | |
6955 | should currently be drawn at, not the minimal size it can possibly | |
6956 | tolerate. | |
6957 | """ | |
6958 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) | |
6959 | ||
6960 | def Center(*args, **kwargs): | |
6961 | """ | |
6962 | Center(self, int direction=BOTH) | |
6963 | ||
6964 | Centers the window. The parameter specifies the direction for | |
6965 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
6966 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
6967 | on the entire screen and not on its parent window. If it is a | |
6968 | top-level window and has no parent then it will always be centered | |
6969 | relative to the screen. | |
6970 | """ | |
6971 | return _core_.Window_Center(*args, **kwargs) | |
6972 | ||
6973 | Centre = Center | |
6974 | def CenterOnScreen(*args, **kwargs): | |
6975 | """ | |
6976 | CenterOnScreen(self, int dir=BOTH) | |
6977 | ||
6978 | Center on screen (only works for top level windows) | |
6979 | """ | |
6980 | return _core_.Window_CenterOnScreen(*args, **kwargs) | |
6981 | ||
6982 | CentreOnScreen = CenterOnScreen | |
6983 | def CenterOnParent(*args, **kwargs): | |
6984 | """ | |
6985 | CenterOnParent(self, int dir=BOTH) | |
6986 | ||
6987 | Center with respect to the the parent window | |
6988 | """ | |
6989 | return _core_.Window_CenterOnParent(*args, **kwargs) | |
6990 | ||
6991 | CentreOnParent = CenterOnParent | |
6992 | def Fit(*args, **kwargs): | |
6993 | """ | |
6994 | Fit(self) | |
6995 | ||
6996 | Sizes the window so that it fits around its subwindows. This function | |
6997 | won't do anything if there are no subwindows and will only really work | |
6998 | correctly if sizers are used for the subwindows layout. Also, if the | |
6999 | window has exactly one subwindow it is better (faster and the result | |
7000 | is more precise as Fit adds some margin to account for fuzziness of | |
7001 | its calculations) to call window.SetClientSize(child.GetSize()) | |
7002 | instead of calling Fit. | |
7003 | """ | |
7004 | return _core_.Window_Fit(*args, **kwargs) | |
7005 | ||
7006 | def FitInside(*args, **kwargs): | |
7007 | """ | |
7008 | FitInside(self) | |
7009 | ||
7010 | Similar to Fit, but sizes the interior (virtual) size of a | |
7011 | window. Mainly useful with scrolled windows to reset scrollbars after | |
7012 | sizing changes that do not trigger a size event, and/or scrolled | |
7013 | windows without an interior sizer. This function similarly won't do | |
7014 | anything if there are no subwindows. | |
7015 | """ | |
7016 | return _core_.Window_FitInside(*args, **kwargs) | |
7017 | ||
03837c5c | 7018 | def SetSizeHints(*args, **kwargs): |
d55e5bfc RD |
7019 | """ |
7020 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, | |
7021 | int incH=-1) | |
d55e5bfc RD |
7022 | |
7023 | Allows specification of minimum and maximum window sizes, and window | |
7024 | size increments. If a pair of values is not set (or set to -1), the | |
7025 | default values will be used. If this function is called, the user | |
908b74cd RD |
7026 | will not be able to size the window outside the given bounds (if it is |
7027 | a top-level window.) Sizers will also inspect the minimum window size | |
7028 | and will use that value if set when calculating layout. | |
7029 | ||
7030 | The resizing increments are only significant under Motif or Xt. | |
d55e5bfc | 7031 | """ |
03837c5c | 7032 | return _core_.Window_SetSizeHints(*args, **kwargs) |
d55e5bfc | 7033 | |
03837c5c RD |
7034 | def SetSizeHintsSz(*args, **kwargs): |
7035 | """ | |
7036 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
7037 | ||
7038 | Allows specification of minimum and maximum window sizes, and window | |
7039 | size increments. If a pair of values is not set (or set to -1), the | |
7040 | default values will be used. If this function is called, the user | |
7041 | will not be able to size the window outside the given bounds (if it is | |
7042 | a top-level window.) Sizers will also inspect the minimum window size | |
7043 | and will use that value if set when calculating layout. | |
7044 | ||
7045 | The resizing increments are only significant under Motif or Xt. | |
7046 | """ | |
7047 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
7048 | ||
7049 | def SetVirtualSizeHints(*args, **kwargs): | |
d55e5bfc | 7050 | """ |
908b74cd | 7051 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
d55e5bfc RD |
7052 | |
7053 | Allows specification of minimum and maximum virtual window sizes. If a | |
7054 | pair of values is not set (or set to -1), the default values will be | |
7055 | used. If this function is called, the user will not be able to size | |
7056 | the virtual area of the window outside the given bounds. | |
7057 | """ | |
03837c5c RD |
7058 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
7059 | ||
7060 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
7061 | """ | |
7062 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
7063 | ||
7064 | Allows specification of minimum and maximum virtual window sizes. If a | |
7065 | pair of values is not set (or set to -1), the default values will be | |
7066 | used. If this function is called, the user will not be able to size | |
7067 | the virtual area of the window outside the given bounds. | |
7068 | """ | |
7069 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
d55e5bfc | 7070 | |
908b74cd RD |
7071 | def GetMaxSize(*args, **kwargs): |
7072 | """GetMaxSize(self) -> Size""" | |
7073 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
7074 | ||
7075 | def GetMinSize(*args, **kwargs): | |
7076 | """GetMinSize(self) -> Size""" | |
7077 | return _core_.Window_GetMinSize(*args, **kwargs) | |
7078 | ||
7079 | def SetMinSize(*args, **kwargs): | |
7080 | """ | |
7081 | SetMinSize(self, Size minSize) | |
7082 | ||
7083 | A more convenient method than `SetSizeHints` for setting just the | |
7084 | min size. | |
7085 | """ | |
7086 | return _core_.Window_SetMinSize(*args, **kwargs) | |
7087 | ||
7088 | def SetMaxSize(*args, **kwargs): | |
7089 | """ | |
7090 | SetMaxSize(self, Size maxSize) | |
7091 | ||
7092 | A more convenient method than `SetSizeHints` for setting just the | |
7093 | max size. | |
7094 | """ | |
7095 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
7096 | ||
d55e5bfc RD |
7097 | def GetMinWidth(*args, **kwargs): |
7098 | """GetMinWidth(self) -> int""" | |
7099 | return _core_.Window_GetMinWidth(*args, **kwargs) | |
7100 | ||
7101 | def GetMinHeight(*args, **kwargs): | |
7102 | """GetMinHeight(self) -> int""" | |
7103 | return _core_.Window_GetMinHeight(*args, **kwargs) | |
7104 | ||
7105 | def GetMaxWidth(*args, **kwargs): | |
7106 | """GetMaxWidth(self) -> int""" | |
7107 | return _core_.Window_GetMaxWidth(*args, **kwargs) | |
7108 | ||
7109 | def GetMaxHeight(*args, **kwargs): | |
7110 | """GetMaxHeight(self) -> int""" | |
7111 | return _core_.Window_GetMaxHeight(*args, **kwargs) | |
7112 | ||
d55e5bfc RD |
7113 | def SetVirtualSize(*args, **kwargs): |
7114 | """ | |
7115 | SetVirtualSize(self, Size size) | |
7116 | ||
7117 | Set the the virtual size of a window in pixels. For most windows this | |
7118 | is just the client area of the window, but for some like scrolled | |
7119 | windows it is more or less independent of the screen window size. | |
7120 | """ | |
7121 | return _core_.Window_SetVirtualSize(*args, **kwargs) | |
7122 | ||
7123 | def SetVirtualSizeWH(*args, **kwargs): | |
7124 | """ | |
7125 | SetVirtualSizeWH(self, int w, int h) | |
7126 | ||
7127 | Set the the virtual size of a window in pixels. For most windows this | |
7128 | is just the client area of the window, but for some like scrolled | |
7129 | windows it is more or less independent of the screen window size. | |
7130 | """ | |
7131 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) | |
7132 | ||
7133 | def GetVirtualSize(*args, **kwargs): | |
7134 | """ | |
7135 | GetVirtualSize(self) -> Size | |
7136 | ||
7137 | Get the the virtual size of the window in pixels. For most windows | |
7138 | this is just the client area of the window, but for some like scrolled | |
7139 | windows it is more or less independent of the screen window size. | |
7140 | """ | |
7141 | return _core_.Window_GetVirtualSize(*args, **kwargs) | |
7142 | ||
7143 | def GetVirtualSizeTuple(*args, **kwargs): | |
7144 | """ | |
7145 | GetVirtualSizeTuple() -> (width, height) | |
7146 | ||
7147 | Get the the virtual size of the window in pixels. For most windows | |
7148 | this is just the client area of the window, but for some like scrolled | |
7149 | windows it is more or less independent of the screen window size. | |
7150 | """ | |
7151 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) | |
7152 | ||
7153 | def GetBestVirtualSize(*args, **kwargs): | |
7154 | """ | |
7155 | GetBestVirtualSize(self) -> Size | |
7156 | ||
7157 | Return the largest of ClientSize and BestSize (as determined by a | |
7158 | sizer, interior children, or other means) | |
7159 | """ | |
7160 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) | |
7161 | ||
7162 | def Show(*args, **kwargs): | |
7163 | """ | |
7164 | Show(self, bool show=True) -> bool | |
7165 | ||
7166 | Shows or hides the window. You may need to call Raise for a top level | |
7167 | window if you want to bring it to top, although this is not needed if | |
7168 | Show is called immediately after the frame creation. Returns True if | |
7169 | the window has been shown or hidden or False if nothing was done | |
7170 | because it already was in the requested state. | |
7171 | """ | |
7172 | return _core_.Window_Show(*args, **kwargs) | |
7173 | ||
7174 | def Hide(*args, **kwargs): | |
7175 | """ | |
7176 | Hide(self) -> bool | |
7177 | ||
7178 | Equivalent to calling Show(False). | |
7179 | """ | |
7180 | return _core_.Window_Hide(*args, **kwargs) | |
7181 | ||
7182 | def Enable(*args, **kwargs): | |
7183 | """ | |
7184 | Enable(self, bool enable=True) -> bool | |
7185 | ||
7186 | Enable or disable the window for user input. Note that when a parent | |
7187 | window is disabled, all of its children are disabled as well and they | |
7188 | are reenabled again when the parent is. Returns true if the window | |
7189 | has been enabled or disabled, false if nothing was done, i.e. if the | |
7190 | window had already been in the specified state. | |
7191 | """ | |
7192 | return _core_.Window_Enable(*args, **kwargs) | |
7193 | ||
7194 | def Disable(*args, **kwargs): | |
7195 | """ | |
7196 | Disable(self) -> bool | |
7197 | ||
7198 | Disables the window, same as Enable(false). | |
7199 | """ | |
7200 | return _core_.Window_Disable(*args, **kwargs) | |
7201 | ||
7202 | def IsShown(*args, **kwargs): | |
7203 | """ | |
7204 | IsShown(self) -> bool | |
7205 | ||
7206 | Returns true if the window is shown, false if it has been hidden. | |
7207 | """ | |
7208 | return _core_.Window_IsShown(*args, **kwargs) | |
7209 | ||
7210 | def IsEnabled(*args, **kwargs): | |
7211 | """ | |
7212 | IsEnabled(self) -> bool | |
7213 | ||
7214 | Returns true if the window is enabled for input, false otherwise. | |
7215 | """ | |
7216 | return _core_.Window_IsEnabled(*args, **kwargs) | |
7217 | ||
7218 | def SetWindowStyleFlag(*args, **kwargs): | |
7219 | """ | |
7220 | SetWindowStyleFlag(self, long style) | |
7221 | ||
79fccf9d RD |
7222 | Sets the style of the window. Please note that some styles cannot be |
7223 | changed after the window creation and that Refresh() might need to be | |
7224 | called after changing the others for the change to take place | |
7225 | immediately. | |
d55e5bfc RD |
7226 | """ |
7227 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) | |
7228 | ||
7229 | def GetWindowStyleFlag(*args, **kwargs): | |
7230 | """ | |
7231 | GetWindowStyleFlag(self) -> long | |
7232 | ||
7233 | Gets the window style that was passed to the constructor or Create | |
7234 | method. | |
7235 | """ | |
7236 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) | |
7237 | ||
7238 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag | |
7239 | def HasFlag(*args, **kwargs): | |
7240 | """ | |
7241 | HasFlag(self, int flag) -> bool | |
7242 | ||
7243 | Test if the given style is set for this window. | |
7244 | """ | |
7245 | return _core_.Window_HasFlag(*args, **kwargs) | |
7246 | ||
7247 | def IsRetained(*args, **kwargs): | |
7248 | """ | |
7249 | IsRetained(self) -> bool | |
7250 | ||
7251 | Returns true if the window is retained, false otherwise. Retained | |
7252 | windows are only available on X platforms. | |
7253 | """ | |
7254 | return _core_.Window_IsRetained(*args, **kwargs) | |
7255 | ||
7256 | def SetExtraStyle(*args, **kwargs): | |
7257 | """ | |
7258 | SetExtraStyle(self, long exStyle) | |
7259 | ||
7260 | Sets the extra style bits for the window. Extra styles are the less | |
7261 | often used style bits which can't be set with the constructor or with | |
7262 | SetWindowStyleFlag() | |
7263 | """ | |
7264 | return _core_.Window_SetExtraStyle(*args, **kwargs) | |
7265 | ||
7266 | def GetExtraStyle(*args, **kwargs): | |
7267 | """ | |
7268 | GetExtraStyle(self) -> long | |
7269 | ||
7270 | Returns the extra style bits for the window. | |
7271 | """ | |
7272 | return _core_.Window_GetExtraStyle(*args, **kwargs) | |
7273 | ||
7274 | def MakeModal(*args, **kwargs): | |
7275 | """ | |
7276 | MakeModal(self, bool modal=True) | |
7277 | ||
7278 | Disables all other windows in the application so that the user can | |
7279 | only interact with this window. Passing False will reverse this | |
7280 | effect. | |
7281 | """ | |
7282 | return _core_.Window_MakeModal(*args, **kwargs) | |
7283 | ||
7284 | def SetThemeEnabled(*args, **kwargs): | |
7285 | """ | |
7286 | SetThemeEnabled(self, bool enableTheme) | |
7287 | ||
7288 | This function tells a window if it should use the system's "theme" | |
7289 | code to draw the windows' background instead if its own background | |
7290 | drawing code. This will only have an effect on platforms that support | |
7291 | the notion of themes in user defined windows. One such platform is | |
7292 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
7293 | user's selected theme. | |
7294 | ||
7295 | Dialogs, notebook pages and the status bar have this flag set to true | |
7296 | by default so that the default look and feel is simulated best. | |
7297 | """ | |
7298 | return _core_.Window_SetThemeEnabled(*args, **kwargs) | |
7299 | ||
7300 | def GetThemeEnabled(*args, **kwargs): | |
7301 | """ | |
7302 | GetThemeEnabled(self) -> bool | |
7303 | ||
7304 | Return the themeEnabled flag. | |
7305 | """ | |
7306 | return _core_.Window_GetThemeEnabled(*args, **kwargs) | |
7307 | ||
7308 | def SetFocus(*args, **kwargs): | |
7309 | """ | |
7310 | SetFocus(self) | |
7311 | ||
7312 | Set's the focus to this window, allowing it to receive keyboard input. | |
7313 | """ | |
7314 | return _core_.Window_SetFocus(*args, **kwargs) | |
7315 | ||
7316 | def SetFocusFromKbd(*args, **kwargs): | |
7317 | """ | |
7318 | SetFocusFromKbd(self) | |
7319 | ||
7320 | Set focus to this window as the result of a keyboard action. Normally | |
7321 | only called internally. | |
7322 | """ | |
7323 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) | |
7324 | ||
7325 | def FindFocus(*args, **kwargs): | |
7326 | """ | |
c24da6d6 | 7327 | FindFocus() -> Window |
d55e5bfc RD |
7328 | |
7329 | Returns the window or control that currently has the keyboard focus, | |
7330 | or None. | |
7331 | """ | |
7332 | return _core_.Window_FindFocus(*args, **kwargs) | |
7333 | ||
7334 | FindFocus = staticmethod(FindFocus) | |
7335 | def AcceptsFocus(*args, **kwargs): | |
7336 | """ | |
7337 | AcceptsFocus(self) -> bool | |
7338 | ||
7339 | Can this window have focus? | |
7340 | """ | |
7341 | return _core_.Window_AcceptsFocus(*args, **kwargs) | |
7342 | ||
7343 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
7344 | """ | |
7345 | AcceptsFocusFromKeyboard(self) -> bool | |
7346 | ||
7347 | Can this window be given focus by keyboard navigation? if not, the | |
7348 | only way to give it focus (provided it accepts it at all) is to click | |
7349 | it. | |
7350 | """ | |
7351 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) | |
7352 | ||
7353 | def GetDefaultItem(*args, **kwargs): | |
7354 | """ | |
7355 | GetDefaultItem(self) -> Window | |
7356 | ||
7357 | Get the default child of this parent, i.e. the one which is activated | |
7358 | by pressing <Enter> such as the OK button on a wx.Dialog. | |
7359 | """ | |
7360 | return _core_.Window_GetDefaultItem(*args, **kwargs) | |
7361 | ||
7362 | def SetDefaultItem(*args, **kwargs): | |
7363 | """ | |
7364 | SetDefaultItem(self, Window child) -> Window | |
7365 | ||
7366 | Set this child as default, return the old default. | |
7367 | """ | |
7368 | return _core_.Window_SetDefaultItem(*args, **kwargs) | |
7369 | ||
7370 | def SetTmpDefaultItem(*args, **kwargs): | |
7371 | """ | |
7372 | SetTmpDefaultItem(self, Window win) | |
7373 | ||
7374 | Set this child as temporary default | |
7375 | """ | |
7376 | return _core_.Window_SetTmpDefaultItem(*args, **kwargs) | |
7377 | ||
908b74cd RD |
7378 | def Navigate(*args, **kwargs): |
7379 | """ | |
7380 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
7381 | ||
a8eff060 RD |
7382 | Does keyboard navigation from this window to another, by sending a |
7383 | `wx.NavigationKeyEvent`. | |
908b74cd RD |
7384 | """ |
7385 | return _core_.Window_Navigate(*args, **kwargs) | |
7386 | ||
bf26d883 RD |
7387 | def MoveAfterInTabOrder(*args, **kwargs): |
7388 | """ | |
7389 | MoveAfterInTabOrder(self, Window win) | |
7390 | ||
7391 | Moves this window in the tab navigation order after the specified | |
7392 | sibling window. This means that when the user presses the TAB key on | |
7393 | that other window, the focus switches to this window. | |
7394 | ||
7395 | The default tab order is the same as creation order. This function | |
7396 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
7397 | windows. | |
7398 | ||
7399 | """ | |
7400 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
7401 | ||
7402 | def MoveBeforeInTabOrder(*args, **kwargs): | |
7403 | """ | |
7404 | MoveBeforeInTabOrder(self, Window win) | |
7405 | ||
7406 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
7407 | before win instead of putting it right after it. | |
7408 | """ | |
7409 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
7410 | ||
d55e5bfc RD |
7411 | def GetChildren(*args, **kwargs): |
7412 | """ | |
7413 | GetChildren(self) -> PyObject | |
7414 | ||
7415 | Returns a list of the window's children. NOTE: Currently this is a | |
7416 | copy of the child window list maintained by the window, so the return | |
7417 | value of this function is only valid as long as the window's children | |
7418 | do not change. | |
7419 | """ | |
7420 | return _core_.Window_GetChildren(*args, **kwargs) | |
7421 | ||
7422 | def GetParent(*args, **kwargs): | |
7423 | """ | |
7424 | GetParent(self) -> Window | |
7425 | ||
7426 | Returns the parent window of this window, or None if there isn't one. | |
7427 | """ | |
7428 | return _core_.Window_GetParent(*args, **kwargs) | |
7429 | ||
7430 | def GetGrandParent(*args, **kwargs): | |
7431 | """ | |
7432 | GetGrandParent(self) -> Window | |
7433 | ||
79fccf9d RD |
7434 | Returns the parent of the parent of this window, or None if there |
7435 | isn't one. | |
d55e5bfc RD |
7436 | """ |
7437 | return _core_.Window_GetGrandParent(*args, **kwargs) | |
7438 | ||
7439 | def IsTopLevel(*args, **kwargs): | |
7440 | """ | |
7441 | IsTopLevel(self) -> bool | |
7442 | ||
7443 | Returns true if the given window is a top-level one. Currently all | |
7444 | frames and dialogs are always considered to be top-level windows (even | |
7445 | if they have a parent window). | |
7446 | """ | |
7447 | return _core_.Window_IsTopLevel(*args, **kwargs) | |
7448 | ||
7449 | def Reparent(*args, **kwargs): | |
7450 | """ | |
7451 | Reparent(self, Window newParent) -> bool | |
7452 | ||
7453 | Reparents the window, i.e the window will be removed from its current | |
7454 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
7455 | re-inserted into another. Available on Windows and GTK. Returns True | |
7456 | if the parent was changed, False otherwise (error or newParent == | |
7457 | oldParent) | |
7458 | """ | |
7459 | return _core_.Window_Reparent(*args, **kwargs) | |
7460 | ||
7461 | def AddChild(*args, **kwargs): | |
7462 | """ | |
7463 | AddChild(self, Window child) | |
7464 | ||
7465 | Adds a child window. This is called automatically by window creation | |
7466 | functions so should not be required by the application programmer. | |
7467 | """ | |
7468 | return _core_.Window_AddChild(*args, **kwargs) | |
7469 | ||
7470 | def RemoveChild(*args, **kwargs): | |
7471 | """ | |
7472 | RemoveChild(self, Window child) | |
7473 | ||
7474 | Removes a child window. This is called automatically by window | |
7475 | deletion functions so should not be required by the application | |
7476 | programmer. | |
7477 | """ | |
7478 | return _core_.Window_RemoveChild(*args, **kwargs) | |
7479 | ||
7480 | def FindWindowById(*args, **kwargs): | |
7481 | """ | |
7482 | FindWindowById(self, long winid) -> Window | |
7483 | ||
7484 | Find a chld of this window by window ID | |
7485 | """ | |
7486 | return _core_.Window_FindWindowById(*args, **kwargs) | |
7487 | ||
7488 | def FindWindowByName(*args, **kwargs): | |
7489 | """ | |
7490 | FindWindowByName(self, String name) -> Window | |
7491 | ||
7492 | Find a child of this window by name | |
7493 | """ | |
7494 | return _core_.Window_FindWindowByName(*args, **kwargs) | |
7495 | ||
7496 | def GetEventHandler(*args, **kwargs): | |
7497 | """ | |
7498 | GetEventHandler(self) -> EvtHandler | |
7499 | ||
7500 | Returns the event handler for this window. By default, the window is | |
7501 | its own event handler. | |
7502 | """ | |
7503 | return _core_.Window_GetEventHandler(*args, **kwargs) | |
7504 | ||
7505 | def SetEventHandler(*args, **kwargs): | |
7506 | """ | |
7507 | SetEventHandler(self, EvtHandler handler) | |
7508 | ||
7509 | Sets the event handler for this window. An event handler is an object | |
7510 | that is capable of processing the events sent to a window. By default, | |
7511 | the window is its own event handler, but an application may wish to | |
7512 | substitute another, for example to allow central implementation of | |
7513 | event-handling for a variety of different window classes. | |
7514 | ||
79fccf9d | 7515 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
d55e5bfc RD |
7516 | up a chain of event handlers, where an event not handled by one event |
7517 | handler is handed to the next one in the chain. | |
7518 | """ | |
7519 | return _core_.Window_SetEventHandler(*args, **kwargs) | |
7520 | ||
7521 | def PushEventHandler(*args, **kwargs): | |
7522 | """ | |
7523 | PushEventHandler(self, EvtHandler handler) | |
7524 | ||
7525 | Pushes this event handler onto the event handler stack for the window. | |
7526 | An event handler is an object that is capable of processing the events | |
7527 | sent to a window. By default, the window is its own event handler, but | |
7528 | an application may wish to substitute another, for example to allow | |
7529 | central implementation of event-handling for a variety of different | |
7530 | window classes. | |
7531 | ||
7532 | wx.Window.PushEventHandler allows an application to set up a chain of | |
7533 | event handlers, where an event not handled by one event handler is | |
79fccf9d | 7534 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` to |
d55e5bfc RD |
7535 | remove the event handler. |
7536 | """ | |
7537 | return _core_.Window_PushEventHandler(*args, **kwargs) | |
7538 | ||
7539 | def PopEventHandler(*args, **kwargs): | |
7540 | """ | |
7541 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler | |
7542 | ||
7543 | Removes and returns the top-most event handler on the event handler | |
7544 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
7545 | destroyed after it is popped. | |
7546 | """ | |
7547 | return _core_.Window_PopEventHandler(*args, **kwargs) | |
7548 | ||
7549 | def RemoveEventHandler(*args, **kwargs): | |
7550 | """ | |
7551 | RemoveEventHandler(self, EvtHandler handler) -> bool | |
7552 | ||
79fccf9d RD |
7553 | Find the given handler in the event handler chain and remove (but not |
7554 | delete) it from the event handler chain, return True if it was found | |
7555 | and False otherwise (this also results in an assert failure so this | |
7556 | function should only be called when the handler is supposed to be | |
7557 | there.) | |
d55e5bfc RD |
7558 | """ |
7559 | return _core_.Window_RemoveEventHandler(*args, **kwargs) | |
7560 | ||
7561 | def SetValidator(*args, **kwargs): | |
7562 | """ | |
7563 | SetValidator(self, Validator validator) | |
7564 | ||
7565 | Deletes the current validator (if any) and sets the window validator, | |
7566 | having called wx.Validator.Clone to create a new validator of this | |
7567 | type. | |
7568 | """ | |
7569 | return _core_.Window_SetValidator(*args, **kwargs) | |
7570 | ||
7571 | def GetValidator(*args, **kwargs): | |
7572 | """ | |
7573 | GetValidator(self) -> Validator | |
7574 | ||
7575 | Returns a pointer to the current validator for the window, or None if | |
7576 | there is none. | |
7577 | """ | |
7578 | return _core_.Window_GetValidator(*args, **kwargs) | |
7579 | ||
7580 | def Validate(*args, **kwargs): | |
7581 | """ | |
7582 | Validate(self) -> bool | |
7583 | ||
7584 | Validates the current values of the child controls using their | |
79fccf9d RD |
7585 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
7586 | style flag set, the method will also call Validate() of all child | |
7587 | windows. Returns false if any of the validations failed. | |
d55e5bfc RD |
7588 | """ |
7589 | return _core_.Window_Validate(*args, **kwargs) | |
7590 | ||
7591 | def TransferDataToWindow(*args, **kwargs): | |
7592 | """ | |
7593 | TransferDataToWindow(self) -> bool | |
7594 | ||
79fccf9d RD |
7595 | Transfers values to child controls from data areas specified by their |
7596 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
7597 | style flag set, the method will also call TransferDataToWindow() of | |
7598 | all child windows. | |
d55e5bfc RD |
7599 | """ |
7600 | return _core_.Window_TransferDataToWindow(*args, **kwargs) | |
7601 | ||
7602 | def TransferDataFromWindow(*args, **kwargs): | |
7603 | """ | |
7604 | TransferDataFromWindow(self) -> bool | |
7605 | ||
79fccf9d RD |
7606 | Transfers values from child controls to data areas specified by their |
7607 | validators. Returns false if a transfer failed. If the window has | |
7608 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
7609 | also call TransferDataFromWindow() of all child windows. | |
d55e5bfc RD |
7610 | """ |
7611 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) | |
7612 | ||
7613 | def InitDialog(*args, **kwargs): | |
7614 | """ | |
7615 | InitDialog(self) | |
7616 | ||
79fccf9d RD |
7617 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
7618 | to the dialog via validators. | |
d55e5bfc RD |
7619 | """ |
7620 | return _core_.Window_InitDialog(*args, **kwargs) | |
7621 | ||
7622 | def SetAcceleratorTable(*args, **kwargs): | |
7623 | """ | |
7624 | SetAcceleratorTable(self, AcceleratorTable accel) | |
7625 | ||
7626 | Sets the accelerator table for this window. | |
7627 | """ | |
7628 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) | |
7629 | ||
7630 | def GetAcceleratorTable(*args, **kwargs): | |
7631 | """ | |
7632 | GetAcceleratorTable(self) -> AcceleratorTable | |
7633 | ||
7634 | Gets the accelerator table for this window. | |
7635 | """ | |
7636 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) | |
7637 | ||
7638 | def RegisterHotKey(*args, **kwargs): | |
7639 | """ | |
7640 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool | |
7641 | ||
7642 | Registers a system wide hotkey. Every time the user presses the hotkey | |
7643 | registered here, this window will receive a hotkey event. It will | |
7644 | receive the event even if the application is in the background and | |
7645 | does not have the input focus because the user is working with some | |
7646 | other application. To bind an event handler function to this hotkey | |
7647 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
7648 | hotkey was registered successfully. | |
7649 | """ | |
7650 | return _core_.Window_RegisterHotKey(*args, **kwargs) | |
7651 | ||
7652 | def UnregisterHotKey(*args, **kwargs): | |
7653 | """ | |
7654 | UnregisterHotKey(self, int hotkeyId) -> bool | |
7655 | ||
7656 | Unregisters a system wide hotkey. | |
7657 | """ | |
7658 | return _core_.Window_UnregisterHotKey(*args, **kwargs) | |
7659 | ||
7660 | def ConvertDialogPointToPixels(*args, **kwargs): | |
7661 | """ | |
7662 | ConvertDialogPointToPixels(self, Point pt) -> Point | |
7663 | ||
7664 | Converts a point or size from dialog units to pixels. Dialog units | |
7665 | are used for maintaining a dialog's proportions even if the font | |
7666 | changes. For the x dimension, the dialog units are multiplied by the | |
7667 | average character width and then divided by 4. For the y dimension, | |
7668 | the dialog units are multiplied by the average character height and | |
7669 | then divided by 8. | |
7670 | """ | |
7671 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) | |
7672 | ||
7673 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
7674 | """ | |
7675 | ConvertDialogSizeToPixels(self, Size sz) -> Size | |
7676 | ||
7677 | Converts a point or size from dialog units to pixels. Dialog units | |
7678 | are used for maintaining a dialog's proportions even if the font | |
7679 | changes. For the x dimension, the dialog units are multiplied by the | |
7680 | average character width and then divided by 4. For the y dimension, | |
7681 | the dialog units are multiplied by the average character height and | |
7682 | then divided by 8. | |
7683 | """ | |
7684 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) | |
7685 | ||
7686 | def DLG_PNT(*args, **kwargs): | |
7687 | """ | |
7688 | DLG_PNT(self, Point pt) -> Point | |
7689 | ||
7690 | Converts a point or size from dialog units to pixels. Dialog units | |
7691 | are used for maintaining a dialog's proportions even if the font | |
7692 | changes. For the x dimension, the dialog units are multiplied by the | |
7693 | average character width and then divided by 4. For the y dimension, | |
7694 | the dialog units are multiplied by the average character height and | |
7695 | then divided by 8. | |
7696 | """ | |
7697 | return _core_.Window_DLG_PNT(*args, **kwargs) | |
7698 | ||
7699 | def DLG_SZE(*args, **kwargs): | |
7700 | """ | |
7701 | DLG_SZE(self, Size sz) -> Size | |
7702 | ||
7703 | Converts a point or size from dialog units to pixels. Dialog units | |
7704 | are used for maintaining a dialog's proportions even if the font | |
7705 | changes. For the x dimension, the dialog units are multiplied by the | |
7706 | average character width and then divided by 4. For the y dimension, | |
7707 | the dialog units are multiplied by the average character height and | |
7708 | then divided by 8. | |
7709 | """ | |
7710 | return _core_.Window_DLG_SZE(*args, **kwargs) | |
7711 | ||
7712 | def ConvertPixelPointToDialog(*args, **kwargs): | |
7713 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" | |
7714 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) | |
7715 | ||
7716 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
7717 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" | |
7718 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) | |
7719 | ||
7720 | def WarpPointer(*args, **kwargs): | |
7721 | """ | |
7722 | WarpPointer(self, int x, int y) | |
7723 | ||
7724 | Moves the pointer to the given position on the window. | |
7725 | ||
7726 | NOTE: This function is not supported under Mac because Apple Human | |
7727 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
7728 | """ | |
7729 | return _core_.Window_WarpPointer(*args, **kwargs) | |
7730 | ||
7731 | def CaptureMouse(*args, **kwargs): | |
7732 | """ | |
7733 | CaptureMouse(self) | |
7734 | ||
7735 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
7736 | release the capture. | |
7737 | ||
7738 | Note that wxWindows maintains the stack of windows having captured the | |
7739 | mouse and when the mouse is released the capture returns to the window | |
7740 | which had had captured it previously and it is only really released if | |
7741 | there were no previous window. In particular, this means that you must | |
7742 | release the mouse as many times as you capture it. | |
7743 | """ | |
7744 | return _core_.Window_CaptureMouse(*args, **kwargs) | |
7745 | ||
7746 | def ReleaseMouse(*args, **kwargs): | |
7747 | """ | |
7748 | ReleaseMouse(self) | |
7749 | ||
7750 | Releases mouse input captured with wx.Window.CaptureMouse. | |
7751 | """ | |
7752 | return _core_.Window_ReleaseMouse(*args, **kwargs) | |
7753 | ||
7754 | def GetCapture(*args, **kwargs): | |
7755 | """ | |
c24da6d6 | 7756 | GetCapture() -> Window |
d55e5bfc RD |
7757 | |
7758 | Returns the window which currently captures the mouse or None | |
7759 | """ | |
7760 | return _core_.Window_GetCapture(*args, **kwargs) | |
7761 | ||
7762 | GetCapture = staticmethod(GetCapture) | |
7763 | def HasCapture(*args, **kwargs): | |
7764 | """ | |
7765 | HasCapture(self) -> bool | |
7766 | ||
7767 | Returns true if this window has the current mouse capture. | |
7768 | """ | |
7769 | return _core_.Window_HasCapture(*args, **kwargs) | |
7770 | ||
7771 | def Refresh(*args, **kwargs): | |
7772 | """ | |
7773 | Refresh(self, bool eraseBackground=True, Rect rect=None) | |
7774 | ||
7775 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
7776 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
7777 | to the window. | |
7778 | """ | |
7779 | return _core_.Window_Refresh(*args, **kwargs) | |
7780 | ||
7781 | def RefreshRect(*args, **kwargs): | |
7782 | """ | |
fef4c27a | 7783 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
d55e5bfc RD |
7784 | |
7785 | Redraws the contents of the given rectangle: the area inside it will | |
7786 | be repainted. This is the same as Refresh but has a nicer syntax. | |
7787 | """ | |
7788 | return _core_.Window_RefreshRect(*args, **kwargs) | |
7789 | ||
7790 | def Update(*args, **kwargs): | |
7791 | """ | |
7792 | Update(self) | |
7793 | ||
7794 | Calling this method immediately repaints the invalidated area of the | |
7795 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
7796 | this would usually only happen when the flow of control returns to the | |
7797 | event loop.) Notice that this function doesn't refresh the window and | |
7798 | does nothing if the window has been already repainted. Use Refresh | |
7799 | first if you want to immediately redraw the window (or some portion of | |
7800 | it) unconditionally. | |
7801 | """ | |
7802 | return _core_.Window_Update(*args, **kwargs) | |
7803 | ||
7804 | def ClearBackground(*args, **kwargs): | |
7805 | """ | |
7806 | ClearBackground(self) | |
7807 | ||
7808 | Clears the window by filling it with the current background | |
7809 | colour. Does not cause an erase background event to be generated. | |
7810 | """ | |
7811 | return _core_.Window_ClearBackground(*args, **kwargs) | |
7812 | ||
7813 | def Freeze(*args, **kwargs): | |
7814 | """ | |
7815 | Freeze(self) | |
7816 | ||
79fccf9d RD |
7817 | Freezes the window or, in other words, prevents any updates from |
7818 | taking place on screen, the window is not redrawn at all. Thaw must be | |
7819 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
7820 | nested, with the actual Thaw being delayed until all the nesting has | |
7821 | been undone. | |
d55e5bfc RD |
7822 | |
7823 | This method is useful for visual appearance optimization (for example, | |
7824 | it is a good idea to use it before inserting large amount of text into | |
7825 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
7826 | for all controls so it is mostly just a hint to wxWindows and not a | |
7827 | mandatory directive. | |
7828 | """ | |
7829 | return _core_.Window_Freeze(*args, **kwargs) | |
7830 | ||
7831 | def Thaw(*args, **kwargs): | |
7832 | """ | |
7833 | Thaw(self) | |
7834 | ||
7835 | Reenables window updating after a previous call to Freeze. Calls to | |
79fccf9d RD |
7836 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
7837 | times that Freeze was before the window will be updated. | |
d55e5bfc RD |
7838 | """ |
7839 | return _core_.Window_Thaw(*args, **kwargs) | |
7840 | ||
7841 | def PrepareDC(*args, **kwargs): | |
7842 | """ | |
7843 | PrepareDC(self, DC dc) | |
7844 | ||
7845 | Call this function to prepare the device context for drawing a | |
7846 | scrolled image. It sets the device origin according to the current | |
7847 | scroll position. | |
7848 | """ | |
7849 | return _core_.Window_PrepareDC(*args, **kwargs) | |
7850 | ||
7851 | def GetUpdateRegion(*args, **kwargs): | |
7852 | """ | |
7853 | GetUpdateRegion(self) -> Region | |
7854 | ||
7855 | Returns the region specifying which parts of the window have been | |
7856 | damaged. Should only be called within an EVT_PAINT handler. | |
7857 | """ | |
7858 | return _core_.Window_GetUpdateRegion(*args, **kwargs) | |
7859 | ||
7860 | def GetUpdateClientRect(*args, **kwargs): | |
7861 | """ | |
7862 | GetUpdateClientRect(self) -> Rect | |
7863 | ||
7864 | Get the update rectangle region bounding box in client coords. | |
7865 | """ | |
7866 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) | |
7867 | ||
7868 | def IsExposed(*args, **kwargs): | |
7869 | """ | |
7870 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool | |
7871 | ||
7872 | Returns true if the given point or rectangle area has been exposed | |
7873 | since the last repaint. Call this in an paint event handler to | |
7874 | optimize redrawing by only redrawing those areas, which have been | |
7875 | exposed. | |
7876 | """ | |
7877 | return _core_.Window_IsExposed(*args, **kwargs) | |
7878 | ||
7879 | def IsExposedPoint(*args, **kwargs): | |
7880 | """ | |
7881 | IsExposedPoint(self, Point pt) -> bool | |
7882 | ||
7883 | Returns true if the given point or rectangle area has been exposed | |
7884 | since the last repaint. Call this in an paint event handler to | |
7885 | optimize redrawing by only redrawing those areas, which have been | |
7886 | exposed. | |
7887 | """ | |
7888 | return _core_.Window_IsExposedPoint(*args, **kwargs) | |
7889 | ||
7890 | def IsExposedRect(*args, **kwargs): | |
7891 | """ | |
7892 | IsExposedRect(self, Rect rect) -> bool | |
7893 | ||
7894 | Returns true if the given point or rectangle area has been exposed | |
7895 | since the last repaint. Call this in an paint event handler to | |
7896 | optimize redrawing by only redrawing those areas, which have been | |
7897 | exposed. | |
7898 | """ | |
7899 | return _core_.Window_IsExposedRect(*args, **kwargs) | |
7900 | ||
7901 | def GetDefaultAttributes(*args, **kwargs): | |
7902 | """ | |
7903 | GetDefaultAttributes(self) -> VisualAttributes | |
7904 | ||
79fccf9d RD |
7905 | Get the default attributes for an instance of this class. This is |
7906 | useful if you want to use the same font or colour in your own control | |
7907 | as in a standard control -- which is a much better idea than hard | |
7908 | coding specific colours or fonts which might look completely out of | |
caef1a4d | 7909 | place on the user's system, especially if it uses themes. |
d55e5bfc RD |
7910 | """ |
7911 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) | |
7912 | ||
7913 | def GetClassDefaultAttributes(*args, **kwargs): | |
7914 | """ | |
c24da6d6 | 7915 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
d55e5bfc | 7916 | |
79fccf9d RD |
7917 | Get the default attributes for this class. This is useful if you want |
7918 | to use the same font or colour in your own control as in a standard | |
7919 | control -- which is a much better idea than hard coding specific | |
caef1a4d RD |
7920 | colours or fonts which might look completely out of place on the |
7921 | user's system, especially if it uses themes. | |
d55e5bfc RD |
7922 | |
7923 | The variant parameter is only relevant under Mac currently and is | |
79fccf9d | 7924 | ignore under other platforms. Under Mac, it will change the size of |
caef1a4d RD |
7925 | the returned font. See `wx.Window.SetWindowVariant` for more about |
7926 | this. | |
d55e5bfc RD |
7927 | """ |
7928 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) | |
7929 | ||
7930 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
7931 | def SetBackgroundColour(*args, **kwargs): | |
7932 | """ | |
7933 | SetBackgroundColour(self, Colour colour) -> bool | |
7934 | ||
7935 | Sets the background colour of the window. Returns True if the colour | |
7936 | was changed. The background colour is usually painted by the default | |
7937 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
7938 | automatically under GTK. Using `wx.NullColour` will reset the window |
7939 | to the default background colour. | |
d55e5bfc | 7940 | |
caef1a4d | 7941 | Note that setting the background colour may not cause an immediate |
f8167d6e | 7942 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
d55e5bfc RD |
7943 | calling this function. |
7944 | ||
f8167d6e RD |
7945 | Using this function will disable attempts to use themes for this |
7946 | window, if the system supports them. Use with care since usually the | |
7947 | themes represent the appearance chosen by the user to be used for all | |
7948 | applications on the system. | |
d55e5bfc RD |
7949 | """ |
7950 | return _core_.Window_SetBackgroundColour(*args, **kwargs) | |
7951 | ||
412d302d RD |
7952 | def SetOwnBackgroundColour(*args, **kwargs): |
7953 | """SetOwnBackgroundColour(self, Colour colour)""" | |
7954 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
d55e5bfc RD |
7955 | |
7956 | def SetForegroundColour(*args, **kwargs): | |
7957 | """ | |
7958 | SetForegroundColour(self, Colour colour) -> bool | |
7959 | ||
7960 | Sets the foreground colour of the window. Returns True is the colour | |
7961 | was changed. The interpretation of foreground colour is dependent on | |
7962 | the window class; it may be the text colour or other colour, or it may | |
7963 | not be used at all. | |
7964 | """ | |
7965 | return _core_.Window_SetForegroundColour(*args, **kwargs) | |
7966 | ||
fa47d7a7 VS |
7967 | def SetOwnForegroundColour(*args, **kwargs): |
7968 | """SetOwnForegroundColour(self, Colour colour)""" | |
7969 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
d55e5bfc RD |
7970 | |
7971 | def GetBackgroundColour(*args, **kwargs): | |
7972 | """ | |
7973 | GetBackgroundColour(self) -> Colour | |
7974 | ||
7975 | Returns the background colour of the window. | |
7976 | """ | |
7977 | return _core_.Window_GetBackgroundColour(*args, **kwargs) | |
7978 | ||
7979 | def GetForegroundColour(*args, **kwargs): | |
7980 | """ | |
7981 | GetForegroundColour(self) -> Colour | |
7982 | ||
7983 | Returns the foreground colour of the window. The interpretation of | |
7984 | foreground colour is dependent on the window class; it may be the text | |
7985 | colour or other colour, or it may not be used at all. | |
7986 | """ | |
7987 | return _core_.Window_GetForegroundColour(*args, **kwargs) | |
7988 | ||
dcb8fc74 RD |
7989 | def InheritsBackgroundColour(*args, **kwargs): |
7990 | """InheritsBackgroundColour(self) -> bool""" | |
7991 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
7992 | ||
7993 | def UseBgCol(*args, **kwargs): | |
7994 | """UseBgCol(self) -> bool""" | |
7995 | return _core_.Window_UseBgCol(*args, **kwargs) | |
7996 | ||
0f63ec68 RD |
7997 | def SetBackgroundStyle(*args, **kwargs): |
7998 | """ | |
7999 | SetBackgroundStyle(self, int style) -> bool | |
8000 | ||
8001 | Returns the background style of the window. The background style | |
8002 | indicates how the background of the window is drawn. | |
8003 | ||
8004 | ====================== ======================================== | |
8005 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
8006 | be determined by the system | |
8007 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
8008 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
8009 | application. | |
8010 | ====================== ======================================== | |
8011 | ||
8012 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
8013 | a custom background, such as a tiled bitmap. Currently the style has | |
8014 | no effect on other platforms. | |
8015 | ||
8016 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
8017 | """ | |
8018 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
8019 | ||
8020 | def GetBackgroundStyle(*args, **kwargs): | |
8021 | """ | |
8022 | GetBackgroundStyle(self) -> int | |
8023 | ||
8024 | Returns the background style of the window. | |
8025 | ||
8026 | :see: `SetBackgroundStyle` | |
8027 | """ | |
8028 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
8029 | ||
51b83b37 RD |
8030 | def HasTransparentBackground(*args, **kwargs): |
8031 | """ | |
8032 | HasTransparentBackground(self) -> bool | |
8033 | ||
8034 | Returns True if this window's background is transparent (as, for | |
8035 | example, for `wx.StaticText`) and should show the parent window's | |
8036 | background. | |
8037 | ||
8038 | This method is mostly used internally by the library itself and you | |
8039 | normally shouldn't have to call it. You may, however, have to override | |
8040 | it in your custom control classes to ensure that background is painted | |
8041 | correctly. | |
8042 | """ | |
8043 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
8044 | ||
d55e5bfc RD |
8045 | def SetCursor(*args, **kwargs): |
8046 | """ | |
8047 | SetCursor(self, Cursor cursor) -> bool | |
8048 | ||
8049 | Sets the window's cursor. Notice that the window cursor also sets it | |
8050 | for the children of the window implicitly. | |
8051 | ||
8052 | The cursor may be wx.NullCursor in which case the window cursor will | |
8053 | be reset back to default. | |
8054 | """ | |
8055 | return _core_.Window_SetCursor(*args, **kwargs) | |
8056 | ||
8057 | def GetCursor(*args, **kwargs): | |
8058 | """ | |
8059 | GetCursor(self) -> Cursor | |
8060 | ||
8061 | Return the cursor associated with this window. | |
8062 | """ | |
8063 | return _core_.Window_GetCursor(*args, **kwargs) | |
8064 | ||
8065 | def SetFont(*args, **kwargs): | |
8066 | """ | |
8067 | SetFont(self, Font font) -> bool | |
8068 | ||
8069 | Sets the font for this window. | |
8070 | """ | |
8071 | return _core_.Window_SetFont(*args, **kwargs) | |
8072 | ||
fa47d7a7 VS |
8073 | def SetOwnFont(*args, **kwargs): |
8074 | """SetOwnFont(self, Font font)""" | |
8075 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
d55e5bfc RD |
8076 | |
8077 | def GetFont(*args, **kwargs): | |
8078 | """ | |
8079 | GetFont(self) -> Font | |
8080 | ||
8081 | Returns the default font used for this window. | |
8082 | """ | |
8083 | return _core_.Window_GetFont(*args, **kwargs) | |
8084 | ||
8085 | def SetCaret(*args, **kwargs): | |
8086 | """ | |
8087 | SetCaret(self, Caret caret) | |
8088 | ||
8089 | Sets the caret associated with the window. | |
8090 | """ | |
8091 | return _core_.Window_SetCaret(*args, **kwargs) | |
8092 | ||
8093 | def GetCaret(*args, **kwargs): | |
8094 | """ | |
8095 | GetCaret(self) -> Caret | |
8096 | ||
8097 | Returns the caret associated with the window. | |
8098 | """ | |
8099 | return _core_.Window_GetCaret(*args, **kwargs) | |
8100 | ||
8101 | def GetCharHeight(*args, **kwargs): | |
8102 | """ | |
8103 | GetCharHeight(self) -> int | |
8104 | ||
8105 | Get the (average) character size for the current font. | |
8106 | """ | |
8107 | return _core_.Window_GetCharHeight(*args, **kwargs) | |
8108 | ||
8109 | def GetCharWidth(*args, **kwargs): | |
8110 | """ | |
8111 | GetCharWidth(self) -> int | |
8112 | ||
8113 | Get the (average) character size for the current font. | |
8114 | """ | |
8115 | return _core_.Window_GetCharWidth(*args, **kwargs) | |
8116 | ||
8117 | def GetTextExtent(*args, **kwargs): | |
a8eff060 RD |
8118 | """ |
8119 | GetTextExtent(String string) -> (width, height) | |
8120 | ||
8121 | Get the width and height of the text using the current font. | |
8122 | """ | |
d55e5bfc RD |
8123 | return _core_.Window_GetTextExtent(*args, **kwargs) |
8124 | ||
8125 | def GetFullTextExtent(*args, **kwargs): | |
8126 | """ | |
8127 | GetFullTextExtent(String string, Font font=None) -> | |
8128 | (width, height, descent, externalLeading) | |
8129 | ||
8130 | Get the width, height, decent and leading of the text using the | |
8131 | current or specified font. | |
8132 | """ | |
8133 | return _core_.Window_GetFullTextExtent(*args, **kwargs) | |
8134 | ||
8135 | def ClientToScreenXY(*args, **kwargs): | |
8136 | """ | |
8137 | ClientToScreenXY(int x, int y) -> (x,y) | |
8138 | ||
8139 | Converts to screen coordinates from coordinates relative to this window. | |
8140 | """ | |
8141 | return _core_.Window_ClientToScreenXY(*args, **kwargs) | |
8142 | ||
8143 | def ScreenToClientXY(*args, **kwargs): | |
8144 | """ | |
8145 | ScreenToClientXY(int x, int y) -> (x,y) | |
8146 | ||
8147 | Converts from screen to client window coordinates. | |
8148 | """ | |
8149 | return _core_.Window_ScreenToClientXY(*args, **kwargs) | |
8150 | ||
8151 | def ClientToScreen(*args, **kwargs): | |
8152 | """ | |
8153 | ClientToScreen(self, Point pt) -> Point | |
8154 | ||
8155 | Converts to screen coordinates from coordinates relative to this window. | |
8156 | """ | |
8157 | return _core_.Window_ClientToScreen(*args, **kwargs) | |
8158 | ||
8159 | def ScreenToClient(*args, **kwargs): | |
8160 | """ | |
8161 | ScreenToClient(self, Point pt) -> Point | |
8162 | ||
8163 | Converts from screen to client window coordinates. | |
8164 | """ | |
8165 | return _core_.Window_ScreenToClient(*args, **kwargs) | |
8166 | ||
8167 | def HitTestXY(*args, **kwargs): | |
8168 | """ | |
8169 | HitTestXY(self, int x, int y) -> int | |
8170 | ||
8171 | Test where the given (in client coords) point lies | |
8172 | """ | |
8173 | return _core_.Window_HitTestXY(*args, **kwargs) | |
8174 | ||
8175 | def HitTest(*args, **kwargs): | |
8176 | """ | |
8177 | HitTest(self, Point pt) -> int | |
8178 | ||
8179 | Test where the given (in client coords) point lies | |
8180 | """ | |
8181 | return _core_.Window_HitTest(*args, **kwargs) | |
8182 | ||
8183 | def GetBorder(*args): | |
8184 | """ | |
8185 | GetBorder(self, long flags) -> int | |
8186 | GetBorder(self) -> int | |
8187 | ||
8188 | Get border for the flags of this window | |
8189 | """ | |
8190 | return _core_.Window_GetBorder(*args) | |
8191 | ||
8192 | def UpdateWindowUI(*args, **kwargs): | |
8193 | """ | |
8194 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) | |
8195 | ||
8196 | This function sends EVT_UPDATE_UI events to the window. The particular | |
8197 | implementation depends on the window; for example a wx.ToolBar will | |
8198 | send an update UI event for each toolbar button, and a wx.Frame will | |
8199 | send an update UI event for each menubar menu item. You can call this | |
8200 | function from your application to ensure that your UI is up-to-date at | |
8201 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
8202 | concerned). This may be necessary if you have called | |
8203 | wx.UpdateUIEvent.SetMode or wx.UpdateUIEvent.SetUpdateInterval to | |
8204 | limit the overhead that wxWindows incurs by sending update UI events | |
8205 | in idle time. | |
d55e5bfc RD |
8206 | """ |
8207 | return _core_.Window_UpdateWindowUI(*args, **kwargs) | |
8208 | ||
8209 | def PopupMenuXY(*args, **kwargs): | |
8210 | """ | |
7a0b95b0 | 8211 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
d55e5bfc | 8212 | |
7a0b95b0 RD |
8213 | Pops up the given menu at the specified coordinates, relative to this window, |
8214 | and returns control when the user has dismissed the menu. If a menu item is | |
8215 | selected, the corresponding menu event is generated and will be processed as | |
8216 | usual. If the default position is given then the current position of the | |
8217 | mouse cursor will be used. | |
d55e5bfc RD |
8218 | """ |
8219 | return _core_.Window_PopupMenuXY(*args, **kwargs) | |
8220 | ||
8221 | def PopupMenu(*args, **kwargs): | |
8222 | """ | |
7a0b95b0 | 8223 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
d55e5bfc | 8224 | |
7a0b95b0 RD |
8225 | Pops up the given menu at the specified coordinates, relative to this window, |
8226 | and returns control when the user has dismissed the menu. If a menu item is | |
8227 | selected, the corresponding menu event is generated and will be processed as | |
8228 | usual. If the default position is given then the current position of the | |
8229 | mouse cursor will be used. | |
d55e5bfc RD |
8230 | """ |
8231 | return _core_.Window_PopupMenu(*args, **kwargs) | |
8232 | ||
8233 | def GetHandle(*args, **kwargs): | |
8234 | """ | |
8235 | GetHandle(self) -> long | |
8236 | ||
8237 | Returns the platform-specific handle (as a long integer) of the | |
8238 | physical window. Currently on wxMac it returns the handle of the | |
8239 | toplevel parent of the window. | |
8240 | """ | |
8241 | return _core_.Window_GetHandle(*args, **kwargs) | |
8242 | ||
629e65c2 RD |
8243 | def AssociateHandle(*args, **kwargs): |
8244 | """ | |
8245 | AssociateHandle(self, long handle) | |
8246 | ||
8247 | Associate the window with a new native handle | |
8248 | """ | |
8249 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
8250 | ||
8251 | def DissociateHandle(*args, **kwargs): | |
8252 | """ | |
8253 | DissociateHandle(self) | |
8254 | ||
8255 | Dissociate the current native handle from the window | |
8256 | """ | |
8257 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
8258 | ||
d55e5bfc RD |
8259 | def OnPaint(*args, **kwargs): |
8260 | """OnPaint(self, PaintEvent event)""" | |
8261 | return _core_.Window_OnPaint(*args, **kwargs) | |
8262 | ||
8263 | def HasScrollbar(*args, **kwargs): | |
8264 | """ | |
8265 | HasScrollbar(self, int orient) -> bool | |
8266 | ||
8267 | Does the window have the scrollbar for this orientation? | |
8268 | """ | |
8269 | return _core_.Window_HasScrollbar(*args, **kwargs) | |
8270 | ||
8271 | def SetScrollbar(*args, **kwargs): | |
8272 | """ | |
79fccf9d | 8273 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
d55e5bfc RD |
8274 | bool refresh=True) |
8275 | ||
8276 | Sets the scrollbar properties of a built-in scrollbar. | |
d55e5bfc RD |
8277 | """ |
8278 | return _core_.Window_SetScrollbar(*args, **kwargs) | |
8279 | ||
8280 | def SetScrollPos(*args, **kwargs): | |
8281 | """ | |
8282 | SetScrollPos(self, int orientation, int pos, bool refresh=True) | |
8283 | ||
8284 | Sets the position of one of the built-in scrollbars. | |
8285 | """ | |
8286 | return _core_.Window_SetScrollPos(*args, **kwargs) | |
8287 | ||
8288 | def GetScrollPos(*args, **kwargs): | |
8289 | """ | |
8290 | GetScrollPos(self, int orientation) -> int | |
8291 | ||
8292 | Returns the built-in scrollbar position. | |
8293 | """ | |
8294 | return _core_.Window_GetScrollPos(*args, **kwargs) | |
8295 | ||
8296 | def GetScrollThumb(*args, **kwargs): | |
8297 | """ | |
8298 | GetScrollThumb(self, int orientation) -> int | |
8299 | ||
8300 | Returns the built-in scrollbar thumb size. | |
8301 | """ | |
8302 | return _core_.Window_GetScrollThumb(*args, **kwargs) | |
8303 | ||
8304 | def GetScrollRange(*args, **kwargs): | |
8305 | """ | |
8306 | GetScrollRange(self, int orientation) -> int | |
8307 | ||
8308 | Returns the built-in scrollbar range. | |
8309 | """ | |
8310 | return _core_.Window_GetScrollRange(*args, **kwargs) | |
8311 | ||
8312 | def ScrollWindow(*args, **kwargs): | |
8313 | """ | |
8314 | ScrollWindow(self, int dx, int dy, Rect rect=None) | |
8315 | ||
8316 | Physically scrolls the pixels in the window and move child windows | |
8317 | accordingly. Use this function to optimise your scrolling | |
8318 | implementations, to minimise the area that must be redrawn. Note that | |
8319 | it is rarely required to call this function from a user program. | |
d55e5bfc RD |
8320 | """ |
8321 | return _core_.Window_ScrollWindow(*args, **kwargs) | |
8322 | ||
8323 | def ScrollLines(*args, **kwargs): | |
8324 | """ | |
8325 | ScrollLines(self, int lines) -> bool | |
8326 | ||
8327 | If the platform and window class supports it, scrolls the window by | |
8328 | the given number of lines down, if lines is positive, or up if lines | |
8329 | is negative. Returns True if the window was scrolled, False if it was | |
8330 | already on top/bottom and nothing was done. | |
8331 | """ | |
8332 | return _core_.Window_ScrollLines(*args, **kwargs) | |
8333 | ||
8334 | def ScrollPages(*args, **kwargs): | |
8335 | """ | |
8336 | ScrollPages(self, int pages) -> bool | |
8337 | ||
79fccf9d | 8338 | If the platform and window class supports it, scrolls the window by |
d55e5bfc RD |
8339 | the given number of pages down, if pages is positive, or up if pages |
8340 | is negative. Returns True if the window was scrolled, False if it was | |
8341 | already on top/bottom and nothing was done. | |
8342 | """ | |
8343 | return _core_.Window_ScrollPages(*args, **kwargs) | |
8344 | ||
8345 | def LineUp(*args, **kwargs): | |
8346 | """ | |
8347 | LineUp(self) -> bool | |
8348 | ||
8349 | This is just a wrapper for ScrollLines(-1). | |
8350 | """ | |
8351 | return _core_.Window_LineUp(*args, **kwargs) | |
8352 | ||
8353 | def LineDown(*args, **kwargs): | |
8354 | """ | |
8355 | LineDown(self) -> bool | |
8356 | ||
8357 | This is just a wrapper for ScrollLines(1). | |
8358 | """ | |
8359 | return _core_.Window_LineDown(*args, **kwargs) | |
8360 | ||
8361 | def PageUp(*args, **kwargs): | |
8362 | """ | |
8363 | PageUp(self) -> bool | |
8364 | ||
8365 | This is just a wrapper for ScrollPages(-1). | |
8366 | """ | |
8367 | return _core_.Window_PageUp(*args, **kwargs) | |
8368 | ||
8369 | def PageDown(*args, **kwargs): | |
8370 | """ | |
8371 | PageDown(self) -> bool | |
8372 | ||
8373 | This is just a wrapper for ScrollPages(1). | |
8374 | """ | |
8375 | return _core_.Window_PageDown(*args, **kwargs) | |
8376 | ||
8377 | def SetHelpText(*args, **kwargs): | |
8378 | """ | |
8379 | SetHelpText(self, String text) | |
8380 | ||
8381 | Sets the help text to be used as context-sensitive help for this | |
8382 | window. Note that the text is actually stored by the current | |
8383 | wxHelpProvider implementation, and not in the window object itself. | |
8384 | """ | |
8385 | return _core_.Window_SetHelpText(*args, **kwargs) | |
8386 | ||
8387 | def SetHelpTextForId(*args, **kwargs): | |
8388 | """ | |
8389 | SetHelpTextForId(self, String text) | |
8390 | ||
8391 | Associate this help text with all windows with the same id as this | |
8392 | one. | |
8393 | """ | |
8394 | return _core_.Window_SetHelpTextForId(*args, **kwargs) | |
8395 | ||
8396 | def GetHelpText(*args, **kwargs): | |
8397 | """ | |
8398 | GetHelpText(self) -> String | |
8399 | ||
8400 | Gets the help text to be used as context-sensitive help for this | |
8401 | window. Note that the text is actually stored by the current | |
8402 | wxHelpProvider implementation, and not in the window object itself. | |
8403 | """ | |
8404 | return _core_.Window_GetHelpText(*args, **kwargs) | |
8405 | ||
8406 | def SetToolTipString(*args, **kwargs): | |
8407 | """ | |
8408 | SetToolTipString(self, String tip) | |
8409 | ||
8410 | Attach a tooltip to the window. | |
8411 | """ | |
8412 | return _core_.Window_SetToolTipString(*args, **kwargs) | |
8413 | ||
8414 | def SetToolTip(*args, **kwargs): | |
8415 | """ | |
8416 | SetToolTip(self, ToolTip tip) | |
8417 | ||
8418 | Attach a tooltip to the window. | |
8419 | """ | |
8420 | return _core_.Window_SetToolTip(*args, **kwargs) | |
8421 | ||
8422 | def GetToolTip(*args, **kwargs): | |
8423 | """ | |
8424 | GetToolTip(self) -> ToolTip | |
8425 | ||
8426 | get the associated tooltip or None if none | |
8427 | """ | |
8428 | return _core_.Window_GetToolTip(*args, **kwargs) | |
8429 | ||
8430 | def SetDropTarget(*args, **kwargs): | |
8431 | """ | |
8432 | SetDropTarget(self, DropTarget dropTarget) | |
8433 | ||
8434 | Associates a drop target with this window. If the window already has | |
8435 | a drop target, it is deleted. | |
8436 | """ | |
8437 | return _core_.Window_SetDropTarget(*args, **kwargs) | |
8438 | ||
8439 | def GetDropTarget(*args, **kwargs): | |
8440 | """ | |
8441 | GetDropTarget(self) -> DropTarget | |
8442 | ||
8443 | Returns the associated drop target, which may be None. | |
8444 | """ | |
8445 | return _core_.Window_GetDropTarget(*args, **kwargs) | |
8446 | ||
8447 | def DragAcceptFiles(*args, **kwargs): | |
8448 | """ | |
8449 | DragAcceptFiles(self, bool accept) | |
8450 | ||
8451 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
8452 | Only available on Windows. | |
8453 | """ | |
8454 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
8455 | ||
8456 | def SetConstraints(*args, **kwargs): | |
8457 | """ | |
8458 | SetConstraints(self, LayoutConstraints constraints) | |
8459 | ||
8460 | Sets the window to have the given layout constraints. If an existing | |
8461 | layout constraints object is already owned by the window, it will be | |
8462 | deleted. Pass None to disassociate and delete the window's current | |
8463 | constraints. | |
8464 | ||
8465 | You must call SetAutoLayout to tell a window to use the constraints | |
8466 | automatically in its default EVT_SIZE handler; otherwise, you must | |
8467 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
8468 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
8469 | effect. | |
8470 | """ | |
8471 | return _core_.Window_SetConstraints(*args, **kwargs) | |
8472 | ||
8473 | def GetConstraints(*args, **kwargs): | |
8474 | """ | |
8475 | GetConstraints(self) -> LayoutConstraints | |
8476 | ||
8477 | Returns a pointer to the window's layout constraints, or None if there | |
8478 | are none. | |
8479 | """ | |
8480 | return _core_.Window_GetConstraints(*args, **kwargs) | |
8481 | ||
8482 | def SetAutoLayout(*args, **kwargs): | |
8483 | """ | |
8484 | SetAutoLayout(self, bool autoLayout) | |
8485 | ||
8486 | Determines whether the Layout function will be called automatically | |
8487 | when the window is resized. It is called implicitly by SetSizer but | |
8488 | if you use SetConstraints you should call it manually or otherwise the | |
8489 | window layout won't be correctly updated when its size changes. | |
8490 | """ | |
8491 | return _core_.Window_SetAutoLayout(*args, **kwargs) | |
8492 | ||
8493 | def GetAutoLayout(*args, **kwargs): | |
8494 | """ | |
8495 | GetAutoLayout(self) -> bool | |
8496 | ||
8497 | Returns the current autoLayout setting | |
8498 | """ | |
8499 | return _core_.Window_GetAutoLayout(*args, **kwargs) | |
8500 | ||
8501 | def Layout(*args, **kwargs): | |
8502 | """ | |
8503 | Layout(self) -> bool | |
8504 | ||
8505 | Invokes the constraint-based layout algorithm or the sizer-based | |
8506 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
8507 | this function gets called automatically by the default EVT_SIZE | |
8508 | handler when the window is resized. | |
8509 | """ | |
8510 | return _core_.Window_Layout(*args, **kwargs) | |
8511 | ||
8512 | def SetSizer(*args, **kwargs): | |
8513 | """ | |
8514 | SetSizer(self, Sizer sizer, bool deleteOld=True) | |
8515 | ||
8516 | Sets the window to have the given layout sizer. The window will then | |
8517 | own the object, and will take care of its deletion. If an existing | |
8518 | layout sizer object is already owned by the window, it will be deleted | |
8519 | if the deleteOld parameter is true. Note that this function will also | |
8520 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
ae8162c8 | 8521 | non-None, and False otherwise. |
d55e5bfc RD |
8522 | """ |
8523 | return _core_.Window_SetSizer(*args, **kwargs) | |
8524 | ||
8525 | def SetSizerAndFit(*args, **kwargs): | |
8526 | """ | |
8527 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) | |
8528 | ||
8529 | The same as SetSizer, except it also sets the size hints for the | |
8530 | window based on the sizer's minimum size. | |
8531 | """ | |
8532 | return _core_.Window_SetSizerAndFit(*args, **kwargs) | |
8533 | ||
8534 | def GetSizer(*args, **kwargs): | |
8535 | """ | |
8536 | GetSizer(self) -> Sizer | |
8537 | ||
8538 | Return the sizer associated with the window by a previous call to | |
8539 | SetSizer or None if there isn't one. | |
8540 | """ | |
8541 | return _core_.Window_GetSizer(*args, **kwargs) | |
8542 | ||
8543 | def SetContainingSizer(*args, **kwargs): | |
8544 | """ | |
8545 | SetContainingSizer(self, Sizer sizer) | |
8546 | ||
8547 | This normally does not need to be called by application code. It is | |
8548 | called internally when a window is added to a sizer, and is used so | |
8549 | the window can remove itself from the sizer when it is destroyed. | |
8550 | """ | |
8551 | return _core_.Window_SetContainingSizer(*args, **kwargs) | |
8552 | ||
8553 | def GetContainingSizer(*args, **kwargs): | |
8554 | """ | |
8555 | GetContainingSizer(self) -> Sizer | |
8556 | ||
8557 | Return the sizer that this window is a member of, if any, otherwise None. | |
8558 | """ | |
8559 | return _core_.Window_GetContainingSizer(*args, **kwargs) | |
8560 | ||
8561 | def InheritAttributes(*args, **kwargs): | |
8562 | """ | |
8563 | InheritAttributes(self) | |
8564 | ||
79fccf9d RD |
8565 | This function is (or should be, in case of custom controls) called |
8566 | during window creation to intelligently set up the window visual | |
8567 | attributes, that is the font and the foreground and background | |
8568 | colours. | |
8569 | ||
8570 | By 'intelligently' the following is meant: by default, all windows use | |
8571 | their own default attributes. However if some of the parent's | |
8572 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 8573 | SetOwnFont) and if the corresponding attribute hadn't been |
79fccf9d RD |
8574 | explicitly set for this window itself, then this window takes the same |
8575 | value as used by the parent. In addition, if the window overrides | |
8576 | ShouldInheritColours to return false, the colours will not be changed | |
8577 | no matter what and only the font might. | |
8578 | ||
ec9b55ca RD |
8579 | This rather complicated logic is necessary in order to accommodate the |
8580 | different usage scenarios. The most common one is when all default | |
79fccf9d RD |
8581 | attributes are used and in this case, nothing should be inherited as |
8582 | in modern GUIs different controls use different fonts (and colours) | |
8583 | than their siblings so they can't inherit the same value from the | |
8584 | parent. However it was also deemed desirable to allow to simply change | |
8585 | the attributes of all children at once by just changing the font or | |
8586 | colour of their common parent, hence in this case we do inherit the | |
8587 | parents attributes. | |
8588 | ||
d55e5bfc RD |
8589 | """ |
8590 | return _core_.Window_InheritAttributes(*args, **kwargs) | |
8591 | ||
8592 | def ShouldInheritColours(*args, **kwargs): | |
8593 | """ | |
8594 | ShouldInheritColours(self) -> bool | |
8595 | ||
8596 | Return true from here to allow the colours of this window to be | |
79fccf9d RD |
8597 | changed by InheritAttributes, returning false forbids inheriting them |
8598 | from the parent window. | |
d55e5bfc | 8599 | |
79fccf9d RD |
8600 | The base class version returns false, but this method is overridden in |
8601 | wxControl where it returns true. | |
d55e5bfc RD |
8602 | """ |
8603 | return _core_.Window_ShouldInheritColours(*args, **kwargs) | |
8604 | ||
8605 | def PostCreate(self, pre): | |
8606 | """ | |
8607 | Phase 3 of the 2-phase create <wink!> | |
8608 | Call this method after precreating the window with the 2-phase create method. | |
8609 | """ | |
8610 | self.this = pre.this | |
8611 | self.thisown = pre.thisown | |
8612 | pre.thisown = 0 | |
8613 | if hasattr(self, '_setOORInfo'): | |
8614 | self._setOORInfo(self) | |
8615 | if hasattr(self, '_setCallbackInfo'): | |
8616 | self._setCallbackInfo(self, self.__class__) | |
8617 | ||
8618 | ||
8619 | class WindowPtr(Window): | |
8620 | def __init__(self, this): | |
8621 | self.this = this | |
8622 | if not hasattr(self,"thisown"): self.thisown = 0 | |
8623 | self.__class__ = Window | |
8624 | _core_.Window_swigregister(WindowPtr) | |
8625 | ||
8626 | def PreWindow(*args, **kwargs): | |
8627 | """ | |
8628 | PreWindow() -> Window | |
8629 | ||
8630 | Precreate a Window for 2-phase creation. | |
8631 | """ | |
8632 | val = _core_.new_PreWindow(*args, **kwargs) | |
8633 | val.thisown = 1 | |
8634 | return val | |
8635 | ||
8636 | def Window_NewControlId(*args, **kwargs): | |
8637 | """ | |
8638 | Window_NewControlId() -> int | |
8639 | ||
8640 | Generate a control id for the controls which were not given one. | |
8641 | """ | |
8642 | return _core_.Window_NewControlId(*args, **kwargs) | |
8643 | ||
8644 | def Window_NextControlId(*args, **kwargs): | |
8645 | """ | |
8646 | Window_NextControlId(int winid) -> int | |
8647 | ||
8648 | Get the id of the control following the one with the given | |
79fccf9d | 8649 | autogenerated) id |
d55e5bfc RD |
8650 | """ |
8651 | return _core_.Window_NextControlId(*args, **kwargs) | |
8652 | ||
8653 | def Window_PrevControlId(*args, **kwargs): | |
8654 | """ | |
8655 | Window_PrevControlId(int winid) -> int | |
8656 | ||
8657 | Get the id of the control preceding the one with the given | |
79fccf9d | 8658 | autogenerated) id |
d55e5bfc RD |
8659 | """ |
8660 | return _core_.Window_PrevControlId(*args, **kwargs) | |
8661 | ||
8662 | def Window_FindFocus(*args, **kwargs): | |
8663 | """ | |
8664 | Window_FindFocus() -> Window | |
8665 | ||
8666 | Returns the window or control that currently has the keyboard focus, | |
8667 | or None. | |
8668 | """ | |
8669 | return _core_.Window_FindFocus(*args, **kwargs) | |
8670 | ||
8671 | def Window_GetCapture(*args, **kwargs): | |
8672 | """ | |
8673 | Window_GetCapture() -> Window | |
8674 | ||
8675 | Returns the window which currently captures the mouse or None | |
8676 | """ | |
8677 | return _core_.Window_GetCapture(*args, **kwargs) | |
8678 | ||
8679 | def Window_GetClassDefaultAttributes(*args, **kwargs): | |
8680 | """ | |
8681 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
8682 | ||
79fccf9d RD |
8683 | Get the default attributes for this class. This is useful if you want |
8684 | to use the same font or colour in your own control as in a standard | |
8685 | control -- which is a much better idea than hard coding specific | |
caef1a4d RD |
8686 | colours or fonts which might look completely out of place on the |
8687 | user's system, especially if it uses themes. | |
d55e5bfc RD |
8688 | |
8689 | The variant parameter is only relevant under Mac currently and is | |
79fccf9d | 8690 | ignore under other platforms. Under Mac, it will change the size of |
caef1a4d RD |
8691 | the returned font. See `wx.Window.SetWindowVariant` for more about |
8692 | this. | |
d55e5bfc RD |
8693 | """ |
8694 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) | |
8695 | ||
8696 | def DLG_PNT(win, point_or_x, y=None): | |
8697 | """ | |
8698 | Convenience function for converting a Point or (x,y) in | |
8699 | dialog units to pixel units. | |
8700 | """ | |
8701 | if y is None: | |
8702 | return win.ConvertDialogPointToPixels(point_or_x) | |
8703 | else: | |
8704 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) | |
8705 | ||
8706 | def DLG_SZE(win, size_width, height=None): | |
8707 | """ | |
8708 | Convenience function for converting a Size or (w,h) in | |
8709 | dialog units to pixel units. | |
8710 | """ | |
8711 | if height is None: | |
8712 | return win.ConvertDialogSizeToPixels(size_width) | |
8713 | else: | |
8714 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) | |
8715 | ||
8716 | ||
8717 | def FindWindowById(*args, **kwargs): | |
8718 | """ | |
8719 | FindWindowById(long id, Window parent=None) -> Window | |
8720 | ||
8721 | Find the first window in the application with the given id. If parent | |
8722 | is None, the search will start from all top-level frames and dialog | |
8723 | boxes; if non-None, the search will be limited to the given window | |
8724 | hierarchy. The search is recursive in both cases. | |
8725 | """ | |
8726 | return _core_.FindWindowById(*args, **kwargs) | |
8727 | ||
8728 | def FindWindowByName(*args, **kwargs): | |
8729 | """ | |
8730 | FindWindowByName(String name, Window parent=None) -> Window | |
8731 | ||
8732 | Find a window by its name (as given in a window constructor or Create | |
8733 | function call). If parent is None, the search will start from all | |
8734 | top-level frames and dialog boxes; if non-None, the search will be | |
8735 | limited to the given window hierarchy. The search is recursive in both | |
8736 | cases. | |
8737 | ||
8738 | If no window with such name is found, wx.FindWindowByLabel is called. | |
8739 | """ | |
8740 | return _core_.FindWindowByName(*args, **kwargs) | |
8741 | ||
8742 | def FindWindowByLabel(*args, **kwargs): | |
8743 | """ | |
8744 | FindWindowByLabel(String label, Window parent=None) -> Window | |
8745 | ||
8746 | Find a window by its label. Depending on the type of window, the label | |
8747 | may be a window title or panel item label. If parent is None, the | |
8748 | search will start from all top-level frames and dialog boxes; if | |
8749 | non-None, the search will be limited to the given window | |
8750 | hierarchy. The search is recursive in both cases. | |
8751 | """ | |
8752 | return _core_.FindWindowByLabel(*args, **kwargs) | |
8753 | ||
8754 | def Window_FromHWND(*args, **kwargs): | |
8755 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" | |
8756 | return _core_.Window_FromHWND(*args, **kwargs) | |
3215336e RD |
8757 | |
8758 | def GetTopLevelWindows(*args, **kwargs): | |
8759 | """ | |
8760 | GetTopLevelWindows() -> PyObject | |
8761 | ||
8762 | Returns a list of the the application's top-level windows, (frames, | |
8763 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
8764 | by wxWidgets, and so it is only valid as long as no top-level windows | |
8765 | are closed or new top-level windows are created. | |
8766 | ||
8767 | """ | |
8768 | return _core_.GetTopLevelWindows(*args, **kwargs) | |
d55e5bfc RD |
8769 | #--------------------------------------------------------------------------- |
8770 | ||
8771 | class Validator(EvtHandler): | |
093d3ff1 | 8772 | """Proxy of C++ Validator class""" |
d55e5bfc RD |
8773 | def __repr__(self): |
8774 | return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
8775 | def __init__(self, *args, **kwargs): | |
8776 | """__init__(self) -> Validator""" | |
8777 | newobj = _core_.new_Validator(*args, **kwargs) | |
8778 | self.this = newobj.this | |
8779 | self.thisown = 1 | |
8780 | del newobj.thisown | |
8781 | self._setOORInfo(self) | |
8782 | ||
8783 | def Clone(*args, **kwargs): | |
8784 | """Clone(self) -> Validator""" | |
8785 | return _core_.Validator_Clone(*args, **kwargs) | |
8786 | ||
8787 | def Validate(*args, **kwargs): | |
8788 | """Validate(self, Window parent) -> bool""" | |
8789 | return _core_.Validator_Validate(*args, **kwargs) | |
8790 | ||
8791 | def TransferToWindow(*args, **kwargs): | |
8792 | """TransferToWindow(self) -> bool""" | |
8793 | return _core_.Validator_TransferToWindow(*args, **kwargs) | |
8794 | ||
8795 | def TransferFromWindow(*args, **kwargs): | |
8796 | """TransferFromWindow(self) -> bool""" | |
8797 | return _core_.Validator_TransferFromWindow(*args, **kwargs) | |
8798 | ||
8799 | def GetWindow(*args, **kwargs): | |
8800 | """GetWindow(self) -> Window""" | |
8801 | return _core_.Validator_GetWindow(*args, **kwargs) | |
8802 | ||
8803 | def SetWindow(*args, **kwargs): | |
8804 | """SetWindow(self, Window window)""" | |
8805 | return _core_.Validator_SetWindow(*args, **kwargs) | |
8806 | ||
8807 | def IsSilent(*args, **kwargs): | |
c24da6d6 | 8808 | """IsSilent() -> bool""" |
d55e5bfc RD |
8809 | return _core_.Validator_IsSilent(*args, **kwargs) |
8810 | ||
8811 | IsSilent = staticmethod(IsSilent) | |
8812 | def SetBellOnError(*args, **kwargs): | |
c24da6d6 | 8813 | """SetBellOnError(int doIt=True)""" |
d55e5bfc RD |
8814 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
8815 | ||
8816 | SetBellOnError = staticmethod(SetBellOnError) | |
8817 | ||
8818 | class ValidatorPtr(Validator): | |
8819 | def __init__(self, this): | |
8820 | self.this = this | |
8821 | if not hasattr(self,"thisown"): self.thisown = 0 | |
8822 | self.__class__ = Validator | |
8823 | _core_.Validator_swigregister(ValidatorPtr) | |
8824 | ||
8825 | def Validator_IsSilent(*args, **kwargs): | |
8826 | """Validator_IsSilent() -> bool""" | |
8827 | return _core_.Validator_IsSilent(*args, **kwargs) | |
8828 | ||
8829 | def Validator_SetBellOnError(*args, **kwargs): | |
8830 | """Validator_SetBellOnError(int doIt=True)""" | |
8831 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
8832 | ||
8833 | class PyValidator(Validator): | |
093d3ff1 | 8834 | """Proxy of C++ PyValidator class""" |
d55e5bfc RD |
8835 | def __repr__(self): |
8836 | return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
8837 | def __init__(self, *args, **kwargs): | |
8838 | """__init__(self) -> PyValidator""" | |
8839 | newobj = _core_.new_PyValidator(*args, **kwargs) | |
8840 | self.this = newobj.this | |
8841 | self.thisown = 1 | |
8842 | del newobj.thisown | |
8843 | ||
8844 | self._setCallbackInfo(self, PyValidator, 1) | |
8845 | self._setOORInfo(self) | |
8846 | ||
8847 | def _setCallbackInfo(*args, **kwargs): | |
8848 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" | |
8849 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) | |
8850 | ||
8851 | ||
8852 | class PyValidatorPtr(PyValidator): | |
8853 | def __init__(self, this): | |
8854 | self.this = this | |
8855 | if not hasattr(self,"thisown"): self.thisown = 0 | |
8856 | self.__class__ = PyValidator | |
8857 | _core_.PyValidator_swigregister(PyValidatorPtr) | |
8858 | ||
8859 | #--------------------------------------------------------------------------- | |
8860 | ||
8861 | class Menu(EvtHandler): | |
093d3ff1 | 8862 | """Proxy of C++ Menu class""" |
d55e5bfc RD |
8863 | def __repr__(self): |
8864 | return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
8865 | def __init__(self, *args, **kwargs): | |
8866 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" | |
8867 | newobj = _core_.new_Menu(*args, **kwargs) | |
8868 | self.this = newobj.this | |
8869 | self.thisown = 1 | |
8870 | del newobj.thisown | |
8871 | self._setOORInfo(self) | |
8872 | ||
8873 | def Append(*args, **kwargs): | |
8874 | """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" | |
8875 | return _core_.Menu_Append(*args, **kwargs) | |
8876 | ||
8877 | def AppendSeparator(*args, **kwargs): | |
8878 | """AppendSeparator(self) -> MenuItem""" | |
8879 | return _core_.Menu_AppendSeparator(*args, **kwargs) | |
8880 | ||
8881 | def AppendCheckItem(*args, **kwargs): | |
8882 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
8883 | return _core_.Menu_AppendCheckItem(*args, **kwargs) | |
8884 | ||
8885 | def AppendRadioItem(*args, **kwargs): | |
8886 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
8887 | return _core_.Menu_AppendRadioItem(*args, **kwargs) | |
8888 | ||
8889 | def AppendMenu(*args, **kwargs): | |
8890 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
8891 | return _core_.Menu_AppendMenu(*args, **kwargs) | |
8892 | ||
8893 | def AppendItem(*args, **kwargs): | |
8894 | """AppendItem(self, MenuItem item) -> MenuItem""" | |
8895 | return _core_.Menu_AppendItem(*args, **kwargs) | |
8896 | ||
8897 | def Break(*args, **kwargs): | |
8898 | """Break(self)""" | |
8899 | return _core_.Menu_Break(*args, **kwargs) | |
8900 | ||
8901 | def InsertItem(*args, **kwargs): | |
8902 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" | |
8903 | return _core_.Menu_InsertItem(*args, **kwargs) | |
8904 | ||
8905 | def Insert(*args, **kwargs): | |
8906 | """ | |
8907 | Insert(self, size_t pos, int id, String text, String help=EmptyString, | |
8908 | int kind=ITEM_NORMAL) -> MenuItem | |
8909 | """ | |
8910 | return _core_.Menu_Insert(*args, **kwargs) | |
8911 | ||
8912 | def InsertSeparator(*args, **kwargs): | |
8913 | """InsertSeparator(self, size_t pos) -> MenuItem""" | |
8914 | return _core_.Menu_InsertSeparator(*args, **kwargs) | |
8915 | ||
8916 | def InsertCheckItem(*args, **kwargs): | |
8917 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" | |
8918 | return _core_.Menu_InsertCheckItem(*args, **kwargs) | |
8919 | ||
8920 | def InsertRadioItem(*args, **kwargs): | |
8921 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" | |
8922 | return _core_.Menu_InsertRadioItem(*args, **kwargs) | |
8923 | ||
8924 | def InsertMenu(*args, **kwargs): | |
8925 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
8926 | return _core_.Menu_InsertMenu(*args, **kwargs) | |
8927 | ||
8928 | def PrependItem(*args, **kwargs): | |
8929 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
8930 | return _core_.Menu_PrependItem(*args, **kwargs) | |
8931 | ||
8932 | def Prepend(*args, **kwargs): | |
8933 | """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" | |
8934 | return _core_.Menu_Prepend(*args, **kwargs) | |
8935 | ||
8936 | def PrependSeparator(*args, **kwargs): | |
8937 | """PrependSeparator(self) -> MenuItem""" | |
8938 | return _core_.Menu_PrependSeparator(*args, **kwargs) | |
8939 | ||
8940 | def PrependCheckItem(*args, **kwargs): | |
8941 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
8942 | return _core_.Menu_PrependCheckItem(*args, **kwargs) | |
8943 | ||
8944 | def PrependRadioItem(*args, **kwargs): | |
8945 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
8946 | return _core_.Menu_PrependRadioItem(*args, **kwargs) | |
8947 | ||
8948 | def PrependMenu(*args, **kwargs): | |
8949 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
8950 | return _core_.Menu_PrependMenu(*args, **kwargs) | |
8951 | ||
8952 | def Remove(*args, **kwargs): | |
8953 | """Remove(self, int id) -> MenuItem""" | |
8954 | return _core_.Menu_Remove(*args, **kwargs) | |
8955 | ||
8956 | def RemoveItem(*args, **kwargs): | |
8957 | """RemoveItem(self, MenuItem item) -> MenuItem""" | |
8958 | return _core_.Menu_RemoveItem(*args, **kwargs) | |
8959 | ||
8960 | def Delete(*args, **kwargs): | |
8961 | """Delete(self, int id) -> bool""" | |
8962 | return _core_.Menu_Delete(*args, **kwargs) | |
8963 | ||
8964 | def DeleteItem(*args, **kwargs): | |
8965 | """DeleteItem(self, MenuItem item) -> bool""" | |
8966 | return _core_.Menu_DeleteItem(*args, **kwargs) | |
8967 | ||
8968 | def Destroy(*args, **kwargs): | |
8969 | """ | |
8970 | Destroy(self) | |
8971 | ||
8972 | Deletes the C++ object this Python object is a proxy for. | |
8973 | """ | |
8974 | return _core_.Menu_Destroy(*args, **kwargs) | |
8975 | ||
8976 | def DestroyId(*args, **kwargs): | |
8977 | """ | |
8978 | DestroyId(self, int id) -> bool | |
8979 | ||
8980 | Deletes the C++ object this Python object is a proxy for. | |
8981 | """ | |
8982 | return _core_.Menu_DestroyId(*args, **kwargs) | |
8983 | ||
8984 | def DestroyItem(*args, **kwargs): | |
8985 | """ | |
8986 | DestroyItem(self, MenuItem item) -> bool | |
8987 | ||
8988 | Deletes the C++ object this Python object is a proxy for. | |
8989 | """ | |
8990 | return _core_.Menu_DestroyItem(*args, **kwargs) | |
8991 | ||
8992 | def GetMenuItemCount(*args, **kwargs): | |
8993 | """GetMenuItemCount(self) -> size_t""" | |
8994 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) | |
8995 | ||
8996 | def GetMenuItems(*args, **kwargs): | |
8997 | """GetMenuItems(self) -> PyObject""" | |
8998 | return _core_.Menu_GetMenuItems(*args, **kwargs) | |
8999 | ||
9000 | def FindItem(*args, **kwargs): | |
9001 | """FindItem(self, String item) -> int""" | |
9002 | return _core_.Menu_FindItem(*args, **kwargs) | |
9003 | ||
9004 | def FindItemById(*args, **kwargs): | |
9005 | """FindItemById(self, int id) -> MenuItem""" | |
9006 | return _core_.Menu_FindItemById(*args, **kwargs) | |
9007 | ||
9008 | def FindItemByPosition(*args, **kwargs): | |
9009 | """FindItemByPosition(self, size_t position) -> MenuItem""" | |
9010 | return _core_.Menu_FindItemByPosition(*args, **kwargs) | |
9011 | ||
9012 | def Enable(*args, **kwargs): | |
9013 | """Enable(self, int id, bool enable)""" | |
9014 | return _core_.Menu_Enable(*args, **kwargs) | |
9015 | ||
9016 | def IsEnabled(*args, **kwargs): | |
9017 | """IsEnabled(self, int id) -> bool""" | |
9018 | return _core_.Menu_IsEnabled(*args, **kwargs) | |
9019 | ||
9020 | def Check(*args, **kwargs): | |
9021 | """Check(self, int id, bool check)""" | |
9022 | return _core_.Menu_Check(*args, **kwargs) | |
9023 | ||
9024 | def IsChecked(*args, **kwargs): | |
9025 | """IsChecked(self, int id) -> bool""" | |
9026 | return _core_.Menu_IsChecked(*args, **kwargs) | |
9027 | ||
9028 | def SetLabel(*args, **kwargs): | |
9029 | """SetLabel(self, int id, String label)""" | |
9030 | return _core_.Menu_SetLabel(*args, **kwargs) | |
9031 | ||
9032 | def GetLabel(*args, **kwargs): | |
9033 | """GetLabel(self, int id) -> String""" | |
9034 | return _core_.Menu_GetLabel(*args, **kwargs) | |
9035 | ||
9036 | def SetHelpString(*args, **kwargs): | |
9037 | """SetHelpString(self, int id, String helpString)""" | |
9038 | return _core_.Menu_SetHelpString(*args, **kwargs) | |
9039 | ||
9040 | def GetHelpString(*args, **kwargs): | |
9041 | """GetHelpString(self, int id) -> String""" | |
9042 | return _core_.Menu_GetHelpString(*args, **kwargs) | |
9043 | ||
9044 | def SetTitle(*args, **kwargs): | |
9045 | """SetTitle(self, String title)""" | |
9046 | return _core_.Menu_SetTitle(*args, **kwargs) | |
9047 | ||
9048 | def GetTitle(*args, **kwargs): | |
9049 | """GetTitle(self) -> String""" | |
9050 | return _core_.Menu_GetTitle(*args, **kwargs) | |
9051 | ||
9052 | def SetEventHandler(*args, **kwargs): | |
9053 | """SetEventHandler(self, EvtHandler handler)""" | |
9054 | return _core_.Menu_SetEventHandler(*args, **kwargs) | |
9055 | ||
9056 | def GetEventHandler(*args, **kwargs): | |
9057 | """GetEventHandler(self) -> EvtHandler""" | |
9058 | return _core_.Menu_GetEventHandler(*args, **kwargs) | |
9059 | ||
9060 | def SetInvokingWindow(*args, **kwargs): | |
9061 | """SetInvokingWindow(self, Window win)""" | |
9062 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) | |
9063 | ||
9064 | def GetInvokingWindow(*args, **kwargs): | |
9065 | """GetInvokingWindow(self) -> Window""" | |
9066 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) | |
9067 | ||
9068 | def GetStyle(*args, **kwargs): | |
9069 | """GetStyle(self) -> long""" | |
9070 | return _core_.Menu_GetStyle(*args, **kwargs) | |
9071 | ||
9072 | def UpdateUI(*args, **kwargs): | |
9073 | """UpdateUI(self, EvtHandler source=None)""" | |
9074 | return _core_.Menu_UpdateUI(*args, **kwargs) | |
9075 | ||
9076 | def GetMenuBar(*args, **kwargs): | |
9077 | """GetMenuBar(self) -> MenuBar""" | |
9078 | return _core_.Menu_GetMenuBar(*args, **kwargs) | |
9079 | ||
9080 | def Attach(*args, **kwargs): | |
9081 | """Attach(self, wxMenuBarBase menubar)""" | |
9082 | return _core_.Menu_Attach(*args, **kwargs) | |
9083 | ||
9084 | def Detach(*args, **kwargs): | |
9085 | """Detach(self)""" | |
9086 | return _core_.Menu_Detach(*args, **kwargs) | |
9087 | ||
9088 | def IsAttached(*args, **kwargs): | |
9089 | """IsAttached(self) -> bool""" | |
9090 | return _core_.Menu_IsAttached(*args, **kwargs) | |
9091 | ||
9092 | def SetParent(*args, **kwargs): | |
9093 | """SetParent(self, Menu parent)""" | |
9094 | return _core_.Menu_SetParent(*args, **kwargs) | |
9095 | ||
9096 | def GetParent(*args, **kwargs): | |
9097 | """GetParent(self) -> Menu""" | |
9098 | return _core_.Menu_GetParent(*args, **kwargs) | |
9099 | ||
9100 | ||
9101 | class MenuPtr(Menu): | |
9102 | def __init__(self, this): | |
9103 | self.this = this | |
9104 | if not hasattr(self,"thisown"): self.thisown = 0 | |
9105 | self.__class__ = Menu | |
9106 | _core_.Menu_swigregister(MenuPtr) | |
9107 | DefaultValidator = cvar.DefaultValidator | |
9108 | ||
9109 | #--------------------------------------------------------------------------- | |
9110 | ||
9111 | class MenuBar(Window): | |
093d3ff1 | 9112 | """Proxy of C++ MenuBar class""" |
d55e5bfc RD |
9113 | def __repr__(self): |
9114 | return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
9115 | def __init__(self, *args, **kwargs): | |
9116 | """__init__(self, long style=0) -> MenuBar""" | |
9117 | newobj = _core_.new_MenuBar(*args, **kwargs) | |
9118 | self.this = newobj.this | |
9119 | self.thisown = 1 | |
9120 | del newobj.thisown | |
9121 | self._setOORInfo(self) | |
9122 | ||
9123 | def Append(*args, **kwargs): | |
9124 | """Append(self, Menu menu, String title) -> bool""" | |
9125 | return _core_.MenuBar_Append(*args, **kwargs) | |
9126 | ||
9127 | def Insert(*args, **kwargs): | |
9128 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" | |
9129 | return _core_.MenuBar_Insert(*args, **kwargs) | |
9130 | ||
9131 | def GetMenuCount(*args, **kwargs): | |
9132 | """GetMenuCount(self) -> size_t""" | |
9133 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) | |
9134 | ||
9135 | def GetMenu(*args, **kwargs): | |
9136 | """GetMenu(self, size_t pos) -> Menu""" | |
9137 | return _core_.MenuBar_GetMenu(*args, **kwargs) | |
9138 | ||
9139 | def Replace(*args, **kwargs): | |
9140 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" | |
9141 | return _core_.MenuBar_Replace(*args, **kwargs) | |
9142 | ||
9143 | def Remove(*args, **kwargs): | |
9144 | """Remove(self, size_t pos) -> Menu""" | |
9145 | return _core_.MenuBar_Remove(*args, **kwargs) | |
9146 | ||
9147 | def EnableTop(*args, **kwargs): | |
9148 | """EnableTop(self, size_t pos, bool enable)""" | |
9149 | return _core_.MenuBar_EnableTop(*args, **kwargs) | |
9150 | ||
9151 | def IsEnabledTop(*args, **kwargs): | |
9152 | """IsEnabledTop(self, size_t pos) -> bool""" | |
9153 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) | |
9154 | ||
9155 | def SetLabelTop(*args, **kwargs): | |
9156 | """SetLabelTop(self, size_t pos, String label)""" | |
9157 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) | |
9158 | ||
9159 | def GetLabelTop(*args, **kwargs): | |
9160 | """GetLabelTop(self, size_t pos) -> String""" | |
9161 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) | |
9162 | ||
9163 | def FindMenuItem(*args, **kwargs): | |
9164 | """FindMenuItem(self, String menu, String item) -> int""" | |
9165 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) | |
9166 | ||
9167 | def FindItemById(*args, **kwargs): | |
9168 | """FindItemById(self, int id) -> MenuItem""" | |
9169 | return _core_.MenuBar_FindItemById(*args, **kwargs) | |
9170 | ||
9171 | def FindMenu(*args, **kwargs): | |
9172 | """FindMenu(self, String title) -> int""" | |
9173 | return _core_.MenuBar_FindMenu(*args, **kwargs) | |
9174 | ||
9175 | def Enable(*args, **kwargs): | |
9176 | """Enable(self, int id, bool enable)""" | |
9177 | return _core_.MenuBar_Enable(*args, **kwargs) | |
9178 | ||
9179 | def Check(*args, **kwargs): | |
9180 | """Check(self, int id, bool check)""" | |
9181 | return _core_.MenuBar_Check(*args, **kwargs) | |
9182 | ||
9183 | def IsChecked(*args, **kwargs): | |
9184 | """IsChecked(self, int id) -> bool""" | |
9185 | return _core_.MenuBar_IsChecked(*args, **kwargs) | |
9186 | ||
9187 | def IsEnabled(*args, **kwargs): | |
9188 | """IsEnabled(self, int id) -> bool""" | |
9189 | return _core_.MenuBar_IsEnabled(*args, **kwargs) | |
9190 | ||
9191 | def SetLabel(*args, **kwargs): | |
9192 | """SetLabel(self, int id, String label)""" | |
9193 | return _core_.MenuBar_SetLabel(*args, **kwargs) | |
9194 | ||
9195 | def GetLabel(*args, **kwargs): | |
9196 | """GetLabel(self, int id) -> String""" | |
9197 | return _core_.MenuBar_GetLabel(*args, **kwargs) | |
9198 | ||
9199 | def SetHelpString(*args, **kwargs): | |
9200 | """SetHelpString(self, int id, String helpString)""" | |
9201 | return _core_.MenuBar_SetHelpString(*args, **kwargs) | |
9202 | ||
9203 | def GetHelpString(*args, **kwargs): | |
9204 | """GetHelpString(self, int id) -> String""" | |
9205 | return _core_.MenuBar_GetHelpString(*args, **kwargs) | |
9206 | ||
9207 | def GetFrame(*args, **kwargs): | |
9208 | """GetFrame(self) -> wxFrame""" | |
9209 | return _core_.MenuBar_GetFrame(*args, **kwargs) | |
9210 | ||
9211 | def IsAttached(*args, **kwargs): | |
9212 | """IsAttached(self) -> bool""" | |
9213 | return _core_.MenuBar_IsAttached(*args, **kwargs) | |
9214 | ||
9215 | def Attach(*args, **kwargs): | |
9216 | """Attach(self, wxFrame frame)""" | |
9217 | return _core_.MenuBar_Attach(*args, **kwargs) | |
9218 | ||
9219 | def Detach(*args, **kwargs): | |
9220 | """Detach(self)""" | |
9221 | return _core_.MenuBar_Detach(*args, **kwargs) | |
9222 | ||
9223 | ||
9224 | class MenuBarPtr(MenuBar): | |
9225 | def __init__(self, this): | |
9226 | self.this = this | |
9227 | if not hasattr(self,"thisown"): self.thisown = 0 | |
9228 | self.__class__ = MenuBar | |
9229 | _core_.MenuBar_swigregister(MenuBarPtr) | |
9230 | ||
9231 | #--------------------------------------------------------------------------- | |
9232 | ||
9233 | class MenuItem(Object): | |
093d3ff1 | 9234 | """Proxy of C++ MenuItem class""" |
d55e5bfc RD |
9235 | def __repr__(self): |
9236 | return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
9237 | def __init__(self, *args, **kwargs): | |
9238 | """ | |
9239 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, | |
9240 | String help=EmptyString, int kind=ITEM_NORMAL, | |
9241 | Menu subMenu=None) -> MenuItem | |
9242 | """ | |
9243 | newobj = _core_.new_MenuItem(*args, **kwargs) | |
9244 | self.this = newobj.this | |
9245 | self.thisown = 1 | |
9246 | del newobj.thisown | |
9247 | def GetMenu(*args, **kwargs): | |
9248 | """GetMenu(self) -> Menu""" | |
9249 | return _core_.MenuItem_GetMenu(*args, **kwargs) | |
9250 | ||
9251 | def SetMenu(*args, **kwargs): | |
9252 | """SetMenu(self, Menu menu)""" | |
9253 | return _core_.MenuItem_SetMenu(*args, **kwargs) | |
9254 | ||
9255 | def SetId(*args, **kwargs): | |
9256 | """SetId(self, int id)""" | |
9257 | return _core_.MenuItem_SetId(*args, **kwargs) | |
9258 | ||
9259 | def GetId(*args, **kwargs): | |
9260 | """GetId(self) -> int""" | |
9261 | return _core_.MenuItem_GetId(*args, **kwargs) | |
9262 | ||
9263 | def IsSeparator(*args, **kwargs): | |
9264 | """IsSeparator(self) -> bool""" | |
9265 | return _core_.MenuItem_IsSeparator(*args, **kwargs) | |
9266 | ||
9267 | def SetText(*args, **kwargs): | |
9268 | """SetText(self, String str)""" | |
9269 | return _core_.MenuItem_SetText(*args, **kwargs) | |
9270 | ||
9271 | def GetLabel(*args, **kwargs): | |
9272 | """GetLabel(self) -> String""" | |
9273 | return _core_.MenuItem_GetLabel(*args, **kwargs) | |
9274 | ||
9275 | def GetText(*args, **kwargs): | |
9276 | """GetText(self) -> String""" | |
9277 | return _core_.MenuItem_GetText(*args, **kwargs) | |
9278 | ||
9279 | def GetLabelFromText(*args, **kwargs): | |
c24da6d6 | 9280 | """GetLabelFromText(String text) -> String""" |
d55e5bfc RD |
9281 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
9282 | ||
9283 | GetLabelFromText = staticmethod(GetLabelFromText) | |
9284 | def GetKind(*args, **kwargs): | |
9285 | """GetKind(self) -> int""" | |
9286 | return _core_.MenuItem_GetKind(*args, **kwargs) | |
9287 | ||
9288 | def SetKind(*args, **kwargs): | |
9289 | """SetKind(self, int kind)""" | |
9290 | return _core_.MenuItem_SetKind(*args, **kwargs) | |
9291 | ||
9292 | def SetCheckable(*args, **kwargs): | |
9293 | """SetCheckable(self, bool checkable)""" | |
9294 | return _core_.MenuItem_SetCheckable(*args, **kwargs) | |
9295 | ||
9296 | def IsCheckable(*args, **kwargs): | |
9297 | """IsCheckable(self) -> bool""" | |
9298 | return _core_.MenuItem_IsCheckable(*args, **kwargs) | |
9299 | ||
9300 | def IsSubMenu(*args, **kwargs): | |
9301 | """IsSubMenu(self) -> bool""" | |
9302 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) | |
9303 | ||
9304 | def SetSubMenu(*args, **kwargs): | |
9305 | """SetSubMenu(self, Menu menu)""" | |
9306 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) | |
9307 | ||
9308 | def GetSubMenu(*args, **kwargs): | |
9309 | """GetSubMenu(self) -> Menu""" | |
9310 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) | |
9311 | ||
9312 | def Enable(*args, **kwargs): | |
9313 | """Enable(self, bool enable=True)""" | |
9314 | return _core_.MenuItem_Enable(*args, **kwargs) | |
9315 | ||
9316 | def IsEnabled(*args, **kwargs): | |
9317 | """IsEnabled(self) -> bool""" | |
9318 | return _core_.MenuItem_IsEnabled(*args, **kwargs) | |
9319 | ||
9320 | def Check(*args, **kwargs): | |
9321 | """Check(self, bool check=True)""" | |
9322 | return _core_.MenuItem_Check(*args, **kwargs) | |
9323 | ||
9324 | def IsChecked(*args, **kwargs): | |
9325 | """IsChecked(self) -> bool""" | |
9326 | return _core_.MenuItem_IsChecked(*args, **kwargs) | |
9327 | ||
9328 | def Toggle(*args, **kwargs): | |
9329 | """Toggle(self)""" | |
9330 | return _core_.MenuItem_Toggle(*args, **kwargs) | |
9331 | ||
9332 | def SetHelp(*args, **kwargs): | |
9333 | """SetHelp(self, String str)""" | |
9334 | return _core_.MenuItem_SetHelp(*args, **kwargs) | |
9335 | ||
9336 | def GetHelp(*args, **kwargs): | |
9337 | """GetHelp(self) -> String""" | |
9338 | return _core_.MenuItem_GetHelp(*args, **kwargs) | |
9339 | ||
9340 | def GetAccel(*args, **kwargs): | |
9341 | """GetAccel(self) -> AcceleratorEntry""" | |
9342 | return _core_.MenuItem_GetAccel(*args, **kwargs) | |
9343 | ||
9344 | def SetAccel(*args, **kwargs): | |
9345 | """SetAccel(self, AcceleratorEntry accel)""" | |
9346 | return _core_.MenuItem_SetAccel(*args, **kwargs) | |
9347 | ||
9348 | def SetFont(*args, **kwargs): | |
9349 | """SetFont(self, Font font)""" | |
9350 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
9351 | ||
9352 | def GetFont(*args, **kwargs): | |
9353 | """GetFont(self) -> Font""" | |
9354 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
9355 | ||
9356 | def SetTextColour(*args, **kwargs): | |
9357 | """SetTextColour(self, Colour colText)""" | |
9358 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
9359 | ||
9360 | def GetTextColour(*args, **kwargs): | |
9361 | """GetTextColour(self) -> Colour""" | |
9362 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
9363 | ||
9364 | def SetBackgroundColour(*args, **kwargs): | |
9365 | """SetBackgroundColour(self, Colour colBack)""" | |
9366 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
9367 | ||
9368 | def GetBackgroundColour(*args, **kwargs): | |
9369 | """GetBackgroundColour(self) -> Colour""" | |
9370 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
9371 | ||
9372 | def SetBitmaps(*args, **kwargs): | |
9373 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
9374 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
9375 | ||
9376 | def SetDisabledBitmap(*args, **kwargs): | |
9377 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
9378 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
9379 | ||
9380 | def GetDisabledBitmap(*args, **kwargs): | |
9381 | """GetDisabledBitmap(self) -> Bitmap""" | |
9382 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
9383 | ||
9384 | def SetMarginWidth(*args, **kwargs): | |
9385 | """SetMarginWidth(self, int nWidth)""" | |
9386 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
9387 | ||
9388 | def GetMarginWidth(*args, **kwargs): | |
9389 | """GetMarginWidth(self) -> int""" | |
9390 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
9391 | ||
9392 | def GetDefaultMarginWidth(*args, **kwargs): | |
c24da6d6 | 9393 | """GetDefaultMarginWidth() -> int""" |
d55e5bfc RD |
9394 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
9395 | ||
9396 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
9397 | def IsOwnerDrawn(*args, **kwargs): | |
9398 | """IsOwnerDrawn(self) -> bool""" | |
9399 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
9400 | ||
9401 | def SetOwnerDrawn(*args, **kwargs): | |
9402 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
9403 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
9404 | ||
9405 | def ResetOwnerDrawn(*args, **kwargs): | |
9406 | """ResetOwnerDrawn(self)""" | |
9407 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
9408 | ||
9409 | def SetBitmap(*args, **kwargs): | |
9410 | """SetBitmap(self, Bitmap bitmap)""" | |
9411 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
9412 | ||
9413 | def GetBitmap(*args, **kwargs): | |
9414 | """GetBitmap(self) -> Bitmap""" | |
9415 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
9416 | ||
9417 | ||
9418 | class MenuItemPtr(MenuItem): | |
9419 | def __init__(self, this): | |
9420 | self.this = this | |
9421 | if not hasattr(self,"thisown"): self.thisown = 0 | |
9422 | self.__class__ = MenuItem | |
9423 | _core_.MenuItem_swigregister(MenuItemPtr) | |
9424 | ||
9425 | def MenuItem_GetLabelFromText(*args, **kwargs): | |
9426 | """MenuItem_GetLabelFromText(String text) -> String""" | |
9427 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
9428 | ||
9429 | def MenuItem_GetDefaultMarginWidth(*args, **kwargs): | |
9430 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
9431 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) | |
9432 | ||
9433 | #--------------------------------------------------------------------------- | |
9434 | ||
9435 | class Control(Window): | |
9436 | """ | |
9437 | This is the base class for a control or 'widget'. | |
9438 | ||
79fccf9d RD |
9439 | A control is generally a small window which processes user input |
9440 | and/or displays one or more item of data. | |
d55e5bfc RD |
9441 | """ |
9442 | def __repr__(self): | |
9443 | return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
9444 | def __init__(self, *args, **kwargs): | |
9445 | """ | |
248ed943 RD |
9446 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
9447 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
d55e5bfc RD |
9448 | String name=ControlNameStr) -> Control |
9449 | ||
79fccf9d RD |
9450 | Create a Control. Normally you should only call this from a subclass' |
9451 | __init__ as a plain old wx.Control is not very useful. | |
d55e5bfc RD |
9452 | """ |
9453 | newobj = _core_.new_Control(*args, **kwargs) | |
9454 | self.this = newobj.this | |
9455 | self.thisown = 1 | |
9456 | del newobj.thisown | |
9457 | self._setOORInfo(self) | |
9458 | ||
9459 | def Create(*args, **kwargs): | |
9460 | """ | |
248ed943 RD |
9461 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
9462 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
d55e5bfc RD |
9463 | String name=ControlNameStr) -> bool |
9464 | ||
9465 | Do the 2nd phase and create the GUI control. | |
9466 | """ | |
9467 | return _core_.Control_Create(*args, **kwargs) | |
9468 | ||
9469 | def Command(*args, **kwargs): | |
9470 | """ | |
9471 | Command(self, CommandEvent event) | |
9472 | ||
79fccf9d RD |
9473 | Simulates the effect of the user issuing a command to the item. |
9474 | ||
9475 | :see: `wx.CommandEvent` | |
9476 | ||
d55e5bfc RD |
9477 | """ |
9478 | return _core_.Control_Command(*args, **kwargs) | |
9479 | ||
9480 | def GetLabel(*args, **kwargs): | |
9481 | """ | |
9482 | GetLabel(self) -> String | |
9483 | ||
9484 | Return a control's text. | |
9485 | """ | |
9486 | return _core_.Control_GetLabel(*args, **kwargs) | |
9487 | ||
9488 | def SetLabel(*args, **kwargs): | |
9489 | """ | |
9490 | SetLabel(self, String label) | |
9491 | ||
9492 | Sets the item's text. | |
9493 | """ | |
9494 | return _core_.Control_SetLabel(*args, **kwargs) | |
9495 | ||
a001823c | 9496 | def GetClassDefaultAttributes(*args, **kwargs): |
f8167d6e | 9497 | """ |
a001823c | 9498 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
f8167d6e | 9499 | |
a001823c RD |
9500 | Get the default attributes for this class. This is useful if you want |
9501 | to use the same font or colour in your own control as in a standard | |
9502 | control -- which is a much better idea than hard coding specific | |
9503 | colours or fonts which might look completely out of place on the | |
9504 | user's system, especially if it uses themes. | |
f8167d6e | 9505 | |
a001823c RD |
9506 | The variant parameter is only relevant under Mac currently and is |
9507 | ignore under other platforms. Under Mac, it will change the size of | |
9508 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
9509 | this. | |
f8167d6e | 9510 | """ |
d55e5bfc RD |
9511 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
9512 | ||
9513 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
9514 | ||
9515 | class ControlPtr(Control): | |
9516 | def __init__(self, this): | |
9517 | self.this = this | |
9518 | if not hasattr(self,"thisown"): self.thisown = 0 | |
9519 | self.__class__ = Control | |
9520 | _core_.Control_swigregister(ControlPtr) | |
9521 | ControlNameStr = cvar.ControlNameStr | |
9522 | ||
9523 | def PreControl(*args, **kwargs): | |
9524 | """ | |
9525 | PreControl() -> Control | |
9526 | ||
9527 | Precreate a Control control for 2-phase creation | |
9528 | """ | |
9529 | val = _core_.new_PreControl(*args, **kwargs) | |
9530 | val.thisown = 1 | |
9531 | return val | |
9532 | ||
9533 | def Control_GetClassDefaultAttributes(*args, **kwargs): | |
a001823c RD |
9534 | """ |
9535 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
9536 | ||
9537 | Get the default attributes for this class. This is useful if you want | |
9538 | to use the same font or colour in your own control as in a standard | |
9539 | control -- which is a much better idea than hard coding specific | |
9540 | colours or fonts which might look completely out of place on the | |
9541 | user's system, especially if it uses themes. | |
9542 | ||
9543 | The variant parameter is only relevant under Mac currently and is | |
9544 | ignore under other platforms. Under Mac, it will change the size of | |
9545 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
9546 | this. | |
9547 | """ | |
d55e5bfc RD |
9548 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
9549 | ||
9550 | #--------------------------------------------------------------------------- | |
9551 | ||
9552 | class ItemContainer(object): | |
9553 | """ | |
53aa7709 RD |
9554 | The wx.ItemContainer class defines an interface which is implemented |
9555 | by all controls which have string subitems, each of which may be | |
9556 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
9557 | as `wx.ComboBox` which implements an extended interface deriving from | |
79fccf9d | 9558 | this one. |
d55e5bfc | 9559 | |
79fccf9d RD |
9560 | It defines the methods for accessing the control's items and although |
9561 | each of the derived classes implements them differently, they still | |
9562 | all conform to the same interface. | |
d55e5bfc | 9563 | |
79fccf9d RD |
9564 | The items in a wx.ItemContainer have (non empty) string labels and, |
9565 | optionally, client data associated with them. | |
d55e5bfc RD |
9566 | |
9567 | """ | |
9568 | def __init__(self): raise RuntimeError, "No constructor defined" | |
9569 | def __repr__(self): | |
9570 | return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
9571 | def Append(*args, **kwargs): | |
9572 | """ | |
9573 | Append(self, String item, PyObject clientData=None) -> int | |
9574 | ||
79fccf9d RD |
9575 | Adds the item to the control, associating the given data with the item |
9576 | if not None. The return value is the index of the newly added item | |
9577 | which may be different from the last one if the control is sorted (e.g. | |
9578 | has wx.LB_SORT or wx.CB_SORT style). | |
d55e5bfc RD |
9579 | """ |
9580 | return _core_.ItemContainer_Append(*args, **kwargs) | |
9581 | ||
9582 | def AppendItems(*args, **kwargs): | |
9583 | """ | |
f5b96ee1 | 9584 | AppendItems(self, List strings) |
d55e5bfc | 9585 | |
79fccf9d RD |
9586 | Apend several items at once to the control. Notice that calling this |
9587 | method may be much faster than appending the items one by one if you | |
9588 | need to add a lot of items. | |
d55e5bfc RD |
9589 | """ |
9590 | return _core_.ItemContainer_AppendItems(*args, **kwargs) | |
9591 | ||
9592 | def Insert(*args, **kwargs): | |
9593 | """ | |
9594 | Insert(self, String item, int pos, PyObject clientData=None) -> int | |
9595 | ||
79fccf9d | 9596 | Insert an item into the control before the item at the ``pos`` index, |
d55e5bfc RD |
9597 | optionally associating some data object with the item. |
9598 | """ | |
9599 | return _core_.ItemContainer_Insert(*args, **kwargs) | |
9600 | ||
9601 | def Clear(*args, **kwargs): | |
9602 | """ | |
9603 | Clear(self) | |
9604 | ||
9605 | Removes all items from the control. | |
9606 | """ | |
9607 | return _core_.ItemContainer_Clear(*args, **kwargs) | |
9608 | ||
9609 | def Delete(*args, **kwargs): | |
9610 | """ | |
9611 | Delete(self, int n) | |
9612 | ||
79fccf9d RD |
9613 | Deletes the item at the zero-based index 'n' from the control. Note |
9614 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
9615 | enabled) to remove an item with the index negative or greater or equal | |
9616 | than the number of items in the control. | |
d55e5bfc RD |
9617 | """ |
9618 | return _core_.ItemContainer_Delete(*args, **kwargs) | |
9619 | ||
53aa7709 RD |
9620 | def GetClientData(*args, **kwargs): |
9621 | """ | |
9622 | GetClientData(self, int n) -> PyObject | |
9623 | ||
9624 | Returns the client data associated with the given item, (if any.) | |
9625 | """ | |
9626 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
9627 | ||
9628 | def SetClientData(*args, **kwargs): | |
9629 | """ | |
9630 | SetClientData(self, int n, PyObject clientData) | |
9631 | ||
9632 | Associate the given client data with the item at position n. | |
9633 | """ | |
9634 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
9635 | ||
d55e5bfc RD |
9636 | def GetCount(*args, **kwargs): |
9637 | """ | |
9638 | GetCount(self) -> int | |
9639 | ||
9640 | Returns the number of items in the control. | |
9641 | """ | |
9642 | return _core_.ItemContainer_GetCount(*args, **kwargs) | |
9643 | ||
9644 | def IsEmpty(*args, **kwargs): | |
9645 | """ | |
9646 | IsEmpty(self) -> bool | |
9647 | ||
9648 | Returns True if the control is empty or False if it has some items. | |
9649 | """ | |
9650 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) | |
9651 | ||
9652 | def GetString(*args, **kwargs): | |
9653 | """ | |
9654 | GetString(self, int n) -> String | |
9655 | ||
9656 | Returns the label of the item with the given index. | |
9657 | """ | |
9658 | return _core_.ItemContainer_GetString(*args, **kwargs) | |
9659 | ||
9660 | def GetStrings(*args, **kwargs): | |
9661 | """GetStrings(self) -> wxArrayString""" | |
9662 | return _core_.ItemContainer_GetStrings(*args, **kwargs) | |
9663 | ||
9664 | def SetString(*args, **kwargs): | |
9665 | """ | |
9666 | SetString(self, int n, String s) | |
9667 | ||
9668 | Sets the label for the given item. | |
9669 | """ | |
9670 | return _core_.ItemContainer_SetString(*args, **kwargs) | |
9671 | ||
9672 | def FindString(*args, **kwargs): | |
9673 | """ | |
9674 | FindString(self, String s) -> int | |
9675 | ||
9676 | Finds an item whose label matches the given string. Returns the | |
79fccf9d RD |
9677 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
9678 | found. | |
d55e5bfc RD |
9679 | """ |
9680 | return _core_.ItemContainer_FindString(*args, **kwargs) | |
9681 | ||
53aa7709 | 9682 | def SetSelection(*args, **kwargs): |
d55e5bfc | 9683 | """ |
53aa7709 | 9684 | SetSelection(self, int n) |
d55e5bfc RD |
9685 | |
9686 | Sets the item at index 'n' to be the selected item. | |
9687 | """ | |
53aa7709 | 9688 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
d55e5bfc | 9689 | |
d55e5bfc RD |
9690 | def GetSelection(*args, **kwargs): |
9691 | """ | |
9692 | GetSelection(self) -> int | |
9693 | ||
79fccf9d RD |
9694 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
9695 | is selected. | |
d55e5bfc RD |
9696 | """ |
9697 | return _core_.ItemContainer_GetSelection(*args, **kwargs) | |
9698 | ||
53aa7709 RD |
9699 | def SetStringSelection(*args, **kwargs): |
9700 | """SetStringSelection(self, String s) -> bool""" | |
9701 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
9702 | ||
d55e5bfc RD |
9703 | def GetStringSelection(*args, **kwargs): |
9704 | """ | |
9705 | GetStringSelection(self) -> String | |
9706 | ||
79fccf9d RD |
9707 | Returns the label of the selected item or an empty string if no item |
9708 | is selected. | |
d55e5bfc RD |
9709 | """ |
9710 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) | |
9711 | ||
53aa7709 | 9712 | def Select(*args, **kwargs): |
d55e5bfc | 9713 | """ |
53aa7709 | 9714 | Select(self, int n) |
d55e5bfc | 9715 | |
53aa7709 RD |
9716 | This is the same as `SetSelection` and exists only because it is |
9717 | slightly more natural for controls which support multiple selection. | |
d55e5bfc | 9718 | """ |
53aa7709 | 9719 | return _core_.ItemContainer_Select(*args, **kwargs) |
d55e5bfc RD |
9720 | |
9721 | ||
9722 | class ItemContainerPtr(ItemContainer): | |
9723 | def __init__(self, this): | |
9724 | self.this = this | |
9725 | if not hasattr(self,"thisown"): self.thisown = 0 | |
9726 | self.__class__ = ItemContainer | |
9727 | _core_.ItemContainer_swigregister(ItemContainerPtr) | |
9728 | ||
9729 | #--------------------------------------------------------------------------- | |
9730 | ||
9731 | class ControlWithItems(Control,ItemContainer): | |
9732 | """ | |
79fccf9d RD |
9733 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
9734 | wx.Control class, and is used for the base class of various controls | |
9735 | that have items. | |
d55e5bfc RD |
9736 | """ |
9737 | def __init__(self): raise RuntimeError, "No constructor defined" | |
9738 | def __repr__(self): | |
9739 | return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
9740 | ||
9741 | class ControlWithItemsPtr(ControlWithItems): | |
9742 | def __init__(self, this): | |
9743 | self.this = this | |
9744 | if not hasattr(self,"thisown"): self.thisown = 0 | |
9745 | self.__class__ = ControlWithItems | |
9746 | _core_.ControlWithItems_swigregister(ControlWithItemsPtr) | |
9747 | ||
9748 | #--------------------------------------------------------------------------- | |
9749 | ||
9750 | class SizerItem(Object): | |
248ed943 RD |
9751 | """ |
9752 | The wx.SizerItem class is used to track the position, size and other | |
9753 | attributes of each item managed by a `wx.Sizer`. In normal usage user | |
9754 | code should never need to deal directly with a wx.SizerItem, but | |
9755 | custom classes derived from `wx.PySizer` will probably need to use the | |
9756 | collection of wx.SizerItems held by wx.Sizer when calculating layout. | |
9757 | ||
9758 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
9759 | """ | |
d55e5bfc RD |
9760 | def __repr__(self): |
9761 | return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
9762 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
9763 | """ |
9764 | __init__(self) -> SizerItem | |
9765 | ||
9766 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
9767 | size will need to be set before this item can be used in a Sizer. | |
9768 | ||
9769 | You will probably never need to create a wx.SizerItem directly as they | |
9770 | are created automatically when the sizer's Add, Insert or Prepend | |
9771 | methods are called. | |
9772 | ||
9773 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
9774 | """ | |
d55e5bfc RD |
9775 | newobj = _core_.new_SizerItem(*args, **kwargs) |
9776 | self.this = newobj.this | |
9777 | self.thisown = 1 | |
9778 | del newobj.thisown | |
9779 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
9780 | """ |
9781 | DeleteWindows(self) | |
9782 | ||
9783 | Destroy the window or the windows in a subsizer, depending on the type | |
9784 | of item. | |
9785 | """ | |
d55e5bfc RD |
9786 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
9787 | ||
9788 | def DetachSizer(*args, **kwargs): | |
248ed943 RD |
9789 | """ |
9790 | DetachSizer(self) | |
9791 | ||
9792 | Enable deleting the SizerItem without destroying the contained sizer. | |
9793 | """ | |
d55e5bfc RD |
9794 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
9795 | ||
9796 | def GetSize(*args, **kwargs): | |
248ed943 RD |
9797 | """ |
9798 | GetSize(self) -> Size | |
9799 | ||
9800 | Get the current size of the item, as set in the last Layout. | |
9801 | """ | |
d55e5bfc RD |
9802 | return _core_.SizerItem_GetSize(*args, **kwargs) |
9803 | ||
9804 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
9805 | """ |
9806 | CalcMin(self) -> Size | |
9807 | ||
9808 | Calculates the minimum desired size for the item, including any space | |
9809 | needed by borders. | |
9810 | """ | |
d55e5bfc RD |
9811 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
9812 | ||
9813 | def SetDimension(*args, **kwargs): | |
248ed943 RD |
9814 | """ |
9815 | SetDimension(self, Point pos, Size size) | |
9816 | ||
9817 | Set the position and size of the space allocated for this item by the | |
9818 | sizer, and adjust the position and size of the item (window or | |
9819 | subsizer) to be within that space taking alignment and borders into | |
9820 | account. | |
9821 | """ | |
d55e5bfc RD |
9822 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
9823 | ||
9824 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
9825 | """ |
9826 | GetMinSize(self) -> Size | |
9827 | ||
9828 | Get the minimum size needed for the item. | |
9829 | """ | |
d55e5bfc RD |
9830 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
9831 | ||
a001823c RD |
9832 | def GetMinSizeWithBorder(*args, **kwargs): |
9833 | """ | |
9834 | GetMinSizeWithBorder(self) -> Size | |
9835 | ||
9836 | Get the minimum size needed for the item with space for the borders | |
9837 | added, if needed. | |
9838 | """ | |
9839 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
9840 | ||
d55e5bfc RD |
9841 | def SetInitSize(*args, **kwargs): |
9842 | """SetInitSize(self, int x, int y)""" | |
9843 | return _core_.SizerItem_SetInitSize(*args, **kwargs) | |
9844 | ||
9845 | def SetRatioWH(*args, **kwargs): | |
248ed943 RD |
9846 | """ |
9847 | SetRatioWH(self, int width, int height) | |
9848 | ||
9849 | Set the ratio item attribute. | |
9850 | """ | |
d55e5bfc RD |
9851 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
9852 | ||
9853 | def SetRatioSize(*args, **kwargs): | |
248ed943 RD |
9854 | """ |
9855 | SetRatioSize(self, Size size) | |
9856 | ||
9857 | Set the ratio item attribute. | |
9858 | """ | |
d55e5bfc RD |
9859 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
9860 | ||
9861 | def SetRatio(*args, **kwargs): | |
248ed943 RD |
9862 | """ |
9863 | SetRatio(self, float ratio) | |
9864 | ||
9865 | Set the ratio item attribute. | |
9866 | """ | |
d55e5bfc RD |
9867 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
9868 | ||
9869 | def GetRatio(*args, **kwargs): | |
248ed943 RD |
9870 | """ |
9871 | GetRatio(self) -> float | |
9872 | ||
9873 | Set the ratio item attribute. | |
9874 | """ | |
d55e5bfc RD |
9875 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
9876 | ||
c1cb24a4 RD |
9877 | def GetRect(*args, **kwargs): |
9878 | """ | |
9879 | GetRect(self) -> Rect | |
9880 | ||
9881 | Returns the rectangle that the sizer item should occupy | |
9882 | """ | |
9883 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
9884 | ||
d55e5bfc | 9885 | def IsWindow(*args, **kwargs): |
248ed943 RD |
9886 | """ |
9887 | IsWindow(self) -> bool | |
9888 | ||
9889 | Is this sizer item a window? | |
9890 | """ | |
d55e5bfc RD |
9891 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
9892 | ||
9893 | def IsSizer(*args, **kwargs): | |
248ed943 RD |
9894 | """ |
9895 | IsSizer(self) -> bool | |
9896 | ||
9897 | Is this sizer item a subsizer? | |
9898 | """ | |
d55e5bfc RD |
9899 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
9900 | ||
9901 | def IsSpacer(*args, **kwargs): | |
248ed943 RD |
9902 | """ |
9903 | IsSpacer(self) -> bool | |
9904 | ||
9905 | Is this sizer item a spacer? | |
9906 | """ | |
d55e5bfc RD |
9907 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
9908 | ||
9909 | def SetProportion(*args, **kwargs): | |
248ed943 RD |
9910 | """ |
9911 | SetProportion(self, int proportion) | |
9912 | ||
9913 | Set the proportion value for this item. | |
9914 | """ | |
d55e5bfc RD |
9915 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
9916 | ||
9917 | def GetProportion(*args, **kwargs): | |
248ed943 RD |
9918 | """ |
9919 | GetProportion(self) -> int | |
9920 | ||
9921 | Get the proportion value for this item. | |
9922 | """ | |
d55e5bfc RD |
9923 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
9924 | ||
248ed943 RD |
9925 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
9926 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
d55e5bfc | 9927 | def SetFlag(*args, **kwargs): |
248ed943 RD |
9928 | """ |
9929 | SetFlag(self, int flag) | |
9930 | ||
9931 | Set the flag value for this item. | |
9932 | """ | |
d55e5bfc RD |
9933 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
9934 | ||
9935 | def GetFlag(*args, **kwargs): | |
248ed943 RD |
9936 | """ |
9937 | GetFlag(self) -> int | |
9938 | ||
9939 | Get the flag value for this item. | |
9940 | """ | |
d55e5bfc RD |
9941 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
9942 | ||
9943 | def SetBorder(*args, **kwargs): | |
248ed943 RD |
9944 | """ |
9945 | SetBorder(self, int border) | |
9946 | ||
9947 | Set the border value for this item. | |
9948 | """ | |
d55e5bfc RD |
9949 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
9950 | ||
9951 | def GetBorder(*args, **kwargs): | |
248ed943 RD |
9952 | """ |
9953 | GetBorder(self) -> int | |
9954 | ||
9955 | Get the border value for this item. | |
9956 | """ | |
d55e5bfc RD |
9957 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
9958 | ||
9959 | def GetWindow(*args, **kwargs): | |
248ed943 RD |
9960 | """ |
9961 | GetWindow(self) -> Window | |
9962 | ||
9963 | Get the window (if any) that is managed by this sizer item. | |
9964 | """ | |
d55e5bfc RD |
9965 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
9966 | ||
9967 | def SetWindow(*args, **kwargs): | |
248ed943 RD |
9968 | """ |
9969 | SetWindow(self, Window window) | |
9970 | ||
9971 | Set the window to be managed by this sizer item. | |
9972 | """ | |
d55e5bfc RD |
9973 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
9974 | ||
9975 | def GetSizer(*args, **kwargs): | |
248ed943 RD |
9976 | """ |
9977 | GetSizer(self) -> Sizer | |
9978 | ||
9979 | Get the subsizer (if any) that is managed by this sizer item. | |
9980 | """ | |
d55e5bfc RD |
9981 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
9982 | ||
9983 | def SetSizer(*args, **kwargs): | |
248ed943 RD |
9984 | """ |
9985 | SetSizer(self, Sizer sizer) | |
9986 | ||
9987 | Set the subsizer to be managed by this sizer item. | |
9988 | """ | |
d55e5bfc RD |
9989 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
9990 | ||
9991 | def GetSpacer(*args, **kwargs): | |
248ed943 RD |
9992 | """ |
9993 | GetSpacer(self) -> Size | |
9994 | ||
9995 | Get the size of the spacer managed by this sizer item. | |
9996 | """ | |
d55e5bfc RD |
9997 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
9998 | ||
9999 | def SetSpacer(*args, **kwargs): | |
248ed943 RD |
10000 | """ |
10001 | SetSpacer(self, Size size) | |
10002 | ||
10003 | Set the size of the spacer to be managed by this sizer item. | |
10004 | """ | |
d55e5bfc RD |
10005 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
10006 | ||
10007 | def Show(*args, **kwargs): | |
248ed943 RD |
10008 | """ |
10009 | Show(self, bool show) | |
10010 | ||
10011 | Set the show item attribute, which sizers use to determine if the item | |
10012 | is to be made part of the layout or not. If the item is tracking a | |
10013 | window then it is shown or hidden as needed. | |
10014 | """ | |
d55e5bfc RD |
10015 | return _core_.SizerItem_Show(*args, **kwargs) |
10016 | ||
10017 | def IsShown(*args, **kwargs): | |
248ed943 RD |
10018 | """ |
10019 | IsShown(self) -> bool | |
10020 | ||
10021 | Is the item to be shown in the layout? | |
10022 | """ | |
d55e5bfc RD |
10023 | return _core_.SizerItem_IsShown(*args, **kwargs) |
10024 | ||
10025 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
10026 | """ |
10027 | GetPosition(self) -> Point | |
10028 | ||
10029 | Returns the current position of the item, as set in the last Layout. | |
10030 | """ | |
d55e5bfc RD |
10031 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
10032 | ||
10033 | def GetUserData(*args, **kwargs): | |
248ed943 RD |
10034 | """ |
10035 | GetUserData(self) -> PyObject | |
10036 | ||
10037 | Returns the userData associated with this sizer item, or None if there | |
10038 | isn't any. | |
10039 | """ | |
d55e5bfc RD |
10040 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
10041 | ||
10042 | ||
10043 | class SizerItemPtr(SizerItem): | |
10044 | def __init__(self, this): | |
10045 | self.this = this | |
10046 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10047 | self.__class__ = SizerItem | |
10048 | _core_.SizerItem_swigregister(SizerItemPtr) | |
10049 | ||
248ed943 | 10050 | def SizerItemWindow(*args, **kwargs): |
d55e5bfc | 10051 | """ |
248ed943 RD |
10052 | SizerItemWindow(Window window, int proportion, int flag, int border, |
10053 | PyObject userData=None) -> SizerItem | |
10054 | ||
10055 | Constructs a `wx.SizerItem` for tracking a window. | |
d55e5bfc | 10056 | """ |
248ed943 | 10057 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d55e5bfc RD |
10058 | val.thisown = 1 |
10059 | return val | |
10060 | ||
248ed943 | 10061 | def SizerItemSpacer(*args, **kwargs): |
d55e5bfc | 10062 | """ |
248ed943 RD |
10063 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
10064 | PyObject userData=None) -> SizerItem | |
10065 | ||
10066 | Constructs a `wx.SizerItem` for tracking a spacer. | |
d55e5bfc | 10067 | """ |
248ed943 | 10068 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d55e5bfc RD |
10069 | val.thisown = 1 |
10070 | return val | |
10071 | ||
10072 | def SizerItemSizer(*args, **kwargs): | |
10073 | """ | |
10074 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
248ed943 RD |
10075 | PyObject userData=None) -> SizerItem |
10076 | ||
10077 | Constructs a `wx.SizerItem` for tracking a subsizer | |
d55e5bfc RD |
10078 | """ |
10079 | val = _core_.new_SizerItemSizer(*args, **kwargs) | |
10080 | val.thisown = 1 | |
10081 | return val | |
10082 | ||
10083 | class Sizer(Object): | |
248ed943 RD |
10084 | """ |
10085 | wx.Sizer is the abstract base class used for laying out subwindows in | |
10086 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
10087 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
10088 | `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer` | |
10089 | and `wx.GridBagSizer`. | |
10090 | ||
10091 | The concept implemented by sizers in wxWidgets is closely related to | |
10092 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
10093 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
10094 | subwindows reporting their minimal required size and their ability to | |
10095 | get stretched if the size of the parent window has changed. This will | |
10096 | most often mean that the programmer does not set the original size of | |
10097 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
10098 | this sizer will be queried about the recommended size. The sizer in | |
10099 | turn will query its children, which can be normal windows or contorls, | |
10100 | empty space or other sizers, so that a hierarchy of sizers can be | |
10101 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
10102 | do not interfere with tab ordering and requires very little resources | |
10103 | compared to a real window on screen. | |
10104 | ||
10105 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
10106 | every control reports its own minimal size and the algorithm can | |
10107 | handle differences in font sizes or different window (dialog item) | |
10108 | sizes on different platforms without problems. If for example the | |
10109 | standard font as well as the overall design of Mac widgets requires | |
10110 | more space than on Windows, then the initial size of a dialog using a | |
10111 | sizer will automatically be bigger on Mac than on Windows. | |
10112 | """ | |
d55e5bfc RD |
10113 | def __init__(self): raise RuntimeError, "No constructor defined" |
10114 | def __repr__(self): | |
10115 | return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10116 | def _setOORInfo(*args, **kwargs): | |
10117 | """_setOORInfo(self, PyObject _self)""" | |
10118 | return _core_.Sizer__setOORInfo(*args, **kwargs) | |
10119 | ||
10120 | def Add(*args, **kwargs): | |
10121 | """ | |
248ed943 | 10122 | Add(self, item, int proportion=0, int flag=0, int border=0, |
c1cb24a4 | 10123 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
10124 | |
10125 | Appends a child item to the sizer. | |
d55e5bfc RD |
10126 | """ |
10127 | return _core_.Sizer_Add(*args, **kwargs) | |
10128 | ||
10129 | def Insert(*args, **kwargs): | |
10130 | """ | |
248ed943 | 10131 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
c1cb24a4 | 10132 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
10133 | |
10134 | Inserts a new item into the list of items managed by this sizer before | |
10135 | the item at index *before*. See `Add` for a description of the parameters. | |
d55e5bfc RD |
10136 | """ |
10137 | return _core_.Sizer_Insert(*args, **kwargs) | |
10138 | ||
10139 | def Prepend(*args, **kwargs): | |
10140 | """ | |
248ed943 | 10141 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
c1cb24a4 | 10142 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
10143 | |
10144 | Adds a new item to the begining of the list of sizer items managed by | |
10145 | this sizer. See `Add` for a description of the parameters. | |
d55e5bfc RD |
10146 | """ |
10147 | return _core_.Sizer_Prepend(*args, **kwargs) | |
10148 | ||
10149 | def Remove(*args, **kwargs): | |
248ed943 RD |
10150 | """ |
10151 | Remove(self, item) -> bool | |
10152 | ||
10153 | Removes an item from the sizer and destroys it. This method does not | |
10154 | cause any layout or resizing to take place, call `Layout` to update | |
10155 | the layout on screen after removing a child from the sizer. The | |
10156 | *item* parameter can be either a window, a sizer, or the zero-based | |
10157 | index of an item to remove. Returns True if the child item was found | |
10158 | and removed. | |
10159 | """ | |
d55e5bfc RD |
10160 | return _core_.Sizer_Remove(*args, **kwargs) |
10161 | ||
1a6bba1e | 10162 | def Detach(*args, **kwargs): |
248ed943 RD |
10163 | """ |
10164 | Detach(self, item) -> bool | |
10165 | ||
10166 | Detaches an item from the sizer without destroying it. This method | |
10167 | does not cause any layout or resizing to take place, call `Layout` to | |
10168 | do so. The *item* parameter can be either a window, a sizer, or the | |
10169 | zero-based index of the item to be detached. Returns True if the child item | |
10170 | was found and detached. | |
10171 | """ | |
1a6bba1e RD |
10172 | return _core_.Sizer_Detach(*args, **kwargs) |
10173 | ||
c1cb24a4 RD |
10174 | def GetItem(*args, **kwargs): |
10175 | """ | |
10176 | GetItem(self, item) -> wx.SizerItem | |
10177 | ||
10178 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
10179 | parameter can be either a window, a sizer, or the zero-based index of | |
10180 | the item to be detached. | |
10181 | """ | |
10182 | return _core_.Sizer_GetItem(*args, **kwargs) | |
10183 | ||
d55e5bfc RD |
10184 | def _SetItemMinSize(*args, **kwargs): |
10185 | """_SetItemMinSize(self, PyObject item, Size size)""" | |
10186 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) | |
10187 | ||
248ed943 RD |
10188 | def SetItemMinSize(self, item, *args): |
10189 | """ | |
10190 | SetItemMinSize(self, item, Size size) | |
10191 | ||
10192 | Sets the minimum size that will be allocated for an item in the sizer. | |
10193 | The *item* parameter can be either a window, a sizer, or the | |
10194 | zero-based index of the item. If a window or sizer is given then it | |
10195 | will be searched for recursivly in subsizers if neccessary. | |
10196 | """ | |
10197 | if len(args) == 2: | |
10198 | # for backward compatibility accept separate width,height args too | |
10199 | return self._SetItemMinSize(item, args) | |
10200 | else: | |
10201 | return self._SetItemMinSize(item, args[0]) | |
10202 | ||
d55e5bfc | 10203 | def AddItem(*args, **kwargs): |
248ed943 RD |
10204 | """ |
10205 | AddItem(self, SizerItem item) | |
10206 | ||
10207 | Adds a `wx.SizerItem` to the sizer. | |
10208 | """ | |
d55e5bfc RD |
10209 | return _core_.Sizer_AddItem(*args, **kwargs) |
10210 | ||
10211 | def InsertItem(*args, **kwargs): | |
248ed943 RD |
10212 | """ |
10213 | InsertItem(self, int index, SizerItem item) | |
10214 | ||
10215 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
10216 | """ | |
d55e5bfc RD |
10217 | return _core_.Sizer_InsertItem(*args, **kwargs) |
10218 | ||
10219 | def PrependItem(*args, **kwargs): | |
248ed943 RD |
10220 | """ |
10221 | PrependItem(self, SizerItem item) | |
10222 | ||
10223 | Prepends a `wx.SizerItem` to the sizer. | |
10224 | """ | |
d55e5bfc RD |
10225 | return _core_.Sizer_PrependItem(*args, **kwargs) |
10226 | ||
248ed943 | 10227 | def AddMany(self, items): |
c24da6d6 RD |
10228 | """ |
10229 | AddMany is a convenience method for adding several items | |
10230 | to a sizer at one time. Simply pass it a list of tuples, | |
10231 | where each tuple consists of the parameters that you | |
10232 | would normally pass to the `Add` method. | |
10233 | """ | |
248ed943 RD |
10234 | for item in items: |
10235 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
10236 | item = (item, ) | |
10237 | self.Add(*item) | |
d55e5bfc RD |
10238 | |
10239 | # for backwards compatibility only, please do not use in new code | |
b9d6a5f3 RD |
10240 | def AddWindow(self, *args, **kw): |
10241 | """Compatibility alias for `Add`.""" | |
10242 | return self.Add(*args, **kw) | |
10243 | def AddSizer(self, *args, **kw): | |
10244 | """Compatibility alias for `Add`.""" | |
10245 | return self.Add(*args, **kw) | |
10246 | def AddSpacer(self, *args, **kw): | |
10247 | """Compatibility alias for `Add`.""" | |
10248 | return self.Add(*args, **kw) | |
10249 | ||
10250 | def PrependWindow(self, *args, **kw): | |
10251 | """Compatibility alias for `Prepend`.""" | |
10252 | return self.Prepend(*args, **kw) | |
10253 | def PrependSizer(self, *args, **kw): | |
10254 | """Compatibility alias for `Prepend`.""" | |
10255 | return self.Prepend(*args, **kw) | |
10256 | def PrependSpacer(self, *args, **kw): | |
10257 | """Compatibility alias for `Prepend`.""" | |
10258 | return self.Prepend(*args, **kw) | |
10259 | ||
10260 | def InsertWindow(self, *args, **kw): | |
10261 | """Compatibility alias for `Insert`.""" | |
10262 | return self.Insert(*args, **kw) | |
10263 | def InsertSizer(self, *args, **kw): | |
10264 | """Compatibility alias for `Insert`.""" | |
10265 | return self.Insert(*args, **kw) | |
10266 | def InsertSpacer(self, *args, **kw): | |
10267 | """Compatibility alias for `Insert`.""" | |
10268 | return self.Insert(*args, **kw) | |
10269 | ||
10270 | def RemoveWindow(self, *args, **kw): | |
10271 | """Compatibility alias for `Remove`.""" | |
10272 | return self.Remove(*args, **kw) | |
10273 | def RemoveSizer(self, *args, **kw): | |
10274 | """Compatibility alias for `Remove`.""" | |
10275 | return self.Remove(*args, **kw) | |
10276 | def RemovePos(self, *args, **kw): | |
10277 | """Compatibility alias for `Remove`.""" | |
10278 | return self.Remove(*args, **kw) | |
d55e5bfc RD |
10279 | |
10280 | ||
d55e5bfc | 10281 | def SetDimension(*args, **kwargs): |
248ed943 RD |
10282 | """ |
10283 | SetDimension(self, int x, int y, int width, int height) | |
10284 | ||
10285 | Call this to force the sizer to take the given dimension and thus | |
10286 | force the items owned by the sizer to resize themselves according to | |
10287 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
10288 | methods. | |
10289 | """ | |
d55e5bfc RD |
10290 | return _core_.Sizer_SetDimension(*args, **kwargs) |
10291 | ||
10292 | def SetMinSize(*args, **kwargs): | |
248ed943 RD |
10293 | """ |
10294 | SetMinSize(self, Size size) | |
10295 | ||
10296 | Call this to give the sizer a minimal size. Normally, the sizer will | |
10297 | calculate its minimal size based purely on how much space its children | |
10298 | need. After calling this method `GetMinSize` will return either the | |
10299 | minimal size as requested by its children or the minimal size set | |
10300 | here, depending on which is bigger. | |
10301 | """ | |
d55e5bfc RD |
10302 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
10303 | ||
10304 | def GetSize(*args, **kwargs): | |
248ed943 RD |
10305 | """ |
10306 | GetSize(self) -> Size | |
10307 | ||
10308 | Returns the current size of the space managed by the sizer. | |
10309 | """ | |
d55e5bfc RD |
10310 | return _core_.Sizer_GetSize(*args, **kwargs) |
10311 | ||
10312 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
10313 | """ |
10314 | GetPosition(self) -> Point | |
10315 | ||
10316 | Returns the current position of the sizer's managed space. | |
10317 | """ | |
d55e5bfc RD |
10318 | return _core_.Sizer_GetPosition(*args, **kwargs) |
10319 | ||
10320 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
10321 | """ |
10322 | GetMinSize(self) -> Size | |
10323 | ||
10324 | Returns the minimal size of the sizer. This is either the combined | |
10325 | minimal size of all the children and their borders or the minimal size | |
10326 | set by SetMinSize, depending on which is bigger. | |
10327 | """ | |
d55e5bfc RD |
10328 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
10329 | ||
10330 | def GetSizeTuple(self): | |
1a6bba1e | 10331 | return self.GetSize().Get() |
d55e5bfc | 10332 | def GetPositionTuple(self): |
1a6bba1e | 10333 | return self.GetPosition().Get() |
d55e5bfc | 10334 | def GetMinSizeTuple(self): |
1a6bba1e | 10335 | return self.GetMinSize().Get() |
d55e5bfc RD |
10336 | |
10337 | def RecalcSizes(*args, **kwargs): | |
248ed943 RD |
10338 | """ |
10339 | RecalcSizes(self) | |
10340 | ||
10341 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
10342 | items managed by this sizer. You should not need to call this directly as | |
10343 | it is called by `Layout`. | |
10344 | """ | |
d55e5bfc RD |
10345 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
10346 | ||
10347 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
10348 | """ |
10349 | CalcMin(self) -> Size | |
10350 | ||
10351 | This method is where the sizer will do the actual calculation of its | |
10352 | children's minimal sizes. You should not need to call this directly as | |
10353 | it is called by `Layout`. | |
10354 | """ | |
d55e5bfc RD |
10355 | return _core_.Sizer_CalcMin(*args, **kwargs) |
10356 | ||
10357 | def Layout(*args, **kwargs): | |
248ed943 RD |
10358 | """ |
10359 | Layout(self) | |
10360 | ||
10361 | This method will force the recalculation and layout of the items | |
10362 | controlled by the sizer using the current space allocated to the | |
10363 | sizer. Normally this is called automatically from the owning window's | |
10364 | EVT_SIZE handler, but it is also useful to call it from user code when | |
10365 | one of the items in a sizer change size, or items are added or | |
10366 | removed. | |
10367 | """ | |
d55e5bfc RD |
10368 | return _core_.Sizer_Layout(*args, **kwargs) |
10369 | ||
10370 | def Fit(*args, **kwargs): | |
248ed943 RD |
10371 | """ |
10372 | Fit(self, Window window) -> Size | |
10373 | ||
10374 | Tell the sizer to resize the *window* to match the sizer's minimal | |
10375 | size. This is commonly done in the constructor of the window itself in | |
10376 | order to set its initial size to match the needs of the children as | |
10377 | determined by the sizer. Returns the new size. | |
10378 | ||
10379 | For a top level window this is the total window size, not the client size. | |
10380 | """ | |
d55e5bfc RD |
10381 | return _core_.Sizer_Fit(*args, **kwargs) |
10382 | ||
10383 | def FitInside(*args, **kwargs): | |
248ed943 RD |
10384 | """ |
10385 | FitInside(self, Window window) | |
10386 | ||
10387 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
10388 | sizer's minimal size. This will not alter the on screen size of the | |
10389 | window, but may cause the addition/removal/alteration of scrollbars | |
10390 | required to view the virtual area in windows which manage it. | |
10391 | ||
10392 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
10393 | ||
10394 | """ | |
d55e5bfc RD |
10395 | return _core_.Sizer_FitInside(*args, **kwargs) |
10396 | ||
10397 | def SetSizeHints(*args, **kwargs): | |
248ed943 RD |
10398 | """ |
10399 | SetSizeHints(self, Window window) | |
10400 | ||
10401 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
10402 | match the sizer's minimal size. This is commonly done in the | |
10403 | constructor of the window itself if the window is resizable (as are | |
10404 | many dialogs under Unix and frames on probably all platforms) in order | |
10405 | to prevent the window from being sized smaller than the minimal size | |
10406 | required by the sizer. | |
10407 | """ | |
d55e5bfc RD |
10408 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
10409 | ||
10410 | def SetVirtualSizeHints(*args, **kwargs): | |
248ed943 RD |
10411 | """ |
10412 | SetVirtualSizeHints(self, Window window) | |
10413 | ||
10414 | Tell the sizer to set the minimal size of the window virtual area to | |
10415 | match the sizer's minimal size. For windows with managed scrollbars | |
10416 | this will set them appropriately. | |
10417 | ||
10418 | :see: `wx.ScrolledWindow.SetScrollbars` | |
10419 | ||
10420 | """ | |
d55e5bfc RD |
10421 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
10422 | ||
10423 | def Clear(*args, **kwargs): | |
248ed943 RD |
10424 | """ |
10425 | Clear(self, bool deleteWindows=False) | |
10426 | ||
10427 | Clear all items from the sizer, optionally destroying the window items | |
10428 | as well. | |
10429 | """ | |
d55e5bfc RD |
10430 | return _core_.Sizer_Clear(*args, **kwargs) |
10431 | ||
10432 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
10433 | """ |
10434 | DeleteWindows(self) | |
10435 | ||
10436 | Destroy all windows managed by the sizer. | |
10437 | """ | |
d55e5bfc RD |
10438 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
10439 | ||
10440 | def GetChildren(*args, **kwargs): | |
248ed943 | 10441 | """ |
51b83b37 | 10442 | GetChildren(self) -> list |
248ed943 RD |
10443 | |
10444 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
10445 | """ | |
d55e5bfc RD |
10446 | return _core_.Sizer_GetChildren(*args, **kwargs) |
10447 | ||
10448 | def Show(*args, **kwargs): | |
248ed943 | 10449 | """ |
ae8162c8 | 10450 | Show(self, item, bool show=True, bool recursive=false) -> bool |
d55e5bfc | 10451 | |
248ed943 RD |
10452 | Shows or hides an item managed by the sizer. To make a sizer item |
10453 | disappear or reappear, use Show followed by `Layout`. The *item* | |
10454 | parameter can be either a window, a sizer, or the zero-based index of | |
629e65c2 RD |
10455 | the item. Use the recursive parameter to show or hide an item in a |
10456 | subsizer. Returns True if the item was found. | |
248ed943 RD |
10457 | """ |
10458 | return _core_.Sizer_Show(*args, **kwargs) | |
d55e5bfc RD |
10459 | |
10460 | def IsShown(*args, **kwargs): | |
248ed943 RD |
10461 | """ |
10462 | IsShown(self, item) | |
10463 | ||
10464 | Determines if the item is currently shown. sizer. To make a sizer | |
10465 | item disappear or reappear, use Show followed by `Layout`. The *item* | |
10466 | parameter can be either a window, a sizer, or the zero-based index of | |
10467 | the item. | |
10468 | """ | |
d55e5bfc RD |
10469 | return _core_.Sizer_IsShown(*args, **kwargs) |
10470 | ||
629e65c2 | 10471 | def Hide(self, item, recursive=False): |
248ed943 | 10472 | """ |
27fb7603 | 10473 | A convenience method for `Show` (item, False, recursive). |
248ed943 | 10474 | """ |
06759a38 | 10475 | return self.Show(item, False, recursive) |
248ed943 | 10476 | |
d55e5bfc | 10477 | def ShowItems(*args, **kwargs): |
248ed943 RD |
10478 | """ |
10479 | ShowItems(self, bool show) | |
10480 | ||
84f85550 | 10481 | Recursively call `wx.SizerItem.Show` on all sizer items. |
248ed943 | 10482 | """ |
d55e5bfc RD |
10483 | return _core_.Sizer_ShowItems(*args, **kwargs) |
10484 | ||
10485 | ||
10486 | class SizerPtr(Sizer): | |
10487 | def __init__(self, this): | |
10488 | self.this = this | |
10489 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10490 | self.__class__ = Sizer | |
10491 | _core_.Sizer_swigregister(SizerPtr) | |
10492 | ||
10493 | class PySizer(Sizer): | |
248ed943 RD |
10494 | """ |
10495 | wx.PySizer is a special version of `wx.Sizer` that has been | |
10496 | instrumented to allow the C++ virtual methods to be overloaded in | |
10497 | Python derived classes. You would derive from this class if you are | |
10498 | wanting to implement a custom sizer in Python code. Simply implement | |
10499 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
10500 | For example:: | |
10501 | ||
10502 | class MySizer(wx.PySizer): | |
10503 | def __init__(self): | |
10504 | wx.PySizer.__init__(self) | |
10505 | ||
10506 | def CalcMin(self): | |
10507 | for item in self.GetChildren(): | |
10508 | # calculate the total minimum width and height needed | |
10509 | # by all items in the sizer according to this sizer's | |
10510 | # layout algorithm. | |
10511 | ... | |
10512 | return wx.Size(width, height) | |
10513 | ||
10514 | def RecalcSizes(self): | |
10515 | # find the space allotted to this sizer | |
10516 | pos = self.GetPosition() | |
10517 | size = self.GetSize() | |
10518 | for item in self.GetChildren(): | |
10519 | # Recalculate (if necessary) the position and size of | |
10520 | # each item and then call item.SetDimension to do the | |
10521 | # actual positioning and sizing of the items within the | |
10522 | # space alloted to this sizer. | |
10523 | ... | |
10524 | item.SetDimension(itemPos, itemSize) | |
10525 | ||
10526 | ||
10527 | When `Layout` is called it first calls `CalcMin` followed by | |
10528 | `RecalcSizes` so you can optimize a bit by saving the results of | |
62d32a5f | 10529 | `CalcMin` and reusing them in `RecalcSizes`. |
248ed943 RD |
10530 | |
10531 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
10532 | ||
10533 | ||
10534 | """ | |
d55e5bfc RD |
10535 | def __repr__(self): |
10536 | return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10537 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
10538 | """ |
10539 | __init__(self) -> PySizer | |
10540 | ||
10541 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
10542 | class. | |
10543 | """ | |
d55e5bfc RD |
10544 | newobj = _core_.new_PySizer(*args, **kwargs) |
10545 | self.this = newobj.this | |
10546 | self.thisown = 1 | |
10547 | del newobj.thisown | |
10548 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) | |
10549 | ||
10550 | def _setCallbackInfo(*args, **kwargs): | |
10551 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
10552 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) | |
10553 | ||
10554 | ||
10555 | class PySizerPtr(PySizer): | |
10556 | def __init__(self, this): | |
10557 | self.this = this | |
10558 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10559 | self.__class__ = PySizer | |
10560 | _core_.PySizer_swigregister(PySizerPtr) | |
10561 | ||
10562 | #--------------------------------------------------------------------------- | |
10563 | ||
10564 | class BoxSizer(Sizer): | |
248ed943 RD |
10565 | """ |
10566 | The basic idea behind a box sizer is that windows will most often be | |
10567 | laid out in rather simple basic geometry, typically in a row or a | |
10568 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
10569 | its items in a simple row or column, depending on the orientation | |
10570 | parameter passed to the constructor. | |
10571 | """ | |
d55e5bfc RD |
10572 | def __repr__(self): |
10573 | return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10574 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
10575 | """ |
10576 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
10577 | ||
10578 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
10579 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
10580 | sizer. | |
10581 | """ | |
d55e5bfc RD |
10582 | newobj = _core_.new_BoxSizer(*args, **kwargs) |
10583 | self.this = newobj.this | |
10584 | self.thisown = 1 | |
10585 | del newobj.thisown | |
10586 | self._setOORInfo(self) | |
10587 | ||
10588 | def GetOrientation(*args, **kwargs): | |
248ed943 RD |
10589 | """ |
10590 | GetOrientation(self) -> int | |
10591 | ||
10592 | Returns the current orientation of the sizer. | |
10593 | """ | |
d55e5bfc RD |
10594 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
10595 | ||
10596 | def SetOrientation(*args, **kwargs): | |
248ed943 RD |
10597 | """ |
10598 | SetOrientation(self, int orient) | |
d55e5bfc | 10599 | |
248ed943 RD |
10600 | Resets the orientation of the sizer. |
10601 | """ | |
10602 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
d55e5bfc RD |
10603 | |
10604 | ||
10605 | class BoxSizerPtr(BoxSizer): | |
10606 | def __init__(self, this): | |
10607 | self.this = this | |
10608 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10609 | self.__class__ = BoxSizer | |
10610 | _core_.BoxSizer_swigregister(BoxSizerPtr) | |
10611 | ||
10612 | #--------------------------------------------------------------------------- | |
10613 | ||
10614 | class StaticBoxSizer(BoxSizer): | |
248ed943 RD |
10615 | """ |
10616 | wx.StaticBoxSizer derives from and functions identically to the | |
10617 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
10618 | manages. Note that this static box must be created separately and | |
10619 | passed to the sizer constructor. | |
10620 | """ | |
d55e5bfc RD |
10621 | def __repr__(self): |
10622 | return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10623 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
10624 | """ |
10625 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
10626 | ||
10627 | Constructor. It takes an associated static box and the orientation | |
10628 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
10629 | ``wx.HORIZONTAL``. | |
10630 | """ | |
d55e5bfc RD |
10631 | newobj = _core_.new_StaticBoxSizer(*args, **kwargs) |
10632 | self.this = newobj.this | |
10633 | self.thisown = 1 | |
10634 | del newobj.thisown | |
10635 | self._setOORInfo(self) | |
10636 | ||
10637 | def GetStaticBox(*args, **kwargs): | |
248ed943 RD |
10638 | """ |
10639 | GetStaticBox(self) -> StaticBox | |
d55e5bfc | 10640 | |
248ed943 RD |
10641 | Returns the static box associated with this sizer. |
10642 | """ | |
10643 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
d55e5bfc RD |
10644 | |
10645 | ||
10646 | class StaticBoxSizerPtr(StaticBoxSizer): | |
10647 | def __init__(self, this): | |
10648 | self.this = this | |
10649 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10650 | self.__class__ = StaticBoxSizer | |
10651 | _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr) | |
10652 | ||
10653 | #--------------------------------------------------------------------------- | |
10654 | ||
10655 | class GridSizer(Sizer): | |
248ed943 RD |
10656 | """ |
10657 | A grid sizer is a sizer which lays out its children in a | |
10658 | two-dimensional table with all cells having the same size. In other | |
10659 | words, the width of each cell within the grid is the width of the | |
10660 | widest item added to the sizer and the height of each grid cell is the | |
10661 | height of the tallest item. An optional vertical and/or horizontal | |
10662 | gap between items can also be specified (in pixels.) | |
10663 | ||
10664 | Items are placed in the cells of the grid in the order they are added, | |
10665 | in row-major order. In other words, the first row is filled first, | |
10666 | then the second, and so on until all items have been added. (If | |
10667 | neccessary, additional rows will be added as items are added.) If you | |
10668 | need to have greater control over the cells that items are placed in | |
10669 | then use the `wx.GridBagSizer`. | |
10670 | ||
10671 | """ | |
d55e5bfc RD |
10672 | def __repr__(self): |
10673 | return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10674 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
10675 | """ |
10676 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
10677 | ||
10678 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
10679 | of columns and rows in the sizer - if either of the parameters is | |
10680 | zero, it will be calculated to from the total number of children in | |
10681 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
10682 | define extra space between all children. | |
10683 | """ | |
d55e5bfc RD |
10684 | newobj = _core_.new_GridSizer(*args, **kwargs) |
10685 | self.this = newobj.this | |
10686 | self.thisown = 1 | |
10687 | del newobj.thisown | |
10688 | self._setOORInfo(self) | |
10689 | ||
d55e5bfc | 10690 | def SetCols(*args, **kwargs): |
248ed943 RD |
10691 | """ |
10692 | SetCols(self, int cols) | |
10693 | ||
10694 | Sets the number of columns in the sizer. | |
10695 | """ | |
d55e5bfc RD |
10696 | return _core_.GridSizer_SetCols(*args, **kwargs) |
10697 | ||
10698 | def SetRows(*args, **kwargs): | |
248ed943 RD |
10699 | """ |
10700 | SetRows(self, int rows) | |
10701 | ||
10702 | Sets the number of rows in the sizer. | |
10703 | """ | |
d55e5bfc RD |
10704 | return _core_.GridSizer_SetRows(*args, **kwargs) |
10705 | ||
10706 | def SetVGap(*args, **kwargs): | |
248ed943 RD |
10707 | """ |
10708 | SetVGap(self, int gap) | |
10709 | ||
10710 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
10711 | """ | |
d55e5bfc RD |
10712 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
10713 | ||
10714 | def SetHGap(*args, **kwargs): | |
248ed943 RD |
10715 | """ |
10716 | SetHGap(self, int gap) | |
10717 | ||
10718 | Sets the horizontal gap (in pixels) between cells in the sizer | |
10719 | """ | |
d55e5bfc RD |
10720 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
10721 | ||
10722 | def GetCols(*args, **kwargs): | |
248ed943 RD |
10723 | """ |
10724 | GetCols(self) -> int | |
10725 | ||
10726 | Returns the number of columns in the sizer. | |
10727 | """ | |
d55e5bfc RD |
10728 | return _core_.GridSizer_GetCols(*args, **kwargs) |
10729 | ||
10730 | def GetRows(*args, **kwargs): | |
248ed943 RD |
10731 | """ |
10732 | GetRows(self) -> int | |
10733 | ||
10734 | Returns the number of rows in the sizer. | |
10735 | """ | |
d55e5bfc RD |
10736 | return _core_.GridSizer_GetRows(*args, **kwargs) |
10737 | ||
10738 | def GetVGap(*args, **kwargs): | |
248ed943 RD |
10739 | """ |
10740 | GetVGap(self) -> int | |
10741 | ||
10742 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
10743 | """ | |
d55e5bfc RD |
10744 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
10745 | ||
10746 | def GetHGap(*args, **kwargs): | |
248ed943 RD |
10747 | """ |
10748 | GetHGap(self) -> int | |
10749 | ||
10750 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
10751 | """ | |
d55e5bfc RD |
10752 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
10753 | ||
10754 | ||
10755 | class GridSizerPtr(GridSizer): | |
10756 | def __init__(self, this): | |
10757 | self.this = this | |
10758 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10759 | self.__class__ = GridSizer | |
10760 | _core_.GridSizer_swigregister(GridSizerPtr) | |
10761 | ||
10762 | #--------------------------------------------------------------------------- | |
10763 | ||
10764 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE | |
10765 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
10766 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
10767 | class FlexGridSizer(GridSizer): | |
248ed943 RD |
10768 | """ |
10769 | A flex grid sizer is a sizer which lays out its children in a | |
10770 | two-dimensional table with all table cells in one row having the same | |
10771 | height and all cells in one column having the same width, but all | |
10772 | rows or all columns are not necessarily the same height or width as in | |
10773 | the `wx.GridSizer`. | |
10774 | ||
10775 | wx.FlexGridSizer can also size items equally in one direction but | |
10776 | unequally ("flexibly") in the other. If the sizer is only flexible | |
10777 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
10778 | needs to be decided how the sizer should grow in the other ("non | |
10779 | flexible") direction in order to fill the available space. The | |
10780 | `SetNonFlexibleGrowMode` method serves this purpose. | |
10781 | ||
10782 | ||
10783 | """ | |
d55e5bfc RD |
10784 | def __repr__(self): |
10785 | return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10786 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
10787 | """ |
10788 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
10789 | ||
10790 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
10791 | number of columns and rows in the sizer - if either of the parameters | |
10792 | is zero, it will be calculated to from the total number of children in | |
10793 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
10794 | define extra space between all children. | |
10795 | """ | |
d55e5bfc RD |
10796 | newobj = _core_.new_FlexGridSizer(*args, **kwargs) |
10797 | self.this = newobj.this | |
10798 | self.thisown = 1 | |
10799 | del newobj.thisown | |
10800 | self._setOORInfo(self) | |
10801 | ||
248ed943 RD |
10802 | def AddGrowableRow(*args, **kwargs): |
10803 | """ | |
10804 | AddGrowableRow(self, size_t idx, int proportion=0) | |
d55e5bfc | 10805 | |
248ed943 RD |
10806 | Specifies that row *idx* (starting from zero) should be grown if there |
10807 | is extra space available to the sizer. | |
d55e5bfc | 10808 | |
248ed943 RD |
10809 | The *proportion* parameter has the same meaning as the stretch factor |
10810 | for the box sizers except that if all proportions are 0, then all | |
10811 | columns are resized equally (instead of not being resized at all). | |
10812 | """ | |
d55e5bfc RD |
10813 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
10814 | ||
10815 | def RemoveGrowableRow(*args, **kwargs): | |
248ed943 RD |
10816 | """ |
10817 | RemoveGrowableRow(self, size_t idx) | |
10818 | ||
10819 | Specifies that row *idx* is no longer growable. | |
10820 | """ | |
d55e5bfc RD |
10821 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
10822 | ||
10823 | def AddGrowableCol(*args, **kwargs): | |
248ed943 RD |
10824 | """ |
10825 | AddGrowableCol(self, size_t idx, int proportion=0) | |
10826 | ||
10827 | Specifies that column *idx* (starting from zero) should be grown if | |
10828 | there is extra space available to the sizer. | |
10829 | ||
10830 | The *proportion* parameter has the same meaning as the stretch factor | |
10831 | for the box sizers except that if all proportions are 0, then all | |
10832 | columns are resized equally (instead of not being resized at all). | |
10833 | """ | |
d55e5bfc RD |
10834 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
10835 | ||
10836 | def RemoveGrowableCol(*args, **kwargs): | |
248ed943 RD |
10837 | """ |
10838 | RemoveGrowableCol(self, size_t idx) | |
10839 | ||
10840 | Specifies that column *idx* is no longer growable. | |
10841 | """ | |
d55e5bfc RD |
10842 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
10843 | ||
10844 | def SetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
10845 | """ |
10846 | SetFlexibleDirection(self, int direction) | |
10847 | ||
10848 | Specifies whether the sizer should flexibly resize its columns, rows, | |
10849 | or both. Argument *direction* can be one of the following values. Any | |
10850 | other value is ignored. | |
10851 | ||
10852 | ============== ======================================= | |
10853 | wx.VERTICAL Rows are flexibly sized. | |
10854 | wx.HORIZONTAL Columns are flexibly sized. | |
10855 | wx.BOTH Both rows and columns are flexibly sized | |
10856 | (this is the default value). | |
10857 | ============== ======================================= | |
10858 | ||
10859 | Note that this method does not trigger relayout. | |
10860 | ||
10861 | """ | |
d55e5bfc RD |
10862 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
10863 | ||
10864 | def GetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
10865 | """ |
10866 | GetFlexibleDirection(self) -> int | |
10867 | ||
10868 | Returns a value that specifies whether the sizer | |
10869 | flexibly resizes its columns, rows, or both (default). | |
10870 | ||
10871 | :see: `SetFlexibleDirection` | |
10872 | """ | |
d55e5bfc RD |
10873 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
10874 | ||
10875 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
10876 | """ |
10877 | SetNonFlexibleGrowMode(self, int mode) | |
10878 | ||
10879 | Specifies how the sizer should grow in the non-flexible direction if | |
10880 | there is one (so `SetFlexibleDirection` must have been called | |
10881 | previously). Argument *mode* can be one of the following values: | |
10882 | ||
10883 | ========================== ================================================= | |
10884 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
10885 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
10886 | `AddGrowableCol` and `AddGrowableRow`. In this | |
10887 | case equal sizing applies to minimum sizes of | |
10888 | columns or rows (this is the default value). | |
10889 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
10890 | the non flexible direction, whether they are | |
10891 | growable or not in the flexbile direction. | |
10892 | ========================== ================================================= | |
10893 | ||
10894 | Note that this method does not trigger relayout. | |
10895 | ||
10896 | ||
10897 | """ | |
d55e5bfc RD |
10898 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
10899 | ||
10900 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
10901 | """ |
10902 | GetNonFlexibleGrowMode(self) -> int | |
10903 | ||
10904 | Returns the value that specifies how the sizer grows in the | |
10905 | non-flexible direction if there is one. | |
10906 | ||
10907 | :see: `SetNonFlexibleGrowMode` | |
10908 | """ | |
d55e5bfc RD |
10909 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
10910 | ||
10911 | def GetRowHeights(*args, **kwargs): | |
a8eff060 RD |
10912 | """ |
10913 | GetRowHeights(self) -> list | |
10914 | ||
10915 | Returns a list of integers representing the heights of each of the | |
10916 | rows in the sizer. | |
10917 | """ | |
d55e5bfc RD |
10918 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
10919 | ||
10920 | def GetColWidths(*args, **kwargs): | |
a8eff060 RD |
10921 | """ |
10922 | GetColWidths(self) -> list | |
10923 | ||
10924 | Returns a list of integers representing the widths of each of the | |
10925 | columns in the sizer. | |
10926 | """ | |
d55e5bfc RD |
10927 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
10928 | ||
10929 | ||
10930 | class FlexGridSizerPtr(FlexGridSizer): | |
10931 | def __init__(self, this): | |
10932 | self.this = this | |
10933 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10934 | self.__class__ = FlexGridSizer | |
10935 | _core_.FlexGridSizer_swigregister(FlexGridSizerPtr) | |
10936 | ||
62d32a5f RD |
10937 | class StdDialogButtonSizer(BoxSizer): |
10938 | """ | |
10939 | A special sizer that knows how to order and position standard buttons | |
10940 | in order to conform to the current platform's standards. You simply | |
10941 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 10942 | buttons using the standard ID's. Then call `Realize` and the sizer |
62d32a5f RD |
10943 | will take care of the rest. |
10944 | ||
10945 | """ | |
10946 | def __repr__(self): | |
10947 | return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10948 | def __init__(self, *args, **kwargs): | |
10949 | """__init__(self) -> StdDialogButtonSizer""" | |
10950 | newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs) | |
10951 | self.this = newobj.this | |
10952 | self.thisown = 1 | |
10953 | del newobj.thisown | |
10954 | def AddButton(*args, **kwargs): | |
10955 | """ | |
10956 | AddButton(self, wxButton button) | |
10957 | ||
10958 | Use this to add the buttons to this sizer. Do not use the `Add` | |
10959 | method in the base class. | |
10960 | """ | |
10961 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
10962 | ||
53aa7709 | 10963 | def Realize(*args, **kwargs): |
62d32a5f | 10964 | """ |
53aa7709 | 10965 | Realize(self) |
62d32a5f RD |
10966 | |
10967 | This funciton needs to be called after all the buttons have been added | |
10968 | to the sizer. It will reorder them and position them in a platform | |
10969 | specifc manner. | |
10970 | """ | |
53aa7709 | 10971 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
10972 | |
10973 | def SetAffirmativeButton(*args, **kwargs): | |
10974 | """SetAffirmativeButton(self, wxButton button)""" | |
10975 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
10976 | ||
10977 | def SetNegativeButton(*args, **kwargs): | |
10978 | """SetNegativeButton(self, wxButton button)""" | |
10979 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
10980 | ||
10981 | def SetCancelButton(*args, **kwargs): | |
10982 | """SetCancelButton(self, wxButton button)""" | |
10983 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
62d32a5f RD |
10984 | |
10985 | def GetAffirmativeButton(*args, **kwargs): | |
10986 | """GetAffirmativeButton(self) -> wxButton""" | |
10987 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
10988 | ||
10989 | def GetApplyButton(*args, **kwargs): | |
10990 | """GetApplyButton(self) -> wxButton""" | |
10991 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
10992 | ||
10993 | def GetNegativeButton(*args, **kwargs): | |
10994 | """GetNegativeButton(self) -> wxButton""" | |
10995 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
10996 | ||
10997 | def GetCancelButton(*args, **kwargs): | |
10998 | """GetCancelButton(self) -> wxButton""" | |
10999 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
11000 | ||
11001 | def GetHelpButton(*args, **kwargs): | |
11002 | """GetHelpButton(self) -> wxButton""" | |
11003 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
11004 | ||
11005 | ||
11006 | class StdDialogButtonSizerPtr(StdDialogButtonSizer): | |
11007 | def __init__(self, this): | |
11008 | self.this = this | |
11009 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11010 | self.__class__ = StdDialogButtonSizer | |
11011 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr) | |
11012 | ||
d55e5bfc RD |
11013 | #--------------------------------------------------------------------------- |
11014 | ||
11015 | class GBPosition(object): | |
248ed943 RD |
11016 | """ |
11017 | This class represents the position of an item in a virtual grid of | |
11018 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
11019 | typemaps that will automatically convert from a 2-element sequence of | |
11020 | integers to a wx.GBPosition, so you can use the more pythonic | |
11021 | representation of the position nearly transparently in Python code. | |
11022 | """ | |
d55e5bfc RD |
11023 | def __repr__(self): |
11024 | return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11025 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11026 | """ |
11027 | __init__(self, int row=0, int col=0) -> GBPosition | |
11028 | ||
11029 | This class represents the position of an item in a virtual grid of | |
11030 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
11031 | typemaps that will automatically convert from a 2-element sequence of | |
11032 | integers to a wx.GBPosition, so you can use the more pythonic | |
11033 | representation of the position nearly transparently in Python code. | |
11034 | """ | |
d55e5bfc RD |
11035 | newobj = _core_.new_GBPosition(*args, **kwargs) |
11036 | self.this = newobj.this | |
11037 | self.thisown = 1 | |
11038 | del newobj.thisown | |
11039 | def GetRow(*args, **kwargs): | |
11040 | """GetRow(self) -> int""" | |
11041 | return _core_.GBPosition_GetRow(*args, **kwargs) | |
11042 | ||
11043 | def GetCol(*args, **kwargs): | |
11044 | """GetCol(self) -> int""" | |
11045 | return _core_.GBPosition_GetCol(*args, **kwargs) | |
11046 | ||
11047 | def SetRow(*args, **kwargs): | |
11048 | """SetRow(self, int row)""" | |
11049 | return _core_.GBPosition_SetRow(*args, **kwargs) | |
11050 | ||
11051 | def SetCol(*args, **kwargs): | |
11052 | """SetCol(self, int col)""" | |
11053 | return _core_.GBPosition_SetCol(*args, **kwargs) | |
11054 | ||
11055 | def __eq__(*args, **kwargs): | |
11056 | """__eq__(self, GBPosition other) -> bool""" | |
11057 | return _core_.GBPosition___eq__(*args, **kwargs) | |
11058 | ||
11059 | def __ne__(*args, **kwargs): | |
11060 | """__ne__(self, GBPosition other) -> bool""" | |
11061 | return _core_.GBPosition___ne__(*args, **kwargs) | |
11062 | ||
11063 | def Set(*args, **kwargs): | |
11064 | """Set(self, int row=0, int col=0)""" | |
11065 | return _core_.GBPosition_Set(*args, **kwargs) | |
11066 | ||
11067 | def Get(*args, **kwargs): | |
11068 | """Get(self) -> PyObject""" | |
11069 | return _core_.GBPosition_Get(*args, **kwargs) | |
11070 | ||
79fccf9d | 11071 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
11072 | def __str__(self): return str(self.Get()) |
11073 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
11074 | def __len__(self): return len(self.Get()) | |
11075 | def __getitem__(self, index): return self.Get()[index] | |
11076 | def __setitem__(self, index, val): | |
11077 | if index == 0: self.SetRow(val) | |
11078 | elif index == 1: self.SetCol(val) | |
11079 | else: raise IndexError | |
11080 | def __nonzero__(self): return self.Get() != (0,0) | |
11081 | __safe_for_unpickling__ = True | |
11082 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
11083 | ||
11084 | row = property(GetRow, SetRow) | |
11085 | col = property(GetCol, SetCol) | |
11086 | ||
11087 | ||
11088 | class GBPositionPtr(GBPosition): | |
11089 | def __init__(self, this): | |
11090 | self.this = this | |
11091 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11092 | self.__class__ = GBPosition | |
11093 | _core_.GBPosition_swigregister(GBPositionPtr) | |
11094 | ||
11095 | class GBSpan(object): | |
248ed943 RD |
11096 | """ |
11097 | This class is used to hold the row and column spanning attributes of | |
11098 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
11099 | automatically convert from a 2-element sequence of integers to a | |
11100 | wx.GBSpan, so you can use the more pythonic representation of the span | |
11101 | nearly transparently in Python code. | |
11102 | ||
11103 | """ | |
d55e5bfc RD |
11104 | def __repr__(self): |
11105 | return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11106 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11107 | """ |
11108 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
11109 | ||
11110 | Construct a new wxGBSpan, optionally setting the rowspan and | |
11111 | colspan. The default is (1,1). (Meaning that the item occupies one | |
11112 | cell in each direction. | |
11113 | """ | |
d55e5bfc RD |
11114 | newobj = _core_.new_GBSpan(*args, **kwargs) |
11115 | self.this = newobj.this | |
11116 | self.thisown = 1 | |
11117 | del newobj.thisown | |
11118 | def GetRowspan(*args, **kwargs): | |
11119 | """GetRowspan(self) -> int""" | |
11120 | return _core_.GBSpan_GetRowspan(*args, **kwargs) | |
11121 | ||
11122 | def GetColspan(*args, **kwargs): | |
11123 | """GetColspan(self) -> int""" | |
11124 | return _core_.GBSpan_GetColspan(*args, **kwargs) | |
11125 | ||
11126 | def SetRowspan(*args, **kwargs): | |
11127 | """SetRowspan(self, int rowspan)""" | |
11128 | return _core_.GBSpan_SetRowspan(*args, **kwargs) | |
11129 | ||
11130 | def SetColspan(*args, **kwargs): | |
11131 | """SetColspan(self, int colspan)""" | |
11132 | return _core_.GBSpan_SetColspan(*args, **kwargs) | |
11133 | ||
11134 | def __eq__(*args, **kwargs): | |
11135 | """__eq__(self, GBSpan other) -> bool""" | |
11136 | return _core_.GBSpan___eq__(*args, **kwargs) | |
11137 | ||
11138 | def __ne__(*args, **kwargs): | |
11139 | """__ne__(self, GBSpan other) -> bool""" | |
11140 | return _core_.GBSpan___ne__(*args, **kwargs) | |
11141 | ||
11142 | def Set(*args, **kwargs): | |
11143 | """Set(self, int rowspan=1, int colspan=1)""" | |
11144 | return _core_.GBSpan_Set(*args, **kwargs) | |
11145 | ||
11146 | def Get(*args, **kwargs): | |
11147 | """Get(self) -> PyObject""" | |
11148 | return _core_.GBSpan_Get(*args, **kwargs) | |
11149 | ||
79fccf9d | 11150 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
11151 | def __str__(self): return str(self.Get()) |
11152 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
11153 | def __len__(self): return len(self.Get()) | |
11154 | def __getitem__(self, index): return self.Get()[index] | |
11155 | def __setitem__(self, index, val): | |
11156 | if index == 0: self.SetRowspan(val) | |
11157 | elif index == 1: self.SetColspan(val) | |
11158 | else: raise IndexError | |
11159 | def __nonzero__(self): return self.Get() != (0,0) | |
11160 | __safe_for_unpickling__ = True | |
11161 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
11162 | ||
11163 | rowspan = property(GetRowspan, SetRowspan) | |
11164 | colspan = property(GetColspan, SetColspan) | |
11165 | ||
11166 | ||
11167 | class GBSpanPtr(GBSpan): | |
11168 | def __init__(self, this): | |
11169 | self.this = this | |
11170 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11171 | self.__class__ = GBSpan | |
11172 | _core_.GBSpan_swigregister(GBSpanPtr) | |
11173 | ||
11174 | class GBSizerItem(SizerItem): | |
248ed943 RD |
11175 | """ |
11176 | The wx.GBSizerItem class is used to track the additional data about | |
11177 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
11178 | and how many rows or columns it spans. | |
11179 | ||
11180 | """ | |
d55e5bfc RD |
11181 | def __repr__(self): |
11182 | return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11183 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11184 | """ |
11185 | __init__(self) -> GBSizerItem | |
11186 | ||
11187 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
11188 | size will need to be set, as well as a position and span before this | |
11189 | item can be used in a Sizer. | |
11190 | ||
11191 | You will probably never need to create a wx.GBSizerItem directly as they | |
11192 | are created automatically when the sizer's Add method is called. | |
11193 | """ | |
d55e5bfc RD |
11194 | newobj = _core_.new_GBSizerItem(*args, **kwargs) |
11195 | self.this = newobj.this | |
11196 | self.thisown = 1 | |
11197 | del newobj.thisown | |
11198 | def GetPos(*args, **kwargs): | |
248ed943 RD |
11199 | """ |
11200 | GetPos(self) -> GBPosition | |
11201 | ||
11202 | Get the grid position of the item | |
11203 | """ | |
d55e5bfc RD |
11204 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
11205 | ||
11206 | def GetPosTuple(self): return self.GetPos().Get() | |
11207 | def GetSpan(*args, **kwargs): | |
248ed943 RD |
11208 | """ |
11209 | GetSpan(self) -> GBSpan | |
11210 | ||
11211 | Get the row and column spanning of the item | |
11212 | """ | |
d55e5bfc RD |
11213 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
11214 | ||
11215 | def GetSpanTuple(self): return self.GetSpan().Get() | |
11216 | def SetPos(*args, **kwargs): | |
248ed943 RD |
11217 | """ |
11218 | SetPos(self, GBPosition pos) -> bool | |
11219 | ||
11220 | If the item is already a member of a sizer then first ensure that | |
11221 | there is no other item that would intersect with this one at the new | |
11222 | position, then set the new position. Returns True if the change is | |
11223 | successful and after the next Layout() the item will be moved. | |
11224 | """ | |
d55e5bfc RD |
11225 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
11226 | ||
11227 | def SetSpan(*args, **kwargs): | |
248ed943 RD |
11228 | """ |
11229 | SetSpan(self, GBSpan span) -> bool | |
11230 | ||
11231 | If the item is already a member of a sizer then first ensure that | |
11232 | there is no other item that would intersect with this one with its new | |
11233 | spanning size, then set the new spanning. Returns True if the change | |
11234 | is successful and after the next Layout() the item will be resized. | |
11235 | ||
11236 | """ | |
d55e5bfc RD |
11237 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
11238 | ||
248ed943 | 11239 | def Intersects(*args, **kwargs): |
d55e5bfc RD |
11240 | """ |
11241 | Intersects(self, GBSizerItem other) -> bool | |
248ed943 RD |
11242 | |
11243 | Returns True if this item and the other item instersect. | |
d55e5bfc | 11244 | """ |
248ed943 RD |
11245 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
11246 | ||
11247 | def IntersectsPos(*args, **kwargs): | |
11248 | """ | |
11249 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
11250 | ||
11251 | Returns True if the given pos/span would intersect with this item. | |
11252 | """ | |
11253 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
d55e5bfc RD |
11254 | |
11255 | def GetEndPos(*args, **kwargs): | |
248ed943 RD |
11256 | """ |
11257 | GetEndPos(self) -> GBPosition | |
11258 | ||
11259 | Get the row and column of the endpoint of this item. | |
11260 | """ | |
d55e5bfc RD |
11261 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
11262 | ||
11263 | def GetGBSizer(*args, **kwargs): | |
248ed943 RD |
11264 | """ |
11265 | GetGBSizer(self) -> GridBagSizer | |
11266 | ||
11267 | Get the sizer this item is a member of. | |
11268 | """ | |
d55e5bfc RD |
11269 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
11270 | ||
11271 | def SetGBSizer(*args, **kwargs): | |
248ed943 RD |
11272 | """ |
11273 | SetGBSizer(self, GridBagSizer sizer) | |
11274 | ||
11275 | Set the sizer this item is a member of. | |
11276 | """ | |
d55e5bfc RD |
11277 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
11278 | ||
11279 | ||
11280 | class GBSizerItemPtr(GBSizerItem): | |
11281 | def __init__(self, this): | |
11282 | self.this = this | |
11283 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11284 | self.__class__ = GBSizerItem | |
11285 | _core_.GBSizerItem_swigregister(GBSizerItemPtr) | |
11286 | DefaultSpan = cvar.DefaultSpan | |
11287 | ||
11288 | def GBSizerItemWindow(*args, **kwargs): | |
11289 | """ | |
11290 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
11291 | int border, PyObject userData=None) -> GBSizerItem |
11292 | ||
11293 | Construct a `wx.GBSizerItem` for a window. | |
d55e5bfc RD |
11294 | """ |
11295 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) | |
11296 | val.thisown = 1 | |
11297 | return val | |
11298 | ||
11299 | def GBSizerItemSizer(*args, **kwargs): | |
11300 | """ | |
11301 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
11302 | int border, PyObject userData=None) -> GBSizerItem |
11303 | ||
11304 | Construct a `wx.GBSizerItem` for a sizer | |
d55e5bfc RD |
11305 | """ |
11306 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) | |
11307 | val.thisown = 1 | |
11308 | return val | |
11309 | ||
11310 | def GBSizerItemSpacer(*args, **kwargs): | |
11311 | """ | |
11312 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
248ed943 RD |
11313 | int flag, int border, PyObject userData=None) -> GBSizerItem |
11314 | ||
11315 | Construct a `wx.GBSizerItem` for a spacer. | |
d55e5bfc RD |
11316 | """ |
11317 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) | |
11318 | val.thisown = 1 | |
11319 | return val | |
11320 | ||
11321 | class GridBagSizer(FlexGridSizer): | |
248ed943 RD |
11322 | """ |
11323 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
11324 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
11325 | is allowed using `wx.GBPosition`, and items can optionally span more | |
11326 | than one row and/or column using `wx.GBSpan`. The total size of the | |
11327 | virtual grid is determined by the largest row and column that items are | |
11328 | positioned at, adjusted for spanning. | |
11329 | ||
11330 | """ | |
d55e5bfc RD |
11331 | def __repr__(self): |
11332 | return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11333 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11334 | """ |
11335 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
11336 | ||
11337 | Constructor, with optional parameters to specify the gap between the | |
11338 | rows and columns. | |
11339 | """ | |
d55e5bfc RD |
11340 | newobj = _core_.new_GridBagSizer(*args, **kwargs) |
11341 | self.this = newobj.this | |
11342 | self.thisown = 1 | |
11343 | del newobj.thisown | |
c9c2cf70 RD |
11344 | self._setOORInfo(self) |
11345 | ||
d55e5bfc RD |
11346 | def Add(*args, **kwargs): |
11347 | """ | |
248ed943 | 11348 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
c1cb24a4 | 11349 | int border=0, userData=None) -> wx.GBSizerItem |
248ed943 RD |
11350 | |
11351 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
11352 | more than one row or column as specified with *span*. The remaining | |
11353 | args behave similarly to `wx.Sizer.Add`. | |
11354 | ||
11355 | Returns True if the item was successfully placed at the given cell | |
11356 | position, False if something was already there. | |
11357 | ||
d55e5bfc RD |
11358 | """ |
11359 | return _core_.GridBagSizer_Add(*args, **kwargs) | |
11360 | ||
11361 | def AddItem(*args, **kwargs): | |
248ed943 | 11362 | """ |
c1cb24a4 | 11363 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
248ed943 RD |
11364 | |
11365 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
11366 | the item was successfully placed at its given cell position, False if | |
11367 | something was already there. | |
11368 | """ | |
d55e5bfc RD |
11369 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
11370 | ||
84f85550 RD |
11371 | def GetCellSize(*args, **kwargs): |
11372 | """ | |
11373 | GetCellSize(self, int row, int col) -> Size | |
11374 | ||
11375 | Get the size of the specified cell, including hgap and | |
11376 | vgap. Only valid after a Layout. | |
11377 | """ | |
11378 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
11379 | ||
d55e5bfc | 11380 | def GetEmptyCellSize(*args, **kwargs): |
248ed943 RD |
11381 | """ |
11382 | GetEmptyCellSize(self) -> Size | |
11383 | ||
11384 | Get the size used for cells in the grid with no item. | |
11385 | """ | |
d55e5bfc RD |
11386 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
11387 | ||
11388 | def SetEmptyCellSize(*args, **kwargs): | |
248ed943 RD |
11389 | """ |
11390 | SetEmptyCellSize(self, Size sz) | |
11391 | ||
11392 | Set the size used for cells in the grid with no item. | |
11393 | """ | |
d55e5bfc RD |
11394 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
11395 | ||
11396 | def GetItemPosition(*args): | |
11397 | """ | |
248ed943 RD |
11398 | GetItemPosition(self, item) -> GBPosition |
11399 | ||
11400 | Get the grid position of the specified *item* where *item* is either a | |
11401 | window or subsizer that is a member of this sizer, or a zero-based | |
11402 | index of an item. | |
d55e5bfc RD |
11403 | """ |
11404 | return _core_.GridBagSizer_GetItemPosition(*args) | |
11405 | ||
11406 | def SetItemPosition(*args): | |
11407 | """ | |
248ed943 RD |
11408 | SetItemPosition(self, item, GBPosition pos) -> bool |
11409 | ||
11410 | Set the grid position of the specified *item* where *item* is either a | |
11411 | window or subsizer that is a member of this sizer, or a zero-based | |
11412 | index of an item. Returns True on success. If the move is not | |
11413 | allowed (because an item is already there) then False is returned. | |
11414 | ||
d55e5bfc RD |
11415 | """ |
11416 | return _core_.GridBagSizer_SetItemPosition(*args) | |
11417 | ||
11418 | def GetItemSpan(*args): | |
11419 | """ | |
248ed943 RD |
11420 | GetItemSpan(self, item) -> GBSpan |
11421 | ||
11422 | Get the row/col spanning of the specified *item* where *item* is | |
11423 | either a window or subsizer that is a member of this sizer, or a | |
11424 | zero-based index of an item. | |
d55e5bfc RD |
11425 | """ |
11426 | return _core_.GridBagSizer_GetItemSpan(*args) | |
11427 | ||
11428 | def SetItemSpan(*args): | |
11429 | """ | |
248ed943 RD |
11430 | SetItemSpan(self, item, GBSpan span) -> bool |
11431 | ||
11432 | Set the row/col spanning of the specified *item* where *item* is | |
11433 | either a window or subsizer that is a member of this sizer, or a | |
11434 | zero-based index of an item. Returns True on success. If the move is | |
11435 | not allowed (because an item is already there) then False is returned. | |
d55e5bfc RD |
11436 | """ |
11437 | return _core_.GridBagSizer_SetItemSpan(*args) | |
11438 | ||
11439 | def FindItem(*args): | |
11440 | """ | |
248ed943 RD |
11441 | FindItem(self, item) -> GBSizerItem |
11442 | ||
11443 | Find the sizer item for the given window or subsizer, returns None if | |
11444 | not found. (non-recursive) | |
d55e5bfc RD |
11445 | """ |
11446 | return _core_.GridBagSizer_FindItem(*args) | |
11447 | ||
11448 | def FindItemAtPosition(*args, **kwargs): | |
248ed943 RD |
11449 | """ |
11450 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
11451 | ||
11452 | Return the sizer item for the given grid cell, or None if there is no | |
11453 | item at that position. (non-recursive) | |
11454 | """ | |
d55e5bfc RD |
11455 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
11456 | ||
11457 | def FindItemAtPoint(*args, **kwargs): | |
248ed943 RD |
11458 | """ |
11459 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
11460 | ||
11461 | Return the sizer item located at the point given in *pt*, or None if | |
11462 | there is no item at that point. The (x,y) coordinates in pt correspond | |
11463 | to the client coordinates of the window using the sizer for | |
11464 | layout. (non-recursive) | |
11465 | """ | |
d55e5bfc RD |
11466 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
11467 | ||
248ed943 RD |
11468 | def CheckForIntersection(*args, **kwargs): |
11469 | """ | |
11470 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
d55e5bfc | 11471 | |
248ed943 RD |
11472 | Look at all items and see if any intersect (or would overlap) the |
11473 | given *item*. Returns True if so, False if there would be no overlap. | |
11474 | If an *excludeItem* is given then it will not be checked for | |
11475 | intersection, for example it may be the item we are checking the | |
11476 | position of. | |
d55e5bfc | 11477 | |
248ed943 RD |
11478 | """ |
11479 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
d55e5bfc | 11480 | |
248ed943 | 11481 | def CheckForIntersectionPos(*args, **kwargs): |
d55e5bfc | 11482 | """ |
248ed943 RD |
11483 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
11484 | ||
11485 | Look at all items and see if any intersect (or would overlap) the | |
11486 | given position and span. Returns True if so, False if there would be | |
11487 | no overlap. If an *excludeItem* is given then it will not be checked | |
11488 | for intersection, for example it may be the item we are checking the | |
11489 | position of. | |
d55e5bfc | 11490 | """ |
248ed943 | 11491 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
d55e5bfc RD |
11492 | |
11493 | ||
11494 | class GridBagSizerPtr(GridBagSizer): | |
11495 | def __init__(self, this): | |
11496 | self.this = this | |
11497 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11498 | self.__class__ = GridBagSizer | |
11499 | _core_.GridBagSizer_swigregister(GridBagSizerPtr) | |
11500 | ||
11501 | #--------------------------------------------------------------------------- | |
11502 | ||
11503 | Left = _core_.Left | |
11504 | Top = _core_.Top | |
11505 | Right = _core_.Right | |
11506 | Bottom = _core_.Bottom | |
11507 | Width = _core_.Width | |
11508 | Height = _core_.Height | |
11509 | Centre = _core_.Centre | |
11510 | Center = _core_.Center | |
11511 | CentreX = _core_.CentreX | |
11512 | CentreY = _core_.CentreY | |
11513 | Unconstrained = _core_.Unconstrained | |
11514 | AsIs = _core_.AsIs | |
11515 | PercentOf = _core_.PercentOf | |
11516 | Above = _core_.Above | |
11517 | Below = _core_.Below | |
11518 | LeftOf = _core_.LeftOf | |
11519 | RightOf = _core_.RightOf | |
11520 | SameAs = _core_.SameAs | |
11521 | Absolute = _core_.Absolute | |
11522 | class IndividualLayoutConstraint(Object): | |
11523 | """ | |
79fccf9d RD |
11524 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
11525 | one of eight possible constraints that a window can be involved in. | |
11526 | You will never need to create an instance of | |
11527 | wx.IndividualLayoutConstraint, rather you should create a | |
11528 | `wx.LayoutConstraints` instance and use the individual contstraints | |
d55e5bfc | 11529 | that it contains. |
d55e5bfc RD |
11530 | """ |
11531 | def __init__(self): raise RuntimeError, "No constructor defined" | |
11532 | def __repr__(self): | |
11533 | return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11534 | def Set(*args, **kwargs): | |
79fccf9d RD |
11535 | """ |
11536 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
11537 | ||
11538 | Sets the properties of the constraint. Normally called by one of the | |
11539 | convenience functions such as Above, RightOf, SameAs. | |
11540 | """ | |
d55e5bfc RD |
11541 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
11542 | ||
11543 | def LeftOf(*args, **kwargs): | |
11544 | """ | |
11545 | LeftOf(self, Window sibling, int marg=0) | |
11546 | ||
79fccf9d RD |
11547 | Constrains this edge to be to the left of the given window, with an |
11548 | optional margin. Implicitly, this is relative to the left edge of the | |
11549 | other window. | |
d55e5bfc RD |
11550 | """ |
11551 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) | |
11552 | ||
11553 | def RightOf(*args, **kwargs): | |
11554 | """ | |
11555 | RightOf(self, Window sibling, int marg=0) | |
11556 | ||
79fccf9d RD |
11557 | Constrains this edge to be to the right of the given window, with an |
11558 | optional margin. Implicitly, this is relative to the right edge of the | |
11559 | other window. | |
d55e5bfc RD |
11560 | """ |
11561 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) | |
11562 | ||
11563 | def Above(*args, **kwargs): | |
11564 | """ | |
11565 | Above(self, Window sibling, int marg=0) | |
11566 | ||
79fccf9d RD |
11567 | Constrains this edge to be above the given window, with an optional |
11568 | margin. Implicitly, this is relative to the top edge of the other | |
11569 | window. | |
d55e5bfc RD |
11570 | """ |
11571 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) | |
11572 | ||
11573 | def Below(*args, **kwargs): | |
11574 | """ | |
11575 | Below(self, Window sibling, int marg=0) | |
11576 | ||
79fccf9d RD |
11577 | Constrains this edge to be below the given window, with an optional |
11578 | margin. Implicitly, this is relative to the bottom edge of the other | |
11579 | window. | |
d55e5bfc RD |
11580 | """ |
11581 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) | |
11582 | ||
11583 | def SameAs(*args, **kwargs): | |
11584 | """ | |
11585 | SameAs(self, Window otherW, int edge, int marg=0) | |
11586 | ||
79fccf9d RD |
11587 | Constrains this edge or dimension to be to the same as the edge of the |
11588 | given window, with an optional margin. | |
d55e5bfc RD |
11589 | """ |
11590 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) | |
11591 | ||
11592 | def PercentOf(*args, **kwargs): | |
11593 | """ | |
11594 | PercentOf(self, Window otherW, int wh, int per) | |
11595 | ||
79fccf9d RD |
11596 | Constrains this edge or dimension to be to a percentage of the given |
11597 | window, with an optional margin. | |
d55e5bfc RD |
11598 | """ |
11599 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) | |
11600 | ||
11601 | def Absolute(*args, **kwargs): | |
11602 | """ | |
11603 | Absolute(self, int val) | |
11604 | ||
79fccf9d | 11605 | Constrains this edge or dimension to be the given absolute value. |
d55e5bfc RD |
11606 | """ |
11607 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) | |
11608 | ||
11609 | def Unconstrained(*args, **kwargs): | |
11610 | """ | |
11611 | Unconstrained(self) | |
11612 | ||
79fccf9d RD |
11613 | Sets this edge or dimension to be unconstrained, that is, dependent on |
11614 | other edges and dimensions from which this value can be deduced. | |
d55e5bfc RD |
11615 | """ |
11616 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) | |
11617 | ||
11618 | def AsIs(*args, **kwargs): | |
11619 | """ | |
11620 | AsIs(self) | |
11621 | ||
79fccf9d RD |
11622 | Sets this edge or constraint to be whatever the window's value is at |
11623 | the moment. If either of the width and height constraints are *as is*, | |
11624 | the window will not be resized, but moved instead. This is important | |
11625 | when considering panel items which are intended to have a default | |
11626 | size, such as a button, which may take its size from the size of the | |
11627 | button label. | |
d55e5bfc RD |
11628 | """ |
11629 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) | |
11630 | ||
11631 | def GetOtherWindow(*args, **kwargs): | |
11632 | """GetOtherWindow(self) -> Window""" | |
11633 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) | |
11634 | ||
11635 | def GetMyEdge(*args, **kwargs): | |
11636 | """GetMyEdge(self) -> int""" | |
11637 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) | |
11638 | ||
11639 | def SetEdge(*args, **kwargs): | |
11640 | """SetEdge(self, int which)""" | |
11641 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) | |
11642 | ||
11643 | def SetValue(*args, **kwargs): | |
11644 | """SetValue(self, int v)""" | |
11645 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) | |
11646 | ||
11647 | def GetMargin(*args, **kwargs): | |
11648 | """GetMargin(self) -> int""" | |
11649 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) | |
11650 | ||
11651 | def SetMargin(*args, **kwargs): | |
11652 | """SetMargin(self, int m)""" | |
11653 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) | |
11654 | ||
11655 | def GetValue(*args, **kwargs): | |
11656 | """GetValue(self) -> int""" | |
11657 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) | |
11658 | ||
11659 | def GetPercent(*args, **kwargs): | |
11660 | """GetPercent(self) -> int""" | |
11661 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) | |
11662 | ||
11663 | def GetOtherEdge(*args, **kwargs): | |
11664 | """GetOtherEdge(self) -> int""" | |
11665 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) | |
11666 | ||
11667 | def GetDone(*args, **kwargs): | |
11668 | """GetDone(self) -> bool""" | |
11669 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) | |
11670 | ||
11671 | def SetDone(*args, **kwargs): | |
11672 | """SetDone(self, bool d)""" | |
11673 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) | |
11674 | ||
11675 | def GetRelationship(*args, **kwargs): | |
11676 | """GetRelationship(self) -> int""" | |
11677 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) | |
11678 | ||
11679 | def SetRelationship(*args, **kwargs): | |
11680 | """SetRelationship(self, int r)""" | |
11681 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) | |
11682 | ||
11683 | def ResetIfWin(*args, **kwargs): | |
11684 | """ | |
11685 | ResetIfWin(self, Window otherW) -> bool | |
11686 | ||
11687 | Reset constraint if it mentions otherWin | |
11688 | """ | |
11689 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) | |
11690 | ||
11691 | def SatisfyConstraint(*args, **kwargs): | |
11692 | """ | |
11693 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool | |
11694 | ||
11695 | Try to satisfy constraint | |
11696 | """ | |
11697 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) | |
11698 | ||
11699 | def GetEdge(*args, **kwargs): | |
11700 | """ | |
11701 | GetEdge(self, int which, Window thisWin, Window other) -> int | |
11702 | ||
11703 | Get the value of this edge or dimension, or if this | |
11704 | is not determinable, -1. | |
11705 | """ | |
11706 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) | |
11707 | ||
11708 | ||
11709 | class IndividualLayoutConstraintPtr(IndividualLayoutConstraint): | |
11710 | def __init__(self, this): | |
11711 | self.this = this | |
11712 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11713 | self.__class__ = IndividualLayoutConstraint | |
11714 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr) | |
11715 | ||
11716 | class LayoutConstraints(Object): | |
11717 | """ | |
79fccf9d RD |
11718 | **Note:** constraints are now deprecated and you should use sizers |
11719 | instead. | |
d55e5bfc | 11720 | |
79fccf9d RD |
11721 | Objects of this class can be associated with a window to define its |
11722 | layout constraints, with respect to siblings or its parent. | |
d55e5bfc RD |
11723 | |
11724 | The class consists of the following eight constraints of class | |
11725 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
11726 | directly to set the appropriate constraints. | |
11727 | ||
11728 | * left: represents the left hand edge of the window | |
11729 | * right: represents the right hand edge of the window | |
11730 | * top: represents the top edge of the window | |
11731 | * bottom: represents the bottom edge of the window | |
11732 | * width: represents the width of the window | |
11733 | * height: represents the height of the window | |
11734 | * centreX: represents the horizontal centre point of the window | |
11735 | * centreY: represents the vertical centre point of the window | |
11736 | ||
79fccf9d RD |
11737 | Most constraints are initially set to have the relationship |
11738 | wxUnconstrained, which means that their values should be calculated by | |
11739 | looking at known constraints. The exceptions are width and height, | |
11740 | which are set to wxAsIs to ensure that if the user does not specify a | |
11741 | constraint, the existing width and height will be used, to be | |
11742 | compatible with panel items which often have take a default size. If | |
11743 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
11744 | ||
11745 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
d55e5bfc RD |
11746 | |
11747 | """ | |
11748 | def __repr__(self): | |
11749 | return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11750 | left = property(_core_.LayoutConstraints_left_get) | |
11751 | top = property(_core_.LayoutConstraints_top_get) | |
11752 | right = property(_core_.LayoutConstraints_right_get) | |
11753 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
11754 | width = property(_core_.LayoutConstraints_width_get) | |
11755 | height = property(_core_.LayoutConstraints_height_get) | |
11756 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
11757 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
11758 | def __init__(self, *args, **kwargs): | |
11759 | """__init__(self) -> LayoutConstraints""" | |
11760 | newobj = _core_.new_LayoutConstraints(*args, **kwargs) | |
11761 | self.this = newobj.this | |
11762 | self.thisown = 1 | |
11763 | del newobj.thisown | |
11764 | def SatisfyConstraints(*args, **kwargs): | |
11765 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" | |
11766 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) | |
11767 | ||
11768 | def AreSatisfied(*args, **kwargs): | |
11769 | """AreSatisfied(self) -> bool""" | |
11770 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) | |
11771 | ||
11772 | ||
11773 | class LayoutConstraintsPtr(LayoutConstraints): | |
11774 | def __init__(self, this): | |
11775 | self.this = this | |
11776 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11777 | self.__class__ = LayoutConstraints | |
11778 | _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr) | |
11779 | ||
11780 | #---------------------------------------------------------------------------- | |
11781 | ||
11782 | # Use Python's bool constants if available, make some if not | |
11783 | try: | |
11784 | True | |
11785 | except NameError: | |
11786 | __builtins__.True = 1==1 | |
11787 | __builtins__.False = 1==0 | |
11788 | def bool(value): return not not value | |
11789 | __builtins__.bool = bool | |
11790 | ||
11791 | ||
11792 | ||
11793 | # workarounds for bad wxRTTI names | |
11794 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
11795 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
11796 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
11797 | ||
11798 | ||
11799 | #---------------------------------------------------------------------------- | |
11800 | # Load version numbers from __version__... Ensure that major and minor | |
0f63ec68 | 11801 | # versions are the same for both wxPython and wxWidgets. |
d55e5bfc RD |
11802 | |
11803 | from __version__ import * | |
11804 | __version__ = VERSION_STRING | |
11805 | ||
0f63ec68 RD |
11806 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
11807 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
d55e5bfc RD |
11808 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
11809 | import warnings | |
0f63ec68 | 11810 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d55e5bfc RD |
11811 | |
11812 | #---------------------------------------------------------------------------- | |
11813 | ||
70b7a5fe RD |
11814 | # Set wxPython's default string<-->unicode conversion encoding from |
11815 | # the locale, but only if Python's default hasn't been changed. (We | |
11816 | # assume that if the user has customized it already then that is the | |
11817 | # encoding we need to use as well.) | |
11818 | # | |
11819 | # The encoding selected here is used when string or unicode objects | |
11820 | # need to be converted in order to pass them to wxWidgets. Please be | |
11821 | # aware that the default encoding within the same locale may be | |
11822 | # slightly different on different platforms. For example, please see | |
62d32a5f RD |
11823 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
11824 | # between the common latin/roman encodings. | |
396fb509 RD |
11825 | |
11826 | default = _sys.getdefaultencoding() | |
11827 | if default == 'ascii': | |
11828 | import locale | |
11829 | import codecs | |
11830 | try: | |
11831 | default = locale.getdefaultlocale()[1] | |
11832 | codecs.lookup(default) | |
70b7a5fe | 11833 | except (ValueError, LookupError, TypeError): |
396fb509 RD |
11834 | default = _sys.getdefaultencoding() |
11835 | del locale | |
11836 | del codecs | |
5cbf236d RD |
11837 | if default: |
11838 | wx.SetDefaultPyEncoding(default) | |
11839 | del default | |
5cbf236d RD |
11840 | |
11841 | #---------------------------------------------------------------------------- | |
11842 | ||
d55e5bfc RD |
11843 | class PyDeadObjectError(AttributeError): |
11844 | pass | |
11845 | ||
11846 | class _wxPyDeadObject(object): | |
11847 | """ | |
11848 | Instances of wx objects that are OOR capable will have their __class__ | |
11849 | changed to this class when the C++ object is deleted. This should help | |
11850 | prevent crashes due to referencing a bogus C++ pointer. | |
11851 | """ | |
11852 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
11853 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
11854 | ||
11855 | def __repr__(self): | |
11856 | if not hasattr(self, "_name"): | |
11857 | self._name = "[unknown]" | |
11858 | return self.reprStr % self._name | |
11859 | ||
11860 | def __getattr__(self, *args): | |
11861 | if not hasattr(self, "_name"): | |
11862 | self._name = "[unknown]" | |
11863 | raise PyDeadObjectError(self.attrStr % self._name) | |
11864 | ||
11865 | def __nonzero__(self): | |
11866 | return 0 | |
11867 | ||
11868 | ||
11869 | ||
11870 | class PyUnbornObjectError(AttributeError): | |
11871 | pass | |
11872 | ||
11873 | class _wxPyUnbornObject(object): | |
11874 | """ | |
11875 | Some stock objects are created when the wx._core module is | |
11876 | imported, but their C++ instance is not created until the wx.App | |
11877 | object is created and initialized. These object instances will | |
11878 | temporarily have their __class__ changed to this class so an | |
11879 | exception will be raised if they are used before the C++ instance | |
11880 | is ready. | |
11881 | """ | |
11882 | ||
11883 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
11884 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
11885 | ||
11886 | def __repr__(self): | |
11887 | #if not hasattr(self, "_name"): | |
11888 | # self._name = "[unknown]" | |
11889 | return self.reprStr #% self._name | |
11890 | ||
11891 | def __getattr__(self, *args): | |
11892 | #if not hasattr(self, "_name"): | |
11893 | # self._name = "[unknown]" | |
11894 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
11895 | ||
11896 | def __nonzero__(self): | |
11897 | return 0 | |
11898 | ||
11899 | ||
11900 | #---------------------------------------------------------------------------- | |
d55e5bfc RD |
11901 | |
11902 | def CallAfter(callable, *args, **kw): | |
11903 | """ | |
11904 | Call the specified function after the current and pending event | |
11905 | handlers have been completed. This is also good for making GUI | |
0439c23b RD |
11906 | method calls from non-GUI threads. Any extra positional or |
11907 | keyword args are passed on to the callable when it is called. | |
11908 | ||
11909 | :see: `wx.FutureCall` | |
d55e5bfc RD |
11910 | """ |
11911 | app = wx.GetApp() | |
a001823c | 11912 | assert app is not None, 'No wx.App created yet' |
d55e5bfc | 11913 | |
891bb194 RD |
11914 | if not hasattr(app, "_CallAfterId"): |
11915 | app._CallAfterId = wx.NewEventType() | |
11916 | app.Connect(-1, -1, app._CallAfterId, | |
11917 | lambda event: event.callable(*event.args, **event.kw) ) | |
d55e5bfc | 11918 | evt = wx.PyEvent() |
891bb194 | 11919 | evt.SetEventType(app._CallAfterId) |
d55e5bfc RD |
11920 | evt.callable = callable |
11921 | evt.args = args | |
11922 | evt.kw = kw | |
11923 | wx.PostEvent(app, evt) | |
11924 | ||
d55e5bfc RD |
11925 | #---------------------------------------------------------------------------- |
11926 | ||
11927 | ||
11928 | class FutureCall: | |
11929 | """ | |
8ac8dba0 | 11930 | A convenience class for `wx.Timer`, that calls the given callable |
d55e5bfc RD |
11931 | object once after the given amount of milliseconds, passing any |
11932 | positional or keyword args. The return value of the callable is | |
0439c23b | 11933 | availbale after it has been run with the `GetResult` method. |
d55e5bfc RD |
11934 | |
11935 | If you don't need to get the return value or restart the timer | |
11936 | then there is no need to hold a reference to this object. It will | |
11937 | hold a reference to itself while the timer is running (the timer | |
11938 | has a reference to self.Notify) but the cycle will be broken when | |
11939 | the timer completes, automatically cleaning up the wx.FutureCall | |
11940 | object. | |
0439c23b RD |
11941 | |
11942 | :see: `wx.CallAfter` | |
d55e5bfc RD |
11943 | """ |
11944 | def __init__(self, millis, callable, *args, **kwargs): | |
11945 | self.millis = millis | |
11946 | self.callable = callable | |
11947 | self.SetArgs(*args, **kwargs) | |
11948 | self.runCount = 0 | |
11949 | self.running = False | |
11950 | self.hasRun = False | |
11951 | self.result = None | |
11952 | self.timer = None | |
11953 | self.Start() | |
11954 | ||
11955 | def __del__(self): | |
11956 | self.Stop() | |
11957 | ||
11958 | ||
11959 | def Start(self, millis=None, *args, **kwargs): | |
11960 | """ | |
11961 | (Re)start the timer | |
11962 | """ | |
11963 | self.hasRun = False | |
11964 | if millis is not None: | |
11965 | self.millis = millis | |
11966 | if args or kwargs: | |
11967 | self.SetArgs(*args, **kwargs) | |
11968 | self.Stop() | |
11969 | self.timer = wx.PyTimer(self.Notify) | |
11970 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
11971 | self.running = True | |
11972 | Restart = Start | |
11973 | ||
11974 | ||
11975 | def Stop(self): | |
11976 | """ | |
11977 | Stop and destroy the timer. | |
11978 | """ | |
11979 | if self.timer is not None: | |
11980 | self.timer.Stop() | |
11981 | self.timer = None | |
11982 | ||
11983 | ||
11984 | def GetInterval(self): | |
11985 | if self.timer is not None: | |
11986 | return self.timer.GetInterval() | |
11987 | else: | |
11988 | return 0 | |
11989 | ||
11990 | ||
11991 | def IsRunning(self): | |
11992 | return self.timer is not None and self.timer.IsRunning() | |
11993 | ||
11994 | ||
11995 | def SetArgs(self, *args, **kwargs): | |
11996 | """ | |
11997 | (Re)set the args passed to the callable object. This is | |
11998 | useful in conjunction with Restart if you want to schedule a | |
11999 | new call to the same callable object but with different | |
12000 | parameters. | |
12001 | """ | |
12002 | self.args = args | |
12003 | self.kwargs = kwargs | |
12004 | ||
12005 | ||
12006 | def HasRun(self): | |
12007 | return self.hasRun | |
12008 | ||
12009 | def GetResult(self): | |
12010 | return self.result | |
12011 | ||
12012 | def Notify(self): | |
12013 | """ | |
12014 | The timer has expired so call the callable. | |
12015 | """ | |
12016 | if self.callable and getattr(self.callable, 'im_self', True): | |
12017 | self.runCount += 1 | |
12018 | self.running = False | |
12019 | self.result = self.callable(*self.args, **self.kwargs) | |
12020 | self.hasRun = True | |
12021 | if not self.running: | |
12022 | # if it wasn't restarted, then cleanup | |
12023 | wx.CallAfter(self.Stop) | |
12024 | ||
12025 | ||
12026 | ||
12027 | #---------------------------------------------------------------------------- | |
12028 | # Control which items in this module should be documented by epydoc. | |
12029 | # We allow only classes and functions, which will help reduce the size | |
12030 | # of the docs by filtering out the zillions of constants, EVT objects, | |
12031 | # and etc that don't make much sense by themselves, but are instead | |
12032 | # documented (or will be) as part of the classes/functions/methods | |
12033 | # where they should be used. | |
12034 | ||
c24da6d6 RD |
12035 | class __DocFilter: |
12036 | """ | |
12037 | A filter for epydoc that only allows non-Ptr classes and | |
12038 | fucntions, in order to reduce the clutter in the API docs. | |
12039 | """ | |
12040 | def __init__(self, globals): | |
12041 | self._globals = globals | |
12042 | ||
12043 | def __call__(self, name): | |
12044 | import types | |
12045 | obj = self._globals.get(name, None) | |
12046 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: | |
12047 | return False | |
12048 | if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'): | |
12049 | return False | |
12050 | return True | |
d55e5bfc RD |
12051 | |
12052 | #---------------------------------------------------------------------------- | |
12053 | #---------------------------------------------------------------------------- | |
12054 | ||
12055 | # Import other modules in this package that should show up in the | |
12056 | # "core" wx namespace | |
12057 | from _gdi import * | |
12058 | from _windows import * | |
12059 | from _controls import * | |
12060 | from _misc import * | |
12061 | ||
12062 | ||
12063 | # Fixup the stock objects since they can't be used yet. (They will be | |
12064 | # restored in wx.PyApp.OnInit.) | |
12065 | _core_._wxPyFixStockObjects() | |
12066 | ||
12067 | #---------------------------------------------------------------------------- | |
12068 | #---------------------------------------------------------------------------- | |
12069 | ||
12070 |