]>
Commit | Line | Data |
---|---|---|
1 | # This file was created automatically by SWIG 1.3.29. | |
2 | # Don't modify this file, modify the SWIG interface instead. | |
3 | ||
4 | import _core_ | |
5 | import new | |
6 | new_instancemethod = new.instancemethod | |
7 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1): | |
8 | if (name == "thisown"): return self.this.own(value) | |
9 | if (name == "this"): | |
10 | if type(value).__name__ == 'PySwigObject': | |
11 | self.__dict__[name] = value | |
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): | |
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 | if (name == "thisown"): return self.this.own() | |
25 | method = class_type.__swig_getmethods__.get(name,None) | |
26 | if method: return method(self) | |
27 | raise AttributeError,name | |
28 | ||
29 | def _swig_repr(self): | |
30 | try: strthis = "proxy of " + self.this.__repr__() | |
31 | except: strthis = "" | |
32 | return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) | |
33 | ||
34 | import types | |
35 | try: | |
36 | _object = types.ObjectType | |
37 | _newclass = 1 | |
38 | except AttributeError: | |
39 | class _object : pass | |
40 | _newclass = 0 | |
41 | del types | |
42 | ||
43 | ||
44 | def _swig_setattr_nondynamic_method(set): | |
45 | def set_attr(self,name,value): | |
46 | if (name == "thisown"): return self.this.own(value) | |
47 | if hasattr(self,name) or (name == "this"): | |
48 | set(self,name,value) | |
49 | else: | |
50 | raise AttributeError("You cannot add attributes to %s" % self) | |
51 | return set_attr | |
52 | ||
53 | ||
54 | #// Give a reference to the dictionary of this module to the C++ extension | |
55 | #// code. | |
56 | _core_._wxPySetDictionary(vars()) | |
57 | ||
58 | #// A little trick to make 'wx' be a reference to this module so wx.Names can | |
59 | #// be used here. | |
60 | import sys as _sys | |
61 | wx = _sys.modules[__name__] | |
62 | ||
63 | ||
64 | #---------------------------------------------------------------------------- | |
65 | ||
66 | def _deprecated(callable, msg=None): | |
67 | """ | |
68 | Create a wrapper function that will raise a DeprecationWarning | |
69 | before calling the callable. | |
70 | """ | |
71 | if msg is None: | |
72 | msg = "%s is deprecated" % callable | |
73 | def deprecatedWrapper(*args, **kwargs): | |
74 | import warnings | |
75 | warnings.warn(msg, DeprecationWarning, stacklevel=2) | |
76 | return callable(*args, **kwargs) | |
77 | deprecatedWrapper.__doc__ = msg | |
78 | return deprecatedWrapper | |
79 | ||
80 | ||
81 | #---------------------------------------------------------------------------- | |
82 | ||
83 | NOT_FOUND = _core_.NOT_FOUND | |
84 | VSCROLL = _core_.VSCROLL | |
85 | HSCROLL = _core_.HSCROLL | |
86 | CAPTION = _core_.CAPTION | |
87 | DOUBLE_BORDER = _core_.DOUBLE_BORDER | |
88 | SUNKEN_BORDER = _core_.SUNKEN_BORDER | |
89 | RAISED_BORDER = _core_.RAISED_BORDER | |
90 | BORDER = _core_.BORDER | |
91 | SIMPLE_BORDER = _core_.SIMPLE_BORDER | |
92 | STATIC_BORDER = _core_.STATIC_BORDER | |
93 | TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW | |
94 | NO_BORDER = _core_.NO_BORDER | |
95 | DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER | |
96 | DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE | |
97 | TAB_TRAVERSAL = _core_.TAB_TRAVERSAL | |
98 | WANTS_CHARS = _core_.WANTS_CHARS | |
99 | POPUP_WINDOW = _core_.POPUP_WINDOW | |
100 | CENTER_FRAME = _core_.CENTER_FRAME | |
101 | CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN | |
102 | CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN | |
103 | CLIP_CHILDREN = _core_.CLIP_CHILDREN | |
104 | CLIP_SIBLINGS = _core_.CLIP_SIBLINGS | |
105 | WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK | |
106 | ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB | |
107 | RETAINED = _core_.RETAINED | |
108 | BACKINGSTORE = _core_.BACKINGSTORE | |
109 | COLOURED = _core_.COLOURED | |
110 | FIXED_LENGTH = _core_.FIXED_LENGTH | |
111 | LB_NEEDED_SB = _core_.LB_NEEDED_SB | |
112 | LB_ALWAYS_SB = _core_.LB_ALWAYS_SB | |
113 | LB_SORT = _core_.LB_SORT | |
114 | LB_SINGLE = _core_.LB_SINGLE | |
115 | LB_MULTIPLE = _core_.LB_MULTIPLE | |
116 | LB_EXTENDED = _core_.LB_EXTENDED | |
117 | LB_OWNERDRAW = _core_.LB_OWNERDRAW | |
118 | LB_HSCROLL = _core_.LB_HSCROLL | |
119 | CB_SIMPLE = _core_.CB_SIMPLE | |
120 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
121 | CB_SORT = _core_.CB_SORT | |
122 | CB_READONLY = _core_.CB_READONLY | |
123 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
124 | RA_VERTICAL = _core_.RA_VERTICAL | |
125 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
126 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
127 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX | |
128 | RB_GROUP = _core_.RB_GROUP | |
129 | RB_SINGLE = _core_.RB_SINGLE | |
130 | SB_HORIZONTAL = _core_.SB_HORIZONTAL | |
131 | SB_VERTICAL = _core_.SB_VERTICAL | |
132 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX | |
133 | ST_SIZEGRIP = _core_.ST_SIZEGRIP | |
134 | ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE | |
135 | ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE | |
136 | ST_DOTS_END = _core_.ST_DOTS_END | |
137 | FLOOD_SURFACE = _core_.FLOOD_SURFACE | |
138 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
139 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
140 | WINDING_RULE = _core_.WINDING_RULE | |
141 | TOOL_TOP = _core_.TOOL_TOP | |
142 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
143 | TOOL_LEFT = _core_.TOOL_LEFT | |
144 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
145 | OK = _core_.OK | |
146 | YES_NO = _core_.YES_NO | |
147 | CANCEL = _core_.CANCEL | |
148 | YES = _core_.YES | |
149 | NO = _core_.NO | |
150 | NO_DEFAULT = _core_.NO_DEFAULT | |
151 | YES_DEFAULT = _core_.YES_DEFAULT | |
152 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION | |
153 | ICON_HAND = _core_.ICON_HAND | |
154 | ICON_QUESTION = _core_.ICON_QUESTION | |
155 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
156 | ICON_STOP = _core_.ICON_STOP | |
157 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
158 | ICON_MASK = _core_.ICON_MASK | |
159 | ICON_WARNING = _core_.ICON_WARNING | |
160 | ICON_ERROR = _core_.ICON_ERROR | |
161 | FORWARD = _core_.FORWARD | |
162 | BACKWARD = _core_.BACKWARD | |
163 | RESET = _core_.RESET | |
164 | HELP = _core_.HELP | |
165 | MORE = _core_.MORE | |
166 | SETUP = _core_.SETUP | |
167 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
168 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
169 | SIZE_AUTO = _core_.SIZE_AUTO | |
170 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
171 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
172 | SIZE_FORCE = _core_.SIZE_FORCE | |
173 | PORTRAIT = _core_.PORTRAIT | |
174 | LANDSCAPE = _core_.LANDSCAPE | |
175 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
176 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
177 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
178 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
179 | ID_ANY = _core_.ID_ANY | |
180 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
181 | ID_NONE = _core_.ID_NONE | |
182 | ID_LOWEST = _core_.ID_LOWEST | |
183 | ID_OPEN = _core_.ID_OPEN | |
184 | ID_CLOSE = _core_.ID_CLOSE | |
185 | ID_NEW = _core_.ID_NEW | |
186 | ID_SAVE = _core_.ID_SAVE | |
187 | ID_SAVEAS = _core_.ID_SAVEAS | |
188 | ID_REVERT = _core_.ID_REVERT | |
189 | ID_EXIT = _core_.ID_EXIT | |
190 | ID_UNDO = _core_.ID_UNDO | |
191 | ID_REDO = _core_.ID_REDO | |
192 | ID_HELP = _core_.ID_HELP | |
193 | ID_PRINT = _core_.ID_PRINT | |
194 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
195 | ID_PAGE_SETUP = _core_.ID_PAGE_SETUP | |
196 | ID_PREVIEW = _core_.ID_PREVIEW | |
197 | ID_ABOUT = _core_.ID_ABOUT | |
198 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
199 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
200 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
201 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
202 | ID_HELP_INDEX = _core_.ID_HELP_INDEX | |
203 | ID_HELP_SEARCH = _core_.ID_HELP_SEARCH | |
204 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL | |
205 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
206 | ID_EDIT = _core_.ID_EDIT | |
207 | ID_CUT = _core_.ID_CUT | |
208 | ID_COPY = _core_.ID_COPY | |
209 | ID_PASTE = _core_.ID_PASTE | |
210 | ID_CLEAR = _core_.ID_CLEAR | |
211 | ID_FIND = _core_.ID_FIND | |
212 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
213 | ID_SELECTALL = _core_.ID_SELECTALL | |
214 | ID_DELETE = _core_.ID_DELETE | |
215 | ID_REPLACE = _core_.ID_REPLACE | |
216 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
217 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
218 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
219 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
220 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
221 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
222 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
223 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
224 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
225 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
226 | ID_FILE = _core_.ID_FILE | |
227 | ID_FILE1 = _core_.ID_FILE1 | |
228 | ID_FILE2 = _core_.ID_FILE2 | |
229 | ID_FILE3 = _core_.ID_FILE3 | |
230 | ID_FILE4 = _core_.ID_FILE4 | |
231 | ID_FILE5 = _core_.ID_FILE5 | |
232 | ID_FILE6 = _core_.ID_FILE6 | |
233 | ID_FILE7 = _core_.ID_FILE7 | |
234 | ID_FILE8 = _core_.ID_FILE8 | |
235 | ID_FILE9 = _core_.ID_FILE9 | |
236 | ID_OK = _core_.ID_OK | |
237 | ID_CANCEL = _core_.ID_CANCEL | |
238 | ID_APPLY = _core_.ID_APPLY | |
239 | ID_YES = _core_.ID_YES | |
240 | ID_NO = _core_.ID_NO | |
241 | ID_STATIC = _core_.ID_STATIC | |
242 | ID_FORWARD = _core_.ID_FORWARD | |
243 | ID_BACKWARD = _core_.ID_BACKWARD | |
244 | ID_DEFAULT = _core_.ID_DEFAULT | |
245 | ID_MORE = _core_.ID_MORE | |
246 | ID_SETUP = _core_.ID_SETUP | |
247 | ID_RESET = _core_.ID_RESET | |
248 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
249 | ID_YESTOALL = _core_.ID_YESTOALL | |
250 | ID_NOTOALL = _core_.ID_NOTOALL | |
251 | ID_ABORT = _core_.ID_ABORT | |
252 | ID_RETRY = _core_.ID_RETRY | |
253 | ID_IGNORE = _core_.ID_IGNORE | |
254 | ID_ADD = _core_.ID_ADD | |
255 | ID_REMOVE = _core_.ID_REMOVE | |
256 | ID_UP = _core_.ID_UP | |
257 | ID_DOWN = _core_.ID_DOWN | |
258 | ID_HOME = _core_.ID_HOME | |
259 | ID_REFRESH = _core_.ID_REFRESH | |
260 | ID_STOP = _core_.ID_STOP | |
261 | ID_INDEX = _core_.ID_INDEX | |
262 | ID_BOLD = _core_.ID_BOLD | |
263 | ID_ITALIC = _core_.ID_ITALIC | |
264 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
265 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
266 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
267 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
268 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
269 | ID_INDENT = _core_.ID_INDENT | |
270 | ID_UNINDENT = _core_.ID_UNINDENT | |
271 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
272 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
273 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
274 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
275 | ID_UNDELETE = _core_.ID_UNDELETE | |
276 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
277 | ID_HIGHEST = _core_.ID_HIGHEST | |
278 | MENU_TEAROFF = _core_.MENU_TEAROFF | |
279 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
280 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
281 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
282 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
283 | LI_VERTICAL = _core_.LI_VERTICAL | |
284 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
285 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
286 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
287 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
288 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
289 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
290 | MM_TEXT = _core_.MM_TEXT | |
291 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
292 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
293 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
294 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
295 | MM_TWIPS = _core_.MM_TWIPS | |
296 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
297 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
298 | MM_POINTS = _core_.MM_POINTS | |
299 | MM_METRIC = _core_.MM_METRIC | |
300 | CENTRE = _core_.CENTRE | |
301 | CENTER = _core_.CENTER | |
302 | HORIZONTAL = _core_.HORIZONTAL | |
303 | VERTICAL = _core_.VERTICAL | |
304 | BOTH = _core_.BOTH | |
305 | LEFT = _core_.LEFT | |
306 | RIGHT = _core_.RIGHT | |
307 | UP = _core_.UP | |
308 | DOWN = _core_.DOWN | |
309 | TOP = _core_.TOP | |
310 | BOTTOM = _core_.BOTTOM | |
311 | NORTH = _core_.NORTH | |
312 | SOUTH = _core_.SOUTH | |
313 | WEST = _core_.WEST | |
314 | EAST = _core_.EAST | |
315 | ALL = _core_.ALL | |
316 | ALIGN_NOT = _core_.ALIGN_NOT | |
317 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
318 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
319 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
320 | ALIGN_TOP = _core_.ALIGN_TOP | |
321 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
322 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
323 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
324 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
325 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
326 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
327 | ALIGN_MASK = _core_.ALIGN_MASK | |
328 | STRETCH_NOT = _core_.STRETCH_NOT | |
329 | SHRINK = _core_.SHRINK | |
330 | GROW = _core_.GROW | |
331 | EXPAND = _core_.EXPAND | |
332 | SHAPED = _core_.SHAPED | |
333 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
334 | TILE = _core_.TILE | |
335 | ADJUST_MINSIZE = 0 | |
336 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
337 | BORDER_NONE = _core_.BORDER_NONE | |
338 | BORDER_STATIC = _core_.BORDER_STATIC | |
339 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
340 | BORDER_RAISED = _core_.BORDER_RAISED | |
341 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
342 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
343 | BORDER_MASK = _core_.BORDER_MASK | |
344 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM | |
345 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
346 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
347 | DEFAULT = _core_.DEFAULT | |
348 | DECORATIVE = _core_.DECORATIVE | |
349 | ROMAN = _core_.ROMAN | |
350 | SCRIPT = _core_.SCRIPT | |
351 | SWISS = _core_.SWISS | |
352 | MODERN = _core_.MODERN | |
353 | TELETYPE = _core_.TELETYPE | |
354 | VARIABLE = _core_.VARIABLE | |
355 | FIXED = _core_.FIXED | |
356 | NORMAL = _core_.NORMAL | |
357 | LIGHT = _core_.LIGHT | |
358 | BOLD = _core_.BOLD | |
359 | ITALIC = _core_.ITALIC | |
360 | SLANT = _core_.SLANT | |
361 | SOLID = _core_.SOLID | |
362 | DOT = _core_.DOT | |
363 | LONG_DASH = _core_.LONG_DASH | |
364 | SHORT_DASH = _core_.SHORT_DASH | |
365 | DOT_DASH = _core_.DOT_DASH | |
366 | USER_DASH = _core_.USER_DASH | |
367 | TRANSPARENT = _core_.TRANSPARENT | |
368 | STIPPLE = _core_.STIPPLE | |
369 | STIPPLE_MASK = _core_.STIPPLE_MASK | |
370 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
371 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH | |
372 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
373 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
374 | CROSS_HATCH = _core_.CROSS_HATCH | |
375 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
376 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
377 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
378 | JOIN_MITER = _core_.JOIN_MITER | |
379 | JOIN_ROUND = _core_.JOIN_ROUND | |
380 | CAP_ROUND = _core_.CAP_ROUND | |
381 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
382 | CAP_BUTT = _core_.CAP_BUTT | |
383 | CLEAR = _core_.CLEAR | |
384 | XOR = _core_.XOR | |
385 | INVERT = _core_.INVERT | |
386 | OR_REVERSE = _core_.OR_REVERSE | |
387 | AND_REVERSE = _core_.AND_REVERSE | |
388 | COPY = _core_.COPY | |
389 | AND = _core_.AND | |
390 | AND_INVERT = _core_.AND_INVERT | |
391 | NO_OP = _core_.NO_OP | |
392 | NOR = _core_.NOR | |
393 | EQUIV = _core_.EQUIV | |
394 | SRC_INVERT = _core_.SRC_INVERT | |
395 | OR_INVERT = _core_.OR_INVERT | |
396 | NAND = _core_.NAND | |
397 | OR = _core_.OR | |
398 | SET = _core_.SET | |
399 | WXK_BACK = _core_.WXK_BACK | |
400 | WXK_TAB = _core_.WXK_TAB | |
401 | WXK_RETURN = _core_.WXK_RETURN | |
402 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
403 | WXK_SPACE = _core_.WXK_SPACE | |
404 | WXK_DELETE = _core_.WXK_DELETE | |
405 | WXK_START = _core_.WXK_START | |
406 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
407 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
408 | WXK_CANCEL = _core_.WXK_CANCEL | |
409 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
410 | WXK_CLEAR = _core_.WXK_CLEAR | |
411 | WXK_SHIFT = _core_.WXK_SHIFT | |
412 | WXK_ALT = _core_.WXK_ALT | |
413 | WXK_CONTROL = _core_.WXK_CONTROL | |
414 | WXK_MENU = _core_.WXK_MENU | |
415 | WXK_PAUSE = _core_.WXK_PAUSE | |
416 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
417 | WXK_END = _core_.WXK_END | |
418 | WXK_HOME = _core_.WXK_HOME | |
419 | WXK_LEFT = _core_.WXK_LEFT | |
420 | WXK_UP = _core_.WXK_UP | |
421 | WXK_RIGHT = _core_.WXK_RIGHT | |
422 | WXK_DOWN = _core_.WXK_DOWN | |
423 | WXK_SELECT = _core_.WXK_SELECT | |
424 | WXK_PRINT = _core_.WXK_PRINT | |
425 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
426 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
427 | WXK_INSERT = _core_.WXK_INSERT | |
428 | WXK_HELP = _core_.WXK_HELP | |
429 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
430 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
431 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
432 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
433 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
434 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
435 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
436 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
437 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
438 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
439 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
440 | WXK_ADD = _core_.WXK_ADD | |
441 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
442 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
443 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
444 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
445 | WXK_F1 = _core_.WXK_F1 | |
446 | WXK_F2 = _core_.WXK_F2 | |
447 | WXK_F3 = _core_.WXK_F3 | |
448 | WXK_F4 = _core_.WXK_F4 | |
449 | WXK_F5 = _core_.WXK_F5 | |
450 | WXK_F6 = _core_.WXK_F6 | |
451 | WXK_F7 = _core_.WXK_F7 | |
452 | WXK_F8 = _core_.WXK_F8 | |
453 | WXK_F9 = _core_.WXK_F9 | |
454 | WXK_F10 = _core_.WXK_F10 | |
455 | WXK_F11 = _core_.WXK_F11 | |
456 | WXK_F12 = _core_.WXK_F12 | |
457 | WXK_F13 = _core_.WXK_F13 | |
458 | WXK_F14 = _core_.WXK_F14 | |
459 | WXK_F15 = _core_.WXK_F15 | |
460 | WXK_F16 = _core_.WXK_F16 | |
461 | WXK_F17 = _core_.WXK_F17 | |
462 | WXK_F18 = _core_.WXK_F18 | |
463 | WXK_F19 = _core_.WXK_F19 | |
464 | WXK_F20 = _core_.WXK_F20 | |
465 | WXK_F21 = _core_.WXK_F21 | |
466 | WXK_F22 = _core_.WXK_F22 | |
467 | WXK_F23 = _core_.WXK_F23 | |
468 | WXK_F24 = _core_.WXK_F24 | |
469 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
470 | WXK_SCROLL = _core_.WXK_SCROLL | |
471 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
472 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
473 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
474 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
475 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
476 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
477 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
478 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
479 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
480 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
481 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
482 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
483 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
484 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
485 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
486 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
487 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
488 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
489 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
490 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
491 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
492 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
493 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
494 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
495 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
496 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
497 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
498 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
499 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
500 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
501 | WXK_COMMAND = _core_.WXK_COMMAND | |
502 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
503 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
504 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
505 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
506 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
507 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
508 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
509 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
510 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
511 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
512 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
513 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
514 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
515 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
516 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
517 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
518 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
519 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
520 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
521 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
522 | WXK_PRIOR = WXK_PAGEUP | |
523 | WXK_NEXT = WXK_PAGEDOWN | |
524 | WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP | |
525 | WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN | |
526 | ||
527 | PAPER_NONE = _core_.PAPER_NONE | |
528 | PAPER_LETTER = _core_.PAPER_LETTER | |
529 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
530 | PAPER_A4 = _core_.PAPER_A4 | |
531 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
532 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
533 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
534 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
535 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
536 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
537 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
538 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
539 | PAPER_A3 = _core_.PAPER_A3 | |
540 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
541 | PAPER_A5 = _core_.PAPER_A5 | |
542 | PAPER_B4 = _core_.PAPER_B4 | |
543 | PAPER_B5 = _core_.PAPER_B5 | |
544 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
545 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
546 | PAPER_10X14 = _core_.PAPER_10X14 | |
547 | PAPER_11X17 = _core_.PAPER_11X17 | |
548 | PAPER_NOTE = _core_.PAPER_NOTE | |
549 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
550 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
551 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
552 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
553 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
554 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
555 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
556 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
557 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
558 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
559 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
560 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
561 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
562 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
563 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
564 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
565 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
566 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
567 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
568 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
569 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
570 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
571 | PAPER_9X11 = _core_.PAPER_9X11 | |
572 | PAPER_10X11 = _core_.PAPER_10X11 | |
573 | PAPER_15X11 = _core_.PAPER_15X11 | |
574 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
575 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
576 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
577 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
578 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
579 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
580 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
581 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
582 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
583 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
584 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
585 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
586 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
587 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
588 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
589 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
590 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
591 | PAPER_A2 = _core_.PAPER_A2 | |
592 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
593 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
594 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD | |
595 | PAPER_A6 = _core_.PAPER_A6 | |
596 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
597 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
598 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
599 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
600 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
601 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
602 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
603 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
604 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
605 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
606 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
607 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
608 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
609 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
610 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
611 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
612 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
613 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
614 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
615 | PAPER_12X11 = _core_.PAPER_12X11 | |
616 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
617 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
618 | PAPER_P16K = _core_.PAPER_P16K | |
619 | PAPER_P32K = _core_.PAPER_P32K | |
620 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
621 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
622 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
623 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
624 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
625 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
626 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
627 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
628 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
629 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
630 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
631 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
632 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
633 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
634 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
635 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
636 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
637 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
638 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
639 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
640 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
641 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
642 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
643 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
644 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX | |
645 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
646 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
647 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
648 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
649 | ITEM_CHECK = _core_.ITEM_CHECK | |
650 | ITEM_RADIO = _core_.ITEM_RADIO | |
651 | ITEM_MAX = _core_.ITEM_MAX | |
652 | HT_NOWHERE = _core_.HT_NOWHERE | |
653 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
654 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
655 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
656 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
657 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
658 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
659 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
660 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
661 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
662 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
663 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
664 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
665 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
666 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
667 | HT_MAX = _core_.HT_MAX | |
668 | MOD_NONE = _core_.MOD_NONE | |
669 | MOD_ALT = _core_.MOD_ALT | |
670 | MOD_CONTROL = _core_.MOD_CONTROL | |
671 | MOD_ALTGR = _core_.MOD_ALTGR | |
672 | MOD_SHIFT = _core_.MOD_SHIFT | |
673 | MOD_META = _core_.MOD_META | |
674 | MOD_WIN = _core_.MOD_WIN | |
675 | MOD_CMD = _core_.MOD_CMD | |
676 | MOD_ALL = _core_.MOD_ALL | |
677 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE | |
678 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
679 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
680 | Layout_Default = _core_.Layout_Default | |
681 | Layout_LeftToRight = _core_.Layout_LeftToRight | |
682 | Layout_RightToLeft = _core_.Layout_RightToLeft | |
683 | #--------------------------------------------------------------------------- | |
684 | ||
685 | class Object(object): | |
686 | """ | |
687 | The base class for most wx objects, although in wxPython not | |
688 | much functionality is needed nor exposed. | |
689 | """ | |
690 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
691 | def __init__(self): raise AttributeError, "No constructor defined" | |
692 | __repr__ = _swig_repr | |
693 | def GetClassName(*args, **kwargs): | |
694 | """ | |
695 | GetClassName(self) -> String | |
696 | ||
697 | Returns the class name of the C++ class using wxRTTI. | |
698 | """ | |
699 | return _core_.Object_GetClassName(*args, **kwargs) | |
700 | ||
701 | def Destroy(*args, **kwargs): | |
702 | """ | |
703 | Destroy(self) | |
704 | ||
705 | Deletes the C++ object this Python object is a proxy for. | |
706 | """ | |
707 | args[0].this.own(False) | |
708 | return _core_.Object_Destroy(*args, **kwargs) | |
709 | ||
710 | def IsSameAs(*args, **kwargs): | |
711 | """ | |
712 | IsSameAs(self, Object p) -> bool | |
713 | ||
714 | For wx.Objects that use C++ reference counting internally, this method | |
715 | can be used to determine if two objects are referencing the same data | |
716 | object. | |
717 | """ | |
718 | return _core_.Object_IsSameAs(*args, **kwargs) | |
719 | ||
720 | ClassName = property(GetClassName,doc="See `GetClassName`") | |
721 | _core_.Object_swigregister(Object) | |
722 | _wxPySetDictionary = _core_._wxPySetDictionary | |
723 | cvar = _core_.cvar | |
724 | EmptyString = cvar.EmptyString | |
725 | ||
726 | #--------------------------------------------------------------------------- | |
727 | ||
728 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID | |
729 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
730 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
731 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
732 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
733 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
734 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
735 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
736 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
737 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
738 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
739 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
740 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
741 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
742 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
743 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
744 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
745 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
746 | BITMAP_TYPE_TGA = _core_.BITMAP_TYPE_TGA | |
747 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
748 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
749 | CURSOR_NONE = _core_.CURSOR_NONE | |
750 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
751 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
752 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
753 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
754 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
755 | CURSOR_HAND = _core_.CURSOR_HAND | |
756 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
757 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
758 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
759 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
760 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
761 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
762 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
763 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
764 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
765 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
766 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
767 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
768 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
769 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
770 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
771 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
772 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
773 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
774 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
775 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
776 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
777 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
778 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
779 | CURSOR_MAX = _core_.CURSOR_MAX | |
780 | #--------------------------------------------------------------------------- | |
781 | ||
782 | class Size(object): | |
783 | """ | |
784 | wx.Size is a useful data structure used to represent the size of | |
785 | something. It simply contains integer width and height | |
786 | properties. In most places in wxPython where a wx.Size is | |
787 | expected a (width, height) tuple can be used instead. | |
788 | """ | |
789 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
790 | __repr__ = _swig_repr | |
791 | width = property(_core_.Size_width_get, _core_.Size_width_set) | |
792 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
793 | x = width; y = height | |
794 | def __init__(self, *args, **kwargs): | |
795 | """ | |
796 | __init__(self, int w=0, int h=0) -> Size | |
797 | ||
798 | Creates a size object. | |
799 | """ | |
800 | _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs)) | |
801 | __swig_destroy__ = _core_.delete_Size | |
802 | __del__ = lambda self : None; | |
803 | def __eq__(*args, **kwargs): | |
804 | """ | |
805 | __eq__(self, PyObject other) -> bool | |
806 | ||
807 | Test for equality of wx.Size objects. | |
808 | """ | |
809 | return _core_.Size___eq__(*args, **kwargs) | |
810 | ||
811 | def __ne__(*args, **kwargs): | |
812 | """ | |
813 | __ne__(self, PyObject other) -> bool | |
814 | ||
815 | Test for inequality of wx.Size objects. | |
816 | """ | |
817 | return _core_.Size___ne__(*args, **kwargs) | |
818 | ||
819 | def __add__(*args, **kwargs): | |
820 | """ | |
821 | __add__(self, Size sz) -> Size | |
822 | ||
823 | Add sz's proprties to this and return the result. | |
824 | """ | |
825 | return _core_.Size___add__(*args, **kwargs) | |
826 | ||
827 | def __sub__(*args, **kwargs): | |
828 | """ | |
829 | __sub__(self, Size sz) -> Size | |
830 | ||
831 | Subtract sz's properties from this and return the result. | |
832 | """ | |
833 | return _core_.Size___sub__(*args, **kwargs) | |
834 | ||
835 | def IncTo(*args, **kwargs): | |
836 | """ | |
837 | IncTo(self, Size sz) | |
838 | ||
839 | Increments this object so that both of its dimensions are not less | |
840 | than the corresponding dimensions of the size. | |
841 | """ | |
842 | return _core_.Size_IncTo(*args, **kwargs) | |
843 | ||
844 | def DecTo(*args, **kwargs): | |
845 | """ | |
846 | DecTo(self, Size sz) | |
847 | ||
848 | Decrements this object so that both of its dimensions are not greater | |
849 | than the corresponding dimensions of the size. | |
850 | """ | |
851 | return _core_.Size_DecTo(*args, **kwargs) | |
852 | ||
853 | def IncBy(*args, **kwargs): | |
854 | """IncBy(self, int dx, int dy)""" | |
855 | return _core_.Size_IncBy(*args, **kwargs) | |
856 | ||
857 | def DecBy(*args, **kwargs): | |
858 | """DecBy(self, int dx, int dy)""" | |
859 | return _core_.Size_DecBy(*args, **kwargs) | |
860 | ||
861 | def Scale(*args, **kwargs): | |
862 | """ | |
863 | Scale(self, float xscale, float yscale) | |
864 | ||
865 | Scales the dimensions of this object by the given factors. | |
866 | """ | |
867 | return _core_.Size_Scale(*args, **kwargs) | |
868 | ||
869 | def Set(*args, **kwargs): | |
870 | """ | |
871 | Set(self, int w, int h) | |
872 | ||
873 | Set both width and height. | |
874 | """ | |
875 | return _core_.Size_Set(*args, **kwargs) | |
876 | ||
877 | def SetWidth(*args, **kwargs): | |
878 | """SetWidth(self, int w)""" | |
879 | return _core_.Size_SetWidth(*args, **kwargs) | |
880 | ||
881 | def SetHeight(*args, **kwargs): | |
882 | """SetHeight(self, int h)""" | |
883 | return _core_.Size_SetHeight(*args, **kwargs) | |
884 | ||
885 | def GetWidth(*args, **kwargs): | |
886 | """GetWidth(self) -> int""" | |
887 | return _core_.Size_GetWidth(*args, **kwargs) | |
888 | ||
889 | def GetHeight(*args, **kwargs): | |
890 | """GetHeight(self) -> int""" | |
891 | return _core_.Size_GetHeight(*args, **kwargs) | |
892 | ||
893 | def IsFullySpecified(*args, **kwargs): | |
894 | """ | |
895 | IsFullySpecified(self) -> bool | |
896 | ||
897 | Returns True if both components of the size are non-default values. | |
898 | """ | |
899 | return _core_.Size_IsFullySpecified(*args, **kwargs) | |
900 | ||
901 | def SetDefaults(*args, **kwargs): | |
902 | """ | |
903 | SetDefaults(self, Size size) | |
904 | ||
905 | Combine this size with the other one replacing the default components | |
906 | of this object (i.e. equal to -1) with those of the other. | |
907 | """ | |
908 | return _core_.Size_SetDefaults(*args, **kwargs) | |
909 | ||
910 | def Get(*args, **kwargs): | |
911 | """ | |
912 | Get() -> (width,height) | |
913 | ||
914 | Returns the width and height properties as a tuple. | |
915 | """ | |
916 | return _core_.Size_Get(*args, **kwargs) | |
917 | ||
918 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") | |
919 | def __str__(self): return str(self.Get()) | |
920 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
921 | def __len__(self): return len(self.Get()) | |
922 | def __getitem__(self, index): return self.Get()[index] | |
923 | def __setitem__(self, index, val): | |
924 | if index == 0: self.width = val | |
925 | elif index == 1: self.height = val | |
926 | else: raise IndexError | |
927 | def __nonzero__(self): return self.Get() != (0,0) | |
928 | __safe_for_unpickling__ = True | |
929 | def __reduce__(self): return (wx.Size, self.Get()) | |
930 | ||
931 | _core_.Size_swigregister(Size) | |
932 | ||
933 | #--------------------------------------------------------------------------- | |
934 | ||
935 | class RealPoint(object): | |
936 | """ | |
937 | A data structure for representing a point or position with floating | |
938 | point x and y properties. In wxPython most places that expect a | |
939 | wx.RealPoint can also accept a (x,y) tuple. | |
940 | """ | |
941 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
942 | __repr__ = _swig_repr | |
943 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) | |
944 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
945 | def __init__(self, *args, **kwargs): | |
946 | """ | |
947 | __init__(self, double x=0.0, double y=0.0) -> RealPoint | |
948 | ||
949 | Create a wx.RealPoint object | |
950 | """ | |
951 | _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs)) | |
952 | __swig_destroy__ = _core_.delete_RealPoint | |
953 | __del__ = lambda self : None; | |
954 | def __eq__(*args, **kwargs): | |
955 | """ | |
956 | __eq__(self, PyObject other) -> bool | |
957 | ||
958 | Test for equality of wx.RealPoint objects. | |
959 | """ | |
960 | return _core_.RealPoint___eq__(*args, **kwargs) | |
961 | ||
962 | def __ne__(*args, **kwargs): | |
963 | """ | |
964 | __ne__(self, PyObject other) -> bool | |
965 | ||
966 | Test for inequality of wx.RealPoint objects. | |
967 | """ | |
968 | return _core_.RealPoint___ne__(*args, **kwargs) | |
969 | ||
970 | def __add__(*args, **kwargs): | |
971 | """ | |
972 | __add__(self, RealPoint pt) -> RealPoint | |
973 | ||
974 | Add pt's proprties to this and return the result. | |
975 | """ | |
976 | return _core_.RealPoint___add__(*args, **kwargs) | |
977 | ||
978 | def __sub__(*args, **kwargs): | |
979 | """ | |
980 | __sub__(self, RealPoint pt) -> RealPoint | |
981 | ||
982 | Subtract pt's proprties from this and return the result | |
983 | """ | |
984 | return _core_.RealPoint___sub__(*args, **kwargs) | |
985 | ||
986 | def Set(*args, **kwargs): | |
987 | """ | |
988 | Set(self, double x, double y) | |
989 | ||
990 | Set both the x and y properties | |
991 | """ | |
992 | return _core_.RealPoint_Set(*args, **kwargs) | |
993 | ||
994 | def Get(*args, **kwargs): | |
995 | """ | |
996 | Get() -> (x,y) | |
997 | ||
998 | Return the x and y properties as a tuple. | |
999 | """ | |
1000 | return _core_.RealPoint_Get(*args, **kwargs) | |
1001 | ||
1002 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") | |
1003 | def __str__(self): return str(self.Get()) | |
1004 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
1005 | def __len__(self): return len(self.Get()) | |
1006 | def __getitem__(self, index): return self.Get()[index] | |
1007 | def __setitem__(self, index, val): | |
1008 | if index == 0: self.x = val | |
1009 | elif index == 1: self.y = val | |
1010 | else: raise IndexError | |
1011 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1012 | __safe_for_unpickling__ = True | |
1013 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
1014 | ||
1015 | _core_.RealPoint_swigregister(RealPoint) | |
1016 | ||
1017 | #--------------------------------------------------------------------------- | |
1018 | ||
1019 | class Point(object): | |
1020 | """ | |
1021 | A data structure for representing a point or position with integer x | |
1022 | and y properties. Most places in wxPython that expect a wx.Point can | |
1023 | also accept a (x,y) tuple. | |
1024 | """ | |
1025 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
1026 | __repr__ = _swig_repr | |
1027 | x = property(_core_.Point_x_get, _core_.Point_x_set) | |
1028 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
1029 | def __init__(self, *args, **kwargs): | |
1030 | """ | |
1031 | __init__(self, int x=0, int y=0) -> Point | |
1032 | ||
1033 | Create a wx.Point object | |
1034 | """ | |
1035 | _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs)) | |
1036 | __swig_destroy__ = _core_.delete_Point | |
1037 | __del__ = lambda self : None; | |
1038 | def __eq__(*args, **kwargs): | |
1039 | """ | |
1040 | __eq__(self, PyObject other) -> bool | |
1041 | ||
1042 | Test for equality of wx.Point objects. | |
1043 | """ | |
1044 | return _core_.Point___eq__(*args, **kwargs) | |
1045 | ||
1046 | def __ne__(*args, **kwargs): | |
1047 | """ | |
1048 | __ne__(self, PyObject other) -> bool | |
1049 | ||
1050 | Test for inequality of wx.Point objects. | |
1051 | """ | |
1052 | return _core_.Point___ne__(*args, **kwargs) | |
1053 | ||
1054 | def __add__(*args, **kwargs): | |
1055 | """ | |
1056 | __add__(self, Point pt) -> Point | |
1057 | ||
1058 | Add pt's proprties to this and return the result. | |
1059 | """ | |
1060 | return _core_.Point___add__(*args, **kwargs) | |
1061 | ||
1062 | def __sub__(*args, **kwargs): | |
1063 | """ | |
1064 | __sub__(self, Point pt) -> Point | |
1065 | ||
1066 | Subtract pt's proprties from this and return the result | |
1067 | """ | |
1068 | return _core_.Point___sub__(*args, **kwargs) | |
1069 | ||
1070 | def __iadd__(*args, **kwargs): | |
1071 | """ | |
1072 | __iadd__(self, Point pt) -> Point | |
1073 | ||
1074 | Add pt to this object. | |
1075 | """ | |
1076 | return _core_.Point___iadd__(*args, **kwargs) | |
1077 | ||
1078 | def __isub__(*args, **kwargs): | |
1079 | """ | |
1080 | __isub__(self, Point pt) -> Point | |
1081 | ||
1082 | Subtract pt from this object. | |
1083 | """ | |
1084 | return _core_.Point___isub__(*args, **kwargs) | |
1085 | ||
1086 | def Set(*args, **kwargs): | |
1087 | """ | |
1088 | Set(self, long x, long y) | |
1089 | ||
1090 | Set both the x and y properties | |
1091 | """ | |
1092 | return _core_.Point_Set(*args, **kwargs) | |
1093 | ||
1094 | def Get(*args, **kwargs): | |
1095 | """ | |
1096 | Get() -> (x,y) | |
1097 | ||
1098 | Return the x and y properties as a tuple. | |
1099 | """ | |
1100 | return _core_.Point_Get(*args, **kwargs) | |
1101 | ||
1102 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") | |
1103 | def __str__(self): return str(self.Get()) | |
1104 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1105 | def __len__(self): return len(self.Get()) | |
1106 | def __getitem__(self, index): return self.Get()[index] | |
1107 | def __setitem__(self, index, val): | |
1108 | if index == 0: self.x = val | |
1109 | elif index == 1: self.y = val | |
1110 | else: raise IndexError | |
1111 | def __nonzero__(self): return self.Get() != (0,0) | |
1112 | __safe_for_unpickling__ = True | |
1113 | def __reduce__(self): return (wx.Point, self.Get()) | |
1114 | ||
1115 | _core_.Point_swigregister(Point) | |
1116 | ||
1117 | #--------------------------------------------------------------------------- | |
1118 | ||
1119 | class Rect(object): | |
1120 | """ | |
1121 | A class for representing and manipulating rectangles. It has x, y, | |
1122 | width and height properties. In wxPython most palces that expect a | |
1123 | wx.Rect can also accept a (x,y,width,height) tuple. | |
1124 | """ | |
1125 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
1126 | __repr__ = _swig_repr | |
1127 | def __init__(self, *args, **kwargs): | |
1128 | """ | |
1129 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect | |
1130 | ||
1131 | Create a new Rect object. | |
1132 | """ | |
1133 | _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs)) | |
1134 | __swig_destroy__ = _core_.delete_Rect | |
1135 | __del__ = lambda self : None; | |
1136 | def GetX(*args, **kwargs): | |
1137 | """GetX(self) -> int""" | |
1138 | return _core_.Rect_GetX(*args, **kwargs) | |
1139 | ||
1140 | def SetX(*args, **kwargs): | |
1141 | """SetX(self, int x)""" | |
1142 | return _core_.Rect_SetX(*args, **kwargs) | |
1143 | ||
1144 | def GetY(*args, **kwargs): | |
1145 | """GetY(self) -> int""" | |
1146 | return _core_.Rect_GetY(*args, **kwargs) | |
1147 | ||
1148 | def SetY(*args, **kwargs): | |
1149 | """SetY(self, int y)""" | |
1150 | return _core_.Rect_SetY(*args, **kwargs) | |
1151 | ||
1152 | def GetWidth(*args, **kwargs): | |
1153 | """GetWidth(self) -> int""" | |
1154 | return _core_.Rect_GetWidth(*args, **kwargs) | |
1155 | ||
1156 | def SetWidth(*args, **kwargs): | |
1157 | """SetWidth(self, int w)""" | |
1158 | return _core_.Rect_SetWidth(*args, **kwargs) | |
1159 | ||
1160 | def GetHeight(*args, **kwargs): | |
1161 | """GetHeight(self) -> int""" | |
1162 | return _core_.Rect_GetHeight(*args, **kwargs) | |
1163 | ||
1164 | def SetHeight(*args, **kwargs): | |
1165 | """SetHeight(self, int h)""" | |
1166 | return _core_.Rect_SetHeight(*args, **kwargs) | |
1167 | ||
1168 | def GetPosition(*args, **kwargs): | |
1169 | """GetPosition(self) -> Point""" | |
1170 | return _core_.Rect_GetPosition(*args, **kwargs) | |
1171 | ||
1172 | def SetPosition(*args, **kwargs): | |
1173 | """SetPosition(self, Point p)""" | |
1174 | return _core_.Rect_SetPosition(*args, **kwargs) | |
1175 | ||
1176 | def GetSize(*args, **kwargs): | |
1177 | """GetSize(self) -> Size""" | |
1178 | return _core_.Rect_GetSize(*args, **kwargs) | |
1179 | ||
1180 | def SetSize(*args, **kwargs): | |
1181 | """SetSize(self, Size s)""" | |
1182 | return _core_.Rect_SetSize(*args, **kwargs) | |
1183 | ||
1184 | def IsEmpty(*args, **kwargs): | |
1185 | """IsEmpty(self) -> bool""" | |
1186 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1187 | ||
1188 | def GetTopLeft(*args, **kwargs): | |
1189 | """GetTopLeft(self) -> Point""" | |
1190 | return _core_.Rect_GetTopLeft(*args, **kwargs) | |
1191 | ||
1192 | def SetTopLeft(*args, **kwargs): | |
1193 | """SetTopLeft(self, Point p)""" | |
1194 | return _core_.Rect_SetTopLeft(*args, **kwargs) | |
1195 | ||
1196 | def GetBottomRight(*args, **kwargs): | |
1197 | """GetBottomRight(self) -> Point""" | |
1198 | return _core_.Rect_GetBottomRight(*args, **kwargs) | |
1199 | ||
1200 | def SetBottomRight(*args, **kwargs): | |
1201 | """SetBottomRight(self, Point p)""" | |
1202 | return _core_.Rect_SetBottomRight(*args, **kwargs) | |
1203 | ||
1204 | def GetTopRight(*args, **kwargs): | |
1205 | """GetTopRight(self) -> Point""" | |
1206 | return _core_.Rect_GetTopRight(*args, **kwargs) | |
1207 | ||
1208 | def SetTopRight(*args, **kwargs): | |
1209 | """SetTopRight(self, Point p)""" | |
1210 | return _core_.Rect_SetTopRight(*args, **kwargs) | |
1211 | ||
1212 | def GetBottomLeft(*args, **kwargs): | |
1213 | """GetBottomLeft(self) -> Point""" | |
1214 | return _core_.Rect_GetBottomLeft(*args, **kwargs) | |
1215 | ||
1216 | def SetBottomLeft(*args, **kwargs): | |
1217 | """SetBottomLeft(self, Point p)""" | |
1218 | return _core_.Rect_SetBottomLeft(*args, **kwargs) | |
1219 | ||
1220 | def GetLeft(*args, **kwargs): | |
1221 | """GetLeft(self) -> int""" | |
1222 | return _core_.Rect_GetLeft(*args, **kwargs) | |
1223 | ||
1224 | def GetTop(*args, **kwargs): | |
1225 | """GetTop(self) -> int""" | |
1226 | return _core_.Rect_GetTop(*args, **kwargs) | |
1227 | ||
1228 | def GetBottom(*args, **kwargs): | |
1229 | """GetBottom(self) -> int""" | |
1230 | return _core_.Rect_GetBottom(*args, **kwargs) | |
1231 | ||
1232 | def GetRight(*args, **kwargs): | |
1233 | """GetRight(self) -> int""" | |
1234 | return _core_.Rect_GetRight(*args, **kwargs) | |
1235 | ||
1236 | def SetLeft(*args, **kwargs): | |
1237 | """SetLeft(self, int left)""" | |
1238 | return _core_.Rect_SetLeft(*args, **kwargs) | |
1239 | ||
1240 | def SetRight(*args, **kwargs): | |
1241 | """SetRight(self, int right)""" | |
1242 | return _core_.Rect_SetRight(*args, **kwargs) | |
1243 | ||
1244 | def SetTop(*args, **kwargs): | |
1245 | """SetTop(self, int top)""" | |
1246 | return _core_.Rect_SetTop(*args, **kwargs) | |
1247 | ||
1248 | def SetBottom(*args, **kwargs): | |
1249 | """SetBottom(self, int bottom)""" | |
1250 | return _core_.Rect_SetBottom(*args, **kwargs) | |
1251 | ||
1252 | position = property(GetPosition, SetPosition) | |
1253 | size = property(GetSize, SetSize) | |
1254 | left = property(GetLeft, SetLeft) | |
1255 | right = property(GetRight, SetRight) | |
1256 | top = property(GetTop, SetTop) | |
1257 | bottom = property(GetBottom, SetBottom) | |
1258 | ||
1259 | def Inflate(*args, **kwargs): | |
1260 | """ | |
1261 | Inflate(self, int dx, int dy) -> Rect | |
1262 | ||
1263 | Increases the size of the rectangle. | |
1264 | ||
1265 | The left border is moved farther left and the right border is moved | |
1266 | farther right by ``dx``. The upper border is moved farther up and the | |
1267 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1268 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1269 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1270 | opposite happens: the rectangle size decreases in the respective | |
1271 | direction. | |
1272 | ||
1273 | The change is made to the rectangle inplace, if instead you need a | |
1274 | copy that is inflated, preserving the original then make the copy | |
1275 | first:: | |
1276 | ||
1277 | copy = wx.Rect(*original) | |
1278 | copy.Inflate(10,15) | |
1279 | ||
1280 | ||
1281 | """ | |
1282 | return _core_.Rect_Inflate(*args, **kwargs) | |
1283 | ||
1284 | def Deflate(*args, **kwargs): | |
1285 | """ | |
1286 | Deflate(self, int dx, int dy) -> Rect | |
1287 | ||
1288 | Decrease the rectangle size. This method is the opposite of `Inflate` | |
1289 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1290 | `Inflate` for a full description. | |
1291 | """ | |
1292 | return _core_.Rect_Deflate(*args, **kwargs) | |
1293 | ||
1294 | def OffsetXY(*args, **kwargs): | |
1295 | """ | |
1296 | OffsetXY(self, int dx, int dy) | |
1297 | ||
1298 | Moves the rectangle by the specified offset. If dx is positive, the | |
1299 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1300 | bottom, otherwise it is moved to the left or top respectively. | |
1301 | """ | |
1302 | return _core_.Rect_OffsetXY(*args, **kwargs) | |
1303 | ||
1304 | def Offset(*args, **kwargs): | |
1305 | """ | |
1306 | Offset(self, Point pt) | |
1307 | ||
1308 | Same as `OffsetXY` but uses dx,dy from Point | |
1309 | """ | |
1310 | return _core_.Rect_Offset(*args, **kwargs) | |
1311 | ||
1312 | def Intersect(*args, **kwargs): | |
1313 | """ | |
1314 | Intersect(self, Rect rect) -> Rect | |
1315 | ||
1316 | Returns the intersectsion of this rectangle and rect. | |
1317 | """ | |
1318 | return _core_.Rect_Intersect(*args, **kwargs) | |
1319 | ||
1320 | def Union(*args, **kwargs): | |
1321 | """ | |
1322 | Union(self, Rect rect) -> Rect | |
1323 | ||
1324 | Returns the union of this rectangle and rect. | |
1325 | """ | |
1326 | return _core_.Rect_Union(*args, **kwargs) | |
1327 | ||
1328 | def __add__(*args, **kwargs): | |
1329 | """ | |
1330 | __add__(self, Rect rect) -> Rect | |
1331 | ||
1332 | Add the properties of rect to this rectangle and return the result. | |
1333 | """ | |
1334 | return _core_.Rect___add__(*args, **kwargs) | |
1335 | ||
1336 | def __iadd__(*args, **kwargs): | |
1337 | """ | |
1338 | __iadd__(self, Rect rect) -> Rect | |
1339 | ||
1340 | Add the properties of rect to this rectangle, updating this rectangle. | |
1341 | """ | |
1342 | return _core_.Rect___iadd__(*args, **kwargs) | |
1343 | ||
1344 | def __eq__(*args, **kwargs): | |
1345 | """ | |
1346 | __eq__(self, PyObject other) -> bool | |
1347 | ||
1348 | Test for equality of wx.Rect objects. | |
1349 | """ | |
1350 | return _core_.Rect___eq__(*args, **kwargs) | |
1351 | ||
1352 | def __ne__(*args, **kwargs): | |
1353 | """ | |
1354 | __ne__(self, PyObject other) -> bool | |
1355 | ||
1356 | Test for inequality of wx.Rect objects. | |
1357 | """ | |
1358 | return _core_.Rect___ne__(*args, **kwargs) | |
1359 | ||
1360 | def ContainsXY(*args, **kwargs): | |
1361 | """ | |
1362 | ContainsXY(self, int x, int y) -> bool | |
1363 | ||
1364 | Return True if the point is inside the rect. | |
1365 | """ | |
1366 | return _core_.Rect_ContainsXY(*args, **kwargs) | |
1367 | ||
1368 | def Contains(*args, **kwargs): | |
1369 | """ | |
1370 | Contains(self, Point pt) -> bool | |
1371 | ||
1372 | Return True if the point is inside the rect. | |
1373 | """ | |
1374 | return _core_.Rect_Contains(*args, **kwargs) | |
1375 | ||
1376 | def ContainsRect(*args, **kwargs): | |
1377 | """ | |
1378 | ContainsRect(self, Rect rect) -> bool | |
1379 | ||
1380 | Returns ``True`` if the given rectangle is completely inside this | |
1381 | rectangle or touches its boundary. | |
1382 | """ | |
1383 | return _core_.Rect_ContainsRect(*args, **kwargs) | |
1384 | ||
1385 | #Inside = wx._deprecated(Contains, "Use `Contains` instead.") | |
1386 | #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.") | |
1387 | #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.") | |
1388 | Inside = Contains | |
1389 | InsideXY = ContainsXY | |
1390 | InsideRect = ContainsRect | |
1391 | ||
1392 | def Intersects(*args, **kwargs): | |
1393 | """ | |
1394 | Intersects(self, Rect rect) -> bool | |
1395 | ||
1396 | Returns True if the rectangles have a non empty intersection. | |
1397 | """ | |
1398 | return _core_.Rect_Intersects(*args, **kwargs) | |
1399 | ||
1400 | def CenterIn(*args, **kwargs): | |
1401 | """ | |
1402 | CenterIn(self, Rect r, int dir=BOTH) -> Rect | |
1403 | ||
1404 | Center this rectangle within the one passed to the method, which is | |
1405 | usually, but not necessarily, the larger one. | |
1406 | """ | |
1407 | return _core_.Rect_CenterIn(*args, **kwargs) | |
1408 | ||
1409 | CentreIn = CenterIn | |
1410 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) | |
1411 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1412 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1413 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
1414 | def Set(*args, **kwargs): | |
1415 | """ | |
1416 | Set(self, int x=0, int y=0, int width=0, int height=0) | |
1417 | ||
1418 | Set all rectangle properties. | |
1419 | """ | |
1420 | return _core_.Rect_Set(*args, **kwargs) | |
1421 | ||
1422 | def Get(*args, **kwargs): | |
1423 | """ | |
1424 | Get() -> (x,y,width,height) | |
1425 | ||
1426 | Return the rectangle properties as a tuple. | |
1427 | """ | |
1428 | return _core_.Rect_Get(*args, **kwargs) | |
1429 | ||
1430 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") | |
1431 | def __str__(self): return str(self.Get()) | |
1432 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1433 | def __len__(self): return len(self.Get()) | |
1434 | def __getitem__(self, index): return self.Get()[index] | |
1435 | def __setitem__(self, index, val): | |
1436 | if index == 0: self.x = val | |
1437 | elif index == 1: self.y = val | |
1438 | elif index == 2: self.width = val | |
1439 | elif index == 3: self.height = val | |
1440 | else: raise IndexError | |
1441 | def __nonzero__(self): return self.Get() != (0,0,0,0) | |
1442 | __safe_for_unpickling__ = True | |
1443 | def __reduce__(self): return (wx.Rect, self.Get()) | |
1444 | ||
1445 | Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`") | |
1446 | BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`") | |
1447 | BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`") | |
1448 | Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`") | |
1449 | Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`") | |
1450 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
1451 | Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`") | |
1452 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
1453 | Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`") | |
1454 | TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`") | |
1455 | TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`") | |
1456 | Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`") | |
1457 | X = property(GetX,SetX,doc="See `GetX` and `SetX`") | |
1458 | Y = property(GetY,SetY,doc="See `GetY` and `SetY`") | |
1459 | Empty = property(IsEmpty,doc="See `IsEmpty`") | |
1460 | _core_.Rect_swigregister(Rect) | |
1461 | ||
1462 | def RectPP(*args, **kwargs): | |
1463 | """ | |
1464 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
1465 | ||
1466 | Create a new Rect object from Points representing two corners. | |
1467 | """ | |
1468 | val = _core_.new_RectPP(*args, **kwargs) | |
1469 | return val | |
1470 | ||
1471 | def RectPS(*args, **kwargs): | |
1472 | """ | |
1473 | RectPS(Point pos, Size size) -> Rect | |
1474 | ||
1475 | Create a new Rect from a position and size. | |
1476 | """ | |
1477 | val = _core_.new_RectPS(*args, **kwargs) | |
1478 | return val | |
1479 | ||
1480 | def RectS(*args, **kwargs): | |
1481 | """ | |
1482 | RectS(Size size) -> Rect | |
1483 | ||
1484 | Create a new Rect from a size only. | |
1485 | """ | |
1486 | val = _core_.new_RectS(*args, **kwargs) | |
1487 | return val | |
1488 | ||
1489 | ||
1490 | def IntersectRect(*args, **kwargs): | |
1491 | """ | |
1492 | IntersectRect(Rect r1, Rect r2) -> Rect | |
1493 | ||
1494 | Calculate and return the intersection of r1 and r2. | |
1495 | """ | |
1496 | return _core_.IntersectRect(*args, **kwargs) | |
1497 | #--------------------------------------------------------------------------- | |
1498 | ||
1499 | class Point2D(object): | |
1500 | """ | |
1501 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1502 | with floating point values. | |
1503 | """ | |
1504 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
1505 | __repr__ = _swig_repr | |
1506 | def __init__(self, *args, **kwargs): | |
1507 | """ | |
1508 | __init__(self, double x=0.0, double y=0.0) -> Point2D | |
1509 | ||
1510 | Create a w.Point2D object. | |
1511 | """ | |
1512 | _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs)) | |
1513 | __swig_destroy__ = _core_.delete_Point2D | |
1514 | __del__ = lambda self : None; | |
1515 | def GetFloor(*args, **kwargs): | |
1516 | """ | |
1517 | GetFloor() -> (x,y) | |
1518 | ||
1519 | Convert to integer | |
1520 | """ | |
1521 | return _core_.Point2D_GetFloor(*args, **kwargs) | |
1522 | ||
1523 | def GetRounded(*args, **kwargs): | |
1524 | """ | |
1525 | GetRounded() -> (x,y) | |
1526 | ||
1527 | Convert to integer | |
1528 | """ | |
1529 | return _core_.Point2D_GetRounded(*args, **kwargs) | |
1530 | ||
1531 | def GetVectorLength(*args, **kwargs): | |
1532 | """GetVectorLength(self) -> double""" | |
1533 | return _core_.Point2D_GetVectorLength(*args, **kwargs) | |
1534 | ||
1535 | def GetVectorAngle(*args, **kwargs): | |
1536 | """GetVectorAngle(self) -> double""" | |
1537 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) | |
1538 | ||
1539 | def SetVectorLength(*args, **kwargs): | |
1540 | """SetVectorLength(self, double length)""" | |
1541 | return _core_.Point2D_SetVectorLength(*args, **kwargs) | |
1542 | ||
1543 | def SetVectorAngle(*args, **kwargs): | |
1544 | """SetVectorAngle(self, double degrees)""" | |
1545 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) | |
1546 | ||
1547 | def SetPolarCoordinates(self, angle, length): | |
1548 | self.SetVectorLength(length) | |
1549 | self.SetVectorAngle(angle) | |
1550 | def Normalize(self): | |
1551 | self.SetVectorLength(1.0) | |
1552 | ||
1553 | def GetDistance(*args, **kwargs): | |
1554 | """GetDistance(self, Point2D pt) -> double""" | |
1555 | return _core_.Point2D_GetDistance(*args, **kwargs) | |
1556 | ||
1557 | def GetDistanceSquare(*args, **kwargs): | |
1558 | """GetDistanceSquare(self, Point2D pt) -> double""" | |
1559 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) | |
1560 | ||
1561 | def GetDotProduct(*args, **kwargs): | |
1562 | """GetDotProduct(self, Point2D vec) -> double""" | |
1563 | return _core_.Point2D_GetDotProduct(*args, **kwargs) | |
1564 | ||
1565 | def GetCrossProduct(*args, **kwargs): | |
1566 | """GetCrossProduct(self, Point2D vec) -> double""" | |
1567 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) | |
1568 | ||
1569 | def __neg__(*args, **kwargs): | |
1570 | """ | |
1571 | __neg__(self) -> Point2D | |
1572 | ||
1573 | the reflection of this point | |
1574 | """ | |
1575 | return _core_.Point2D___neg__(*args, **kwargs) | |
1576 | ||
1577 | def __iadd__(*args, **kwargs): | |
1578 | """__iadd__(self, Point2D pt) -> Point2D""" | |
1579 | return _core_.Point2D___iadd__(*args, **kwargs) | |
1580 | ||
1581 | def __isub__(*args, **kwargs): | |
1582 | """__isub__(self, Point2D pt) -> Point2D""" | |
1583 | return _core_.Point2D___isub__(*args, **kwargs) | |
1584 | ||
1585 | def __imul__(*args, **kwargs): | |
1586 | """__imul__(self, Point2D pt) -> Point2D""" | |
1587 | return _core_.Point2D___imul__(*args, **kwargs) | |
1588 | ||
1589 | def __idiv__(*args, **kwargs): | |
1590 | """__idiv__(self, Point2D pt) -> Point2D""" | |
1591 | return _core_.Point2D___idiv__(*args, **kwargs) | |
1592 | ||
1593 | def __eq__(*args, **kwargs): | |
1594 | """ | |
1595 | __eq__(self, PyObject other) -> bool | |
1596 | ||
1597 | Test for equality of wx.Point2D objects. | |
1598 | """ | |
1599 | return _core_.Point2D___eq__(*args, **kwargs) | |
1600 | ||
1601 | def __ne__(*args, **kwargs): | |
1602 | """ | |
1603 | __ne__(self, PyObject other) -> bool | |
1604 | ||
1605 | Test for inequality of wx.Point2D objects. | |
1606 | """ | |
1607 | return _core_.Point2D___ne__(*args, **kwargs) | |
1608 | ||
1609 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) | |
1610 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
1611 | def Set(*args, **kwargs): | |
1612 | """Set(self, double x=0, double y=0)""" | |
1613 | return _core_.Point2D_Set(*args, **kwargs) | |
1614 | ||
1615 | def Get(*args, **kwargs): | |
1616 | """ | |
1617 | Get() -> (x,y) | |
1618 | ||
1619 | Return x and y properties as a tuple. | |
1620 | """ | |
1621 | return _core_.Point2D_Get(*args, **kwargs) | |
1622 | ||
1623 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") | |
1624 | def __str__(self): return str(self.Get()) | |
1625 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1626 | def __len__(self): return len(self.Get()) | |
1627 | def __getitem__(self, index): return self.Get()[index] | |
1628 | def __setitem__(self, index, val): | |
1629 | if index == 0: self.x = val | |
1630 | elif index == 1: self.y = val | |
1631 | else: raise IndexError | |
1632 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1633 | __safe_for_unpickling__ = True | |
1634 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
1635 | ||
1636 | Floor = property(GetFloor,doc="See `GetFloor`") | |
1637 | Rounded = property(GetRounded,doc="See `GetRounded`") | |
1638 | VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`") | |
1639 | VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`") | |
1640 | _core_.Point2D_swigregister(Point2D) | |
1641 | ||
1642 | def Point2DCopy(*args, **kwargs): | |
1643 | """ | |
1644 | Point2DCopy(Point2D pt) -> Point2D | |
1645 | ||
1646 | Create a w.Point2D object. | |
1647 | """ | |
1648 | val = _core_.new_Point2DCopy(*args, **kwargs) | |
1649 | return val | |
1650 | ||
1651 | def Point2DFromPoint(*args, **kwargs): | |
1652 | """ | |
1653 | Point2DFromPoint(Point pt) -> Point2D | |
1654 | ||
1655 | Create a w.Point2D object. | |
1656 | """ | |
1657 | val = _core_.new_Point2DFromPoint(*args, **kwargs) | |
1658 | return val | |
1659 | ||
1660 | #--------------------------------------------------------------------------- | |
1661 | ||
1662 | Inside = _core_.Inside | |
1663 | OutLeft = _core_.OutLeft | |
1664 | OutRight = _core_.OutRight | |
1665 | OutTop = _core_.OutTop | |
1666 | OutBottom = _core_.OutBottom | |
1667 | class Rect2D(object): | |
1668 | """ | |
1669 | wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system | |
1670 | with floating point component values. | |
1671 | """ | |
1672 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
1673 | __repr__ = _swig_repr | |
1674 | def __init__(self, *args, **kwargs): | |
1675 | """ | |
1676 | __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D | |
1677 | ||
1678 | wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system | |
1679 | with floating point component values. | |
1680 | """ | |
1681 | _core_.Rect2D_swiginit(self,_core_.new_Rect2D(*args, **kwargs)) | |
1682 | __swig_destroy__ = _core_.delete_Rect2D | |
1683 | __del__ = lambda self : None; | |
1684 | def GetPosition(*args, **kwargs): | |
1685 | """GetPosition(self) -> Point2D""" | |
1686 | return _core_.Rect2D_GetPosition(*args, **kwargs) | |
1687 | ||
1688 | def GetSize(*args, **kwargs): | |
1689 | """GetSize(self) -> Size""" | |
1690 | return _core_.Rect2D_GetSize(*args, **kwargs) | |
1691 | ||
1692 | def GetLeft(*args, **kwargs): | |
1693 | """GetLeft(self) -> wxDouble""" | |
1694 | return _core_.Rect2D_GetLeft(*args, **kwargs) | |
1695 | ||
1696 | def SetLeft(*args, **kwargs): | |
1697 | """SetLeft(self, wxDouble n)""" | |
1698 | return _core_.Rect2D_SetLeft(*args, **kwargs) | |
1699 | ||
1700 | def MoveLeftTo(*args, **kwargs): | |
1701 | """MoveLeftTo(self, wxDouble n)""" | |
1702 | return _core_.Rect2D_MoveLeftTo(*args, **kwargs) | |
1703 | ||
1704 | def GetTop(*args, **kwargs): | |
1705 | """GetTop(self) -> wxDouble""" | |
1706 | return _core_.Rect2D_GetTop(*args, **kwargs) | |
1707 | ||
1708 | def SetTop(*args, **kwargs): | |
1709 | """SetTop(self, wxDouble n)""" | |
1710 | return _core_.Rect2D_SetTop(*args, **kwargs) | |
1711 | ||
1712 | def MoveTopTo(*args, **kwargs): | |
1713 | """MoveTopTo(self, wxDouble n)""" | |
1714 | return _core_.Rect2D_MoveTopTo(*args, **kwargs) | |
1715 | ||
1716 | def GetBottom(*args, **kwargs): | |
1717 | """GetBottom(self) -> wxDouble""" | |
1718 | return _core_.Rect2D_GetBottom(*args, **kwargs) | |
1719 | ||
1720 | def SetBottom(*args, **kwargs): | |
1721 | """SetBottom(self, wxDouble n)""" | |
1722 | return _core_.Rect2D_SetBottom(*args, **kwargs) | |
1723 | ||
1724 | def MoveBottomTo(*args, **kwargs): | |
1725 | """MoveBottomTo(self, wxDouble n)""" | |
1726 | return _core_.Rect2D_MoveBottomTo(*args, **kwargs) | |
1727 | ||
1728 | def GetRight(*args, **kwargs): | |
1729 | """GetRight(self) -> wxDouble""" | |
1730 | return _core_.Rect2D_GetRight(*args, **kwargs) | |
1731 | ||
1732 | def SetRight(*args, **kwargs): | |
1733 | """SetRight(self, wxDouble n)""" | |
1734 | return _core_.Rect2D_SetRight(*args, **kwargs) | |
1735 | ||
1736 | def MoveRightTo(*args, **kwargs): | |
1737 | """MoveRightTo(self, wxDouble n)""" | |
1738 | return _core_.Rect2D_MoveRightTo(*args, **kwargs) | |
1739 | ||
1740 | def GetLeftTop(*args, **kwargs): | |
1741 | """GetLeftTop(self) -> Point2D""" | |
1742 | return _core_.Rect2D_GetLeftTop(*args, **kwargs) | |
1743 | ||
1744 | def SetLeftTop(*args, **kwargs): | |
1745 | """SetLeftTop(self, Point2D pt)""" | |
1746 | return _core_.Rect2D_SetLeftTop(*args, **kwargs) | |
1747 | ||
1748 | def MoveLeftTopTo(*args, **kwargs): | |
1749 | """MoveLeftTopTo(self, Point2D pt)""" | |
1750 | return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs) | |
1751 | ||
1752 | def GetLeftBottom(*args, **kwargs): | |
1753 | """GetLeftBottom(self) -> Point2D""" | |
1754 | return _core_.Rect2D_GetLeftBottom(*args, **kwargs) | |
1755 | ||
1756 | def SetLeftBottom(*args, **kwargs): | |
1757 | """SetLeftBottom(self, Point2D pt)""" | |
1758 | return _core_.Rect2D_SetLeftBottom(*args, **kwargs) | |
1759 | ||
1760 | def MoveLeftBottomTo(*args, **kwargs): | |
1761 | """MoveLeftBottomTo(self, Point2D pt)""" | |
1762 | return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs) | |
1763 | ||
1764 | def GetRightTop(*args, **kwargs): | |
1765 | """GetRightTop(self) -> Point2D""" | |
1766 | return _core_.Rect2D_GetRightTop(*args, **kwargs) | |
1767 | ||
1768 | def SetRightTop(*args, **kwargs): | |
1769 | """SetRightTop(self, Point2D pt)""" | |
1770 | return _core_.Rect2D_SetRightTop(*args, **kwargs) | |
1771 | ||
1772 | def MoveRightTopTo(*args, **kwargs): | |
1773 | """MoveRightTopTo(self, Point2D pt)""" | |
1774 | return _core_.Rect2D_MoveRightTopTo(*args, **kwargs) | |
1775 | ||
1776 | def GetRightBottom(*args, **kwargs): | |
1777 | """GetRightBottom(self) -> Point2D""" | |
1778 | return _core_.Rect2D_GetRightBottom(*args, **kwargs) | |
1779 | ||
1780 | def SetRightBottom(*args, **kwargs): | |
1781 | """SetRightBottom(self, Point2D pt)""" | |
1782 | return _core_.Rect2D_SetRightBottom(*args, **kwargs) | |
1783 | ||
1784 | def MoveRightBottomTo(*args, **kwargs): | |
1785 | """MoveRightBottomTo(self, Point2D pt)""" | |
1786 | return _core_.Rect2D_MoveRightBottomTo(*args, **kwargs) | |
1787 | ||
1788 | def GetCentre(*args, **kwargs): | |
1789 | """GetCentre(self) -> Point2D""" | |
1790 | return _core_.Rect2D_GetCentre(*args, **kwargs) | |
1791 | ||
1792 | def SetCentre(*args, **kwargs): | |
1793 | """SetCentre(self, Point2D pt)""" | |
1794 | return _core_.Rect2D_SetCentre(*args, **kwargs) | |
1795 | ||
1796 | def MoveCentreTo(*args, **kwargs): | |
1797 | """MoveCentreTo(self, Point2D pt)""" | |
1798 | return _core_.Rect2D_MoveCentreTo(*args, **kwargs) | |
1799 | ||
1800 | def GetOutcode(*args, **kwargs): | |
1801 | """GetOutcode(self, Point2D pt) -> int""" | |
1802 | return _core_.Rect2D_GetOutcode(*args, **kwargs) | |
1803 | ||
1804 | def Contains(*args, **kwargs): | |
1805 | """Contains(self, Point2D pt) -> bool""" | |
1806 | return _core_.Rect2D_Contains(*args, **kwargs) | |
1807 | ||
1808 | def ContainsRect(*args, **kwargs): | |
1809 | """ContainsRect(self, Rect2D rect) -> bool""" | |
1810 | return _core_.Rect2D_ContainsRect(*args, **kwargs) | |
1811 | ||
1812 | def IsEmpty(*args, **kwargs): | |
1813 | """IsEmpty(self) -> bool""" | |
1814 | return _core_.Rect2D_IsEmpty(*args, **kwargs) | |
1815 | ||
1816 | def HaveEqualSize(*args, **kwargs): | |
1817 | """HaveEqualSize(self, Rect2D rect) -> bool""" | |
1818 | return _core_.Rect2D_HaveEqualSize(*args, **kwargs) | |
1819 | ||
1820 | def Inset(*args): | |
1821 | """ | |
1822 | Inset(self, wxDouble x, wxDouble y) | |
1823 | Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom) | |
1824 | """ | |
1825 | return _core_.Rect2D_Inset(*args) | |
1826 | ||
1827 | def Offset(*args, **kwargs): | |
1828 | """Offset(self, Point2D pt)""" | |
1829 | return _core_.Rect2D_Offset(*args, **kwargs) | |
1830 | ||
1831 | def ConstrainTo(*args, **kwargs): | |
1832 | """ConstrainTo(self, Rect2D rect)""" | |
1833 | return _core_.Rect2D_ConstrainTo(*args, **kwargs) | |
1834 | ||
1835 | def Interpolate(*args, **kwargs): | |
1836 | """Interpolate(self, int widthfactor, int heightfactor) -> Point2D""" | |
1837 | return _core_.Rect2D_Interpolate(*args, **kwargs) | |
1838 | ||
1839 | def Intersect(*args, **kwargs): | |
1840 | """Intersect(self, Rect2D otherRect)""" | |
1841 | return _core_.Rect2D_Intersect(*args, **kwargs) | |
1842 | ||
1843 | def CreateIntersection(*args, **kwargs): | |
1844 | """CreateIntersection(self, Rect2D otherRect) -> Rect2D""" | |
1845 | return _core_.Rect2D_CreateIntersection(*args, **kwargs) | |
1846 | ||
1847 | def Intersects(*args, **kwargs): | |
1848 | """Intersects(self, Rect2D rect) -> bool""" | |
1849 | return _core_.Rect2D_Intersects(*args, **kwargs) | |
1850 | ||
1851 | def Union(*args, **kwargs): | |
1852 | """Union(self, Rect2D otherRect)""" | |
1853 | return _core_.Rect2D_Union(*args, **kwargs) | |
1854 | ||
1855 | def CreateUnion(*args, **kwargs): | |
1856 | """CreateUnion(self, Rect2D otherRect) -> Rect2D""" | |
1857 | return _core_.Rect2D_CreateUnion(*args, **kwargs) | |
1858 | ||
1859 | def Scale(*args): | |
1860 | """ | |
1861 | Scale(self, wxDouble f) | |
1862 | Scale(self, int num, int denum) | |
1863 | """ | |
1864 | return _core_.Rect2D_Scale(*args) | |
1865 | ||
1866 | def __eq__(*args, **kwargs): | |
1867 | """ | |
1868 | __eq__(self, PyObject other) -> bool | |
1869 | ||
1870 | Test for equality of wx.Rect2D objects. | |
1871 | """ | |
1872 | return _core_.Rect2D___eq__(*args, **kwargs) | |
1873 | ||
1874 | def __ne__(*args, **kwargs): | |
1875 | """ | |
1876 | __ne__(self, PyObject other) -> bool | |
1877 | ||
1878 | Test for inequality of wx.Rect2D objects. | |
1879 | """ | |
1880 | return _core_.Rect2D___ne__(*args, **kwargs) | |
1881 | ||
1882 | x = property(_core_.Rect2D_x_get, _core_.Rect2D_x_set) | |
1883 | y = property(_core_.Rect2D_y_get, _core_.Rect2D_y_set) | |
1884 | width = property(_core_.Rect2D_width_get, _core_.Rect2D_width_set) | |
1885 | height = property(_core_.Rect2D_height_get, _core_.Rect2D_height_set) | |
1886 | def Set(*args, **kwargs): | |
1887 | """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)""" | |
1888 | return _core_.Rect2D_Set(*args, **kwargs) | |
1889 | ||
1890 | def Get(*args, **kwargs): | |
1891 | """ | |
1892 | Get() -> (x,y, width, height) | |
1893 | ||
1894 | Return x, y, width and height y properties as a tuple. | |
1895 | """ | |
1896 | return _core_.Rect2D_Get(*args, **kwargs) | |
1897 | ||
1898 | def __str__(self): return str(self.Get()) | |
1899 | def __repr__(self): return 'wx.Rect2D'+str(self.Get()) | |
1900 | def __len__(self): return len(self.Get()) | |
1901 | def __getitem__(self, index): return self.Get()[index] | |
1902 | def __setitem__(self, index, val): | |
1903 | if index == 0: self.x = val | |
1904 | elif index == 1: self.y = val | |
1905 | elif index == 2: self.width = val | |
1906 | elif index == 3: self.height = val | |
1907 | else: raise IndexError | |
1908 | def __nonzero__(self): return self.Get() != (0.0, 0.0, 0.0, 0.0) | |
1909 | __safe_for_unpickling__ = True | |
1910 | def __reduce__(self): return (wx.Rect2D, self.Get()) | |
1911 | ||
1912 | _core_.Rect2D_swigregister(Rect2D) | |
1913 | ||
1914 | #--------------------------------------------------------------------------- | |
1915 | ||
1916 | FromStart = _core_.FromStart | |
1917 | FromCurrent = _core_.FromCurrent | |
1918 | FromEnd = _core_.FromEnd | |
1919 | class InputStream(object): | |
1920 | """Proxy of C++ InputStream class""" | |
1921 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
1922 | __repr__ = _swig_repr | |
1923 | def __init__(self, *args, **kwargs): | |
1924 | """__init__(self, PyObject p) -> InputStream""" | |
1925 | _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs)) | |
1926 | __swig_destroy__ = _core_.delete_InputStream | |
1927 | __del__ = lambda self : None; | |
1928 | def close(*args, **kwargs): | |
1929 | """close(self)""" | |
1930 | return _core_.InputStream_close(*args, **kwargs) | |
1931 | ||
1932 | def flush(*args, **kwargs): | |
1933 | """flush(self)""" | |
1934 | return _core_.InputStream_flush(*args, **kwargs) | |
1935 | ||
1936 | def eof(*args, **kwargs): | |
1937 | """eof(self) -> bool""" | |
1938 | return _core_.InputStream_eof(*args, **kwargs) | |
1939 | ||
1940 | def read(*args, **kwargs): | |
1941 | """read(self, int size=-1) -> PyObject""" | |
1942 | return _core_.InputStream_read(*args, **kwargs) | |
1943 | ||
1944 | def readline(*args, **kwargs): | |
1945 | """readline(self, int size=-1) -> PyObject""" | |
1946 | return _core_.InputStream_readline(*args, **kwargs) | |
1947 | ||
1948 | def readlines(*args, **kwargs): | |
1949 | """readlines(self, int sizehint=-1) -> PyObject""" | |
1950 | return _core_.InputStream_readlines(*args, **kwargs) | |
1951 | ||
1952 | def seek(*args, **kwargs): | |
1953 | """seek(self, int offset, int whence=0)""" | |
1954 | return _core_.InputStream_seek(*args, **kwargs) | |
1955 | ||
1956 | def tell(*args, **kwargs): | |
1957 | """tell(self) -> int""" | |
1958 | return _core_.InputStream_tell(*args, **kwargs) | |
1959 | ||
1960 | def Peek(*args, **kwargs): | |
1961 | """Peek(self) -> char""" | |
1962 | return _core_.InputStream_Peek(*args, **kwargs) | |
1963 | ||
1964 | def GetC(*args, **kwargs): | |
1965 | """GetC(self) -> char""" | |
1966 | return _core_.InputStream_GetC(*args, **kwargs) | |
1967 | ||
1968 | def LastRead(*args, **kwargs): | |
1969 | """LastRead(self) -> size_t""" | |
1970 | return _core_.InputStream_LastRead(*args, **kwargs) | |
1971 | ||
1972 | def CanRead(*args, **kwargs): | |
1973 | """CanRead(self) -> bool""" | |
1974 | return _core_.InputStream_CanRead(*args, **kwargs) | |
1975 | ||
1976 | def Eof(*args, **kwargs): | |
1977 | """Eof(self) -> bool""" | |
1978 | return _core_.InputStream_Eof(*args, **kwargs) | |
1979 | ||
1980 | def Ungetch(*args, **kwargs): | |
1981 | """Ungetch(self, char c) -> bool""" | |
1982 | return _core_.InputStream_Ungetch(*args, **kwargs) | |
1983 | ||
1984 | def SeekI(*args, **kwargs): | |
1985 | """SeekI(self, long pos, int mode=FromStart) -> long""" | |
1986 | return _core_.InputStream_SeekI(*args, **kwargs) | |
1987 | ||
1988 | def TellI(*args, **kwargs): | |
1989 | """TellI(self) -> long""" | |
1990 | return _core_.InputStream_TellI(*args, **kwargs) | |
1991 | ||
1992 | _core_.InputStream_swigregister(InputStream) | |
1993 | DefaultPosition = cvar.DefaultPosition | |
1994 | DefaultSize = cvar.DefaultSize | |
1995 | ||
1996 | class OutputStream(object): | |
1997 | """Proxy of C++ OutputStream class""" | |
1998 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
1999 | def __init__(self): raise AttributeError, "No constructor defined" | |
2000 | __repr__ = _swig_repr | |
2001 | def write(*args, **kwargs): | |
2002 | """write(self, PyObject obj)""" | |
2003 | return _core_.OutputStream_write(*args, **kwargs) | |
2004 | ||
2005 | def LastWrite(*args, **kwargs): | |
2006 | """LastWrite(self) -> size_t""" | |
2007 | return _core_.OutputStream_LastWrite(*args, **kwargs) | |
2008 | ||
2009 | _core_.OutputStream_swigregister(OutputStream) | |
2010 | ||
2011 | #--------------------------------------------------------------------------- | |
2012 | ||
2013 | class FSFile(Object): | |
2014 | """Proxy of C++ FSFile class""" | |
2015 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2016 | __repr__ = _swig_repr | |
2017 | def __init__(self, *args, **kwargs): | |
2018 | """ | |
2019 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, | |
2020 | DateTime modif) -> FSFile | |
2021 | """ | |
2022 | _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs)) | |
2023 | __swig_destroy__ = _core_.delete_FSFile | |
2024 | __del__ = lambda self : None; | |
2025 | def GetStream(*args, **kwargs): | |
2026 | """GetStream(self) -> InputStream""" | |
2027 | return _core_.FSFile_GetStream(*args, **kwargs) | |
2028 | ||
2029 | def DetachStream(*args, **kwargs): | |
2030 | """DetachStream(self)""" | |
2031 | return _core_.FSFile_DetachStream(*args, **kwargs) | |
2032 | ||
2033 | def GetMimeType(*args, **kwargs): | |
2034 | """GetMimeType(self) -> String""" | |
2035 | return _core_.FSFile_GetMimeType(*args, **kwargs) | |
2036 | ||
2037 | def GetLocation(*args, **kwargs): | |
2038 | """GetLocation(self) -> String""" | |
2039 | return _core_.FSFile_GetLocation(*args, **kwargs) | |
2040 | ||
2041 | def GetAnchor(*args, **kwargs): | |
2042 | """GetAnchor(self) -> String""" | |
2043 | return _core_.FSFile_GetAnchor(*args, **kwargs) | |
2044 | ||
2045 | def GetModificationTime(*args, **kwargs): | |
2046 | """GetModificationTime(self) -> DateTime""" | |
2047 | return _core_.FSFile_GetModificationTime(*args, **kwargs) | |
2048 | ||
2049 | Anchor = property(GetAnchor,doc="See `GetAnchor`") | |
2050 | Location = property(GetLocation,doc="See `GetLocation`") | |
2051 | MimeType = property(GetMimeType,doc="See `GetMimeType`") | |
2052 | ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`") | |
2053 | Stream = property(GetStream,doc="See `GetStream`") | |
2054 | _core_.FSFile_swigregister(FSFile) | |
2055 | ||
2056 | class CPPFileSystemHandler(object): | |
2057 | """Proxy of C++ CPPFileSystemHandler class""" | |
2058 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2059 | def __init__(self): raise AttributeError, "No constructor defined" | |
2060 | __repr__ = _swig_repr | |
2061 | __swig_destroy__ = _core_.delete_CPPFileSystemHandler | |
2062 | __del__ = lambda self : None; | |
2063 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler) | |
2064 | ||
2065 | class FileSystemHandler(CPPFileSystemHandler): | |
2066 | """Proxy of C++ FileSystemHandler class""" | |
2067 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2068 | __repr__ = _swig_repr | |
2069 | def __init__(self, *args, **kwargs): | |
2070 | """__init__(self) -> FileSystemHandler""" | |
2071 | _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs)) | |
2072 | FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler) | |
2073 | ||
2074 | def _setCallbackInfo(*args, **kwargs): | |
2075 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
2076 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) | |
2077 | ||
2078 | def CanOpen(*args, **kwargs): | |
2079 | """CanOpen(self, String location) -> bool""" | |
2080 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) | |
2081 | ||
2082 | def OpenFile(*args, **kwargs): | |
2083 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
2084 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) | |
2085 | ||
2086 | def FindFirst(*args, **kwargs): | |
2087 | """FindFirst(self, String spec, int flags=0) -> String""" | |
2088 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) | |
2089 | ||
2090 | def FindNext(*args, **kwargs): | |
2091 | """FindNext(self) -> String""" | |
2092 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) | |
2093 | ||
2094 | def GetProtocol(*args, **kwargs): | |
2095 | """GetProtocol(self, String location) -> String""" | |
2096 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) | |
2097 | ||
2098 | def GetLeftLocation(*args, **kwargs): | |
2099 | """GetLeftLocation(self, String location) -> String""" | |
2100 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | |
2101 | ||
2102 | def GetAnchor(*args, **kwargs): | |
2103 | """GetAnchor(self, String location) -> String""" | |
2104 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) | |
2105 | ||
2106 | def GetRightLocation(*args, **kwargs): | |
2107 | """GetRightLocation(self, String location) -> String""" | |
2108 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) | |
2109 | ||
2110 | def GetMimeTypeFromExt(*args, **kwargs): | |
2111 | """GetMimeTypeFromExt(self, String location) -> String""" | |
2112 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) | |
2113 | ||
2114 | Anchor = property(GetAnchor,doc="See `GetAnchor`") | |
2115 | LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`") | |
2116 | MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`") | |
2117 | Protocol = property(GetProtocol,doc="See `GetProtocol`") | |
2118 | RightLocation = property(GetRightLocation,doc="See `GetRightLocation`") | |
2119 | _core_.FileSystemHandler_swigregister(FileSystemHandler) | |
2120 | ||
2121 | class FileSystem(Object): | |
2122 | """Proxy of C++ FileSystem class""" | |
2123 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2124 | __repr__ = _swig_repr | |
2125 | def __init__(self, *args, **kwargs): | |
2126 | """__init__(self) -> FileSystem""" | |
2127 | _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs)) | |
2128 | __swig_destroy__ = _core_.delete_FileSystem | |
2129 | __del__ = lambda self : None; | |
2130 | def ChangePathTo(*args, **kwargs): | |
2131 | """ChangePathTo(self, String location, bool is_dir=False)""" | |
2132 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) | |
2133 | ||
2134 | def GetPath(*args, **kwargs): | |
2135 | """GetPath(self) -> String""" | |
2136 | return _core_.FileSystem_GetPath(*args, **kwargs) | |
2137 | ||
2138 | def OpenFile(*args, **kwargs): | |
2139 | """OpenFile(self, String location) -> FSFile""" | |
2140 | return _core_.FileSystem_OpenFile(*args, **kwargs) | |
2141 | ||
2142 | def FindFirst(*args, **kwargs): | |
2143 | """FindFirst(self, String spec, int flags=0) -> String""" | |
2144 | return _core_.FileSystem_FindFirst(*args, **kwargs) | |
2145 | ||
2146 | def FindNext(*args, **kwargs): | |
2147 | """FindNext(self) -> String""" | |
2148 | return _core_.FileSystem_FindNext(*args, **kwargs) | |
2149 | ||
2150 | def AddHandler(*args, **kwargs): | |
2151 | """AddHandler(CPPFileSystemHandler handler)""" | |
2152 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
2153 | ||
2154 | AddHandler = staticmethod(AddHandler) | |
2155 | def RemoveHandler(*args, **kwargs): | |
2156 | """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler""" | |
2157 | return _core_.FileSystem_RemoveHandler(*args, **kwargs) | |
2158 | ||
2159 | RemoveHandler = staticmethod(RemoveHandler) | |
2160 | def CleanUpHandlers(*args, **kwargs): | |
2161 | """CleanUpHandlers()""" | |
2162 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) | |
2163 | ||
2164 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
2165 | def FileNameToURL(*args, **kwargs): | |
2166 | """FileNameToURL(String filename) -> String""" | |
2167 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
2168 | ||
2169 | FileNameToURL = staticmethod(FileNameToURL) | |
2170 | def URLToFileName(*args, **kwargs): | |
2171 | """URLToFileName(String url) -> String""" | |
2172 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
2173 | ||
2174 | URLToFileName = staticmethod(URLToFileName) | |
2175 | Path = property(GetPath,doc="See `GetPath`") | |
2176 | _core_.FileSystem_swigregister(FileSystem) | |
2177 | ||
2178 | def FileSystem_AddHandler(*args, **kwargs): | |
2179 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" | |
2180 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
2181 | ||
2182 | def FileSystem_RemoveHandler(*args, **kwargs): | |
2183 | """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler""" | |
2184 | return _core_.FileSystem_RemoveHandler(*args, **kwargs) | |
2185 | ||
2186 | def FileSystem_CleanUpHandlers(*args): | |
2187 | """FileSystem_CleanUpHandlers()""" | |
2188 | return _core_.FileSystem_CleanUpHandlers(*args) | |
2189 | ||
2190 | def FileSystem_FileNameToURL(*args, **kwargs): | |
2191 | """FileSystem_FileNameToURL(String filename) -> String""" | |
2192 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
2193 | ||
2194 | def FileSystem_URLToFileName(*args, **kwargs): | |
2195 | """FileSystem_URLToFileName(String url) -> String""" | |
2196 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
2197 | ||
2198 | class InternetFSHandler(CPPFileSystemHandler): | |
2199 | """Proxy of C++ InternetFSHandler class""" | |
2200 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2201 | __repr__ = _swig_repr | |
2202 | def __init__(self, *args, **kwargs): | |
2203 | """__init__(self) -> InternetFSHandler""" | |
2204 | _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs)) | |
2205 | def CanOpen(*args, **kwargs): | |
2206 | """CanOpen(self, String location) -> bool""" | |
2207 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) | |
2208 | ||
2209 | def OpenFile(*args, **kwargs): | |
2210 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
2211 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) | |
2212 | ||
2213 | _core_.InternetFSHandler_swigregister(InternetFSHandler) | |
2214 | ||
2215 | class ZipFSHandler(CPPFileSystemHandler): | |
2216 | """Proxy of C++ ZipFSHandler class""" | |
2217 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2218 | __repr__ = _swig_repr | |
2219 | def __init__(self, *args, **kwargs): | |
2220 | """__init__(self) -> ZipFSHandler""" | |
2221 | _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs)) | |
2222 | def CanOpen(*args, **kwargs): | |
2223 | """CanOpen(self, String location) -> bool""" | |
2224 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) | |
2225 | ||
2226 | def OpenFile(*args, **kwargs): | |
2227 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
2228 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) | |
2229 | ||
2230 | def FindFirst(*args, **kwargs): | |
2231 | """FindFirst(self, String spec, int flags=0) -> String""" | |
2232 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) | |
2233 | ||
2234 | def FindNext(*args, **kwargs): | |
2235 | """FindNext(self) -> String""" | |
2236 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) | |
2237 | ||
2238 | _core_.ZipFSHandler_swigregister(ZipFSHandler) | |
2239 | ||
2240 | ||
2241 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): | |
2242 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" | |
2243 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
2244 | ||
2245 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): | |
2246 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" | |
2247 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
2248 | ||
2249 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): | |
2250 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" | |
2251 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
2252 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): | |
2253 | """ | |
2254 | Add 'file' to the memory filesystem. The dataItem parameter can | |
2255 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
2256 | arbitrary data. If a bitmap or image is used then the imgType | |
2257 | parameter should specify what kind of image file it should be | |
2258 | written as, wx.BITMAP_TYPE_PNG, etc. | |
2259 | """ | |
2260 | if isinstance(dataItem, wx.Image): | |
2261 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
2262 | elif isinstance(dataItem, wx.Bitmap): | |
2263 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
2264 | elif type(dataItem) == str: | |
2265 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
2266 | else: | |
2267 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
2268 | ||
2269 | class MemoryFSHandler(CPPFileSystemHandler): | |
2270 | """Proxy of C++ MemoryFSHandler class""" | |
2271 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2272 | __repr__ = _swig_repr | |
2273 | def __init__(self, *args, **kwargs): | |
2274 | """__init__(self) -> MemoryFSHandler""" | |
2275 | _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs)) | |
2276 | def RemoveFile(*args, **kwargs): | |
2277 | """RemoveFile(String filename)""" | |
2278 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
2279 | ||
2280 | RemoveFile = staticmethod(RemoveFile) | |
2281 | AddFile = staticmethod(MemoryFSHandler_AddFile) | |
2282 | def CanOpen(*args, **kwargs): | |
2283 | """CanOpen(self, String location) -> bool""" | |
2284 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) | |
2285 | ||
2286 | def OpenFile(*args, **kwargs): | |
2287 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" | |
2288 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) | |
2289 | ||
2290 | def FindFirst(*args, **kwargs): | |
2291 | """FindFirst(self, String spec, int flags=0) -> String""" | |
2292 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) | |
2293 | ||
2294 | def FindNext(*args, **kwargs): | |
2295 | """FindNext(self) -> String""" | |
2296 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) | |
2297 | ||
2298 | _core_.MemoryFSHandler_swigregister(MemoryFSHandler) | |
2299 | ||
2300 | def MemoryFSHandler_RemoveFile(*args, **kwargs): | |
2301 | """MemoryFSHandler_RemoveFile(String filename)""" | |
2302 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
2303 | ||
2304 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT | |
2305 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
2306 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
2307 | IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL | |
2308 | IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH | |
2309 | #--------------------------------------------------------------------------- | |
2310 | ||
2311 | class ImageHandler(Object): | |
2312 | """ | |
2313 | This is the base class for implementing image file loading/saving, and | |
2314 | image creation from data. It is used within `wx.Image` and is not | |
2315 | normally seen by the application. | |
2316 | """ | |
2317 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2318 | def __init__(self): raise AttributeError, "No constructor defined" | |
2319 | __repr__ = _swig_repr | |
2320 | def GetName(*args, **kwargs): | |
2321 | """GetName(self) -> String""" | |
2322 | return _core_.ImageHandler_GetName(*args, **kwargs) | |
2323 | ||
2324 | def GetExtension(*args, **kwargs): | |
2325 | """GetExtension(self) -> String""" | |
2326 | return _core_.ImageHandler_GetExtension(*args, **kwargs) | |
2327 | ||
2328 | def GetType(*args, **kwargs): | |
2329 | """GetType(self) -> long""" | |
2330 | return _core_.ImageHandler_GetType(*args, **kwargs) | |
2331 | ||
2332 | def GetMimeType(*args, **kwargs): | |
2333 | """GetMimeType(self) -> String""" | |
2334 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) | |
2335 | ||
2336 | def CanRead(*args, **kwargs): | |
2337 | """CanRead(self, String name) -> bool""" | |
2338 | return _core_.ImageHandler_CanRead(*args, **kwargs) | |
2339 | ||
2340 | def CanReadStream(*args, **kwargs): | |
2341 | """CanReadStream(self, InputStream stream) -> bool""" | |
2342 | return _core_.ImageHandler_CanReadStream(*args, **kwargs) | |
2343 | ||
2344 | def SetName(*args, **kwargs): | |
2345 | """SetName(self, String name)""" | |
2346 | return _core_.ImageHandler_SetName(*args, **kwargs) | |
2347 | ||
2348 | def SetExtension(*args, **kwargs): | |
2349 | """SetExtension(self, String extension)""" | |
2350 | return _core_.ImageHandler_SetExtension(*args, **kwargs) | |
2351 | ||
2352 | def SetType(*args, **kwargs): | |
2353 | """SetType(self, long type)""" | |
2354 | return _core_.ImageHandler_SetType(*args, **kwargs) | |
2355 | ||
2356 | def SetMimeType(*args, **kwargs): | |
2357 | """SetMimeType(self, String mimetype)""" | |
2358 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) | |
2359 | ||
2360 | Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`") | |
2361 | MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`") | |
2362 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
2363 | Type = property(GetType,SetType,doc="See `GetType` and `SetType`") | |
2364 | _core_.ImageHandler_swigregister(ImageHandler) | |
2365 | ||
2366 | class PyImageHandler(ImageHandler): | |
2367 | """ | |
2368 | This is the base class for implementing image file loading/saving, and | |
2369 | image creation from data, all written in Python. To create a custom | |
2370 | image handler derive a new class from wx.PyImageHandler and provide | |
2371 | the following methods:: | |
2372 | ||
2373 | def DoCanRead(self, stream) --> bool | |
2374 | '''Check if this handler can read the image on the stream''' | |
2375 | ||
2376 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2377 | '''Load image data from the stream and load it into image.''' | |
2378 | ||
2379 | def SaveFile(self, image, stream, verbose) --> bool | |
2380 | '''Save the iamge data in image to the stream using | |
2381 | this handler's image file format.''' | |
2382 | ||
2383 | def GetImageCount(self, stream) --> int | |
2384 | '''If this image format can hold more than one image, | |
2385 | how many does the image on the stream have?''' | |
2386 | ||
2387 | To activate your handler create an instance of it and pass it to | |
2388 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2389 | `SetExtension` from your constructor. | |
2390 | ||
2391 | """ | |
2392 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2393 | __repr__ = _swig_repr | |
2394 | def __init__(self, *args, **kwargs): | |
2395 | """ | |
2396 | __init__(self) -> PyImageHandler | |
2397 | ||
2398 | This is the base class for implementing image file loading/saving, and | |
2399 | image creation from data, all written in Python. To create a custom | |
2400 | image handler derive a new class from wx.PyImageHandler and provide | |
2401 | the following methods:: | |
2402 | ||
2403 | def DoCanRead(self, stream) --> bool | |
2404 | '''Check if this handler can read the image on the stream''' | |
2405 | ||
2406 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2407 | '''Load image data from the stream and load it into image.''' | |
2408 | ||
2409 | def SaveFile(self, image, stream, verbose) --> bool | |
2410 | '''Save the iamge data in image to the stream using | |
2411 | this handler's image file format.''' | |
2412 | ||
2413 | def GetImageCount(self, stream) --> int | |
2414 | '''If this image format can hold more than one image, | |
2415 | how many does the image on the stream have?''' | |
2416 | ||
2417 | To activate your handler create an instance of it and pass it to | |
2418 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2419 | `SetExtension` from your constructor. | |
2420 | ||
2421 | """ | |
2422 | _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs)) | |
2423 | self._SetSelf(self) | |
2424 | ||
2425 | def _SetSelf(*args, **kwargs): | |
2426 | """_SetSelf(self, PyObject self)""" | |
2427 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2428 | ||
2429 | _core_.PyImageHandler_swigregister(PyImageHandler) | |
2430 | ||
2431 | class ImageHistogram(object): | |
2432 | """Proxy of C++ ImageHistogram class""" | |
2433 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2434 | __repr__ = _swig_repr | |
2435 | def __init__(self, *args, **kwargs): | |
2436 | """__init__(self) -> ImageHistogram""" | |
2437 | _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs)) | |
2438 | def MakeKey(*args, **kwargs): | |
2439 | """ | |
2440 | MakeKey(byte r, byte g, byte b) -> unsigned long | |
2441 | ||
2442 | Get the key in the histogram for the given RGB values | |
2443 | """ | |
2444 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) | |
2445 | ||
2446 | MakeKey = staticmethod(MakeKey) | |
2447 | def FindFirstUnusedColour(*args, **kwargs): | |
2448 | """ | |
2449 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2450 | ||
2451 | Find first colour that is not used in the image and has higher RGB | |
2452 | values than startR, startG, startB. Returns a tuple consisting of a | |
2453 | success flag and rgb values. | |
2454 | """ | |
2455 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) | |
2456 | ||
2457 | def GetCount(*args, **kwargs): | |
2458 | """ | |
2459 | GetCount(self, unsigned long key) -> unsigned long | |
2460 | ||
2461 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2462 | key value from a RGB tripple. | |
2463 | """ | |
2464 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
2465 | ||
2466 | def GetCountRGB(*args, **kwargs): | |
2467 | """ | |
2468 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long | |
2469 | ||
2470 | Returns the pixel count for the given RGB values. | |
2471 | """ | |
2472 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2473 | ||
2474 | def GetCountColour(*args, **kwargs): | |
2475 | """ | |
2476 | GetCountColour(self, Colour colour) -> unsigned long | |
2477 | ||
2478 | Returns the pixel count for the given `wx.Colour` value. | |
2479 | """ | |
2480 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2481 | ||
2482 | _core_.ImageHistogram_swigregister(ImageHistogram) | |
2483 | ||
2484 | def ImageHistogram_MakeKey(*args, **kwargs): | |
2485 | """ | |
2486 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long | |
2487 | ||
2488 | Get the key in the histogram for the given RGB values | |
2489 | """ | |
2490 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) | |
2491 | ||
2492 | class Image_RGBValue(object): | |
2493 | """ | |
2494 | An object that contains values for red, green and blue which represent | |
2495 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2496 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2497 | color space. | |
2498 | """ | |
2499 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2500 | __repr__ = _swig_repr | |
2501 | def __init__(self, *args, **kwargs): | |
2502 | """ | |
2503 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2504 | ||
2505 | Constructor. | |
2506 | """ | |
2507 | _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs)) | |
2508 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) | |
2509 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2510 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2511 | _core_.Image_RGBValue_swigregister(Image_RGBValue) | |
2512 | ||
2513 | class Image_HSVValue(object): | |
2514 | """ | |
2515 | An object that contains values for hue, saturation and value which | |
2516 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2517 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2518 | color space. | |
2519 | """ | |
2520 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2521 | __repr__ = _swig_repr | |
2522 | def __init__(self, *args, **kwargs): | |
2523 | """ | |
2524 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2525 | ||
2526 | Constructor. | |
2527 | """ | |
2528 | _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs)) | |
2529 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) | |
2530 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2531 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2532 | _core_.Image_HSVValue_swigregister(Image_HSVValue) | |
2533 | ||
2534 | class Image(Object): | |
2535 | """ | |
2536 | A platform-independent image class. An image can be created from | |
2537 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2538 | variety of formats. Functions are available to set and get image | |
2539 | bits, so it can be used for basic image manipulation. | |
2540 | ||
2541 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2542 | platform-specific `wx.Bitmap` object must be created from it using the | |
2543 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2544 | device context, using `wx.DC.DrawBitmap`. | |
2545 | ||
2546 | One colour value of the image may be used as a mask colour which will | |
2547 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2548 | bitmap object. | |
2549 | ||
2550 | wx.Image supports alpha channel data, that is in addition to a byte | |
2551 | for the red, green and blue colour components for each pixel it also | |
2552 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2553 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2554 | means that the pixel is 100% opaque. | |
2555 | ||
2556 | Unlike RGB data, not all images have an alpha channel and before using | |
2557 | `GetAlpha` you should check if this image contains an alpha channel | |
2558 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2559 | with transparency information will have an alpha channel. | |
2560 | """ | |
2561 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
2562 | __repr__ = _swig_repr | |
2563 | def __init__(self, *args, **kwargs): | |
2564 | """ | |
2565 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2566 | ||
2567 | Loads an image from a file. | |
2568 | """ | |
2569 | _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs)) | |
2570 | __swig_destroy__ = _core_.delete_Image | |
2571 | __del__ = lambda self : None; | |
2572 | def Create(*args, **kwargs): | |
2573 | """ | |
2574 | Create(self, int width, int height, bool clear=True) | |
2575 | ||
2576 | Creates a fresh image. If clear is ``True``, the new image will be | |
2577 | initialized to black. Otherwise, the image data will be uninitialized. | |
2578 | """ | |
2579 | return _core_.Image_Create(*args, **kwargs) | |
2580 | ||
2581 | def Destroy(*args, **kwargs): | |
2582 | """ | |
2583 | Destroy(self) | |
2584 | ||
2585 | Destroys the image data. | |
2586 | """ | |
2587 | args[0].this.own(False) | |
2588 | return _core_.Image_Destroy(*args, **kwargs) | |
2589 | ||
2590 | def Scale(*args, **kwargs): | |
2591 | """ | |
2592 | Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image | |
2593 | ||
2594 | Returns a scaled version of the image. This is also useful for scaling | |
2595 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
2596 | `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter | |
2597 | specifies what method to use for resampling the image. It can be | |
2598 | either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling | |
2599 | method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses | |
2600 | bicubic and box averaging resampling methods for upsampling and | |
2601 | downsampling respectively. | |
2602 | """ | |
2603 | return _core_.Image_Scale(*args, **kwargs) | |
2604 | ||
2605 | def ResampleBox(*args, **kwargs): | |
2606 | """ResampleBox(self, int width, int height) -> Image""" | |
2607 | return _core_.Image_ResampleBox(*args, **kwargs) | |
2608 | ||
2609 | def ResampleBicubic(*args, **kwargs): | |
2610 | """ResampleBicubic(self, int width, int height) -> Image""" | |
2611 | return _core_.Image_ResampleBicubic(*args, **kwargs) | |
2612 | ||
2613 | def Blur(*args, **kwargs): | |
2614 | """ | |
2615 | Blur(self, int radius) -> Image | |
2616 | ||
2617 | Blurs the image in both horizontal and vertical directions by the | |
2618 | specified pixel ``radius``. This should not be used when using a | |
2619 | single mask colour for transparency. | |
2620 | """ | |
2621 | return _core_.Image_Blur(*args, **kwargs) | |
2622 | ||
2623 | def BlurHorizontal(*args, **kwargs): | |
2624 | """ | |
2625 | BlurHorizontal(self, int radius) -> Image | |
2626 | ||
2627 | Blurs the image in the horizontal direction only. This should not be | |
2628 | used when using a single mask colour for transparency. | |
2629 | ||
2630 | """ | |
2631 | return _core_.Image_BlurHorizontal(*args, **kwargs) | |
2632 | ||
2633 | def BlurVertical(*args, **kwargs): | |
2634 | """ | |
2635 | BlurVertical(self, int radius) -> Image | |
2636 | ||
2637 | Blurs the image in the vertical direction only. This should not be | |
2638 | used when using a single mask colour for transparency. | |
2639 | """ | |
2640 | return _core_.Image_BlurVertical(*args, **kwargs) | |
2641 | ||
2642 | def ShrinkBy(*args, **kwargs): | |
2643 | """ | |
2644 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2645 | ||
2646 | Return a version of the image scaled smaller by the given factors. | |
2647 | """ | |
2648 | return _core_.Image_ShrinkBy(*args, **kwargs) | |
2649 | ||
2650 | def Rescale(*args, **kwargs): | |
2651 | """ | |
2652 | Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image | |
2653 | ||
2654 | Changes the size of the image in-place by scaling it: after a call to | |
2655 | this function, the image will have the given width and height. | |
2656 | ||
2657 | Returns the (modified) image itself. | |
2658 | """ | |
2659 | return _core_.Image_Rescale(*args, **kwargs) | |
2660 | ||
2661 | def Resize(*args, **kwargs): | |
2662 | """ | |
2663 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2664 | ||
2665 | Changes the size of the image in-place without scaling it, by adding | |
2666 | either a border with the given colour or cropping as necessary. The | |
2667 | image is pasted into a new image with the given size and background | |
2668 | colour at the position pos relative to the upper left of the new | |
2669 | image. If red = green = blue = -1 then use either the current mask | |
2670 | colour if set or find, use, and set a suitable mask colour for any | |
2671 | newly exposed areas. | |
2672 | ||
2673 | Returns the (modified) image itself. | |
2674 | """ | |
2675 | return _core_.Image_Resize(*args, **kwargs) | |
2676 | ||
2677 | def SetRGB(*args, **kwargs): | |
2678 | """ | |
2679 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2680 | ||
2681 | Sets the pixel at the given coordinate. This routine performs | |
2682 | bounds-checks for the coordinate so it can be considered a safe way to | |
2683 | manipulate the data, but in some cases this might be too slow so that | |
2684 | the data will have to be set directly. In that case you will have to | |
2685 | get access to the image data using the `GetData` method. | |
2686 | """ | |
2687 | return _core_.Image_SetRGB(*args, **kwargs) | |
2688 | ||
2689 | def SetRGBRect(*args, **kwargs): | |
2690 | """ | |
2691 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2692 | ||
2693 | Sets the colour of the pixels within the given rectangle. This routine | |
2694 | performs bounds-checks for the rectangle so it can be considered a | |
2695 | safe way to manipulate the data. | |
2696 | """ | |
2697 | return _core_.Image_SetRGBRect(*args, **kwargs) | |
2698 | ||
2699 | def GetRed(*args, **kwargs): | |
2700 | """ | |
2701 | GetRed(self, int x, int y) -> byte | |
2702 | ||
2703 | Returns the red intensity at the given coordinate. | |
2704 | """ | |
2705 | return _core_.Image_GetRed(*args, **kwargs) | |
2706 | ||
2707 | def GetGreen(*args, **kwargs): | |
2708 | """ | |
2709 | GetGreen(self, int x, int y) -> byte | |
2710 | ||
2711 | Returns the green intensity at the given coordinate. | |
2712 | """ | |
2713 | return _core_.Image_GetGreen(*args, **kwargs) | |
2714 | ||
2715 | def GetBlue(*args, **kwargs): | |
2716 | """ | |
2717 | GetBlue(self, int x, int y) -> byte | |
2718 | ||
2719 | Returns the blue intensity at the given coordinate. | |
2720 | """ | |
2721 | return _core_.Image_GetBlue(*args, **kwargs) | |
2722 | ||
2723 | def SetAlpha(*args, **kwargs): | |
2724 | """ | |
2725 | SetAlpha(self, int x, int y, byte alpha) | |
2726 | ||
2727 | Sets the alpha value for the given pixel. This function should only be | |
2728 | called if the image has alpha channel data, use `HasAlpha` to check | |
2729 | for this. | |
2730 | """ | |
2731 | return _core_.Image_SetAlpha(*args, **kwargs) | |
2732 | ||
2733 | def GetAlpha(*args, **kwargs): | |
2734 | """ | |
2735 | GetAlpha(self, int x, int y) -> byte | |
2736 | ||
2737 | Returns the alpha value for the given pixel. This function may only be | |
2738 | called for the images with alpha channel, use `HasAlpha` to check for | |
2739 | this. | |
2740 | ||
2741 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2742 | corresponds to the fully transparent pixels while the value of 255 to | |
2743 | the fully opaque pixels. | |
2744 | """ | |
2745 | return _core_.Image_GetAlpha(*args, **kwargs) | |
2746 | ||
2747 | def HasAlpha(*args, **kwargs): | |
2748 | """ | |
2749 | HasAlpha(self) -> bool | |
2750 | ||
2751 | Returns true if this image has alpha channel, false otherwise. | |
2752 | """ | |
2753 | return _core_.Image_HasAlpha(*args, **kwargs) | |
2754 | ||
2755 | def InitAlpha(*args, **kwargs): | |
2756 | """ | |
2757 | InitAlpha(self) | |
2758 | ||
2759 | Initializes the image alpha channel data. It is an error to call it if | |
2760 | the image already has alpha data. If it doesn't, alpha data will be by | |
2761 | default initialized to all pixels being fully opaque. But if the image | |
2762 | has a a mask colour, all mask pixels will be completely transparent. | |
2763 | """ | |
2764 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2765 | ||
2766 | def IsTransparent(*args, **kwargs): | |
2767 | """ | |
2768 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool | |
2769 | ||
2770 | Returns ``True`` if this pixel is masked or has an alpha value less | |
2771 | than the spcified threshold. | |
2772 | """ | |
2773 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2774 | ||
2775 | def FindFirstUnusedColour(*args, **kwargs): | |
2776 | """ | |
2777 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2778 | ||
2779 | Find first colour that is not used in the image and has higher RGB | |
2780 | values than startR, startG, startB. Returns a tuple consisting of a | |
2781 | success flag and rgb values. | |
2782 | """ | |
2783 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) | |
2784 | ||
2785 | def ConvertAlphaToMask(*args, **kwargs): | |
2786 | """ | |
2787 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool | |
2788 | ||
2789 | If the image has alpha channel, this method converts it to mask. All | |
2790 | pixels with alpha value less than ``threshold`` are replaced with the | |
2791 | mask colour and the alpha channel is removed. The mask colour is | |
2792 | chosen automatically using `FindFirstUnusedColour`. | |
2793 | ||
2794 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2795 | nothing. | |
2796 | """ | |
2797 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
2798 | ||
2799 | def ConvertColourToAlpha(*args, **kwargs): | |
2800 | """ | |
2801 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool | |
2802 | ||
2803 | This method converts an image where the original alpha information is | |
2804 | only available as a shades of a colour (actually shades of grey) | |
2805 | typically when you draw anti-aliased text into a bitmap. The DC | |
2806 | drawing routines draw grey values on the black background although | |
2807 | they actually mean to draw white with differnt alpha values. This | |
2808 | method reverses it, assuming a black (!) background and white text. | |
2809 | The method will then fill up the whole image with the colour given. | |
2810 | """ | |
2811 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2812 | ||
2813 | def SetMaskFromImage(*args, **kwargs): | |
2814 | """ | |
2815 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2816 | ||
2817 | Sets the image's mask so that the pixels that have RGB value of | |
2818 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2819 | by first finding an unused colour in the image, setting this colour as | |
2820 | the mask colour and then using this colour to draw all pixels in the | |
2821 | image who corresponding pixel in mask has given RGB value. | |
2822 | ||
2823 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2824 | image or if there is no unused colour left. Returns ``True`` if the | |
2825 | mask was successfully applied. | |
2826 | ||
2827 | Note that this method involves computing the histogram, which is | |
2828 | computationally intensive operation. | |
2829 | """ | |
2830 | return _core_.Image_SetMaskFromImage(*args, **kwargs) | |
2831 | ||
2832 | def CanRead(*args, **kwargs): | |
2833 | """ | |
2834 | CanRead(String filename) -> bool | |
2835 | ||
2836 | Returns True if the image handlers can read this file. | |
2837 | """ | |
2838 | return _core_.Image_CanRead(*args, **kwargs) | |
2839 | ||
2840 | CanRead = staticmethod(CanRead) | |
2841 | def GetImageCount(*args, **kwargs): | |
2842 | """ | |
2843 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2844 | ||
2845 | If the image file contains more than one image and the image handler | |
2846 | is capable of retrieving these individually, this function will return | |
2847 | the number of available images. | |
2848 | """ | |
2849 | return _core_.Image_GetImageCount(*args, **kwargs) | |
2850 | ||
2851 | GetImageCount = staticmethod(GetImageCount) | |
2852 | def LoadFile(*args, **kwargs): | |
2853 | """ | |
2854 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2855 | ||
2856 | Loads an image from a file. If no handler type is provided, the | |
2857 | library will try to autodetect the format. | |
2858 | """ | |
2859 | return _core_.Image_LoadFile(*args, **kwargs) | |
2860 | ||
2861 | def LoadMimeFile(*args, **kwargs): | |
2862 | """ | |
2863 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2864 | ||
2865 | Loads an image from a file, specifying the image type with a MIME type | |
2866 | string. | |
2867 | """ | |
2868 | return _core_.Image_LoadMimeFile(*args, **kwargs) | |
2869 | ||
2870 | def SaveFile(*args, **kwargs): | |
2871 | """ | |
2872 | SaveFile(self, String name, int type) -> bool | |
2873 | ||
2874 | Saves an image in the named file. | |
2875 | """ | |
2876 | return _core_.Image_SaveFile(*args, **kwargs) | |
2877 | ||
2878 | def SaveMimeFile(*args, **kwargs): | |
2879 | """ | |
2880 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2881 | ||
2882 | Saves an image in the named file. | |
2883 | """ | |
2884 | return _core_.Image_SaveMimeFile(*args, **kwargs) | |
2885 | ||
2886 | def CanReadStream(*args, **kwargs): | |
2887 | """ | |
2888 | CanReadStream(InputStream stream) -> bool | |
2889 | ||
2890 | Returns True if the image handlers can read an image file from the | |
2891 | data currently on the input stream, or a readable Python file-like | |
2892 | object. | |
2893 | """ | |
2894 | return _core_.Image_CanReadStream(*args, **kwargs) | |
2895 | ||
2896 | CanReadStream = staticmethod(CanReadStream) | |
2897 | def LoadStream(*args, **kwargs): | |
2898 | """ | |
2899 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2900 | ||
2901 | Loads an image from an input stream or a readable Python file-like | |
2902 | object. If no handler type is provided, the library will try to | |
2903 | autodetect the format. | |
2904 | """ | |
2905 | return _core_.Image_LoadStream(*args, **kwargs) | |
2906 | ||
2907 | def LoadMimeStream(*args, **kwargs): | |
2908 | """ | |
2909 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2910 | ||
2911 | Loads an image from an input stream or a readable Python file-like | |
2912 | object, using a MIME type string to specify the image file format. | |
2913 | """ | |
2914 | return _core_.Image_LoadMimeStream(*args, **kwargs) | |
2915 | ||
2916 | def IsOk(*args, **kwargs): | |
2917 | """ | |
2918 | IsOk(self) -> bool | |
2919 | ||
2920 | Returns true if image data is present. | |
2921 | """ | |
2922 | return _core_.Image_IsOk(*args, **kwargs) | |
2923 | ||
2924 | Ok = IsOk | |
2925 | def GetWidth(*args, **kwargs): | |
2926 | """ | |
2927 | GetWidth(self) -> int | |
2928 | ||
2929 | Gets the width of the image in pixels. | |
2930 | """ | |
2931 | return _core_.Image_GetWidth(*args, **kwargs) | |
2932 | ||
2933 | def GetHeight(*args, **kwargs): | |
2934 | """ | |
2935 | GetHeight(self) -> int | |
2936 | ||
2937 | Gets the height of the image in pixels. | |
2938 | """ | |
2939 | return _core_.Image_GetHeight(*args, **kwargs) | |
2940 | ||
2941 | def GetSize(*args, **kwargs): | |
2942 | """ | |
2943 | GetSize(self) -> Size | |
2944 | ||
2945 | Returns the size of the image in pixels. | |
2946 | """ | |
2947 | return _core_.Image_GetSize(*args, **kwargs) | |
2948 | ||
2949 | def GetSubImage(*args, **kwargs): | |
2950 | """ | |
2951 | GetSubImage(self, Rect rect) -> Image | |
2952 | ||
2953 | Returns a sub image of the current one as long as the rect belongs | |
2954 | entirely to the image. | |
2955 | """ | |
2956 | return _core_.Image_GetSubImage(*args, **kwargs) | |
2957 | ||
2958 | def Size(*args, **kwargs): | |
2959 | """ | |
2960 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2961 | ||
2962 | Returns a resized version of this image without scaling it by adding | |
2963 | either a border with the given colour or cropping as necessary. The | |
2964 | image is pasted into a new image with the given size and background | |
2965 | colour at the position ``pos`` relative to the upper left of the new | |
2966 | image. If red = green = blue = -1 then use either the current mask | |
2967 | colour if set or find, use, and set a suitable mask colour for any | |
2968 | newly exposed areas. | |
2969 | """ | |
2970 | return _core_.Image_Size(*args, **kwargs) | |
2971 | ||
2972 | def Copy(*args, **kwargs): | |
2973 | """ | |
2974 | Copy(self) -> Image | |
2975 | ||
2976 | Returns an identical copy of the image. | |
2977 | """ | |
2978 | return _core_.Image_Copy(*args, **kwargs) | |
2979 | ||
2980 | def Paste(*args, **kwargs): | |
2981 | """ | |
2982 | Paste(self, Image image, int x, int y) | |
2983 | ||
2984 | Pastes ``image`` into this instance and takes care of the mask colour | |
2985 | and any out of bounds problems. | |
2986 | """ | |
2987 | return _core_.Image_Paste(*args, **kwargs) | |
2988 | ||
2989 | def GetData(*args, **kwargs): | |
2990 | """ | |
2991 | GetData(self) -> PyObject | |
2992 | ||
2993 | Returns a string containing a copy of the RGB bytes of the image. | |
2994 | """ | |
2995 | return _core_.Image_GetData(*args, **kwargs) | |
2996 | ||
2997 | def SetData(*args, **kwargs): | |
2998 | """ | |
2999 | SetData(self, buffer data) | |
3000 | ||
3001 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
3002 | either a string or a buffer object holding the data and the length of | |
3003 | the data must be width*height*3. | |
3004 | """ | |
3005 | return _core_.Image_SetData(*args, **kwargs) | |
3006 | ||
3007 | def GetDataBuffer(*args, **kwargs): | |
3008 | """ | |
3009 | GetDataBuffer(self) -> PyObject | |
3010 | ||
3011 | Returns a writable Python buffer object that is pointing at the RGB | |
3012 | image data buffer inside the wx.Image. You need to ensure that you do | |
3013 | not use this buffer object after the image has been destroyed. | |
3014 | """ | |
3015 | return _core_.Image_GetDataBuffer(*args, **kwargs) | |
3016 | ||
3017 | def SetDataBuffer(*args, **kwargs): | |
3018 | """ | |
3019 | SetDataBuffer(self, buffer data) | |
3020 | ||
3021 | Sets the internal image data pointer to point at a Python buffer | |
3022 | object. This can save making an extra copy of the data but you must | |
3023 | ensure that the buffer object lives longer than the wx.Image does. | |
3024 | """ | |
3025 | return _core_.Image_SetDataBuffer(*args, **kwargs) | |
3026 | ||
3027 | def GetAlphaData(*args, **kwargs): | |
3028 | """ | |
3029 | GetAlphaData(self) -> PyObject | |
3030 | ||
3031 | Returns a string containing a copy of the alpha bytes of the image. | |
3032 | """ | |
3033 | return _core_.Image_GetAlphaData(*args, **kwargs) | |
3034 | ||
3035 | def SetAlphaData(*args, **kwargs): | |
3036 | """ | |
3037 | SetAlphaData(self, buffer alpha) | |
3038 | ||
3039 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
3040 | a string or a buffer object holding the data and the length of the | |
3041 | data must be width*height. | |
3042 | """ | |
3043 | return _core_.Image_SetAlphaData(*args, **kwargs) | |
3044 | ||
3045 | def GetAlphaBuffer(*args, **kwargs): | |
3046 | """ | |
3047 | GetAlphaBuffer(self) -> PyObject | |
3048 | ||
3049 | Returns a writable Python buffer object that is pointing at the Alpha | |
3050 | data buffer inside the wx.Image. You need to ensure that you do not | |
3051 | use this buffer object after the image has been destroyed. | |
3052 | """ | |
3053 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) | |
3054 | ||
3055 | def SetAlphaBuffer(*args, **kwargs): | |
3056 | """ | |
3057 | SetAlphaBuffer(self, buffer alpha) | |
3058 | ||
3059 | Sets the internal image alpha pointer to point at a Python buffer | |
3060 | object. This can save making an extra copy of the data but you must | |
3061 | ensure that the buffer object lives as long as the wx.Image does. | |
3062 | """ | |
3063 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) | |
3064 | ||
3065 | def SetMaskColour(*args, **kwargs): | |
3066 | """ | |
3067 | SetMaskColour(self, byte r, byte g, byte b) | |
3068 | ||
3069 | Sets the mask colour for this image (and tells the image to use the | |
3070 | mask). | |
3071 | """ | |
3072 | return _core_.Image_SetMaskColour(*args, **kwargs) | |
3073 | ||
3074 | def GetOrFindMaskColour(*args, **kwargs): | |
3075 | """ | |
3076 | GetOrFindMaskColour() -> (r,g,b) | |
3077 | ||
3078 | Get the current mask colour or find a suitable colour. | |
3079 | """ | |
3080 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
3081 | ||
3082 | def GetMaskRed(*args, **kwargs): | |
3083 | """ | |
3084 | GetMaskRed(self) -> byte | |
3085 | ||
3086 | Gets the red component of the mask colour. | |
3087 | """ | |
3088 | return _core_.Image_GetMaskRed(*args, **kwargs) | |
3089 | ||
3090 | def GetMaskGreen(*args, **kwargs): | |
3091 | """ | |
3092 | GetMaskGreen(self) -> byte | |
3093 | ||
3094 | Gets the green component of the mask colour. | |
3095 | """ | |
3096 | return _core_.Image_GetMaskGreen(*args, **kwargs) | |
3097 | ||
3098 | def GetMaskBlue(*args, **kwargs): | |
3099 | """ | |
3100 | GetMaskBlue(self) -> byte | |
3101 | ||
3102 | Gets the blue component of the mask colour. | |
3103 | """ | |
3104 | return _core_.Image_GetMaskBlue(*args, **kwargs) | |
3105 | ||
3106 | def SetMask(*args, **kwargs): | |
3107 | """ | |
3108 | SetMask(self, bool mask=True) | |
3109 | ||
3110 | Specifies whether there is a mask or not. The area of the mask is | |
3111 | determined by the current mask colour. | |
3112 | """ | |
3113 | return _core_.Image_SetMask(*args, **kwargs) | |
3114 | ||
3115 | def HasMask(*args, **kwargs): | |
3116 | """ | |
3117 | HasMask(self) -> bool | |
3118 | ||
3119 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
3120 | """ | |
3121 | return _core_.Image_HasMask(*args, **kwargs) | |
3122 | ||
3123 | def Rotate(*args, **kwargs): | |
3124 | """ | |
3125 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, | |
3126 | Point offset_after_rotation=None) -> Image | |
3127 | ||
3128 | Rotates the image about the given point, by ``angle`` radians. Passing | |
3129 | ``True`` to ``interpolating`` results in better image quality, but is | |
3130 | slower. If the image has a mask, then the mask colour is used for the | |
3131 | uncovered pixels in the rotated image background. Otherwise, black | |
3132 | will be used as the fill colour. | |
3133 | ||
3134 | Returns the rotated image, leaving this image intact. | |
3135 | """ | |
3136 | return _core_.Image_Rotate(*args, **kwargs) | |
3137 | ||
3138 | def Rotate90(*args, **kwargs): | |
3139 | """ | |
3140 | Rotate90(self, bool clockwise=True) -> Image | |
3141 | ||
3142 | Returns a copy of the image rotated 90 degrees in the direction | |
3143 | indicated by ``clockwise``. | |
3144 | """ | |
3145 | return _core_.Image_Rotate90(*args, **kwargs) | |
3146 | ||
3147 | def Mirror(*args, **kwargs): | |
3148 | """ | |
3149 | Mirror(self, bool horizontally=True) -> Image | |
3150 | ||
3151 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
3152 | indicates the orientation. | |
3153 | """ | |
3154 | return _core_.Image_Mirror(*args, **kwargs) | |
3155 | ||
3156 | def Replace(*args, **kwargs): | |
3157 | """ | |
3158 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) | |
3159 | ||
3160 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
3161 | ``(r2,g2,b2)``. | |
3162 | """ | |
3163 | return _core_.Image_Replace(*args, **kwargs) | |
3164 | ||
3165 | def ConvertToGreyscale(*args, **kwargs): | |
3166 | """ | |
3167 | ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image | |
3168 | ||
3169 | Convert to greyscale image. Uses the luminance component (Y) of the | |
3170 | image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), | |
3171 | defaults to ITU-T BT.601 | |
3172 | """ | |
3173 | return _core_.Image_ConvertToGreyscale(*args, **kwargs) | |
3174 | ||
3175 | def ConvertToMono(*args, **kwargs): | |
3176 | """ | |
3177 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
3178 | ||
3179 | Returns monochromatic version of the image. The returned image has | |
3180 | white colour where the original has ``(r,g,b)`` colour and black | |
3181 | colour everywhere else. | |
3182 | """ | |
3183 | return _core_.Image_ConvertToMono(*args, **kwargs) | |
3184 | ||
3185 | def SetOption(*args, **kwargs): | |
3186 | """ | |
3187 | SetOption(self, String name, String value) | |
3188 | ||
3189 | Sets an image handler defined option. For example, when saving as a | |
3190 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
3191 | number between 0 and 100 (0 is terrible, 100 is very good). | |
3192 | """ | |
3193 | return _core_.Image_SetOption(*args, **kwargs) | |
3194 | ||
3195 | def SetOptionInt(*args, **kwargs): | |
3196 | """ | |
3197 | SetOptionInt(self, String name, int value) | |
3198 | ||
3199 | Sets an image option as an integer. | |
3200 | """ | |
3201 | return _core_.Image_SetOptionInt(*args, **kwargs) | |
3202 | ||
3203 | def GetOption(*args, **kwargs): | |
3204 | """ | |
3205 | GetOption(self, String name) -> String | |
3206 | ||
3207 | Gets the value of an image handler option. | |
3208 | """ | |
3209 | return _core_.Image_GetOption(*args, **kwargs) | |
3210 | ||
3211 | def GetOptionInt(*args, **kwargs): | |
3212 | """ | |
3213 | GetOptionInt(self, String name) -> int | |
3214 | ||
3215 | Gets the value of an image handler option as an integer. If the given | |
3216 | option is not present, the function returns 0. | |
3217 | """ | |
3218 | return _core_.Image_GetOptionInt(*args, **kwargs) | |
3219 | ||
3220 | def HasOption(*args, **kwargs): | |
3221 | """ | |
3222 | HasOption(self, String name) -> bool | |
3223 | ||
3224 | Returns true if the given option is present. | |
3225 | """ | |
3226 | return _core_.Image_HasOption(*args, **kwargs) | |
3227 | ||
3228 | def CountColours(*args, **kwargs): | |
3229 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" | |
3230 | return _core_.Image_CountColours(*args, **kwargs) | |
3231 | ||
3232 | def ComputeHistogram(*args, **kwargs): | |
3233 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" | |
3234 | return _core_.Image_ComputeHistogram(*args, **kwargs) | |
3235 | ||
3236 | def AddHandler(*args, **kwargs): | |
3237 | """AddHandler(ImageHandler handler)""" | |
3238 | return _core_.Image_AddHandler(*args, **kwargs) | |
3239 | ||
3240 | AddHandler = staticmethod(AddHandler) | |
3241 | def InsertHandler(*args, **kwargs): | |
3242 | """InsertHandler(ImageHandler handler)""" | |
3243 | return _core_.Image_InsertHandler(*args, **kwargs) | |
3244 | ||
3245 | InsertHandler = staticmethod(InsertHandler) | |
3246 | def RemoveHandler(*args, **kwargs): | |
3247 | """RemoveHandler(String name) -> bool""" | |
3248 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
3249 | ||
3250 | RemoveHandler = staticmethod(RemoveHandler) | |
3251 | def GetHandlers(*args, **kwargs): | |
3252 | """GetHandlers() -> PyObject""" | |
3253 | return _core_.Image_GetHandlers(*args, **kwargs) | |
3254 | ||
3255 | GetHandlers = staticmethod(GetHandlers) | |
3256 | def GetImageExtWildcard(*args, **kwargs): | |
3257 | """ | |
3258 | GetImageExtWildcard() -> String | |
3259 | ||
3260 | Iterates all registered wxImageHandler objects, and returns a string | |
3261 | containing file extension masks suitable for passing to file open/save | |
3262 | dialog boxes. | |
3263 | """ | |
3264 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) | |
3265 | ||
3266 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
3267 | def ConvertToBitmap(*args, **kwargs): | |
3268 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" | |
3269 | return _core_.Image_ConvertToBitmap(*args, **kwargs) | |
3270 | ||
3271 | def ConvertToMonoBitmap(*args, **kwargs): | |
3272 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" | |
3273 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) | |
3274 | ||
3275 | def RotateHue(*args, **kwargs): | |
3276 | """ | |
3277 | RotateHue(self, double angle) | |
3278 | ||
3279 | Rotates the hue of each pixel of the image. Hue is a double in the | |
3280 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
3281 | """ | |
3282 | return _core_.Image_RotateHue(*args, **kwargs) | |
3283 | ||
3284 | def RGBtoHSV(*args, **kwargs): | |
3285 | """ | |
3286 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
3287 | ||
3288 | Converts a color in RGB color space to HSV color space. | |
3289 | """ | |
3290 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
3291 | ||
3292 | RGBtoHSV = staticmethod(RGBtoHSV) | |
3293 | def HSVtoRGB(*args, **kwargs): | |
3294 | """ | |
3295 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
3296 | ||
3297 | Converts a color in HSV color space to RGB color space. | |
3298 | """ | |
3299 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
3300 | ||
3301 | HSVtoRGB = staticmethod(HSVtoRGB) | |
3302 | def __nonzero__(self): return self.IsOk() | |
3303 | AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`") | |
3304 | AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`") | |
3305 | Data = property(GetData,SetData,doc="See `GetData` and `SetData`") | |
3306 | DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`") | |
3307 | Height = property(GetHeight,doc="See `GetHeight`") | |
3308 | MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`") | |
3309 | MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`") | |
3310 | MaskRed = property(GetMaskRed,doc="See `GetMaskRed`") | |
3311 | Width = property(GetWidth,doc="See `GetWidth`") | |
3312 | _core_.Image_swigregister(Image) | |
3313 | ||
3314 | def ImageFromMime(*args, **kwargs): | |
3315 | """ | |
3316 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
3317 | ||
3318 | Loads an image from a file, using a MIME type string (such as | |
3319 | 'image/jpeg') to specify image type. | |
3320 | """ | |
3321 | val = _core_.new_ImageFromMime(*args, **kwargs) | |
3322 | return val | |
3323 | ||
3324 | def ImageFromStream(*args, **kwargs): | |
3325 | """ | |
3326 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
3327 | ||
3328 | Loads an image from an input stream, or any readable Python file-like | |
3329 | object. | |
3330 | """ | |
3331 | val = _core_.new_ImageFromStream(*args, **kwargs) | |
3332 | return val | |
3333 | ||
3334 | def ImageFromStreamMime(*args, **kwargs): | |
3335 | """ | |
3336 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
3337 | ||
3338 | Loads an image from an input stream, or any readable Python file-like | |
3339 | object, specifying the image format with a MIME type string. | |
3340 | """ | |
3341 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) | |
3342 | return val | |
3343 | ||
3344 | def EmptyImage(*args, **kwargs): | |
3345 | """ | |
3346 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
3347 | ||
3348 | Construct an empty image of a given size, optionally setting all | |
3349 | pixels to black. | |
3350 | """ | |
3351 | val = _core_.new_EmptyImage(*args, **kwargs) | |
3352 | return val | |
3353 | ||
3354 | def ImageFromBitmap(*args, **kwargs): | |
3355 | """ | |
3356 | ImageFromBitmap(Bitmap bitmap) -> Image | |
3357 | ||
3358 | Construct an Image from a `wx.Bitmap`. | |
3359 | """ | |
3360 | val = _core_.new_ImageFromBitmap(*args, **kwargs) | |
3361 | return val | |
3362 | ||
3363 | def ImageFromData(*args, **kwargs): | |
3364 | """ | |
3365 | ImageFromData(int width, int height, buffer data) -> Image | |
3366 | ||
3367 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
3368 | string or a buffer object holding the data and the length of the data | |
3369 | must be width*height*3. | |
3370 | """ | |
3371 | val = _core_.new_ImageFromData(*args, **kwargs) | |
3372 | return val | |
3373 | ||
3374 | def ImageFromDataWithAlpha(*args, **kwargs): | |
3375 | """ | |
3376 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
3377 | ||
3378 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
3379 | Accepts either a string or a buffer object holding the data and the | |
3380 | length of the data must be width*height*3 bytes, and the length of the | |
3381 | alpha data must be width*height bytes. | |
3382 | """ | |
3383 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) | |
3384 | return val | |
3385 | ||
3386 | def Image_CanRead(*args, **kwargs): | |
3387 | """ | |
3388 | Image_CanRead(String filename) -> bool | |
3389 | ||
3390 | Returns True if the image handlers can read this file. | |
3391 | """ | |
3392 | return _core_.Image_CanRead(*args, **kwargs) | |
3393 | ||
3394 | def Image_GetImageCount(*args, **kwargs): | |
3395 | """ | |
3396 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
3397 | ||
3398 | If the image file contains more than one image and the image handler | |
3399 | is capable of retrieving these individually, this function will return | |
3400 | the number of available images. | |
3401 | """ | |
3402 | return _core_.Image_GetImageCount(*args, **kwargs) | |
3403 | ||
3404 | def Image_CanReadStream(*args, **kwargs): | |
3405 | """ | |
3406 | Image_CanReadStream(InputStream stream) -> bool | |
3407 | ||
3408 | Returns True if the image handlers can read an image file from the | |
3409 | data currently on the input stream, or a readable Python file-like | |
3410 | object. | |
3411 | """ | |
3412 | return _core_.Image_CanReadStream(*args, **kwargs) | |
3413 | ||
3414 | def Image_AddHandler(*args, **kwargs): | |
3415 | """Image_AddHandler(ImageHandler handler)""" | |
3416 | return _core_.Image_AddHandler(*args, **kwargs) | |
3417 | ||
3418 | def Image_InsertHandler(*args, **kwargs): | |
3419 | """Image_InsertHandler(ImageHandler handler)""" | |
3420 | return _core_.Image_InsertHandler(*args, **kwargs) | |
3421 | ||
3422 | def Image_RemoveHandler(*args, **kwargs): | |
3423 | """Image_RemoveHandler(String name) -> bool""" | |
3424 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
3425 | ||
3426 | def Image_GetHandlers(*args): | |
3427 | """Image_GetHandlers() -> PyObject""" | |
3428 | return _core_.Image_GetHandlers(*args) | |
3429 | ||
3430 | def Image_GetImageExtWildcard(*args): | |
3431 | """ | |
3432 | Image_GetImageExtWildcard() -> String | |
3433 | ||
3434 | Iterates all registered wxImageHandler objects, and returns a string | |
3435 | containing file extension masks suitable for passing to file open/save | |
3436 | dialog boxes. | |
3437 | """ | |
3438 | return _core_.Image_GetImageExtWildcard(*args) | |
3439 | ||
3440 | def Image_RGBtoHSV(*args, **kwargs): | |
3441 | """ | |
3442 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
3443 | ||
3444 | Converts a color in RGB color space to HSV color space. | |
3445 | """ | |
3446 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
3447 | ||
3448 | def Image_HSVtoRGB(*args, **kwargs): | |
3449 | """ | |
3450 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
3451 | ||
3452 | Converts a color in HSV color space to RGB color space. | |
3453 | """ | |
3454 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
3455 | ||
3456 | ||
3457 | def _ImageFromBuffer(*args, **kwargs): | |
3458 | """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image""" | |
3459 | return _core_._ImageFromBuffer(*args, **kwargs) | |
3460 | def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None): | |
3461 | """ | |
3462 | Creates a `wx.Image` from the data in dataBuffer. The dataBuffer | |
3463 | parameter must be a Python object that implements the buffer interface, | |
3464 | such as a string, array, etc. The dataBuffer object is expected to | |
3465 | contain a series of RGB bytes and be width*height*3 bytes long. A buffer | |
3466 | object can optionally be supplied for the image's alpha channel data, and | |
3467 | it is expected to be width*height bytes long. | |
3468 | ||
3469 | The wx.Image will be created with its data and alpha pointers initialized | |
3470 | to the memory address pointed to by the buffer objects, thus saving the | |
3471 | time needed to copy the image data from the buffer object to the wx.Image. | |
3472 | While this has advantages, it also has the shoot-yourself-in-the-foot | |
3473 | risks associated with sharing a C pointer between two objects. | |
3474 | ||
3475 | To help alleviate the risk a reference to the data and alpha buffer | |
3476 | objects are kept with the wx.Image, so that they won't get deleted until | |
3477 | after the wx.Image is deleted. However please be aware that it is not | |
3478 | guaranteed that an object won't move its memory buffer to a new location | |
3479 | when it needs to resize its contents. If that happens then the wx.Image | |
3480 | will end up referring to an invalid memory location and could cause the | |
3481 | application to crash. Therefore care should be taken to not manipulate | |
3482 | the objects used for the data and alpha buffers in a way that would cause | |
3483 | them to change size. | |
3484 | """ | |
3485 | image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer) | |
3486 | image._buffer = dataBuffer | |
3487 | image._alpha = alphaBuffer | |
3488 | return image | |
3489 | ||
3490 | def InitAllImageHandlers(): | |
3491 | """ | |
3492 | The former functionality of InitAllImageHanders is now done internal to | |
3493 | the _core_ extension module and so this function has become a simple NOP. | |
3494 | """ | |
3495 | pass | |
3496 | ||
3497 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES | |
3498 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
3499 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR | |
3500 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3501 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
3502 | BMP_24BPP = _core_.BMP_24BPP | |
3503 | BMP_8BPP = _core_.BMP_8BPP | |
3504 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3505 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3506 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3507 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3508 | BMP_4BPP = _core_.BMP_4BPP | |
3509 | BMP_1BPP = _core_.BMP_1BPP | |
3510 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
3511 | class BMPHandler(ImageHandler): | |
3512 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" | |
3513 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3514 | __repr__ = _swig_repr | |
3515 | def __init__(self, *args, **kwargs): | |
3516 | """ | |
3517 | __init__(self) -> BMPHandler | |
3518 | ||
3519 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3520 | """ | |
3521 | _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs)) | |
3522 | _core_.BMPHandler_swigregister(BMPHandler) | |
3523 | NullImage = cvar.NullImage | |
3524 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME | |
3525 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT | |
3526 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3527 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3528 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
3529 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX | |
3530 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
3531 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT | |
3532 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY | |
3533 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE | |
3534 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3535 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3536 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
3537 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT | |
3538 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
3539 | ||
3540 | class ICOHandler(BMPHandler): | |
3541 | """A `wx.ImageHandler` for \*.ico icon files.""" | |
3542 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3543 | __repr__ = _swig_repr | |
3544 | def __init__(self, *args, **kwargs): | |
3545 | """ | |
3546 | __init__(self) -> ICOHandler | |
3547 | ||
3548 | A `wx.ImageHandler` for \*.ico icon files. | |
3549 | """ | |
3550 | _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs)) | |
3551 | _core_.ICOHandler_swigregister(ICOHandler) | |
3552 | ||
3553 | class CURHandler(ICOHandler): | |
3554 | """A `wx.ImageHandler` for \*.cur cursor files.""" | |
3555 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3556 | __repr__ = _swig_repr | |
3557 | def __init__(self, *args, **kwargs): | |
3558 | """ | |
3559 | __init__(self) -> CURHandler | |
3560 | ||
3561 | A `wx.ImageHandler` for \*.cur cursor files. | |
3562 | """ | |
3563 | _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs)) | |
3564 | _core_.CURHandler_swigregister(CURHandler) | |
3565 | ||
3566 | class ANIHandler(CURHandler): | |
3567 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" | |
3568 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3569 | __repr__ = _swig_repr | |
3570 | def __init__(self, *args, **kwargs): | |
3571 | """ | |
3572 | __init__(self) -> ANIHandler | |
3573 | ||
3574 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3575 | """ | |
3576 | _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs)) | |
3577 | _core_.ANIHandler_swigregister(ANIHandler) | |
3578 | ||
3579 | class PNGHandler(ImageHandler): | |
3580 | """A `wx.ImageHandler` for PNG image files.""" | |
3581 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3582 | __repr__ = _swig_repr | |
3583 | def __init__(self, *args, **kwargs): | |
3584 | """ | |
3585 | __init__(self) -> PNGHandler | |
3586 | ||
3587 | A `wx.ImageHandler` for PNG image files. | |
3588 | """ | |
3589 | _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs)) | |
3590 | _core_.PNGHandler_swigregister(PNGHandler) | |
3591 | ||
3592 | class GIFHandler(ImageHandler): | |
3593 | """A `wx.ImageHandler` for GIF image files.""" | |
3594 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3595 | __repr__ = _swig_repr | |
3596 | def __init__(self, *args, **kwargs): | |
3597 | """ | |
3598 | __init__(self) -> GIFHandler | |
3599 | ||
3600 | A `wx.ImageHandler` for GIF image files. | |
3601 | """ | |
3602 | _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs)) | |
3603 | _core_.GIFHandler_swigregister(GIFHandler) | |
3604 | ||
3605 | class PCXHandler(ImageHandler): | |
3606 | """A `wx.ImageHandler` for PCX imager files.""" | |
3607 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3608 | __repr__ = _swig_repr | |
3609 | def __init__(self, *args, **kwargs): | |
3610 | """ | |
3611 | __init__(self) -> PCXHandler | |
3612 | ||
3613 | A `wx.ImageHandler` for PCX imager files. | |
3614 | """ | |
3615 | _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs)) | |
3616 | _core_.PCXHandler_swigregister(PCXHandler) | |
3617 | ||
3618 | class JPEGHandler(ImageHandler): | |
3619 | """A `wx.ImageHandler` for JPEG/JPG image files.""" | |
3620 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3621 | __repr__ = _swig_repr | |
3622 | def __init__(self, *args, **kwargs): | |
3623 | """ | |
3624 | __init__(self) -> JPEGHandler | |
3625 | ||
3626 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3627 | """ | |
3628 | _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs)) | |
3629 | _core_.JPEGHandler_swigregister(JPEGHandler) | |
3630 | ||
3631 | class PNMHandler(ImageHandler): | |
3632 | """A `wx.ImageHandler` for PNM image files.""" | |
3633 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3634 | __repr__ = _swig_repr | |
3635 | def __init__(self, *args, **kwargs): | |
3636 | """ | |
3637 | __init__(self) -> PNMHandler | |
3638 | ||
3639 | A `wx.ImageHandler` for PNM image files. | |
3640 | """ | |
3641 | _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs)) | |
3642 | _core_.PNMHandler_swigregister(PNMHandler) | |
3643 | ||
3644 | class XPMHandler(ImageHandler): | |
3645 | """A `wx.ImageHandler` for XPM image.""" | |
3646 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3647 | __repr__ = _swig_repr | |
3648 | def __init__(self, *args, **kwargs): | |
3649 | """ | |
3650 | __init__(self) -> XPMHandler | |
3651 | ||
3652 | A `wx.ImageHandler` for XPM image. | |
3653 | """ | |
3654 | _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs)) | |
3655 | _core_.XPMHandler_swigregister(XPMHandler) | |
3656 | ||
3657 | class TIFFHandler(ImageHandler): | |
3658 | """A `wx.ImageHandler` for TIFF image files.""" | |
3659 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3660 | __repr__ = _swig_repr | |
3661 | def __init__(self, *args, **kwargs): | |
3662 | """ | |
3663 | __init__(self) -> TIFFHandler | |
3664 | ||
3665 | A `wx.ImageHandler` for TIFF image files. | |
3666 | """ | |
3667 | _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs)) | |
3668 | _core_.TIFFHandler_swigregister(TIFFHandler) | |
3669 | ||
3670 | class TGAHandler(ImageHandler): | |
3671 | """A `wx.ImageHandler` for TGA image files.""" | |
3672 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3673 | __repr__ = _swig_repr | |
3674 | def __init__(self, *args, **kwargs): | |
3675 | """ | |
3676 | __init__(self) -> TGAHandler | |
3677 | ||
3678 | A `wx.ImageHandler` for TGA image files. | |
3679 | """ | |
3680 | _core_.TGAHandler_swiginit(self,_core_.new_TGAHandler(*args, **kwargs)) | |
3681 | _core_.TGAHandler_swigregister(TGAHandler) | |
3682 | ||
3683 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS | |
3684 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3685 | class Quantize(object): | |
3686 | """Performs quantization, or colour reduction, on a wxImage.""" | |
3687 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3688 | def __init__(self): raise AttributeError, "No constructor defined" | |
3689 | __repr__ = _swig_repr | |
3690 | def Quantize(*args, **kwargs): | |
3691 | """ | |
3692 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3693 | ||
3694 | Reduce the colours in the source image and put the result into the | |
3695 | destination image, setting the palette in the destination if | |
3696 | needed. Both images may be the same, to overwrite the source image. | |
3697 | """ | |
3698 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3699 | ||
3700 | Quantize = staticmethod(Quantize) | |
3701 | _core_.Quantize_swigregister(Quantize) | |
3702 | ||
3703 | def Quantize_Quantize(*args, **kwargs): | |
3704 | """ | |
3705 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3706 | ||
3707 | Reduce the colours in the source image and put the result into the | |
3708 | destination image, setting the palette in the destination if | |
3709 | needed. Both images may be the same, to overwrite the source image. | |
3710 | """ | |
3711 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3712 | ||
3713 | #--------------------------------------------------------------------------- | |
3714 | ||
3715 | class EvtHandler(Object): | |
3716 | """Proxy of C++ EvtHandler class""" | |
3717 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3718 | __repr__ = _swig_repr | |
3719 | def __init__(self, *args, **kwargs): | |
3720 | """__init__(self) -> EvtHandler""" | |
3721 | _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs)) | |
3722 | self._setOORInfo(self) | |
3723 | ||
3724 | def GetNextHandler(*args, **kwargs): | |
3725 | """GetNextHandler(self) -> EvtHandler""" | |
3726 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) | |
3727 | ||
3728 | def GetPreviousHandler(*args, **kwargs): | |
3729 | """GetPreviousHandler(self) -> EvtHandler""" | |
3730 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) | |
3731 | ||
3732 | def SetNextHandler(*args, **kwargs): | |
3733 | """SetNextHandler(self, EvtHandler handler)""" | |
3734 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) | |
3735 | ||
3736 | def SetPreviousHandler(*args, **kwargs): | |
3737 | """SetPreviousHandler(self, EvtHandler handler)""" | |
3738 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) | |
3739 | ||
3740 | def GetEvtHandlerEnabled(*args, **kwargs): | |
3741 | """GetEvtHandlerEnabled(self) -> bool""" | |
3742 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) | |
3743 | ||
3744 | def SetEvtHandlerEnabled(*args, **kwargs): | |
3745 | """SetEvtHandlerEnabled(self, bool enabled)""" | |
3746 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) | |
3747 | ||
3748 | def ProcessEvent(*args, **kwargs): | |
3749 | """ProcessEvent(self, Event event) -> bool""" | |
3750 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) | |
3751 | ||
3752 | def AddPendingEvent(*args, **kwargs): | |
3753 | """AddPendingEvent(self, Event event)""" | |
3754 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) | |
3755 | ||
3756 | def ProcessPendingEvents(*args, **kwargs): | |
3757 | """ProcessPendingEvents(self)""" | |
3758 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) | |
3759 | ||
3760 | def Connect(*args, **kwargs): | |
3761 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" | |
3762 | return _core_.EvtHandler_Connect(*args, **kwargs) | |
3763 | ||
3764 | def Disconnect(*args, **kwargs): | |
3765 | """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool""" | |
3766 | return _core_.EvtHandler_Disconnect(*args, **kwargs) | |
3767 | ||
3768 | def _setOORInfo(*args, **kwargs): | |
3769 | """_setOORInfo(self, PyObject _self, bool incref=True)""" | |
3770 | val = _core_.EvtHandler__setOORInfo(*args, **kwargs) | |
3771 | args[0].this.own(False) | |
3772 | return val | |
3773 | ||
3774 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): | |
3775 | """ | |
3776 | Bind an event to an event handler. | |
3777 | ||
3778 | :param event: One of the EVT_* objects that specifies the | |
3779 | type of event to bind, | |
3780 | ||
3781 | :param handler: A callable object to be invoked when the | |
3782 | event is delivered to self. Pass None to | |
3783 | disconnect an event handler. | |
3784 | ||
3785 | :param source: Sometimes the event originates from a | |
3786 | different window than self, but you still | |
3787 | want to catch it in self. (For example, a | |
3788 | button event delivered to a frame.) By | |
3789 | passing the source of the event, the event | |
3790 | handling system is able to differentiate | |
3791 | between the same event type from different | |
3792 | controls. | |
3793 | ||
3794 | :param id: Used to spcify the event source by ID instead | |
3795 | of instance. | |
3796 | ||
3797 | :param id2: Used when it is desirable to bind a handler | |
3798 | to a range of IDs, such as with EVT_MENU_RANGE. | |
3799 | """ | |
3800 | if source is not None: | |
3801 | id = source.GetId() | |
3802 | event.Bind(self, id, id2, handler) | |
3803 | ||
3804 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): | |
3805 | """ | |
3806 | Disconencts the event handler binding for event from self. | |
3807 | Returns True if successful. | |
3808 | """ | |
3809 | if source is not None: | |
3810 | id = source.GetId() | |
3811 | return event.Unbind(self, id, id2) | |
3812 | ||
3813 | EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`") | |
3814 | NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`") | |
3815 | PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`") | |
3816 | _core_.EvtHandler_swigregister(EvtHandler) | |
3817 | ||
3818 | #--------------------------------------------------------------------------- | |
3819 | ||
3820 | class PyEventBinder(object): | |
3821 | """ | |
3822 | Instances of this class are used to bind specific events to event | |
3823 | handlers. | |
3824 | """ | |
3825 | def __init__(self, evtType, expectedIDs=0): | |
3826 | if expectedIDs not in [0, 1, 2]: | |
3827 | raise ValueError, "Invalid number of expectedIDs" | |
3828 | self.expectedIDs = expectedIDs | |
3829 | ||
3830 | if type(evtType) == list or type(evtType) == tuple: | |
3831 | self.evtType = evtType | |
3832 | else: | |
3833 | self.evtType = [evtType] | |
3834 | ||
3835 | ||
3836 | def Bind(self, target, id1, id2, function): | |
3837 | """Bind this set of event types to target.""" | |
3838 | for et in self.evtType: | |
3839 | target.Connect(id1, id2, et, function) | |
3840 | ||
3841 | ||
3842 | def Unbind(self, target, id1, id2): | |
3843 | """Remove an event binding.""" | |
3844 | success = 0 | |
3845 | for et in self.evtType: | |
3846 | success += target.Disconnect(id1, id2, et) | |
3847 | return success != 0 | |
3848 | ||
3849 | def _getEvtType(self): | |
3850 | """ | |
3851 | Make it easy to get to the default wxEventType typeID for this | |
3852 | event binder. | |
3853 | """ | |
3854 | return self.evtType[0] | |
3855 | ||
3856 | typeId = property(_getEvtType) | |
3857 | ||
3858 | ||
3859 | def __call__(self, *args): | |
3860 | """ | |
3861 | For backwards compatibility with the old EVT_* functions. | |
3862 | Should be called with either (window, func), (window, ID, | |
3863 | func) or (window, ID1, ID2, func) parameters depending on the | |
3864 | type of the event. | |
3865 | """ | |
3866 | assert len(args) == 2 + self.expectedIDs | |
3867 | id1 = wx.ID_ANY | |
3868 | id2 = wx.ID_ANY | |
3869 | target = args[0] | |
3870 | if self.expectedIDs == 0: | |
3871 | func = args[1] | |
3872 | elif self.expectedIDs == 1: | |
3873 | id1 = args[1] | |
3874 | func = args[2] | |
3875 | elif self.expectedIDs == 2: | |
3876 | id1 = args[1] | |
3877 | id2 = args[2] | |
3878 | func = args[3] | |
3879 | else: | |
3880 | raise ValueError, "Unexpected number of IDs" | |
3881 | ||
3882 | self.Bind(target, id1, id2, func) | |
3883 | ||
3884 | ||
3885 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3886 | def EVT_COMMAND(win, id, cmd, func): | |
3887 | win.Connect(id, -1, cmd, func) | |
3888 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3889 | win.Connect(id1, id2, cmd, func) | |
3890 | ||
3891 | ||
3892 | #--------------------------------------------------------------------------- | |
3893 | ||
3894 | #--------------------------------------------------------------------------- | |
3895 | ||
3896 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE | |
3897 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
3898 | ||
3899 | def NewEventType(*args): | |
3900 | """NewEventType() -> EventType""" | |
3901 | return _core_.NewEventType(*args) | |
3902 | wxEVT_ANY = _core_.wxEVT_ANY | |
3903 | wxEVT_NULL = _core_.wxEVT_NULL | |
3904 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3905 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3906 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3907 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3908 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3909 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3910 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3911 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3912 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3913 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3914 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3915 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3916 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3917 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3918 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3919 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3920 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3921 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3922 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3923 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3924 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3925 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3926 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3927 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3928 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3929 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3930 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3931 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3932 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3933 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3934 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3935 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3936 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3937 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3938 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3939 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3940 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3941 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3942 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3943 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3944 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3945 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3946 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3947 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3948 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3949 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3950 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3951 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3952 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3953 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3954 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3955 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3956 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3957 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3958 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3959 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3960 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3961 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3962 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3963 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3964 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
3965 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED | |
3966 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
3967 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP | |
3968 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3969 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3970 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3971 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3972 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3973 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3974 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3975 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3976 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3977 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3978 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3979 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3980 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
3981 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE | |
3982 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3983 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3984 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3985 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3986 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3987 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
3988 | wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST | |
3989 | wxEVT_PAINT = _core_.wxEVT_PAINT | |
3990 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3991 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3992 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3993 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3994 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3995 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3996 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3997 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3998 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3999 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
4000 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
4001 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
4002 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
4003 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
4004 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
4005 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
4006 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
4007 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
4008 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
4009 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
4010 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
4011 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE | |
4012 | wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY | |
4013 | wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT | |
4014 | wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE | |
4015 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK | |
4016 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
4017 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
4018 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
4019 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
4020 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
4021 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
4022 | # | |
4023 | # Create some event binders | |
4024 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
4025 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
4026 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
4027 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
4028 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
4029 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
4030 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
4031 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
4032 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
4033 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
4034 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
4035 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
4036 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
4037 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) | |
4038 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) | |
4039 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
4040 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
4041 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
4042 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
4043 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
4044 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
4045 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
4046 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
4047 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
4048 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) | |
4049 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
4050 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
4051 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
4052 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
4053 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
4054 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
4055 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
4056 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
4057 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
4058 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
4059 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
4060 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
4061 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
4062 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
4063 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
4064 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
4065 | EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST ) | |
4066 | ||
4067 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
4068 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
4069 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
4070 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
4071 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
4072 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
4073 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
4074 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
4075 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
4076 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
4077 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
4078 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
4079 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
4080 | ||
4081 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
4082 | wxEVT_LEFT_UP, | |
4083 | wxEVT_MIDDLE_DOWN, | |
4084 | wxEVT_MIDDLE_UP, | |
4085 | wxEVT_RIGHT_DOWN, | |
4086 | wxEVT_RIGHT_UP, | |
4087 | wxEVT_MOTION, | |
4088 | wxEVT_LEFT_DCLICK, | |
4089 | wxEVT_MIDDLE_DCLICK, | |
4090 | wxEVT_RIGHT_DCLICK, | |
4091 | wxEVT_ENTER_WINDOW, | |
4092 | wxEVT_LEAVE_WINDOW, | |
4093 | wxEVT_MOUSEWHEEL | |
4094 | ]) | |
4095 | ||
4096 | ||
4097 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
4098 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, | |
4099 | wxEVT_SCROLLWIN_BOTTOM, | |
4100 | wxEVT_SCROLLWIN_LINEUP, | |
4101 | wxEVT_SCROLLWIN_LINEDOWN, | |
4102 | wxEVT_SCROLLWIN_PAGEUP, | |
4103 | wxEVT_SCROLLWIN_PAGEDOWN, | |
4104 | wxEVT_SCROLLWIN_THUMBTRACK, | |
4105 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
4106 | ]) | |
4107 | ||
4108 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
4109 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
4110 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
4111 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
4112 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
4113 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
4114 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
4115 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
4116 | ||
4117 | # Scrolling from wx.Slider and wx.ScrollBar | |
4118 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, | |
4119 | wxEVT_SCROLL_BOTTOM, | |
4120 | wxEVT_SCROLL_LINEUP, | |
4121 | wxEVT_SCROLL_LINEDOWN, | |
4122 | wxEVT_SCROLL_PAGEUP, | |
4123 | wxEVT_SCROLL_PAGEDOWN, | |
4124 | wxEVT_SCROLL_THUMBTRACK, | |
4125 | wxEVT_SCROLL_THUMBRELEASE, | |
4126 | wxEVT_SCROLL_CHANGED, | |
4127 | ]) | |
4128 | ||
4129 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
4130 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
4131 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
4132 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
4133 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
4134 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
4135 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
4136 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4137 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) | |
4138 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
4139 | ||
4140 | # Scrolling from wx.Slider and wx.ScrollBar, with an id | |
4141 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, | |
4142 | wxEVT_SCROLL_BOTTOM, | |
4143 | wxEVT_SCROLL_LINEUP, | |
4144 | wxEVT_SCROLL_LINEDOWN, | |
4145 | wxEVT_SCROLL_PAGEUP, | |
4146 | wxEVT_SCROLL_PAGEDOWN, | |
4147 | wxEVT_SCROLL_THUMBTRACK, | |
4148 | wxEVT_SCROLL_THUMBRELEASE, | |
4149 | wxEVT_SCROLL_CHANGED, | |
4150 | ], 1) | |
4151 | ||
4152 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
4153 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
4154 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
4155 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
4156 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
4157 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
4158 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
4159 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4160 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) | |
4161 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
4162 | ||
4163 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) | |
4164 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
4165 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
4166 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
4167 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
4168 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
4169 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
4170 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
4171 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
4172 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
4173 | ||
4174 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
4175 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
4176 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
4177 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
4178 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
4179 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
4180 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
4181 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
4182 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
4183 | ||
4184 | ||
4185 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
4186 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
4187 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
4188 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
4189 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
4190 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
4191 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
4192 | ||
4193 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
4194 | ||
4195 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
4196 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
4197 | ||
4198 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
4199 | ||
4200 | EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT ) | |
4201 | EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY ) | |
4202 | EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE ) | |
4203 | ||
4204 | ||
4205 | #--------------------------------------------------------------------------- | |
4206 | ||
4207 | class Event(Object): | |
4208 | """ | |
4209 | An event is a structure holding information about an event passed to a | |
4210 | callback or member function. wx.Event is an abstract base class for | |
4211 | other event classes | |
4212 | """ | |
4213 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
4214 | def __init__(self): raise AttributeError, "No constructor defined" | |
4215 | __repr__ = _swig_repr | |
4216 | __swig_destroy__ = _core_.delete_Event | |
4217 | __del__ = lambda self : None; | |
4218 | def SetEventType(*args, **kwargs): | |
4219 | """ | |
4220 | SetEventType(self, EventType typ) | |
4221 | ||
4222 | Sets the specific type of the event. | |
4223 | """ | |
4224 | return _core_.Event_SetEventType(*args, **kwargs) | |
4225 | ||
4226 | def GetEventType(*args, **kwargs): | |
4227 | """ | |
4228 | GetEventType(self) -> EventType | |
4229 | ||
4230 | Returns the identifier of the given event type, such as | |
4231 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
4232 | """ | |
4233 | return _core_.Event_GetEventType(*args, **kwargs) | |
4234 | ||
4235 | def GetEventObject(*args, **kwargs): | |
4236 | """ | |
4237 | GetEventObject(self) -> Object | |
4238 | ||
4239 | Returns the object (usually a window) associated with the event, if | |
4240 | any. | |
4241 | """ | |
4242 | return _core_.Event_GetEventObject(*args, **kwargs) | |
4243 | ||
4244 | def SetEventObject(*args, **kwargs): | |
4245 | """ | |
4246 | SetEventObject(self, Object obj) | |
4247 | ||
4248 | Sets the originating object, or in other words, obj is normally the | |
4249 | object that is sending the event. | |
4250 | """ | |
4251 | return _core_.Event_SetEventObject(*args, **kwargs) | |
4252 | ||
4253 | def GetTimestamp(*args, **kwargs): | |
4254 | """GetTimestamp(self) -> long""" | |
4255 | return _core_.Event_GetTimestamp(*args, **kwargs) | |
4256 | ||
4257 | def SetTimestamp(*args, **kwargs): | |
4258 | """SetTimestamp(self, long ts=0)""" | |
4259 | return _core_.Event_SetTimestamp(*args, **kwargs) | |
4260 | ||
4261 | def GetId(*args, **kwargs): | |
4262 | """ | |
4263 | GetId(self) -> int | |
4264 | ||
4265 | Returns the identifier associated with this event, such as a button | |
4266 | command id. | |
4267 | """ | |
4268 | return _core_.Event_GetId(*args, **kwargs) | |
4269 | ||
4270 | def SetId(*args, **kwargs): | |
4271 | """ | |
4272 | SetId(self, int Id) | |
4273 | ||
4274 | Set's the ID for the event. This is usually the ID of the window that | |
4275 | is sending the event, but it can also be a command id from a menu | |
4276 | item, etc. | |
4277 | """ | |
4278 | return _core_.Event_SetId(*args, **kwargs) | |
4279 | ||
4280 | def IsCommandEvent(*args, **kwargs): | |
4281 | """ | |
4282 | IsCommandEvent(self) -> bool | |
4283 | ||
4284 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
4285 | it returns false. Note: Exists only for optimization purposes. | |
4286 | """ | |
4287 | return _core_.Event_IsCommandEvent(*args, **kwargs) | |
4288 | ||
4289 | def Skip(*args, **kwargs): | |
4290 | """ | |
4291 | Skip(self, bool skip=True) | |
4292 | ||
4293 | This method can be used inside an event handler to control whether | |
4294 | further event handlers bound to this event will be called after the | |
4295 | current one returns. Without Skip() (or equivalently if Skip(False) is | |
4296 | used), the event will not be processed any more. If Skip(True) is | |
4297 | called, the event processing system continues searching for a further | |
4298 | handler function for this event, even though it has been processed | |
4299 | already in the current handler. | |
4300 | """ | |
4301 | return _core_.Event_Skip(*args, **kwargs) | |
4302 | ||
4303 | def GetSkipped(*args, **kwargs): | |
4304 | """ | |
4305 | GetSkipped(self) -> bool | |
4306 | ||
4307 | Returns true if the event handler should be skipped, false otherwise. | |
4308 | :see: `Skip` | |
4309 | """ | |
4310 | return _core_.Event_GetSkipped(*args, **kwargs) | |
4311 | ||
4312 | def ShouldPropagate(*args, **kwargs): | |
4313 | """ | |
4314 | ShouldPropagate(self) -> bool | |
4315 | ||
4316 | Test if this event should be propagated to the parent window or not, | |
4317 | i.e. if the propagation level is currently greater than 0. | |
4318 | """ | |
4319 | return _core_.Event_ShouldPropagate(*args, **kwargs) | |
4320 | ||
4321 | def StopPropagation(*args, **kwargs): | |
4322 | """ | |
4323 | StopPropagation(self) -> int | |
4324 | ||
4325 | Stop the event from propagating to its parent window. Returns the old | |
4326 | propagation level value which may be later passed to | |
4327 | `ResumePropagation` to allow propagating the event again. | |
4328 | """ | |
4329 | return _core_.Event_StopPropagation(*args, **kwargs) | |
4330 | ||
4331 | def ResumePropagation(*args, **kwargs): | |
4332 | """ | |
4333 | ResumePropagation(self, int propagationLevel) | |
4334 | ||
4335 | Resume the event propagation by restoring the propagation level. (For | |
4336 | example, you can use the value returned by an earlier call to | |
4337 | `StopPropagation`.) | |
4338 | ||
4339 | """ | |
4340 | return _core_.Event_ResumePropagation(*args, **kwargs) | |
4341 | ||
4342 | def Clone(*args, **kwargs): | |
4343 | """Clone(self) -> Event""" | |
4344 | return _core_.Event_Clone(*args, **kwargs) | |
4345 | ||
4346 | EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`") | |
4347 | EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`") | |
4348 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
4349 | Skipped = property(GetSkipped,doc="See `GetSkipped`") | |
4350 | Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`") | |
4351 | _core_.Event_swigregister(Event) | |
4352 | ||
4353 | #--------------------------------------------------------------------------- | |
4354 | ||
4355 | class PropagationDisabler(object): | |
4356 | """ | |
4357 | Helper class to temporarily change an event not to propagate. Simply | |
4358 | create an instance of this class and then whe it is destroyed the | |
4359 | propogation of the event will be restored. | |
4360 | """ | |
4361 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
4362 | __repr__ = _swig_repr | |
4363 | def __init__(self, *args, **kwargs): | |
4364 | """ | |
4365 | __init__(self, Event event) -> PropagationDisabler | |
4366 | ||
4367 | Helper class to temporarily change an event not to propagate. Simply | |
4368 | create an instance of this class and then whe it is destroyed the | |
4369 | propogation of the event will be restored. | |
4370 | """ | |
4371 | _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs)) | |
4372 | __swig_destroy__ = _core_.delete_PropagationDisabler | |
4373 | __del__ = lambda self : None; | |
4374 | _core_.PropagationDisabler_swigregister(PropagationDisabler) | |
4375 | ||
4376 | class PropagateOnce(object): | |
4377 | """ | |
4378 | A helper class that will temporarily lower propagation level of an | |
4379 | event. Simply create an instance of this class and then whe it is | |
4380 | destroyed the propogation of the event will be restored. | |
4381 | """ | |
4382 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
4383 | __repr__ = _swig_repr | |
4384 | def __init__(self, *args, **kwargs): | |
4385 | """ | |
4386 | __init__(self, Event event) -> PropagateOnce | |
4387 | ||
4388 | A helper class that will temporarily lower propagation level of an | |
4389 | event. Simply create an instance of this class and then whe it is | |
4390 | destroyed the propogation of the event will be restored. | |
4391 | """ | |
4392 | _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs)) | |
4393 | __swig_destroy__ = _core_.delete_PropagateOnce | |
4394 | __del__ = lambda self : None; | |
4395 | _core_.PropagateOnce_swigregister(PropagateOnce) | |
4396 | ||
4397 | #--------------------------------------------------------------------------- | |
4398 | ||
4399 | class CommandEvent(Event): | |
4400 | """ | |
4401 | This event class contains information about command events, which | |
4402 | originate from a variety of simple controls, as well as menus and | |
4403 | toolbars. | |
4404 | """ | |
4405 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
4406 | __repr__ = _swig_repr | |
4407 | def __init__(self, *args, **kwargs): | |
4408 | """ | |
4409 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent | |
4410 | ||
4411 | This event class contains information about command events, which | |
4412 | originate from a variety of simple controls, as well as menus and | |
4413 | toolbars. | |
4414 | """ | |
4415 | _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs)) | |
4416 | def GetSelection(*args, **kwargs): | |
4417 | """ | |
4418 | GetSelection(self) -> int | |
4419 | ||
4420 | Returns item index for a listbox or choice selection event (not valid | |
4421 | for a deselection). | |
4422 | """ | |
4423 | return _core_.CommandEvent_GetSelection(*args, **kwargs) | |
4424 | ||
4425 | def SetString(*args, **kwargs): | |
4426 | """SetString(self, String s)""" | |
4427 | return _core_.CommandEvent_SetString(*args, **kwargs) | |
4428 | ||
4429 | def GetString(*args, **kwargs): | |
4430 | """ | |
4431 | GetString(self) -> String | |
4432 | ||
4433 | Returns item string for a listbox or choice selection event (not valid | |
4434 | for a deselection). | |
4435 | """ | |
4436 | return _core_.CommandEvent_GetString(*args, **kwargs) | |
4437 | ||
4438 | def IsChecked(*args, **kwargs): | |
4439 | """ | |
4440 | IsChecked(self) -> bool | |
4441 | ||
4442 | This method can be used with checkbox and menu events: for the | |
4443 | checkboxes, the method returns true for a selection event and false | |
4444 | for a deselection one. For the menu events, this method indicates if | |
4445 | the menu item just has become checked or unchecked (and thus only | |
4446 | makes sense for checkable menu items). | |
4447 | """ | |
4448 | return _core_.CommandEvent_IsChecked(*args, **kwargs) | |
4449 | ||
4450 | Checked = IsChecked | |
4451 | def IsSelection(*args, **kwargs): | |
4452 | """ | |
4453 | IsSelection(self) -> bool | |
4454 | ||
4455 | For a listbox or similar event, returns true if it is a selection, | |
4456 | false if it is a deselection. | |
4457 | """ | |
4458 | return _core_.CommandEvent_IsSelection(*args, **kwargs) | |
4459 | ||
4460 | def SetExtraLong(*args, **kwargs): | |
4461 | """SetExtraLong(self, long extraLong)""" | |
4462 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) | |
4463 | ||
4464 | def GetExtraLong(*args, **kwargs): | |
4465 | """ | |
4466 | GetExtraLong(self) -> long | |
4467 | ||
4468 | Returns extra information dependant on the event objects type. If the | |
4469 | event comes from a listbox selection, it is a boolean determining | |
4470 | whether the event was a selection (true) or a deselection (false). A | |
4471 | listbox deselection only occurs for multiple-selection boxes, and in | |
4472 | this case the index and string values are indeterminate and the | |
4473 | listbox must be examined by the application. | |
4474 | """ | |
4475 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) | |
4476 | ||
4477 | def SetInt(*args, **kwargs): | |
4478 | """SetInt(self, int i)""" | |
4479 | return _core_.CommandEvent_SetInt(*args, **kwargs) | |
4480 | ||
4481 | def GetInt(*args, **kwargs): | |
4482 | """ | |
4483 | GetInt(self) -> int | |
4484 | ||
4485 | Returns the integer identifier corresponding to a listbox, choice or | |
4486 | radiobox selection (only if the event was a selection, not a | |
4487 | deselection), or a boolean value representing the value of a checkbox. | |
4488 | """ | |
4489 | return _core_.CommandEvent_GetInt(*args, **kwargs) | |
4490 | ||
4491 | def GetClientData(*args, **kwargs): | |
4492 | """ | |
4493 | GetClientData(self) -> PyObject | |
4494 | ||
4495 | Returns the client data object for a listbox or choice selection event, (if any.) | |
4496 | """ | |
4497 | return _core_.CommandEvent_GetClientData(*args, **kwargs) | |
4498 | ||
4499 | def SetClientData(*args, **kwargs): | |
4500 | """ | |
4501 | SetClientData(self, PyObject clientData) | |
4502 | ||
4503 | Associate the given client data with the item at position n. | |
4504 | """ | |
4505 | return _core_.CommandEvent_SetClientData(*args, **kwargs) | |
4506 | ||
4507 | GetClientObject = GetClientData | |
4508 | SetClientObject = SetClientData | |
4509 | ||
4510 | def Clone(*args, **kwargs): | |
4511 | """Clone(self) -> Event""" | |
4512 | return _core_.CommandEvent_Clone(*args, **kwargs) | |
4513 | ||
4514 | ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`") | |
4515 | ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`") | |
4516 | ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`") | |
4517 | Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`") | |
4518 | Selection = property(GetSelection,doc="See `GetSelection`") | |
4519 | String = property(GetString,SetString,doc="See `GetString` and `SetString`") | |
4520 | _core_.CommandEvent_swigregister(CommandEvent) | |
4521 | ||
4522 | #--------------------------------------------------------------------------- | |
4523 | ||
4524 | class NotifyEvent(CommandEvent): | |
4525 | """ | |
4526 | An instance of this class (or one of its derived classes) is sent from | |
4527 | a control when the control's state is being changed and the control | |
4528 | allows that change to be prevented from happening. The event handler | |
4529 | can call `Veto` or `Allow` to tell the control what to do. | |
4530 | """ | |
4531 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
4532 | __repr__ = _swig_repr | |
4533 | def __init__(self, *args, **kwargs): | |
4534 | """ | |
4535 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent | |
4536 | ||
4537 | An instance of this class (or one of its derived classes) is sent from | |
4538 | a control when the control's state is being changed and the control | |
4539 | allows that change to be prevented from happening. The event handler | |
4540 | can call `Veto` or `Allow` to tell the control what to do. | |
4541 | """ | |
4542 | _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs)) | |
4543 | def Veto(*args, **kwargs): | |
4544 | """ | |
4545 | Veto(self) | |
4546 | ||
4547 | Prevents the change announced by this event from happening. | |
4548 | ||
4549 | It is in general a good idea to notify the user about the reasons for | |
4550 | vetoing the change because otherwise the applications behaviour (which | |
4551 | just refuses to do what the user wants) might be quite surprising. | |
4552 | """ | |
4553 | return _core_.NotifyEvent_Veto(*args, **kwargs) | |
4554 | ||
4555 | def Allow(*args, **kwargs): | |
4556 | """ | |
4557 | Allow(self) | |
4558 | ||
4559 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4560 | processed. For most events it is not necessary to call this method as | |
4561 | the events are allowed anyhow but some are forbidden by default (this | |
4562 | will be mentioned in the corresponding event description). | |
4563 | """ | |
4564 | return _core_.NotifyEvent_Allow(*args, **kwargs) | |
4565 | ||
4566 | def IsAllowed(*args, **kwargs): | |
4567 | """ | |
4568 | IsAllowed(self) -> bool | |
4569 | ||
4570 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4571 | false otherwise (if it was). | |
4572 | """ | |
4573 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) | |
4574 | ||
4575 | _core_.NotifyEvent_swigregister(NotifyEvent) | |
4576 | ||
4577 | #--------------------------------------------------------------------------- | |
4578 | ||
4579 | class ScrollEvent(CommandEvent): | |
4580 | """ | |
4581 | A scroll event holds information about events sent from stand-alone | |
4582 | scrollbars and sliders. Note that scrolled windows do not send | |
4583 | instances of this event class, but send the `wx.ScrollWinEvent` | |
4584 | instead. | |
4585 | """ | |
4586 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
4587 | __repr__ = _swig_repr | |
4588 | def __init__(self, *args, **kwargs): | |
4589 | """ | |
4590 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0, | |
4591 | int orient=0) -> ScrollEvent | |
4592 | """ | |
4593 | _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs)) | |
4594 | def GetOrientation(*args, **kwargs): | |
4595 | """ | |
4596 | GetOrientation(self) -> int | |
4597 | ||
4598 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4599 | the scrollbar. | |
4600 | """ | |
4601 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) | |
4602 | ||
4603 | def GetPosition(*args, **kwargs): | |
4604 | """ | |
4605 | GetPosition(self) -> int | |
4606 | ||
4607 | Returns the position of the scrollbar. | |
4608 | """ | |
4609 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) | |
4610 | ||
4611 | def SetOrientation(*args, **kwargs): | |
4612 | """SetOrientation(self, int orient)""" | |
4613 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) | |
4614 | ||
4615 | def SetPosition(*args, **kwargs): | |
4616 | """SetPosition(self, int pos)""" | |
4617 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) | |
4618 | ||
4619 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") | |
4620 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
4621 | _core_.ScrollEvent_swigregister(ScrollEvent) | |
4622 | ||
4623 | #--------------------------------------------------------------------------- | |
4624 | ||
4625 | class ScrollWinEvent(Event): | |
4626 | """ | |
4627 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4628 | scrolling windows. | |
4629 | """ | |
4630 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
4631 | __repr__ = _swig_repr | |
4632 | def __init__(self, *args, **kwargs): | |
4633 | """ | |
4634 | __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent | |
4635 | ||
4636 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4637 | scrolling windows. | |
4638 | """ | |
4639 | _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs)) | |
4640 | def GetOrientation(*args, **kwargs): | |
4641 | """ | |
4642 | GetOrientation(self) -> int | |
4643 | ||
4644 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4645 | the scrollbar. | |
4646 | """ | |
4647 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) | |
4648 | ||
4649 | def GetPosition(*args, **kwargs): | |
4650 | """ | |
4651 | GetPosition(self) -> int | |
4652 | ||
4653 | Returns the position of the scrollbar for the thumb track and release | |
4654 | events. Note that this field can't be used for the other events, you | |
4655 | need to query the window itself for the current position in that case. | |
4656 | """ | |
4657 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) | |
4658 | ||
4659 | def SetOrientation(*args, **kwargs): | |
4660 | """SetOrientation(self, int orient)""" | |
4661 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) | |
4662 | ||
4663 | def SetPosition(*args, **kwargs): | |
4664 | """SetPosition(self, int pos)""" | |
4665 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) | |
4666 | ||
4667 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") | |
4668 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
4669 | _core_.ScrollWinEvent_swigregister(ScrollWinEvent) | |
4670 | ||
4671 | #--------------------------------------------------------------------------- | |
4672 | ||
4673 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY | |
4674 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4675 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4676 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4677 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
4678 | class MouseEvent(Event): | |
4679 | """ | |
4680 | This event class contains information about the events generated by | |
4681 | the mouse: they include mouse buttons press and release events and | |
4682 | mouse move events. | |
4683 | ||
4684 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4685 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4686 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4687 | a middle button so a portable application should avoid relying on the | |
4688 | events from it. | |
4689 | ||
4690 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4691 | the former returns true when the event corresponds to the left mouse | |
4692 | button click while the latter returns true if the left mouse button is | |
4693 | currently being pressed. For example, when the user is dragging the | |
4694 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4695 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4696 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4697 | underlying GUI behaviour is (which is platform-dependent). The same | |
4698 | applies, of course, to other mouse buttons as well. | |
4699 | """ | |
4700 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
4701 | __repr__ = _swig_repr | |
4702 | def __init__(self, *args, **kwargs): | |
4703 | """ | |
4704 | __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent | |
4705 | ||
4706 | Constructs a wx.MouseEvent. Valid event types are: | |
4707 | ||
4708 | * wxEVT_ENTER_WINDOW | |
4709 | * wxEVT_LEAVE_WINDOW | |
4710 | * wxEVT_LEFT_DOWN | |
4711 | * wxEVT_LEFT_UP | |
4712 | * wxEVT_LEFT_DCLICK | |
4713 | * wxEVT_MIDDLE_DOWN | |
4714 | * wxEVT_MIDDLE_UP | |
4715 | * wxEVT_MIDDLE_DCLICK | |
4716 | * wxEVT_RIGHT_DOWN | |
4717 | * wxEVT_RIGHT_UP | |
4718 | * wxEVT_RIGHT_DCLICK | |
4719 | * wxEVT_MOTION | |
4720 | * wxEVT_MOUSEWHEEL | |
4721 | """ | |
4722 | _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs)) | |
4723 | def IsButton(*args, **kwargs): | |
4724 | """ | |
4725 | IsButton(self) -> bool | |
4726 | ||
4727 | Returns true if the event was a mouse button event (not necessarily a | |
4728 | button down event - that may be tested using `ButtonDown`). | |
4729 | """ | |
4730 | return _core_.MouseEvent_IsButton(*args, **kwargs) | |
4731 | ||
4732 | def ButtonDown(*args, **kwargs): | |
4733 | """ | |
4734 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4735 | ||
4736 | If the argument is omitted, this returns true if the event was any | |
4737 | mouse button down event. Otherwise the argument specifies which | |
4738 | button-down event shold be checked for (see `Button` for the possible | |
4739 | values). | |
4740 | """ | |
4741 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) | |
4742 | ||
4743 | def ButtonDClick(*args, **kwargs): | |
4744 | """ | |
4745 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4746 | ||
4747 | If the argument is omitted, this returns true if the event was any | |
4748 | mouse double click event. Otherwise the argument specifies which | |
4749 | double click event to check for (see `Button` for the possible | |
4750 | values). | |
4751 | """ | |
4752 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) | |
4753 | ||
4754 | def ButtonUp(*args, **kwargs): | |
4755 | """ | |
4756 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4757 | ||
4758 | If the argument is omitted, this returns true if the event was any | |
4759 | mouse button up event. Otherwise the argument specifies which button | |
4760 | up event to check for (see `Button` for the possible values). | |
4761 | """ | |
4762 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) | |
4763 | ||
4764 | def Button(*args, **kwargs): | |
4765 | """ | |
4766 | Button(self, int button) -> bool | |
4767 | ||
4768 | Returns true if the identified mouse button is changing state. Valid | |
4769 | values of button are: | |
4770 | ||
4771 | ==================== ===================================== | |
4772 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4773 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4774 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4775 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4776 | ==================== ===================================== | |
4777 | ||
4778 | """ | |
4779 | return _core_.MouseEvent_Button(*args, **kwargs) | |
4780 | ||
4781 | def ButtonIsDown(*args, **kwargs): | |
4782 | """ButtonIsDown(self, int but) -> bool""" | |
4783 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) | |
4784 | ||
4785 | def GetButton(*args, **kwargs): | |
4786 | """ | |
4787 | GetButton(self) -> int | |
4788 | ||
4789 | Returns the mouse button which generated this event or | |
4790 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4791 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4792 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4793 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4794 | right buttons respectively. | |
4795 | """ | |
4796 | return _core_.MouseEvent_GetButton(*args, **kwargs) | |
4797 | ||
4798 | def ControlDown(*args, **kwargs): | |
4799 | """ | |
4800 | ControlDown(self) -> bool | |
4801 | ||
4802 | Returns true if the control key was down at the time of the event. | |
4803 | """ | |
4804 | return _core_.MouseEvent_ControlDown(*args, **kwargs) | |
4805 | ||
4806 | def MetaDown(*args, **kwargs): | |
4807 | """ | |
4808 | MetaDown(self) -> bool | |
4809 | ||
4810 | Returns true if the Meta key was down at the time of the event. | |
4811 | """ | |
4812 | return _core_.MouseEvent_MetaDown(*args, **kwargs) | |
4813 | ||
4814 | def AltDown(*args, **kwargs): | |
4815 | """ | |
4816 | AltDown(self) -> bool | |
4817 | ||
4818 | Returns true if the Alt key was down at the time of the event. | |
4819 | """ | |
4820 | return _core_.MouseEvent_AltDown(*args, **kwargs) | |
4821 | ||
4822 | def ShiftDown(*args, **kwargs): | |
4823 | """ | |
4824 | ShiftDown(self) -> bool | |
4825 | ||
4826 | Returns true if the Shift key was down at the time of the event. | |
4827 | """ | |
4828 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) | |
4829 | ||
4830 | def CmdDown(*args, **kwargs): | |
4831 | """ | |
4832 | CmdDown(self) -> bool | |
4833 | ||
4834 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4835 | platforms but the special "Apple" (a.k.a as "Command") key on | |
4836 | Macs. It often makes sense to use it instead of, say, `ControlDown` | |
4837 | because Cmd key is used for the same thing under Mac as Ctrl | |
4838 | elsewhere. The Ctrl key still exists, it's just not used for this | |
4839 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
4840 | and Macs this is the same as `MetaDown`. | |
4841 | """ | |
4842 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4843 | ||
4844 | def LeftDown(*args, **kwargs): | |
4845 | """ | |
4846 | LeftDown(self) -> bool | |
4847 | ||
4848 | Returns true if the left mouse button state changed to down. | |
4849 | """ | |
4850 | return _core_.MouseEvent_LeftDown(*args, **kwargs) | |
4851 | ||
4852 | def MiddleDown(*args, **kwargs): | |
4853 | """ | |
4854 | MiddleDown(self) -> bool | |
4855 | ||
4856 | Returns true if the middle mouse button state changed to down. | |
4857 | """ | |
4858 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) | |
4859 | ||
4860 | def RightDown(*args, **kwargs): | |
4861 | """ | |
4862 | RightDown(self) -> bool | |
4863 | ||
4864 | Returns true if the right mouse button state changed to down. | |
4865 | """ | |
4866 | return _core_.MouseEvent_RightDown(*args, **kwargs) | |
4867 | ||
4868 | def LeftUp(*args, **kwargs): | |
4869 | """ | |
4870 | LeftUp(self) -> bool | |
4871 | ||
4872 | Returns true if the left mouse button state changed to up. | |
4873 | """ | |
4874 | return _core_.MouseEvent_LeftUp(*args, **kwargs) | |
4875 | ||
4876 | def MiddleUp(*args, **kwargs): | |
4877 | """ | |
4878 | MiddleUp(self) -> bool | |
4879 | ||
4880 | Returns true if the middle mouse button state changed to up. | |
4881 | """ | |
4882 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) | |
4883 | ||
4884 | def RightUp(*args, **kwargs): | |
4885 | """ | |
4886 | RightUp(self) -> bool | |
4887 | ||
4888 | Returns true if the right mouse button state changed to up. | |
4889 | """ | |
4890 | return _core_.MouseEvent_RightUp(*args, **kwargs) | |
4891 | ||
4892 | def LeftDClick(*args, **kwargs): | |
4893 | """ | |
4894 | LeftDClick(self) -> bool | |
4895 | ||
4896 | Returns true if the event was a left button double click. | |
4897 | """ | |
4898 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) | |
4899 | ||
4900 | def MiddleDClick(*args, **kwargs): | |
4901 | """ | |
4902 | MiddleDClick(self) -> bool | |
4903 | ||
4904 | Returns true if the event was a middle button double click. | |
4905 | """ | |
4906 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) | |
4907 | ||
4908 | def RightDClick(*args, **kwargs): | |
4909 | """ | |
4910 | RightDClick(self) -> bool | |
4911 | ||
4912 | Returns true if the event was a right button double click. | |
4913 | """ | |
4914 | return _core_.MouseEvent_RightDClick(*args, **kwargs) | |
4915 | ||
4916 | def LeftIsDown(*args, **kwargs): | |
4917 | """ | |
4918 | LeftIsDown(self) -> bool | |
4919 | ||
4920 | Returns true if the left mouse button is currently down, independent | |
4921 | of the current event type. | |
4922 | ||
4923 | Please notice that it is not the same as LeftDown which returns true | |
4924 | if the left mouse button was just pressed. Rather, it describes the | |
4925 | state of the mouse button before the event happened. | |
4926 | ||
4927 | This event is usually used in the mouse event handlers which process | |
4928 | "move mouse" messages to determine whether the user is (still) | |
4929 | dragging the mouse. | |
4930 | """ | |
4931 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) | |
4932 | ||
4933 | def MiddleIsDown(*args, **kwargs): | |
4934 | """ | |
4935 | MiddleIsDown(self) -> bool | |
4936 | ||
4937 | Returns true if the middle mouse button is currently down, independent | |
4938 | of the current event type. | |
4939 | """ | |
4940 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) | |
4941 | ||
4942 | def RightIsDown(*args, **kwargs): | |
4943 | """ | |
4944 | RightIsDown(self) -> bool | |
4945 | ||
4946 | Returns true if the right mouse button is currently down, independent | |
4947 | of the current event type. | |
4948 | """ | |
4949 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) | |
4950 | ||
4951 | def Dragging(*args, **kwargs): | |
4952 | """ | |
4953 | Dragging(self) -> bool | |
4954 | ||
4955 | Returns true if this was a dragging event (motion while a button is | |
4956 | depressed). | |
4957 | """ | |
4958 | return _core_.MouseEvent_Dragging(*args, **kwargs) | |
4959 | ||
4960 | def Moving(*args, **kwargs): | |
4961 | """ | |
4962 | Moving(self) -> bool | |
4963 | ||
4964 | Returns true if this was a motion event and no mouse buttons were | |
4965 | pressed. If any mouse button is held pressed, then this method returns | |
4966 | false and Dragging returns true. | |
4967 | """ | |
4968 | return _core_.MouseEvent_Moving(*args, **kwargs) | |
4969 | ||
4970 | def Entering(*args, **kwargs): | |
4971 | """ | |
4972 | Entering(self) -> bool | |
4973 | ||
4974 | Returns true if the mouse was entering the window. | |
4975 | """ | |
4976 | return _core_.MouseEvent_Entering(*args, **kwargs) | |
4977 | ||
4978 | def Leaving(*args, **kwargs): | |
4979 | """ | |
4980 | Leaving(self) -> bool | |
4981 | ||
4982 | Returns true if the mouse was leaving the window. | |
4983 | """ | |
4984 | return _core_.MouseEvent_Leaving(*args, **kwargs) | |
4985 | ||
4986 | def GetPosition(*args, **kwargs): | |
4987 | """ | |
4988 | GetPosition(self) -> Point | |
4989 | ||
4990 | Returns the pixel position of the mouse in window coordinates when the | |
4991 | event happened. | |
4992 | """ | |
4993 | return _core_.MouseEvent_GetPosition(*args, **kwargs) | |
4994 | ||
4995 | def GetPositionTuple(*args, **kwargs): | |
4996 | """ | |
4997 | GetPositionTuple() -> (x,y) | |
4998 | ||
4999 | Returns the pixel position of the mouse in window coordinates when the | |
5000 | event happened. | |
5001 | """ | |
5002 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) | |
5003 | ||
5004 | def GetLogicalPosition(*args, **kwargs): | |
5005 | """ | |
5006 | GetLogicalPosition(self, DC dc) -> Point | |
5007 | ||
5008 | Returns the logical mouse position in pixels (i.e. translated | |
5009 | according to the translation set for the DC, which usually indicates | |
5010 | that the window has been scrolled). | |
5011 | """ | |
5012 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) | |
5013 | ||
5014 | def GetX(*args, **kwargs): | |
5015 | """ | |
5016 | GetX(self) -> int | |
5017 | ||
5018 | Returns X coordinate of the physical mouse event position. | |
5019 | """ | |
5020 | return _core_.MouseEvent_GetX(*args, **kwargs) | |
5021 | ||
5022 | def GetY(*args, **kwargs): | |
5023 | """ | |
5024 | GetY(self) -> int | |
5025 | ||
5026 | Returns Y coordinate of the physical mouse event position. | |
5027 | """ | |
5028 | return _core_.MouseEvent_GetY(*args, **kwargs) | |
5029 | ||
5030 | def GetWheelRotation(*args, **kwargs): | |
5031 | """ | |
5032 | GetWheelRotation(self) -> int | |
5033 | ||
5034 | Get wheel rotation, positive or negative indicates direction of | |
5035 | rotation. Current devices all send an event when rotation is equal to | |
5036 | +/-WheelDelta, but this allows for finer resolution devices to be | |
5037 | created in the future. Because of this you shouldn't assume that one | |
5038 | event is equal to 1 line or whatever, but you should be able to either | |
5039 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
5040 | have been accumulated before scrolling. | |
5041 | """ | |
5042 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) | |
5043 | ||
5044 | def GetWheelDelta(*args, **kwargs): | |
5045 | """ | |
5046 | GetWheelDelta(self) -> int | |
5047 | ||
5048 | Get wheel delta, normally 120. This is the threshold for action to be | |
5049 | taken, and one such action (for example, scrolling one increment) | |
5050 | should occur for each delta. | |
5051 | """ | |
5052 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) | |
5053 | ||
5054 | def GetWheelAxis(*args, **kwargs): | |
5055 | """ | |
5056 | GetWheelAxis(self) -> int | |
5057 | ||
5058 | Gets the axis the wheel operation concerns, 0 being the y axis as on | |
5059 | most mouse wheels, 1 is the x axis for things like MightyMouse scrolls | |
5060 | or horizontal trackpad scrolling. | |
5061 | """ | |
5062 | return _core_.MouseEvent_GetWheelAxis(*args, **kwargs) | |
5063 | ||
5064 | def GetLinesPerAction(*args, **kwargs): | |
5065 | """ | |
5066 | GetLinesPerAction(self) -> int | |
5067 | ||
5068 | Returns the configured number of lines (or whatever) to be scrolled | |
5069 | per wheel action. Defaults to three. | |
5070 | """ | |
5071 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) | |
5072 | ||
5073 | def IsPageScroll(*args, **kwargs): | |
5074 | """ | |
5075 | IsPageScroll(self) -> bool | |
5076 | ||
5077 | Returns true if the system has been setup to do page scrolling with | |
5078 | the mouse wheel instead of line scrolling. | |
5079 | """ | |
5080 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) | |
5081 | ||
5082 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
5083 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
5084 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
5085 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
5086 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
5087 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
5088 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
5089 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
5090 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
5091 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
5092 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
5093 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
5094 | Button = property(GetButton,doc="See `GetButton`") | |
5095 | LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`") | |
5096 | LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`") | |
5097 | Position = property(GetPosition,doc="See `GetPosition`") | |
5098 | WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`") | |
5099 | WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`") | |
5100 | X = property(GetX,doc="See `GetX`") | |
5101 | Y = property(GetY,doc="See `GetY`") | |
5102 | _core_.MouseEvent_swigregister(MouseEvent) | |
5103 | ||
5104 | #--------------------------------------------------------------------------- | |
5105 | ||
5106 | class SetCursorEvent(Event): | |
5107 | """ | |
5108 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
5109 | as a result of mouse motion. This event gives the application the | |
5110 | chance to perform specific mouse cursor processing based on the | |
5111 | current position of the mouse within the window. Use the `SetCursor` | |
5112 | method to specify the cursor you want to be displayed. | |
5113 | """ | |
5114 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5115 | __repr__ = _swig_repr | |
5116 | def __init__(self, *args, **kwargs): | |
5117 | """ | |
5118 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
5119 | ||
5120 | Construct a new `wx.SetCursorEvent`. | |
5121 | """ | |
5122 | _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs)) | |
5123 | def GetX(*args, **kwargs): | |
5124 | """ | |
5125 | GetX(self) -> int | |
5126 | ||
5127 | Returns the X coordinate of the mouse in client coordinates. | |
5128 | """ | |
5129 | return _core_.SetCursorEvent_GetX(*args, **kwargs) | |
5130 | ||
5131 | def GetY(*args, **kwargs): | |
5132 | """ | |
5133 | GetY(self) -> int | |
5134 | ||
5135 | Returns the Y coordinate of the mouse in client coordinates. | |
5136 | """ | |
5137 | return _core_.SetCursorEvent_GetY(*args, **kwargs) | |
5138 | ||
5139 | def SetCursor(*args, **kwargs): | |
5140 | """ | |
5141 | SetCursor(self, Cursor cursor) | |
5142 | ||
5143 | Sets the cursor associated with this event. | |
5144 | """ | |
5145 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) | |
5146 | ||
5147 | def GetCursor(*args, **kwargs): | |
5148 | """ | |
5149 | GetCursor(self) -> Cursor | |
5150 | ||
5151 | Returns a reference to the cursor specified by this event. | |
5152 | """ | |
5153 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) | |
5154 | ||
5155 | def HasCursor(*args, **kwargs): | |
5156 | """ | |
5157 | HasCursor(self) -> bool | |
5158 | ||
5159 | Returns true if the cursor specified by this event is a valid cursor. | |
5160 | """ | |
5161 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) | |
5162 | ||
5163 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") | |
5164 | X = property(GetX,doc="See `GetX`") | |
5165 | Y = property(GetY,doc="See `GetY`") | |
5166 | _core_.SetCursorEvent_swigregister(SetCursorEvent) | |
5167 | ||
5168 | #--------------------------------------------------------------------------- | |
5169 | ||
5170 | class KeyEvent(Event): | |
5171 | """ | |
5172 | This event class contains information about keypress and character | |
5173 | events. These events are only sent to the widget that currently has | |
5174 | the keyboard focus. | |
5175 | ||
5176 | Notice that there are three different kinds of keyboard events in | |
5177 | wxWidgets: key down and up events and char events. The difference | |
5178 | between the first two is clear - the first corresponds to a key press | |
5179 | and the second to a key release - otherwise they are identical. Just | |
5180 | note that if the key is maintained in a pressed state you will | |
5181 | typically get a lot of (automatically generated) down events but only | |
5182 | one up so it is wrong to assume that there is one up event | |
5183 | corresponding to each down one. | |
5184 | ||
5185 | Both key events provide untranslated key codes while the char event | |
5186 | carries the translated one. The untranslated code for alphanumeric | |
5187 | keys is always an upper case value. For the other keys it is one of | |
5188 | WXK_XXX values from the keycodes table. The translated key is, in | |
5189 | general, the character the user expects to appear as the result of the | |
5190 | key combination when typing the text into a text entry zone, for | |
5191 | example. | |
5192 | ||
5193 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
5194 | and the standard US keyboard): when the 'A' key is pressed, the key | |
5195 | down event key code is equal to ASCII A == 65. But the char event key | |
5196 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
5197 | 'A' keys simultaneously , the key code in key down event will still be | |
5198 | just 'A' while the char event key code parameter will now be 'A' as | |
5199 | well. | |
5200 | ||
5201 | Although in this simple case it is clear that the correct key code | |
5202 | could be found in the key down event handler by checking the value | |
5203 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
5204 | as for non alphanumeric keys or non-US keyboard layouts the | |
5205 | translation is keyboard-layout dependent and can only be done properly | |
5206 | by the system itself. | |
5207 | ||
5208 | Another kind of translation is done when the control key is pressed: | |
5209 | for example, for CTRL-A key press the key down event still carries the | |
5210 | same key code 'A' as usual but the char event will have key code of 1, | |
5211 | the ASCII value of this key combination. | |
5212 | ||
5213 | You may discover how the other keys on your system behave | |
5214 | interactively by running the KeyEvents sample in the wxPython demo and | |
5215 | pressing some keys while the blue box at the top has the keyboard | |
5216 | focus. | |
5217 | ||
5218 | **Note**: If a key down event is caught and the event handler does not | |
5219 | call event.Skip() then the coresponding char event will not | |
5220 | happen. This is by design and enables the programs that handle both | |
5221 | types of events to be a bit simpler. | |
5222 | ||
5223 | **Note for Windows programmers**: The key and char events in wxWidgets | |
5224 | are similar to but slightly different from Windows WM_KEYDOWN and | |
5225 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
5226 | event in wxWidgets (unless it is used as an accelerator). | |
5227 | ||
5228 | **Tip**: be sure to call event.Skip() for events that you don't | |
5229 | process in key event function, otherwise menu shortcuts may cease to | |
5230 | work under Windows. | |
5231 | ||
5232 | """ | |
5233 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5234 | __repr__ = _swig_repr | |
5235 | def __init__(self, *args, **kwargs): | |
5236 | """ | |
5237 | __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent | |
5238 | ||
5239 | Construct a new `wx.KeyEvent`. Valid event types are: | |
5240 | * | |
5241 | """ | |
5242 | _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs)) | |
5243 | def GetModifiers(*args, **kwargs): | |
5244 | """ | |
5245 | GetModifiers(self) -> int | |
5246 | ||
5247 | Returns a bitmask of the current modifier settings. Can be used to | |
5248 | check if the key event has exactly the given modifiers without having | |
5249 | to explicitly check that the other modifiers are not down. For | |
5250 | example:: | |
5251 | ||
5252 | if event.GetModifers() == wx.MOD_CONTROL: | |
5253 | DoSomething() | |
5254 | ||
5255 | """ | |
5256 | return _core_.KeyEvent_GetModifiers(*args, **kwargs) | |
5257 | ||
5258 | def ControlDown(*args, **kwargs): | |
5259 | """ | |
5260 | ControlDown(self) -> bool | |
5261 | ||
5262 | Returns ``True`` if the Control key was down at the time of the event. | |
5263 | """ | |
5264 | return _core_.KeyEvent_ControlDown(*args, **kwargs) | |
5265 | ||
5266 | def MetaDown(*args, **kwargs): | |
5267 | """ | |
5268 | MetaDown(self) -> bool | |
5269 | ||
5270 | Returns ``True`` if the Meta key was down at the time of the event. | |
5271 | """ | |
5272 | return _core_.KeyEvent_MetaDown(*args, **kwargs) | |
5273 | ||
5274 | def AltDown(*args, **kwargs): | |
5275 | """ | |
5276 | AltDown(self) -> bool | |
5277 | ||
5278 | Returns ``True`` if the Alt key was down at the time of the event. | |
5279 | """ | |
5280 | return _core_.KeyEvent_AltDown(*args, **kwargs) | |
5281 | ||
5282 | def ShiftDown(*args, **kwargs): | |
5283 | """ | |
5284 | ShiftDown(self) -> bool | |
5285 | ||
5286 | Returns ``True`` if the Shift key was down at the time of the event. | |
5287 | """ | |
5288 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) | |
5289 | ||
5290 | def CmdDown(*args, **kwargs): | |
5291 | """ | |
5292 | CmdDown(self) -> bool | |
5293 | ||
5294 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
5295 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5296 | Macs. It makes often sense to use it instead of, say, `ControlDown` | |
5297 | because Cmd key is used for the same thing under Mac as Ctrl | |
5298 | elsewhere. The Ctrl still exists, it's just not used for this | |
5299 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
5300 | and Macs this is the same as `MetaDown`. | |
5301 | """ | |
5302 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
5303 | ||
5304 | def HasModifiers(*args, **kwargs): | |
5305 | """ | |
5306 | HasModifiers(self) -> bool | |
5307 | ||
5308 | Returns true if either CTRL or ALT keys was down at the time of the | |
5309 | key event. Note that this function does not take into account neither | |
5310 | SHIFT nor META key states (the reason for ignoring the latter is that | |
5311 | it is common for NUMLOCK key to be configured as META under X but the | |
5312 | key presses even while NUMLOCK is on should be still processed | |
5313 | normally). | |
5314 | """ | |
5315 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) | |
5316 | ||
5317 | def GetKeyCode(*args, **kwargs): | |
5318 | """ | |
5319 | GetKeyCode(self) -> int | |
5320 | ||
5321 | Returns the virtual key code. ASCII events return normal ASCII values, | |
5322 | while non-ASCII events return values such as WXK_LEFT for the left | |
5323 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
5324 | codes. | |
5325 | ||
5326 | Note that in Unicode build, the returned value is meaningful only if | |
5327 | the user entered a character that can be represented in current | |
5328 | locale's default charset. You can obtain the corresponding Unicode | |
5329 | character using `GetUnicodeKey`. | |
5330 | """ | |
5331 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) | |
5332 | ||
5333 | def GetUnicodeKey(*args, **kwargs): | |
5334 | """ | |
5335 | GetUnicodeKey(self) -> int | |
5336 | ||
5337 | Returns the Unicode character corresponding to this key event. This | |
5338 | function is only meaningfule in a Unicode build of wxPython. | |
5339 | """ | |
5340 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) | |
5341 | ||
5342 | GetUniChar = GetUnicodeKey | |
5343 | def SetUnicodeKey(*args, **kwargs): | |
5344 | """ | |
5345 | SetUnicodeKey(self, int uniChar) | |
5346 | ||
5347 | Set the Unicode value of the key event, but only if this is a Unicode | |
5348 | build of wxPython. | |
5349 | """ | |
5350 | return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs) | |
5351 | ||
5352 | def GetRawKeyCode(*args, **kwargs): | |
5353 | """ | |
5354 | GetRawKeyCode(self) -> unsigned int | |
5355 | ||
5356 | Returns the raw key code for this event. This is a platform-dependent | |
5357 | scan code which should only be used in advanced | |
5358 | applications. Currently the raw key codes are not supported by all | |
5359 | ports. | |
5360 | """ | |
5361 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) | |
5362 | ||
5363 | def GetRawKeyFlags(*args, **kwargs): | |
5364 | """ | |
5365 | GetRawKeyFlags(self) -> unsigned int | |
5366 | ||
5367 | Returns the low level key flags for this event. The flags are | |
5368 | platform-dependent and should only be used in advanced applications. | |
5369 | Currently the raw key flags are not supported by all ports. | |
5370 | """ | |
5371 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) | |
5372 | ||
5373 | def GetPosition(*args, **kwargs): | |
5374 | """ | |
5375 | GetPosition(self) -> Point | |
5376 | ||
5377 | Find the position of the event, if applicable. | |
5378 | """ | |
5379 | return _core_.KeyEvent_GetPosition(*args, **kwargs) | |
5380 | ||
5381 | def GetPositionTuple(*args, **kwargs): | |
5382 | """ | |
5383 | GetPositionTuple() -> (x,y) | |
5384 | ||
5385 | Find the position of the event, if applicable. | |
5386 | """ | |
5387 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) | |
5388 | ||
5389 | def GetX(*args, **kwargs): | |
5390 | """ | |
5391 | GetX(self) -> int | |
5392 | ||
5393 | Returns the X position (in client coordinates) of the event, if | |
5394 | applicable. | |
5395 | """ | |
5396 | return _core_.KeyEvent_GetX(*args, **kwargs) | |
5397 | ||
5398 | def GetY(*args, **kwargs): | |
5399 | """ | |
5400 | GetY(self) -> int | |
5401 | ||
5402 | Returns the Y position (in client coordinates) of the event, if | |
5403 | applicable. | |
5404 | """ | |
5405 | return _core_.KeyEvent_GetY(*args, **kwargs) | |
5406 | ||
5407 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
5408 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
5409 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
5410 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
5411 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
5412 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
5413 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
5414 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
5415 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
5416 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
5417 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") | |
5418 | Modifiers = property(GetModifiers,doc="See `GetModifiers`") | |
5419 | Position = property(GetPosition,doc="See `GetPosition`") | |
5420 | RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`") | |
5421 | RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`") | |
5422 | UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`") | |
5423 | X = property(GetX,doc="See `GetX`") | |
5424 | Y = property(GetY,doc="See `GetY`") | |
5425 | _core_.KeyEvent_swigregister(KeyEvent) | |
5426 | ||
5427 | #--------------------------------------------------------------------------- | |
5428 | ||
5429 | class SizeEvent(Event): | |
5430 | """ | |
5431 | A size event holds information about size change events. The EVT_SIZE | |
5432 | handler function will be called when the window it is bound to has | |
5433 | been resized. | |
5434 | ||
5435 | Note that the size passed is of the whole window: call | |
5436 | `wx.Window.GetClientSize` for the area which may be used by the | |
5437 | application. | |
5438 | ||
5439 | When a window is resized, usually only a small part of the window is | |
5440 | damaged and and that area is all that is in the update region for the | |
5441 | next paint event. However, if your drawing depends on the size of the | |
5442 | window, you may need to clear the DC explicitly and repaint the whole | |
5443 | window. In which case, you may need to call `wx.Window.Refresh` to | |
5444 | invalidate the entire window. | |
5445 | ||
5446 | """ | |
5447 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5448 | __repr__ = _swig_repr | |
5449 | def __init__(self, *args, **kwargs): | |
5450 | """ | |
5451 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
5452 | ||
5453 | Construct a new ``wx.SizeEvent``. | |
5454 | """ | |
5455 | _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs)) | |
5456 | def GetSize(*args, **kwargs): | |
5457 | """ | |
5458 | GetSize(self) -> Size | |
5459 | ||
5460 | Returns the entire size of the window generating the size change | |
5461 | event. | |
5462 | """ | |
5463 | return _core_.SizeEvent_GetSize(*args, **kwargs) | |
5464 | ||
5465 | def GetRect(*args, **kwargs): | |
5466 | """GetRect(self) -> Rect""" | |
5467 | return _core_.SizeEvent_GetRect(*args, **kwargs) | |
5468 | ||
5469 | def SetRect(*args, **kwargs): | |
5470 | """SetRect(self, Rect rect)""" | |
5471 | return _core_.SizeEvent_SetRect(*args, **kwargs) | |
5472 | ||
5473 | def SetSize(*args, **kwargs): | |
5474 | """SetSize(self, Size size)""" | |
5475 | return _core_.SizeEvent_SetSize(*args, **kwargs) | |
5476 | ||
5477 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) | |
5478 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
5479 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
5480 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
5481 | _core_.SizeEvent_swigregister(SizeEvent) | |
5482 | ||
5483 | #--------------------------------------------------------------------------- | |
5484 | ||
5485 | class MoveEvent(Event): | |
5486 | """ | |
5487 | This event object is sent for EVT_MOVE event bindings when a window is | |
5488 | moved to a new position. | |
5489 | """ | |
5490 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5491 | __repr__ = _swig_repr | |
5492 | def __init__(self, *args, **kwargs): | |
5493 | """ | |
5494 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5495 | ||
5496 | Constructor. | |
5497 | """ | |
5498 | _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs)) | |
5499 | def GetPosition(*args, **kwargs): | |
5500 | """ | |
5501 | GetPosition(self) -> Point | |
5502 | ||
5503 | Returns the position of the window generating the move change event. | |
5504 | """ | |
5505 | return _core_.MoveEvent_GetPosition(*args, **kwargs) | |
5506 | ||
5507 | def GetRect(*args, **kwargs): | |
5508 | """GetRect(self) -> Rect""" | |
5509 | return _core_.MoveEvent_GetRect(*args, **kwargs) | |
5510 | ||
5511 | def SetRect(*args, **kwargs): | |
5512 | """SetRect(self, Rect rect)""" | |
5513 | return _core_.MoveEvent_SetRect(*args, **kwargs) | |
5514 | ||
5515 | def SetPosition(*args, **kwargs): | |
5516 | """SetPosition(self, Point pos)""" | |
5517 | return _core_.MoveEvent_SetPosition(*args, **kwargs) | |
5518 | ||
5519 | m_pos = property(GetPosition, SetPosition) | |
5520 | m_rect = property(GetRect, SetRect) | |
5521 | ||
5522 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
5523 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
5524 | _core_.MoveEvent_swigregister(MoveEvent) | |
5525 | ||
5526 | #--------------------------------------------------------------------------- | |
5527 | ||
5528 | class PaintEvent(Event): | |
5529 | """ | |
5530 | A paint event is sent when a window's contents needs to be repainted. | |
5531 | Note that in an EVT_PAINT handler the application must *always* create | |
5532 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5533 | Windows assumes that the window has not been painted yet and will send | |
5534 | the event again, causing endless refreshes. | |
5535 | ||
5536 | You can optimize painting by retrieving the rectangles that have been | |
5537 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5538 | and only repainting these rectangles. The rectangles are in terms of | |
5539 | the client area, and are unscrolled, so you will need to do some | |
5540 | calculations using the current view position to obtain logical, | |
5541 | scrolled units. | |
5542 | ||
5543 | """ | |
5544 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5545 | __repr__ = _swig_repr | |
5546 | def __init__(self, *args, **kwargs): | |
5547 | """__init__(self, int Id=0) -> PaintEvent""" | |
5548 | _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs)) | |
5549 | _core_.PaintEvent_swigregister(PaintEvent) | |
5550 | ||
5551 | class NcPaintEvent(Event): | |
5552 | """Proxy of C++ NcPaintEvent class""" | |
5553 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5554 | __repr__ = _swig_repr | |
5555 | def __init__(self, *args, **kwargs): | |
5556 | """__init__(self, int winid=0) -> NcPaintEvent""" | |
5557 | _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs)) | |
5558 | _core_.NcPaintEvent_swigregister(NcPaintEvent) | |
5559 | ||
5560 | #--------------------------------------------------------------------------- | |
5561 | ||
5562 | class EraseEvent(Event): | |
5563 | """ | |
5564 | An erase event is sent whenever the background of a window needs to be | |
5565 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5566 | binder. On some platforms, such as GTK+, this event is simulated | |
5567 | (simply generated just before the paint event) and may cause flicker. | |
5568 | ||
5569 | To paint a custom background use the `GetDC` method and use the returned | |
5570 | device context if it is not ``None``, otherwise create a temporary | |
5571 | `wx.ClientDC` and draw on that. | |
5572 | ||
5573 | """ | |
5574 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5575 | __repr__ = _swig_repr | |
5576 | def __init__(self, *args, **kwargs): | |
5577 | """ | |
5578 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5579 | ||
5580 | Constructor | |
5581 | """ | |
5582 | _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs)) | |
5583 | def GetDC(*args, **kwargs): | |
5584 | """ | |
5585 | GetDC(self) -> DC | |
5586 | ||
5587 | Returns the device context the event handler should draw upon. If | |
5588 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5589 | that instead. | |
5590 | """ | |
5591 | return _core_.EraseEvent_GetDC(*args, **kwargs) | |
5592 | ||
5593 | DC = property(GetDC,doc="See `GetDC`") | |
5594 | _core_.EraseEvent_swigregister(EraseEvent) | |
5595 | ||
5596 | #--------------------------------------------------------------------------- | |
5597 | ||
5598 | class FocusEvent(Event): | |
5599 | """ | |
5600 | A focus event is sent when a window's focus changes. The window losing | |
5601 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5602 | gets an EVT_SET_FOCUS event. | |
5603 | ||
5604 | Notice that the set focus event happens both when the user gives focus | |
5605 | to the window (whether using the mouse or keyboard) and when it is | |
5606 | done from the program itself using `wx.Window.SetFocus`. | |
5607 | ||
5608 | """ | |
5609 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5610 | __repr__ = _swig_repr | |
5611 | def __init__(self, *args, **kwargs): | |
5612 | """ | |
5613 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent | |
5614 | ||
5615 | Constructor | |
5616 | """ | |
5617 | _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs)) | |
5618 | def GetWindow(*args, **kwargs): | |
5619 | """ | |
5620 | GetWindow(self) -> Window | |
5621 | ||
5622 | Returns the other window associated with this event, that is the | |
5623 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5624 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5625 | ||
5626 | Warning: the window returned may be None! | |
5627 | """ | |
5628 | return _core_.FocusEvent_GetWindow(*args, **kwargs) | |
5629 | ||
5630 | def SetWindow(*args, **kwargs): | |
5631 | """SetWindow(self, Window win)""" | |
5632 | return _core_.FocusEvent_SetWindow(*args, **kwargs) | |
5633 | ||
5634 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") | |
5635 | _core_.FocusEvent_swigregister(FocusEvent) | |
5636 | ||
5637 | #--------------------------------------------------------------------------- | |
5638 | ||
5639 | class ChildFocusEvent(CommandEvent): | |
5640 | """ | |
5641 | A child focus event is sent to a (parent-)window when one of its child | |
5642 | windows gains focus, so that the window could restore the focus back | |
5643 | to its corresponding child if it loses it now and regains later. | |
5644 | ||
5645 | Notice that child window is the direct child of the window receiving | |
5646 | the event, and so may not be the actual widget recieving focus if it | |
5647 | is further down the containment heirarchy. Use `wx.Window.FindFocus` | |
5648 | to get the widget that is actually receiving focus. | |
5649 | """ | |
5650 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5651 | __repr__ = _swig_repr | |
5652 | def __init__(self, *args, **kwargs): | |
5653 | """ | |
5654 | __init__(self, Window win=None) -> ChildFocusEvent | |
5655 | ||
5656 | Constructor | |
5657 | """ | |
5658 | _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs)) | |
5659 | def GetWindow(*args, **kwargs): | |
5660 | """ | |
5661 | GetWindow(self) -> Window | |
5662 | ||
5663 | The window, or (grand)parent of the window which has just received the | |
5664 | focus. | |
5665 | """ | |
5666 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) | |
5667 | ||
5668 | Window = property(GetWindow,doc="See `GetWindow`") | |
5669 | _core_.ChildFocusEvent_swigregister(ChildFocusEvent) | |
5670 | ||
5671 | #--------------------------------------------------------------------------- | |
5672 | ||
5673 | class ActivateEvent(Event): | |
5674 | """ | |
5675 | An activate event is sent when a top-level window or the entire | |
5676 | application is being activated or deactivated. | |
5677 | ||
5678 | A top-level window (a dialog or frame) receives an activate event when | |
5679 | is being activated or deactivated. This is indicated visually by the | |
5680 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5681 | An application is activated or deactivated when one of its frames | |
5682 | becomes activated, or a frame becomes inactivate resulting in all | |
5683 | application frames being inactive. | |
5684 | ||
5685 | Please note that usually you should call event.Skip() in your handlers | |
5686 | for these events so the default handlers will still be called, as not | |
5687 | doing so can result in strange effects. | |
5688 | ||
5689 | """ | |
5690 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5691 | __repr__ = _swig_repr | |
5692 | def __init__(self, *args, **kwargs): | |
5693 | """ | |
5694 | __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent | |
5695 | ||
5696 | Constructor | |
5697 | """ | |
5698 | _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs)) | |
5699 | def GetActive(*args, **kwargs): | |
5700 | """ | |
5701 | GetActive(self) -> bool | |
5702 | ||
5703 | Returns true if the application or window is being activated, false | |
5704 | otherwise. | |
5705 | """ | |
5706 | return _core_.ActivateEvent_GetActive(*args, **kwargs) | |
5707 | ||
5708 | Active = property(GetActive,doc="See `GetActive`") | |
5709 | _core_.ActivateEvent_swigregister(ActivateEvent) | |
5710 | ||
5711 | #--------------------------------------------------------------------------- | |
5712 | ||
5713 | class InitDialogEvent(Event): | |
5714 | """ | |
5715 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5716 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5717 | event can transfer data to the window, or anything else that should be | |
5718 | done before the user begins editing the form. The default handler | |
5719 | calls `wx.Window.TransferDataToWindow`. | |
5720 | """ | |
5721 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5722 | __repr__ = _swig_repr | |
5723 | def __init__(self, *args, **kwargs): | |
5724 | """ | |
5725 | __init__(self, int Id=0) -> InitDialogEvent | |
5726 | ||
5727 | Constructor | |
5728 | """ | |
5729 | _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs)) | |
5730 | _core_.InitDialogEvent_swigregister(InitDialogEvent) | |
5731 | ||
5732 | #--------------------------------------------------------------------------- | |
5733 | ||
5734 | class MenuEvent(Event): | |
5735 | """ | |
5736 | This class is used for a variety of menu-related events. Note that | |
5737 | these do not include menu command events, which are handled by sending | |
5738 | `wx.CommandEvent` objects. | |
5739 | ||
5740 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5741 | text in the first field of the status bar. | |
5742 | """ | |
5743 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5744 | __repr__ = _swig_repr | |
5745 | def __init__(self, *args, **kwargs): | |
5746 | """ | |
5747 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent | |
5748 | ||
5749 | Constructor | |
5750 | """ | |
5751 | _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs)) | |
5752 | def GetMenuId(*args, **kwargs): | |
5753 | """ | |
5754 | GetMenuId(self) -> int | |
5755 | ||
5756 | Returns the menu identifier associated with the event. This method | |
5757 | should be only used with the HIGHLIGHT events. | |
5758 | """ | |
5759 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) | |
5760 | ||
5761 | def IsPopup(*args, **kwargs): | |
5762 | """ | |
5763 | IsPopup(self) -> bool | |
5764 | ||
5765 | Returns ``True`` if the menu which is being opened or closed is a | |
5766 | popup menu, ``False`` if it is a normal one. This method should only | |
5767 | be used with the OPEN and CLOSE events. | |
5768 | """ | |
5769 | return _core_.MenuEvent_IsPopup(*args, **kwargs) | |
5770 | ||
5771 | def GetMenu(*args, **kwargs): | |
5772 | """ | |
5773 | GetMenu(self) -> Menu | |
5774 | ||
5775 | Returns the menu which is being opened or closed. This method should | |
5776 | only be used with the OPEN and CLOSE events. | |
5777 | """ | |
5778 | return _core_.MenuEvent_GetMenu(*args, **kwargs) | |
5779 | ||
5780 | Menu = property(GetMenu,doc="See `GetMenu`") | |
5781 | MenuId = property(GetMenuId,doc="See `GetMenuId`") | |
5782 | _core_.MenuEvent_swigregister(MenuEvent) | |
5783 | ||
5784 | #--------------------------------------------------------------------------- | |
5785 | ||
5786 | class CloseEvent(Event): | |
5787 | """ | |
5788 | This event class contains information about window and session close | |
5789 | events. | |
5790 | ||
5791 | The handler function for EVT_CLOSE is called when the user has tried | |
5792 | to close a a frame or dialog box using the window manager controls or | |
5793 | the system menu. It can also be invoked by the application itself | |
5794 | programmatically, for example by calling the `wx.Window.Close` | |
5795 | function. | |
5796 | ||
5797 | You should check whether the application is forcing the deletion of | |
5798 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5799 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5800 | it is up to you whether you respond by destroying the window or not. | |
5801 | For example you may wish to display a message dialog prompting to save | |
5802 | files or to cancel the close. | |
5803 | ||
5804 | If you don't destroy the window, you should call `Veto` to let the | |
5805 | calling code know that you did not destroy the window. This allows the | |
5806 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5807 | on whether the close instruction was honored or not. | |
5808 | """ | |
5809 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5810 | __repr__ = _swig_repr | |
5811 | def __init__(self, *args, **kwargs): | |
5812 | """ | |
5813 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent | |
5814 | ||
5815 | Constructor. | |
5816 | """ | |
5817 | _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs)) | |
5818 | def SetLoggingOff(*args, **kwargs): | |
5819 | """ | |
5820 | SetLoggingOff(self, bool logOff) | |
5821 | ||
5822 | Sets the 'logging off' flag. | |
5823 | """ | |
5824 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) | |
5825 | ||
5826 | def GetLoggingOff(*args, **kwargs): | |
5827 | """ | |
5828 | GetLoggingOff(self) -> bool | |
5829 | ||
5830 | Returns ``True`` if the user is logging off or ``False`` if the | |
5831 | system is shutting down. This method can only be called for end | |
5832 | session and query end session events, it doesn't make sense for close | |
5833 | window event. | |
5834 | """ | |
5835 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) | |
5836 | ||
5837 | def Veto(*args, **kwargs): | |
5838 | """ | |
5839 | Veto(self, bool veto=True) | |
5840 | ||
5841 | Call this from your event handler to veto a system shutdown or to | |
5842 | signal to the calling application that a window close did not happen. | |
5843 | ||
5844 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5845 | """ | |
5846 | return _core_.CloseEvent_Veto(*args, **kwargs) | |
5847 | ||
5848 | def GetVeto(*args, **kwargs): | |
5849 | """GetVeto(self) -> bool""" | |
5850 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5851 | ||
5852 | def SetCanVeto(*args, **kwargs): | |
5853 | """ | |
5854 | SetCanVeto(self, bool canVeto) | |
5855 | ||
5856 | Sets the 'can veto' flag. | |
5857 | """ | |
5858 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) | |
5859 | ||
5860 | def CanVeto(*args, **kwargs): | |
5861 | """ | |
5862 | CanVeto(self) -> bool | |
5863 | ||
5864 | Returns true if you can veto a system shutdown or a window close | |
5865 | event. Vetoing a window close event is not possible if the calling | |
5866 | code wishes to force the application to exit, and so this function | |
5867 | must be called to check this. | |
5868 | """ | |
5869 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
5870 | ||
5871 | LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`") | |
5872 | _core_.CloseEvent_swigregister(CloseEvent) | |
5873 | ||
5874 | #--------------------------------------------------------------------------- | |
5875 | ||
5876 | class ShowEvent(Event): | |
5877 | """An EVT_SHOW event is sent when a window is shown or hidden.""" | |
5878 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5879 | __repr__ = _swig_repr | |
5880 | def __init__(self, *args, **kwargs): | |
5881 | """ | |
5882 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5883 | ||
5884 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5885 | """ | |
5886 | _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs)) | |
5887 | def SetShow(*args, **kwargs): | |
5888 | """SetShow(self, bool show)""" | |
5889 | return _core_.ShowEvent_SetShow(*args, **kwargs) | |
5890 | ||
5891 | def GetShow(*args, **kwargs): | |
5892 | """GetShow(self) -> bool""" | |
5893 | return _core_.ShowEvent_GetShow(*args, **kwargs) | |
5894 | ||
5895 | Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`") | |
5896 | _core_.ShowEvent_swigregister(ShowEvent) | |
5897 | ||
5898 | #--------------------------------------------------------------------------- | |
5899 | ||
5900 | class IconizeEvent(Event): | |
5901 | """ | |
5902 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5903 | restored. | |
5904 | """ | |
5905 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5906 | __repr__ = _swig_repr | |
5907 | def __init__(self, *args, **kwargs): | |
5908 | """ | |
5909 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5910 | ||
5911 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5912 | restored. | |
5913 | """ | |
5914 | _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs)) | |
5915 | def Iconized(*args, **kwargs): | |
5916 | """ | |
5917 | Iconized(self) -> bool | |
5918 | ||
5919 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5920 | been restored. | |
5921 | """ | |
5922 | return _core_.IconizeEvent_Iconized(*args, **kwargs) | |
5923 | ||
5924 | _core_.IconizeEvent_swigregister(IconizeEvent) | |
5925 | ||
5926 | #--------------------------------------------------------------------------- | |
5927 | ||
5928 | class MaximizeEvent(Event): | |
5929 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" | |
5930 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5931 | __repr__ = _swig_repr | |
5932 | def __init__(self, *args, **kwargs): | |
5933 | """ | |
5934 | __init__(self, int id=0) -> MaximizeEvent | |
5935 | ||
5936 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5937 | """ | |
5938 | _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs)) | |
5939 | _core_.MaximizeEvent_swigregister(MaximizeEvent) | |
5940 | ||
5941 | #--------------------------------------------------------------------------- | |
5942 | ||
5943 | class DropFilesEvent(Event): | |
5944 | """ | |
5945 | This class is used for drop files events, that is, when files have | |
5946 | been dropped onto the window. This functionality is only available | |
5947 | under Windows. The window must have previously been enabled for | |
5948 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5949 | ||
5950 | Important note: this is a separate implementation to the more general | |
5951 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5952 | implementation uses the older, Windows message-based approach of | |
5953 | dropping files. | |
5954 | ||
5955 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5956 | events. | |
5957 | ||
5958 | """ | |
5959 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5960 | def __init__(self): raise AttributeError, "No constructor defined" | |
5961 | __repr__ = _swig_repr | |
5962 | def GetPosition(*args, **kwargs): | |
5963 | """ | |
5964 | GetPosition(self) -> Point | |
5965 | ||
5966 | Returns the position at which the files were dropped. | |
5967 | """ | |
5968 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) | |
5969 | ||
5970 | def GetNumberOfFiles(*args, **kwargs): | |
5971 | """ | |
5972 | GetNumberOfFiles(self) -> int | |
5973 | ||
5974 | Returns the number of files dropped. | |
5975 | """ | |
5976 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) | |
5977 | ||
5978 | def GetFiles(*args, **kwargs): | |
5979 | """ | |
5980 | GetFiles(self) -> PyObject | |
5981 | ||
5982 | Returns a list of the filenames that were dropped. | |
5983 | """ | |
5984 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) | |
5985 | ||
5986 | Files = property(GetFiles,doc="See `GetFiles`") | |
5987 | NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`") | |
5988 | Position = property(GetPosition,doc="See `GetPosition`") | |
5989 | _core_.DropFilesEvent_swigregister(DropFilesEvent) | |
5990 | ||
5991 | #--------------------------------------------------------------------------- | |
5992 | ||
5993 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL | |
5994 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
5995 | class UpdateUIEvent(CommandEvent): | |
5996 | """ | |
5997 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5998 | wxWidgets to give an application the chance to update various user | |
5999 | interface elements. | |
6000 | ||
6001 | Without update UI events, an application has to work hard to | |
6002 | check/uncheck, enable/disable, and set the text for elements such as | |
6003 | menu items and toolbar buttons. The code for doing this has to be | |
6004 | mixed up with the code that is invoked when an action is invoked for a | |
6005 | menu item or button. | |
6006 | ||
6007 | With update UI events, you define an event handler to look at the | |
6008 | state of the application and change UI elements accordingly. wxWidgets | |
6009 | will call your handler functions in idle time, so you don't have to | |
6010 | worry where to call this code. In addition to being a clearer and more | |
6011 | declarative method, it also means you don't have to worry whether | |
6012 | you're updating a toolbar or menubar identifier. The same handler can | |
6013 | update a menu item and toolbar button, if the ID values are the same. | |
6014 | ||
6015 | Instead of directly manipulating the menu or button, you call | |
6016 | functions in the event object, such as `Check`. wxWidgets will | |
6017 | determine whether such a call has been made, and which UI element to | |
6018 | update. | |
6019 | ||
6020 | These events will work for popup menus as well as menubars. Just | |
6021 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
6022 | any UI events for the window that owns the menu. | |
6023 | ||
6024 | If you find that the overhead of UI update processing is affecting | |
6025 | your application, you can do one or both of the following: | |
6026 | ||
6027 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
6028 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
6029 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
6030 | receive update events. No other windows will receive update | |
6031 | events. | |
6032 | ||
6033 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
6034 | value to set the delay between updates. You may need to call | |
6035 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
6036 | a dialog is about to be shown, in case the user sees a slight | |
6037 | delay before windows are updated. | |
6038 | ||
6039 | Note that although events are sent in idle time, defining a EVT_IDLE | |
6040 | handler for a window does not affect this because the events are sent | |
6041 | from an internal idle handler. | |
6042 | ||
6043 | wxWidgets tries to optimize update events on some platforms. On | |
6044 | Windows and GTK+, events for menubar items are only sent when the menu | |
6045 | is about to be shown, and not in idle time. | |
6046 | ||
6047 | """ | |
6048 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6049 | __repr__ = _swig_repr | |
6050 | def __init__(self, *args, **kwargs): | |
6051 | """ | |
6052 | __init__(self, int commandId=0) -> UpdateUIEvent | |
6053 | ||
6054 | Constructor | |
6055 | """ | |
6056 | _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs)) | |
6057 | def GetChecked(*args, **kwargs): | |
6058 | """ | |
6059 | GetChecked(self) -> bool | |
6060 | ||
6061 | Returns ``True`` if the UI element should be checked. | |
6062 | """ | |
6063 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) | |
6064 | ||
6065 | def GetEnabled(*args, **kwargs): | |
6066 | """ | |
6067 | GetEnabled(self) -> bool | |
6068 | ||
6069 | Returns ``True`` if the UI element should be enabled. | |
6070 | """ | |
6071 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) | |
6072 | ||
6073 | def GetShown(*args, **kwargs): | |
6074 | """ | |
6075 | GetShown(self) -> bool | |
6076 | ||
6077 | Returns ``True`` if the UI element should be shown. | |
6078 | """ | |
6079 | return _core_.UpdateUIEvent_GetShown(*args, **kwargs) | |
6080 | ||
6081 | def GetText(*args, **kwargs): | |
6082 | """ | |
6083 | GetText(self) -> String | |
6084 | ||
6085 | Returns the text that should be set for the UI element. | |
6086 | """ | |
6087 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) | |
6088 | ||
6089 | def GetSetText(*args, **kwargs): | |
6090 | """ | |
6091 | GetSetText(self) -> bool | |
6092 | ||
6093 | Returns ``True`` if the application has called `SetText`. For | |
6094 | wxWidgets internal use only. | |
6095 | """ | |
6096 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) | |
6097 | ||
6098 | def GetSetChecked(*args, **kwargs): | |
6099 | """ | |
6100 | GetSetChecked(self) -> bool | |
6101 | ||
6102 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
6103 | internal use only. | |
6104 | """ | |
6105 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) | |
6106 | ||
6107 | def GetSetEnabled(*args, **kwargs): | |
6108 | """ | |
6109 | GetSetEnabled(self) -> bool | |
6110 | ||
6111 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
6112 | internal use only. | |
6113 | """ | |
6114 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) | |
6115 | ||
6116 | def GetSetShown(*args, **kwargs): | |
6117 | """ | |
6118 | GetSetShown(self) -> bool | |
6119 | ||
6120 | Returns ``True`` if the application has called `Show`. For wxWidgets | |
6121 | internal use only. | |
6122 | """ | |
6123 | return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs) | |
6124 | ||
6125 | def Check(*args, **kwargs): | |
6126 | """ | |
6127 | Check(self, bool check) | |
6128 | ||
6129 | Check or uncheck the UI element. | |
6130 | """ | |
6131 | return _core_.UpdateUIEvent_Check(*args, **kwargs) | |
6132 | ||
6133 | def Enable(*args, **kwargs): | |
6134 | """ | |
6135 | Enable(self, bool enable) | |
6136 | ||
6137 | Enable or disable the UI element. | |
6138 | """ | |
6139 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) | |
6140 | ||
6141 | def Show(*args, **kwargs): | |
6142 | """ | |
6143 | Show(self, bool show) | |
6144 | ||
6145 | Show or hide the UI element. | |
6146 | """ | |
6147 | return _core_.UpdateUIEvent_Show(*args, **kwargs) | |
6148 | ||
6149 | def SetText(*args, **kwargs): | |
6150 | """ | |
6151 | SetText(self, String text) | |
6152 | ||
6153 | Sets the text for this UI element. | |
6154 | """ | |
6155 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) | |
6156 | ||
6157 | def SetUpdateInterval(*args, **kwargs): | |
6158 | """ | |
6159 | SetUpdateInterval(long updateInterval) | |
6160 | ||
6161 | Sets the interval between updates in milliseconds. Set to -1 to | |
6162 | disable updates, or to 0 to update as frequently as possible. The | |
6163 | default is 0. | |
6164 | ||
6165 | Use this to reduce the overhead of UI update events if your | |
6166 | application has a lot of windows. If you set the value to -1 or | |
6167 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
6168 | at appropriate points in your application, such as when a dialog is | |
6169 | about to be shown. | |
6170 | """ | |
6171 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) | |
6172 | ||
6173 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
6174 | def GetUpdateInterval(*args, **kwargs): | |
6175 | """ | |
6176 | GetUpdateInterval() -> long | |
6177 | ||
6178 | Returns the current interval between updates in milliseconds. -1 | |
6179 | disables updates, 0 updates as frequently as possible. | |
6180 | """ | |
6181 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) | |
6182 | ||
6183 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
6184 | def CanUpdate(*args, **kwargs): | |
6185 | """ | |
6186 | CanUpdate(Window win) -> bool | |
6187 | ||
6188 | Returns ``True`` if it is appropriate to update (send UI update events | |
6189 | to) this window. | |
6190 | ||
6191 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6192 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6193 | events were last sent in idle time, and the update interval, to | |
6194 | determine whether events should be sent to this window now. By default | |
6195 | this will always return true because the update mode is initially | |
6196 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6197 | events will be sent as often as possible. You can reduce the frequency | |
6198 | that events are sent by changing the mode and/or setting an update | |
6199 | interval. | |
6200 | ||
6201 | """ | |
6202 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) | |
6203 | ||
6204 | CanUpdate = staticmethod(CanUpdate) | |
6205 | def ResetUpdateTime(*args, **kwargs): | |
6206 | """ | |
6207 | ResetUpdateTime() | |
6208 | ||
6209 | Used internally to reset the last-updated time to the current time. It | |
6210 | is assumed that update events are normally sent in idle time, so this | |
6211 | is called at the end of idle processing. | |
6212 | """ | |
6213 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) | |
6214 | ||
6215 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
6216 | def SetMode(*args, **kwargs): | |
6217 | """ | |
6218 | SetMode(int mode) | |
6219 | ||
6220 | Specify how wxWidgets will send update events: to all windows, or only | |
6221 | to those which specify that they will process the events. | |
6222 | ||
6223 | The mode may be one of the following values: | |
6224 | ||
6225 | ============================= ========================================== | |
6226 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6227 | is the default setting. | |
6228 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6229 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6230 | style set. | |
6231 | ============================= ========================================== | |
6232 | ||
6233 | """ | |
6234 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) | |
6235 | ||
6236 | SetMode = staticmethod(SetMode) | |
6237 | def GetMode(*args, **kwargs): | |
6238 | """ | |
6239 | GetMode() -> int | |
6240 | ||
6241 | Returns a value specifying how wxWidgets will send update events: to | |
6242 | all windows, or only to those which specify that they will process the | |
6243 | events. | |
6244 | """ | |
6245 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) | |
6246 | ||
6247 | GetMode = staticmethod(GetMode) | |
6248 | Checked = property(GetChecked,Check,doc="See `GetChecked`") | |
6249 | Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`") | |
6250 | Shown = property(GetShown,Show,doc="See `GetShown`") | |
6251 | Text = property(GetText,SetText,doc="See `GetText` and `SetText`") | |
6252 | _core_.UpdateUIEvent_swigregister(UpdateUIEvent) | |
6253 | ||
6254 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): | |
6255 | """ | |
6256 | UpdateUIEvent_SetUpdateInterval(long updateInterval) | |
6257 | ||
6258 | Sets the interval between updates in milliseconds. Set to -1 to | |
6259 | disable updates, or to 0 to update as frequently as possible. The | |
6260 | default is 0. | |
6261 | ||
6262 | Use this to reduce the overhead of UI update events if your | |
6263 | application has a lot of windows. If you set the value to -1 or | |
6264 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
6265 | at appropriate points in your application, such as when a dialog is | |
6266 | about to be shown. | |
6267 | """ | |
6268 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) | |
6269 | ||
6270 | def UpdateUIEvent_GetUpdateInterval(*args): | |
6271 | """ | |
6272 | UpdateUIEvent_GetUpdateInterval() -> long | |
6273 | ||
6274 | Returns the current interval between updates in milliseconds. -1 | |
6275 | disables updates, 0 updates as frequently as possible. | |
6276 | """ | |
6277 | return _core_.UpdateUIEvent_GetUpdateInterval(*args) | |
6278 | ||
6279 | def UpdateUIEvent_CanUpdate(*args, **kwargs): | |
6280 | """ | |
6281 | UpdateUIEvent_CanUpdate(Window win) -> bool | |
6282 | ||
6283 | Returns ``True`` if it is appropriate to update (send UI update events | |
6284 | to) this window. | |
6285 | ||
6286 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6287 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6288 | events were last sent in idle time, and the update interval, to | |
6289 | determine whether events should be sent to this window now. By default | |
6290 | this will always return true because the update mode is initially | |
6291 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6292 | events will be sent as often as possible. You can reduce the frequency | |
6293 | that events are sent by changing the mode and/or setting an update | |
6294 | interval. | |
6295 | ||
6296 | """ | |
6297 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) | |
6298 | ||
6299 | def UpdateUIEvent_ResetUpdateTime(*args): | |
6300 | """ | |
6301 | UpdateUIEvent_ResetUpdateTime() | |
6302 | ||
6303 | Used internally to reset the last-updated time to the current time. It | |
6304 | is assumed that update events are normally sent in idle time, so this | |
6305 | is called at the end of idle processing. | |
6306 | """ | |
6307 | return _core_.UpdateUIEvent_ResetUpdateTime(*args) | |
6308 | ||
6309 | def UpdateUIEvent_SetMode(*args, **kwargs): | |
6310 | """ | |
6311 | UpdateUIEvent_SetMode(int mode) | |
6312 | ||
6313 | Specify how wxWidgets will send update events: to all windows, or only | |
6314 | to those which specify that they will process the events. | |
6315 | ||
6316 | The mode may be one of the following values: | |
6317 | ||
6318 | ============================= ========================================== | |
6319 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6320 | is the default setting. | |
6321 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6322 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6323 | style set. | |
6324 | ============================= ========================================== | |
6325 | ||
6326 | """ | |
6327 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) | |
6328 | ||
6329 | def UpdateUIEvent_GetMode(*args): | |
6330 | """ | |
6331 | UpdateUIEvent_GetMode() -> int | |
6332 | ||
6333 | Returns a value specifying how wxWidgets will send update events: to | |
6334 | all windows, or only to those which specify that they will process the | |
6335 | events. | |
6336 | """ | |
6337 | return _core_.UpdateUIEvent_GetMode(*args) | |
6338 | ||
6339 | #--------------------------------------------------------------------------- | |
6340 | ||
6341 | class SysColourChangedEvent(Event): | |
6342 | """ | |
6343 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
6344 | when the user changes the colour settings using the control | |
6345 | panel. This is only applicable under Windows. | |
6346 | ||
6347 | The default event handler for this event propagates the event to child | |
6348 | windows, since Windows only sends the events to top-level windows. If | |
6349 | intercepting this event for a top-level window, remember to call | |
6350 | `Skip` so the the base class handler will still be executed, or to | |
6351 | pass the event on to the window's children explicitly. | |
6352 | ||
6353 | """ | |
6354 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6355 | __repr__ = _swig_repr | |
6356 | def __init__(self, *args, **kwargs): | |
6357 | """ | |
6358 | __init__(self) -> SysColourChangedEvent | |
6359 | ||
6360 | Constructor | |
6361 | """ | |
6362 | _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs)) | |
6363 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent) | |
6364 | ||
6365 | #--------------------------------------------------------------------------- | |
6366 | ||
6367 | class MouseCaptureChangedEvent(Event): | |
6368 | """ | |
6369 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
6370 | a window that loses its mouse capture. This is called even if | |
6371 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
6372 | this event allows an application to cater for unexpected capture | |
6373 | releases which might otherwise confuse mouse handling code. | |
6374 | ||
6375 | This event is implemented under Windows only. | |
6376 | """ | |
6377 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6378 | __repr__ = _swig_repr | |
6379 | def __init__(self, *args, **kwargs): | |
6380 | """ | |
6381 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
6382 | ||
6383 | Constructor | |
6384 | """ | |
6385 | _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs)) | |
6386 | def GetCapturedWindow(*args, **kwargs): | |
6387 | """ | |
6388 | GetCapturedWindow(self) -> Window | |
6389 | ||
6390 | Returns the window that gained the capture, or ``None`` if it was a | |
6391 | non-wxWidgets window. | |
6392 | """ | |
6393 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) | |
6394 | ||
6395 | CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`") | |
6396 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent) | |
6397 | ||
6398 | #--------------------------------------------------------------------------- | |
6399 | ||
6400 | class MouseCaptureLostEvent(Event): | |
6401 | """ | |
6402 | A mouse capture lost event is sent to a window that obtained mouse | |
6403 | capture, which was subsequently loss due to "external" event, for | |
6404 | example when a dialog box is shown or if another application captures | |
6405 | the mouse. | |
6406 | ||
6407 | If this happens, this event is sent to all windows that are on the | |
6408 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
6409 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
6410 | if the capture changes because of a call to CaptureMouse or | |
6411 | ReleaseMouse. | |
6412 | ||
6413 | This event is currently emitted under Windows only. | |
6414 | ||
6415 | """ | |
6416 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6417 | __repr__ = _swig_repr | |
6418 | def __init__(self, *args, **kwargs): | |
6419 | """ | |
6420 | __init__(self, int winid=0) -> MouseCaptureLostEvent | |
6421 | ||
6422 | A mouse capture lost event is sent to a window that obtained mouse | |
6423 | capture, which was subsequently loss due to "external" event, for | |
6424 | example when a dialog box is shown or if another application captures | |
6425 | the mouse. | |
6426 | ||
6427 | If this happens, this event is sent to all windows that are on the | |
6428 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
6429 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
6430 | if the capture changes because of a call to CaptureMouse or | |
6431 | ReleaseMouse. | |
6432 | ||
6433 | This event is currently emitted under Windows only. | |
6434 | ||
6435 | """ | |
6436 | _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs)) | |
6437 | _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent) | |
6438 | ||
6439 | #--------------------------------------------------------------------------- | |
6440 | ||
6441 | class DisplayChangedEvent(Event): | |
6442 | """ | |
6443 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
6444 | resolution has changed. | |
6445 | ||
6446 | This event is implemented under Windows only. | |
6447 | """ | |
6448 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6449 | __repr__ = _swig_repr | |
6450 | def __init__(self, *args, **kwargs): | |
6451 | """__init__(self) -> DisplayChangedEvent""" | |
6452 | _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs)) | |
6453 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent) | |
6454 | ||
6455 | #--------------------------------------------------------------------------- | |
6456 | ||
6457 | class PaletteChangedEvent(Event): | |
6458 | """ | |
6459 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6460 | changed, thereby giving each window a chance to redo their own to | |
6461 | match. | |
6462 | ||
6463 | This event is implemented under Windows only. | |
6464 | """ | |
6465 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6466 | __repr__ = _swig_repr | |
6467 | def __init__(self, *args, **kwargs): | |
6468 | """ | |
6469 | __init__(self, int id=0) -> PaletteChangedEvent | |
6470 | ||
6471 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6472 | changed, thereby giving each window a chance to redo their own to | |
6473 | match. | |
6474 | ||
6475 | This event is implemented under Windows only. | |
6476 | """ | |
6477 | _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs)) | |
6478 | def SetChangedWindow(*args, **kwargs): | |
6479 | """SetChangedWindow(self, Window win)""" | |
6480 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) | |
6481 | ||
6482 | def GetChangedWindow(*args, **kwargs): | |
6483 | """GetChangedWindow(self) -> Window""" | |
6484 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) | |
6485 | ||
6486 | ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`") | |
6487 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent) | |
6488 | ||
6489 | #--------------------------------------------------------------------------- | |
6490 | ||
6491 | class QueryNewPaletteEvent(Event): | |
6492 | """ | |
6493 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6494 | focus and should re-do its palette. | |
6495 | ||
6496 | This event is implemented under Windows only. | |
6497 | """ | |
6498 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6499 | __repr__ = _swig_repr | |
6500 | def __init__(self, *args, **kwargs): | |
6501 | """ | |
6502 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6503 | ||
6504 | Constructor. | |
6505 | """ | |
6506 | _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs)) | |
6507 | def SetPaletteRealized(*args, **kwargs): | |
6508 | """ | |
6509 | SetPaletteRealized(self, bool realized) | |
6510 | ||
6511 | App should set this if it changes the palette. | |
6512 | """ | |
6513 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) | |
6514 | ||
6515 | def GetPaletteRealized(*args, **kwargs): | |
6516 | """GetPaletteRealized(self) -> bool""" | |
6517 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) | |
6518 | ||
6519 | PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`") | |
6520 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent) | |
6521 | ||
6522 | #--------------------------------------------------------------------------- | |
6523 | ||
6524 | class NavigationKeyEvent(Event): | |
6525 | """ | |
6526 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6527 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6528 | catch navigation events in applications as there are already | |
6529 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6530 | it useful to send navigation events in certain situations to change | |
6531 | the focus in certain ways, although it's probably easier to just call | |
6532 | `wx.Window.Navigate`. | |
6533 | """ | |
6534 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6535 | __repr__ = _swig_repr | |
6536 | def __init__(self, *args, **kwargs): | |
6537 | """__init__(self) -> NavigationKeyEvent""" | |
6538 | _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs)) | |
6539 | def GetDirection(*args, **kwargs): | |
6540 | """ | |
6541 | GetDirection(self) -> bool | |
6542 | ||
6543 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6544 | """ | |
6545 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) | |
6546 | ||
6547 | def SetDirection(*args, **kwargs): | |
6548 | """ | |
6549 | SetDirection(self, bool forward) | |
6550 | ||
6551 | Specify the direction that the navigation should take. Usually the | |
6552 | difference between using Tab and Shift-Tab. | |
6553 | """ | |
6554 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) | |
6555 | ||
6556 | def IsWindowChange(*args, **kwargs): | |
6557 | """ | |
6558 | IsWindowChange(self) -> bool | |
6559 | ||
6560 | Returns ``True`` if window change is allowed. | |
6561 | """ | |
6562 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) | |
6563 | ||
6564 | def SetWindowChange(*args, **kwargs): | |
6565 | """ | |
6566 | SetWindowChange(self, bool ischange) | |
6567 | ||
6568 | Specify if the navigation should be able to change parent windows. | |
6569 | For example, changing notebook pages, etc. This is usually implemented | |
6570 | by using Control-Tab. | |
6571 | """ | |
6572 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) | |
6573 | ||
6574 | def IsFromTab(*args, **kwargs): | |
6575 | """ | |
6576 | IsFromTab(self) -> bool | |
6577 | ||
6578 | Returns ``True`` if the navigation event is originated from the Tab | |
6579 | key. | |
6580 | """ | |
6581 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) | |
6582 | ||
6583 | def SetFromTab(*args, **kwargs): | |
6584 | """ | |
6585 | SetFromTab(self, bool bIs) | |
6586 | ||
6587 | Set to true under MSW if the event was generated using the tab key. | |
6588 | This is required for proper navogation over radio buttons. | |
6589 | """ | |
6590 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) | |
6591 | ||
6592 | def SetFlags(*args, **kwargs): | |
6593 | """ | |
6594 | SetFlags(self, long flags) | |
6595 | ||
6596 | Set the navigation flags to a combination of the following: | |
6597 | ||
6598 | * wx.NavigationKeyEvent.IsBackward | |
6599 | * wx.NavigationKeyEvent.IsForward | |
6600 | * wx.NavigationKeyEvent.WinChange | |
6601 | * wx.NavigationKeyEvent.FromTab | |
6602 | ||
6603 | """ | |
6604 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) | |
6605 | ||
6606 | def GetCurrentFocus(*args, **kwargs): | |
6607 | """ | |
6608 | GetCurrentFocus(self) -> Window | |
6609 | ||
6610 | Returns the child window which currenty has the focus. May be | |
6611 | ``None``. | |
6612 | """ | |
6613 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) | |
6614 | ||
6615 | def SetCurrentFocus(*args, **kwargs): | |
6616 | """ | |
6617 | SetCurrentFocus(self, Window win) | |
6618 | ||
6619 | Set the window that has the focus. | |
6620 | """ | |
6621 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) | |
6622 | ||
6623 | IsBackward = _core_.NavigationKeyEvent_IsBackward | |
6624 | IsForward = _core_.NavigationKeyEvent_IsForward | |
6625 | WinChange = _core_.NavigationKeyEvent_WinChange | |
6626 | FromTab = _core_.NavigationKeyEvent_FromTab | |
6627 | CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`") | |
6628 | Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`") | |
6629 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent) | |
6630 | ||
6631 | #--------------------------------------------------------------------------- | |
6632 | ||
6633 | class WindowCreateEvent(CommandEvent): | |
6634 | """ | |
6635 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6636 | underlying GUI object) exists. | |
6637 | """ | |
6638 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6639 | __repr__ = _swig_repr | |
6640 | def __init__(self, *args, **kwargs): | |
6641 | """ | |
6642 | __init__(self, Window win=None) -> WindowCreateEvent | |
6643 | ||
6644 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6645 | underlying GUI object) exists. | |
6646 | """ | |
6647 | _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs)) | |
6648 | def GetWindow(*args, **kwargs): | |
6649 | """ | |
6650 | GetWindow(self) -> Window | |
6651 | ||
6652 | Returns the window that this event refers to. | |
6653 | """ | |
6654 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) | |
6655 | ||
6656 | Window = property(GetWindow,doc="See `GetWindow`") | |
6657 | _core_.WindowCreateEvent_swigregister(WindowCreateEvent) | |
6658 | ||
6659 | class WindowDestroyEvent(CommandEvent): | |
6660 | """ | |
6661 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor | |
6662 | when the GUI window is destroyed. | |
6663 | ||
6664 | When a class derived from `wx.Window` is destroyed its destructor will | |
6665 | have already run by the time this event is sent. Therefore this event | |
6666 | will not usually be received at all by the window itself. Since it is | |
6667 | received after the destructor has run, an object should not try to | |
6668 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6669 | notification of the destruction of another window. | |
6670 | """ | |
6671 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6672 | __repr__ = _swig_repr | |
6673 | def __init__(self, *args, **kwargs): | |
6674 | """ | |
6675 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6676 | ||
6677 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor | |
6678 | when the GUI window is destroyed. | |
6679 | ||
6680 | When a class derived from `wx.Window` is destroyed its destructor will | |
6681 | have already run by the time this event is sent. Therefore this event | |
6682 | will not usually be received at all by the window itself. Since it is | |
6683 | received after the destructor has run, an object should not try to | |
6684 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6685 | notification of the destruction of another window. | |
6686 | """ | |
6687 | _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs)) | |
6688 | def GetWindow(*args, **kwargs): | |
6689 | """ | |
6690 | GetWindow(self) -> Window | |
6691 | ||
6692 | Returns the window that this event refers to. | |
6693 | """ | |
6694 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) | |
6695 | ||
6696 | Window = property(GetWindow,doc="See `GetWindow`") | |
6697 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent) | |
6698 | ||
6699 | #--------------------------------------------------------------------------- | |
6700 | ||
6701 | class ContextMenuEvent(CommandEvent): | |
6702 | """ | |
6703 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6704 | give the application a chance to show a context (popup) menu. | |
6705 | """ | |
6706 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6707 | __repr__ = _swig_repr | |
6708 | def __init__(self, *args, **kwargs): | |
6709 | """ | |
6710 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent | |
6711 | ||
6712 | Constructor. | |
6713 | """ | |
6714 | _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs)) | |
6715 | def GetPosition(*args, **kwargs): | |
6716 | """ | |
6717 | GetPosition(self) -> Point | |
6718 | ||
6719 | Returns the position (in screen coordinants) at which the menu should | |
6720 | be shown. | |
6721 | """ | |
6722 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) | |
6723 | ||
6724 | def SetPosition(*args, **kwargs): | |
6725 | """ | |
6726 | SetPosition(self, Point pos) | |
6727 | ||
6728 | Sets the position at which the menu should be shown. | |
6729 | """ | |
6730 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) | |
6731 | ||
6732 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
6733 | _core_.ContextMenuEvent_swigregister(ContextMenuEvent) | |
6734 | ||
6735 | #--------------------------------------------------------------------------- | |
6736 | ||
6737 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL | |
6738 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
6739 | class IdleEvent(Event): | |
6740 | """ | |
6741 | This class is used for EVT_IDLE events, which are generated and sent | |
6742 | when the application *becomes* idle. In other words, the when the | |
6743 | event queue becomes empty then idle events are sent to all windows (by | |
6744 | default) and as long as none of them call `RequestMore` then there are | |
6745 | no more idle events until after the system event queue has some normal | |
6746 | events and then becomes empty again. | |
6747 | ||
6748 | By default, idle events are sent to all windows. If this is causing a | |
6749 | significant overhead in your application, you can call | |
6750 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6751 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6752 | which should receive idle events. Then idle events will only be sent | |
6753 | to those windows and not to any others. | |
6754 | """ | |
6755 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6756 | __repr__ = _swig_repr | |
6757 | def __init__(self, *args, **kwargs): | |
6758 | """ | |
6759 | __init__(self) -> IdleEvent | |
6760 | ||
6761 | Constructor | |
6762 | """ | |
6763 | _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs)) | |
6764 | def RequestMore(*args, **kwargs): | |
6765 | """ | |
6766 | RequestMore(self, bool needMore=True) | |
6767 | ||
6768 | Tells wxWidgets that more processing is required. This function can be | |
6769 | called by an EVT_IDLE handler for a window to indicate that the | |
6770 | application should forward the EVT_IDLE event once more to the | |
6771 | application windows. If no window calls this function during its | |
6772 | EVT_IDLE handler, then the application will remain in a passive event | |
6773 | loop until a new event is posted to the application by the windowing | |
6774 | system. | |
6775 | """ | |
6776 | return _core_.IdleEvent_RequestMore(*args, **kwargs) | |
6777 | ||
6778 | def MoreRequested(*args, **kwargs): | |
6779 | """ | |
6780 | MoreRequested(self) -> bool | |
6781 | ||
6782 | Returns ``True`` if the OnIdle function processing this event | |
6783 | requested more processing time. | |
6784 | """ | |
6785 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) | |
6786 | ||
6787 | def SetMode(*args, **kwargs): | |
6788 | """ | |
6789 | SetMode(int mode) | |
6790 | ||
6791 | Static method for specifying how wxWidgets will send idle events: to | |
6792 | all windows, or only to those which specify that they will process the | |
6793 | events. | |
6794 | ||
6795 | The mode can be one of the following values: | |
6796 | ||
6797 | ========================= ======================================== | |
6798 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6799 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6800 | the wx.WS_EX_PROCESS_IDLE extra style | |
6801 | flag set. | |
6802 | ========================= ======================================== | |
6803 | ||
6804 | """ | |
6805 | return _core_.IdleEvent_SetMode(*args, **kwargs) | |
6806 | ||
6807 | SetMode = staticmethod(SetMode) | |
6808 | def GetMode(*args, **kwargs): | |
6809 | """ | |
6810 | GetMode() -> int | |
6811 | ||
6812 | Static method returning a value specifying how wxWidgets will send | |
6813 | idle events: to all windows, or only to those which specify that they | |
6814 | will process the events. | |
6815 | """ | |
6816 | return _core_.IdleEvent_GetMode(*args, **kwargs) | |
6817 | ||
6818 | GetMode = staticmethod(GetMode) | |
6819 | def CanSend(*args, **kwargs): | |
6820 | """ | |
6821 | CanSend(Window win) -> bool | |
6822 | ||
6823 | Returns ``True`` if it is appropriate to send idle events to this | |
6824 | window. | |
6825 | ||
6826 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6827 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6828 | events should be sent to this window now. By default this will always | |
6829 | return ``True`` because the update mode is initially | |
6830 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6831 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6832 | """ | |
6833 | return _core_.IdleEvent_CanSend(*args, **kwargs) | |
6834 | ||
6835 | CanSend = staticmethod(CanSend) | |
6836 | _core_.IdleEvent_swigregister(IdleEvent) | |
6837 | ||
6838 | def IdleEvent_SetMode(*args, **kwargs): | |
6839 | """ | |
6840 | IdleEvent_SetMode(int mode) | |
6841 | ||
6842 | Static method for specifying how wxWidgets will send idle events: to | |
6843 | all windows, or only to those which specify that they will process the | |
6844 | events. | |
6845 | ||
6846 | The mode can be one of the following values: | |
6847 | ||
6848 | ========================= ======================================== | |
6849 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6850 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6851 | the wx.WS_EX_PROCESS_IDLE extra style | |
6852 | flag set. | |
6853 | ========================= ======================================== | |
6854 | ||
6855 | """ | |
6856 | return _core_.IdleEvent_SetMode(*args, **kwargs) | |
6857 | ||
6858 | def IdleEvent_GetMode(*args): | |
6859 | """ | |
6860 | IdleEvent_GetMode() -> int | |
6861 | ||
6862 | Static method returning a value specifying how wxWidgets will send | |
6863 | idle events: to all windows, or only to those which specify that they | |
6864 | will process the events. | |
6865 | """ | |
6866 | return _core_.IdleEvent_GetMode(*args) | |
6867 | ||
6868 | def IdleEvent_CanSend(*args, **kwargs): | |
6869 | """ | |
6870 | IdleEvent_CanSend(Window win) -> bool | |
6871 | ||
6872 | Returns ``True`` if it is appropriate to send idle events to this | |
6873 | window. | |
6874 | ||
6875 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6876 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6877 | events should be sent to this window now. By default this will always | |
6878 | return ``True`` because the update mode is initially | |
6879 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6880 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6881 | """ | |
6882 | return _core_.IdleEvent_CanSend(*args, **kwargs) | |
6883 | ||
6884 | #--------------------------------------------------------------------------- | |
6885 | ||
6886 | class ClipboardTextEvent(CommandEvent): | |
6887 | """ | |
6888 | A Clipboard Text event is sent when a window intercepts a text | |
6889 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6890 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6891 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6892 | generated automatically for a Rich Edit text control. | |
6893 | """ | |
6894 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6895 | __repr__ = _swig_repr | |
6896 | def __init__(self, *args, **kwargs): | |
6897 | """ | |
6898 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent | |
6899 | ||
6900 | A Clipboard Text event is sent when a window intercepts a text | |
6901 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6902 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6903 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6904 | generated automatically for a Rich Edit text control. | |
6905 | """ | |
6906 | _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs)) | |
6907 | _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent) | |
6908 | ||
6909 | #--------------------------------------------------------------------------- | |
6910 | ||
6911 | class PyEvent(Event): | |
6912 | """ | |
6913 | wx.PyEvent can be used as a base class for implementing custom event | |
6914 | types in Python. You should derived from this class instead of | |
6915 | `wx.Event` because this class is Python-aware and is able to transport | |
6916 | its Python bits safely through the wxWidgets event system and have | |
6917 | them still be there when the event handler is invoked. | |
6918 | ||
6919 | :see: `wx.PyCommandEvent` | |
6920 | ||
6921 | """ | |
6922 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6923 | __repr__ = _swig_repr | |
6924 | def __init__(self, *args, **kwargs): | |
6925 | """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent""" | |
6926 | _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs)) | |
6927 | self._SetSelf(self) | |
6928 | ||
6929 | __swig_destroy__ = _core_.delete_PyEvent | |
6930 | __del__ = lambda self : None; | |
6931 | def _SetSelf(*args, **kwargs): | |
6932 | """_SetSelf(self, PyObject self)""" | |
6933 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
6934 | ||
6935 | def _GetSelf(*args, **kwargs): | |
6936 | """_GetSelf(self) -> PyObject""" | |
6937 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
6938 | ||
6939 | _core_.PyEvent_swigregister(PyEvent) | |
6940 | ||
6941 | class PyCommandEvent(CommandEvent): | |
6942 | """ | |
6943 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6944 | event types in Python, where the event shoudl travel up to parent | |
6945 | windows looking for a handler. You should derived from this class | |
6946 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6947 | able to transport its Python bits safely through the wxWidgets event | |
6948 | system and have them still be there when the event handler is invoked. | |
6949 | ||
6950 | :see: `wx.PyEvent` | |
6951 | ||
6952 | """ | |
6953 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6954 | __repr__ = _swig_repr | |
6955 | def __init__(self, *args, **kwargs): | |
6956 | """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" | |
6957 | _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs)) | |
6958 | self._SetSelf(self) | |
6959 | ||
6960 | __swig_destroy__ = _core_.delete_PyCommandEvent | |
6961 | __del__ = lambda self : None; | |
6962 | def _SetSelf(*args, **kwargs): | |
6963 | """_SetSelf(self, PyObject self)""" | |
6964 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
6965 | ||
6966 | def _GetSelf(*args, **kwargs): | |
6967 | """_GetSelf(self) -> PyObject""" | |
6968 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
6969 | ||
6970 | _core_.PyCommandEvent_swigregister(PyCommandEvent) | |
6971 | ||
6972 | class DateEvent(CommandEvent): | |
6973 | """ | |
6974 | This event class holds information about a date change event and is | |
6975 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6976 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6977 | EVT_DATE_CHANGED. | |
6978 | """ | |
6979 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6980 | __repr__ = _swig_repr | |
6981 | def __init__(self, *args, **kwargs): | |
6982 | """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent""" | |
6983 | _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs)) | |
6984 | def GetDate(*args, **kwargs): | |
6985 | """ | |
6986 | GetDate(self) -> DateTime | |
6987 | ||
6988 | Returns the date. | |
6989 | """ | |
6990 | return _core_.DateEvent_GetDate(*args, **kwargs) | |
6991 | ||
6992 | def SetDate(*args, **kwargs): | |
6993 | """ | |
6994 | SetDate(self, DateTime date) | |
6995 | ||
6996 | Sets the date carried by the event, normally only used by the library | |
6997 | internally. | |
6998 | """ | |
6999 | return _core_.DateEvent_SetDate(*args, **kwargs) | |
7000 | ||
7001 | Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`") | |
7002 | _core_.DateEvent_swigregister(DateEvent) | |
7003 | ||
7004 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
7005 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
7006 | ||
7007 | class EventBlocker(EvtHandler): | |
7008 | """Helper class to temporarily disable event handling for a window.""" | |
7009 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
7010 | __repr__ = _swig_repr | |
7011 | def __init__(self, *args, **kwargs): | |
7012 | """ | |
7013 | __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker | |
7014 | ||
7015 | Helper class to temporarily disable event handling for a window. | |
7016 | """ | |
7017 | _core_.EventBlocker_swiginit(self,_core_.new_EventBlocker(*args, **kwargs)) | |
7018 | __swig_destroy__ = _core_.delete_EventBlocker | |
7019 | __del__ = lambda self : None; | |
7020 | def Block(*args, **kwargs): | |
7021 | """Block(self, EventType type)""" | |
7022 | return _core_.EventBlocker_Block(*args, **kwargs) | |
7023 | ||
7024 | _core_.EventBlocker_swigregister(EventBlocker) | |
7025 | ||
7026 | #--------------------------------------------------------------------------- | |
7027 | ||
7028 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS | |
7029 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
7030 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
7031 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
7032 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
7033 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
7034 | class PyApp(EvtHandler): | |
7035 | """ | |
7036 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
7037 | `wx.App` class (or some other derived class) instead. | |
7038 | """ | |
7039 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
7040 | __repr__ = _swig_repr | |
7041 | def __init__(self, *args, **kwargs): | |
7042 | """ | |
7043 | __init__(self) -> PyApp | |
7044 | ||
7045 | Create a new application object, starting the bootstrap process. | |
7046 | """ | |
7047 | _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs)) | |
7048 | self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp) | |
7049 | ||
7050 | __swig_destroy__ = _core_.delete_PyApp | |
7051 | __del__ = lambda self : None; | |
7052 | def _setCallbackInfo(*args, **kwargs): | |
7053 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)""" | |
7054 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) | |
7055 | ||
7056 | def GetAppName(*args, **kwargs): | |
7057 | """ | |
7058 | GetAppName(self) -> String | |
7059 | ||
7060 | Get the application name. | |
7061 | """ | |
7062 | return _core_.PyApp_GetAppName(*args, **kwargs) | |
7063 | ||
7064 | def SetAppName(*args, **kwargs): | |
7065 | """ | |
7066 | SetAppName(self, String name) | |
7067 | ||
7068 | Set the application name. This value may be used automatically by | |
7069 | `wx.Config` and such. | |
7070 | """ | |
7071 | return _core_.PyApp_SetAppName(*args, **kwargs) | |
7072 | ||
7073 | def GetClassName(*args, **kwargs): | |
7074 | """ | |
7075 | GetClassName(self) -> String | |
7076 | ||
7077 | Get the application's class name. | |
7078 | """ | |
7079 | return _core_.PyApp_GetClassName(*args, **kwargs) | |
7080 | ||
7081 | def SetClassName(*args, **kwargs): | |
7082 | """ | |
7083 | SetClassName(self, String name) | |
7084 | ||
7085 | Set the application's class name. This value may be used for | |
7086 | X-resources if applicable for the platform | |
7087 | """ | |
7088 | return _core_.PyApp_SetClassName(*args, **kwargs) | |
7089 | ||
7090 | def GetVendorName(*args, **kwargs): | |
7091 | """ | |
7092 | GetVendorName(self) -> String | |
7093 | ||
7094 | Get the application's vendor name. | |
7095 | """ | |
7096 | return _core_.PyApp_GetVendorName(*args, **kwargs) | |
7097 | ||
7098 | def SetVendorName(*args, **kwargs): | |
7099 | """ | |
7100 | SetVendorName(self, String name) | |
7101 | ||
7102 | Set the application's vendor name. This value may be used | |
7103 | automatically by `wx.Config` and such. | |
7104 | """ | |
7105 | return _core_.PyApp_SetVendorName(*args, **kwargs) | |
7106 | ||
7107 | def GetTraits(*args, **kwargs): | |
7108 | """ | |
7109 | GetTraits(self) -> wxAppTraits | |
7110 | ||
7111 | Return (and create if necessary) the app traits object to which we | |
7112 | delegate for everything which either should be configurable by the | |
7113 | user (then he can change the default behaviour simply by overriding | |
7114 | CreateTraits() and returning his own traits object) or which is | |
7115 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
7116 | differences behind the common facade. | |
7117 | ||
7118 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
7119 | """ | |
7120 | return _core_.PyApp_GetTraits(*args, **kwargs) | |
7121 | ||
7122 | def ProcessPendingEvents(*args, **kwargs): | |
7123 | """ | |
7124 | ProcessPendingEvents(self) | |
7125 | ||
7126 | Process all events in the Pending Events list -- it is necessary to | |
7127 | call this function to process posted events. This normally happens | |
7128 | during each event loop iteration. | |
7129 | """ | |
7130 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) | |
7131 | ||
7132 | def Yield(*args, **kwargs): | |
7133 | """ | |
7134 | Yield(self, bool onlyIfNeeded=False) -> bool | |
7135 | ||
7136 | Process all currently pending events right now, instead of waiting | |
7137 | until return to the event loop. It is an error to call ``Yield`` | |
7138 | recursively unless the value of ``onlyIfNeeded`` is True. | |
7139 | ||
7140 | :warning: This function is dangerous as it can lead to unexpected | |
7141 | reentrancies (i.e. when called from an event handler it may | |
7142 | result in calling the same event handler again), use with | |
7143 | extreme care or, better, don't use at all! | |
7144 | ||
7145 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` | |
7146 | ||
7147 | """ | |
7148 | return _core_.PyApp_Yield(*args, **kwargs) | |
7149 | ||
7150 | def WakeUpIdle(*args, **kwargs): | |
7151 | """ | |
7152 | WakeUpIdle(self) | |
7153 | ||
7154 | Make sure that idle events are sent again. | |
7155 | :see: `wx.WakeUpIdle` | |
7156 | """ | |
7157 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) | |
7158 | ||
7159 | def IsMainLoopRunning(*args, **kwargs): | |
7160 | """ | |
7161 | IsMainLoopRunning() -> bool | |
7162 | ||
7163 | Returns True if we're running the main loop, i.e. if the events can | |
7164 | currently be dispatched. | |
7165 | """ | |
7166 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
7167 | ||
7168 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
7169 | def MainLoop(*args, **kwargs): | |
7170 | """ | |
7171 | MainLoop(self) -> int | |
7172 | ||
7173 | Execute the main GUI loop, the function doesn't normally return until | |
7174 | all top level windows have been closed and destroyed. | |
7175 | """ | |
7176 | return _core_.PyApp_MainLoop(*args, **kwargs) | |
7177 | ||
7178 | def Exit(*args, **kwargs): | |
7179 | """ | |
7180 | Exit(self) | |
7181 | ||
7182 | Exit the main loop thus terminating the application. | |
7183 | :see: `wx.Exit` | |
7184 | """ | |
7185 | return _core_.PyApp_Exit(*args, **kwargs) | |
7186 | ||
7187 | def GetLayoutDirection(*args, **kwargs): | |
7188 | """ | |
7189 | GetLayoutDirection(self) -> int | |
7190 | ||
7191 | Return the layout direction for the current locale. | |
7192 | """ | |
7193 | return _core_.PyApp_GetLayoutDirection(*args, **kwargs) | |
7194 | ||
7195 | def ExitMainLoop(*args, **kwargs): | |
7196 | """ | |
7197 | ExitMainLoop(self) | |
7198 | ||
7199 | Exit the main GUI loop during the next iteration of the main | |
7200 | loop, (i.e. it does not stop the program immediately!) | |
7201 | """ | |
7202 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) | |
7203 | ||
7204 | def Pending(*args, **kwargs): | |
7205 | """ | |
7206 | Pending(self) -> bool | |
7207 | ||
7208 | Returns True if there are unprocessed events in the event queue. | |
7209 | """ | |
7210 | return _core_.PyApp_Pending(*args, **kwargs) | |
7211 | ||
7212 | def Dispatch(*args, **kwargs): | |
7213 | """ | |
7214 | Dispatch(self) -> bool | |
7215 | ||
7216 | Process the first event in the event queue (blocks until an event | |
7217 | appears if there are none currently) | |
7218 | """ | |
7219 | return _core_.PyApp_Dispatch(*args, **kwargs) | |
7220 | ||
7221 | def ProcessIdle(*args, **kwargs): | |
7222 | """ | |
7223 | ProcessIdle(self) -> bool | |
7224 | ||
7225 | Called from the MainLoop when the application becomes idle (there are | |
7226 | no pending events) and sends a `wx.IdleEvent` to all interested | |
7227 | parties. Returns True if more idle events are needed, False if not. | |
7228 | """ | |
7229 | return _core_.PyApp_ProcessIdle(*args, **kwargs) | |
7230 | ||
7231 | def SendIdleEvents(*args, **kwargs): | |
7232 | """ | |
7233 | SendIdleEvents(self, Window win, IdleEvent event) -> bool | |
7234 | ||
7235 | Send idle event to window and all subwindows. Returns True if more | |
7236 | idle time is requested. | |
7237 | """ | |
7238 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) | |
7239 | ||
7240 | def IsActive(*args, **kwargs): | |
7241 | """ | |
7242 | IsActive(self) -> bool | |
7243 | ||
7244 | Return True if our app has focus. | |
7245 | """ | |
7246 | return _core_.PyApp_IsActive(*args, **kwargs) | |
7247 | ||
7248 | def SetTopWindow(*args, **kwargs): | |
7249 | """ | |
7250 | SetTopWindow(self, Window win) | |
7251 | ||
7252 | Set the *main* top level window | |
7253 | """ | |
7254 | return _core_.PyApp_SetTopWindow(*args, **kwargs) | |
7255 | ||
7256 | def GetTopWindow(*args, **kwargs): | |
7257 | """ | |
7258 | GetTopWindow(self) -> Window | |
7259 | ||
7260 | Return the *main* top level window (if it hadn't been set previously | |
7261 | with SetTopWindow(), will return just some top level window and, if | |
7262 | there not any, will return None) | |
7263 | """ | |
7264 | return _core_.PyApp_GetTopWindow(*args, **kwargs) | |
7265 | ||
7266 | def SetExitOnFrameDelete(*args, **kwargs): | |
7267 | """ | |
7268 | SetExitOnFrameDelete(self, bool flag) | |
7269 | ||
7270 | Control the exit behaviour: by default, the program will exit the main | |
7271 | loop (and so, usually, terminate) when the last top-level program | |
7272 | window is deleted. Beware that if you disable this behaviour (with | |
7273 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
7274 | explicitly from somewhere. | |
7275 | """ | |
7276 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) | |
7277 | ||
7278 | def GetExitOnFrameDelete(*args, **kwargs): | |
7279 | """ | |
7280 | GetExitOnFrameDelete(self) -> bool | |
7281 | ||
7282 | Get the current exit behaviour setting. | |
7283 | """ | |
7284 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) | |
7285 | ||
7286 | def SetUseBestVisual(*args, **kwargs): | |
7287 | """ | |
7288 | SetUseBestVisual(self, bool flag, bool forceTrueColour=False) | |
7289 | ||
7290 | Set whether the app should try to use the best available visual on | |
7291 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
7292 | """ | |
7293 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) | |
7294 | ||
7295 | def GetUseBestVisual(*args, **kwargs): | |
7296 | """ | |
7297 | GetUseBestVisual(self) -> bool | |
7298 | ||
7299 | Get current UseBestVisual setting. | |
7300 | """ | |
7301 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) | |
7302 | ||
7303 | def SetPrintMode(*args, **kwargs): | |
7304 | """SetPrintMode(self, int mode)""" | |
7305 | return _core_.PyApp_SetPrintMode(*args, **kwargs) | |
7306 | ||
7307 | def GetPrintMode(*args, **kwargs): | |
7308 | """GetPrintMode(self) -> int""" | |
7309 | return _core_.PyApp_GetPrintMode(*args, **kwargs) | |
7310 | ||
7311 | def SetAssertMode(*args, **kwargs): | |
7312 | """ | |
7313 | SetAssertMode(self, int mode) | |
7314 | ||
7315 | Set the OnAssert behaviour for debug and hybrid builds. | |
7316 | """ | |
7317 | return _core_.PyApp_SetAssertMode(*args, **kwargs) | |
7318 | ||
7319 | def GetAssertMode(*args, **kwargs): | |
7320 | """ | |
7321 | GetAssertMode(self) -> int | |
7322 | ||
7323 | Get the current OnAssert behaviour setting. | |
7324 | """ | |
7325 | return _core_.PyApp_GetAssertMode(*args, **kwargs) | |
7326 | ||
7327 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): | |
7328 | """GetMacSupportPCMenuShortcuts() -> bool""" | |
7329 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) | |
7330 | ||
7331 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
7332 | def GetMacAboutMenuItemId(*args, **kwargs): | |
7333 | """GetMacAboutMenuItemId() -> long""" | |
7334 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) | |
7335 | ||
7336 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
7337 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
7338 | """GetMacPreferencesMenuItemId() -> long""" | |
7339 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) | |
7340 | ||
7341 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
7342 | def GetMacExitMenuItemId(*args, **kwargs): | |
7343 | """GetMacExitMenuItemId() -> long""" | |
7344 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) | |
7345 | ||
7346 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
7347 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
7348 | """GetMacHelpMenuTitleName() -> String""" | |
7349 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) | |
7350 | ||
7351 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
7352 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
7353 | """SetMacSupportPCMenuShortcuts(bool val)""" | |
7354 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
7355 | ||
7356 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
7357 | def SetMacAboutMenuItemId(*args, **kwargs): | |
7358 | """SetMacAboutMenuItemId(long val)""" | |
7359 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
7360 | ||
7361 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
7362 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
7363 | """SetMacPreferencesMenuItemId(long val)""" | |
7364 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
7365 | ||
7366 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
7367 | def SetMacExitMenuItemId(*args, **kwargs): | |
7368 | """SetMacExitMenuItemId(long val)""" | |
7369 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
7370 | ||
7371 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
7372 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
7373 | """SetMacHelpMenuTitleName(String val)""" | |
7374 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
7375 | ||
7376 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
7377 | def _BootstrapApp(*args, **kwargs): | |
7378 | """ | |
7379 | _BootstrapApp(self) | |
7380 | ||
7381 | For internal use only | |
7382 | """ | |
7383 | return _core_.PyApp__BootstrapApp(*args, **kwargs) | |
7384 | ||
7385 | def GetComCtl32Version(*args, **kwargs): | |
7386 | """ | |
7387 | GetComCtl32Version() -> int | |
7388 | ||
7389 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if | |
7390 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
7391 | """ | |
7392 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) | |
7393 | ||
7394 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
7395 | def IsDisplayAvailable(*args, **kwargs): | |
7396 | """ | |
7397 | IsDisplayAvailable() -> bool | |
7398 | ||
7399 | Tests if it is possible to create a GUI in the current environment. | |
7400 | This will mean different things on the different platforms. | |
7401 | ||
7402 | * On X Windows systems this function will return ``False`` if it is | |
7403 | not able to open a connection to the X display, which can happen | |
7404 | if $DISPLAY is not set, or is not set correctly. | |
7405 | ||
7406 | * On Mac OS X a ``False`` return value will mean that wx is not | |
7407 | able to access the window manager, which can happen if logged in | |
7408 | remotely or if running from the normal version of python instead | |
7409 | of the framework version, (i.e., pythonw.) | |
7410 | ||
7411 | * On MS Windows... | |
7412 | ||
7413 | """ | |
7414 | return _core_.PyApp_IsDisplayAvailable(*args, **kwargs) | |
7415 | ||
7416 | IsDisplayAvailable = staticmethod(IsDisplayAvailable) | |
7417 | AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`") | |
7418 | AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`") | |
7419 | ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`") | |
7420 | ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`") | |
7421 | LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`") | |
7422 | PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`") | |
7423 | TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`") | |
7424 | Traits = property(GetTraits,doc="See `GetTraits`") | |
7425 | UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`") | |
7426 | VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`") | |
7427 | Active = property(IsActive) | |
7428 | _core_.PyApp_swigregister(PyApp) | |
7429 | ||
7430 | def PyApp_IsMainLoopRunning(*args): | |
7431 | """ | |
7432 | PyApp_IsMainLoopRunning() -> bool | |
7433 | ||
7434 | Returns True if we're running the main loop, i.e. if the events can | |
7435 | currently be dispatched. | |
7436 | """ | |
7437 | return _core_.PyApp_IsMainLoopRunning(*args) | |
7438 | ||
7439 | def PyApp_GetMacSupportPCMenuShortcuts(*args): | |
7440 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
7441 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args) | |
7442 | ||
7443 | def PyApp_GetMacAboutMenuItemId(*args): | |
7444 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
7445 | return _core_.PyApp_GetMacAboutMenuItemId(*args) | |
7446 | ||
7447 | def PyApp_GetMacPreferencesMenuItemId(*args): | |
7448 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
7449 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args) | |
7450 | ||
7451 | def PyApp_GetMacExitMenuItemId(*args): | |
7452 | """PyApp_GetMacExitMenuItemId() -> long""" | |
7453 | return _core_.PyApp_GetMacExitMenuItemId(*args) | |
7454 | ||
7455 | def PyApp_GetMacHelpMenuTitleName(*args): | |
7456 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
7457 | return _core_.PyApp_GetMacHelpMenuTitleName(*args) | |
7458 | ||
7459 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
7460 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" | |
7461 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
7462 | ||
7463 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): | |
7464 | """PyApp_SetMacAboutMenuItemId(long val)""" | |
7465 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
7466 | ||
7467 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): | |
7468 | """PyApp_SetMacPreferencesMenuItemId(long val)""" | |
7469 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
7470 | ||
7471 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): | |
7472 | """PyApp_SetMacExitMenuItemId(long val)""" | |
7473 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
7474 | ||
7475 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): | |
7476 | """PyApp_SetMacHelpMenuTitleName(String val)""" | |
7477 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
7478 | ||
7479 | def PyApp_GetComCtl32Version(*args): | |
7480 | """ | |
7481 | PyApp_GetComCtl32Version() -> int | |
7482 | ||
7483 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if | |
7484 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
7485 | """ | |
7486 | return _core_.PyApp_GetComCtl32Version(*args) | |
7487 | ||
7488 | def PyApp_IsDisplayAvailable(*args): | |
7489 | """ | |
7490 | PyApp_IsDisplayAvailable() -> bool | |
7491 | ||
7492 | Tests if it is possible to create a GUI in the current environment. | |
7493 | This will mean different things on the different platforms. | |
7494 | ||
7495 | * On X Windows systems this function will return ``False`` if it is | |
7496 | not able to open a connection to the X display, which can happen | |
7497 | if $DISPLAY is not set, or is not set correctly. | |
7498 | ||
7499 | * On Mac OS X a ``False`` return value will mean that wx is not | |
7500 | able to access the window manager, which can happen if logged in | |
7501 | remotely or if running from the normal version of python instead | |
7502 | of the framework version, (i.e., pythonw.) | |
7503 | ||
7504 | * On MS Windows... | |
7505 | ||
7506 | """ | |
7507 | return _core_.PyApp_IsDisplayAvailable(*args) | |
7508 | ||
7509 | #--------------------------------------------------------------------------- | |
7510 | ||
7511 | ||
7512 | def Exit(*args): | |
7513 | """ | |
7514 | Exit() | |
7515 | ||
7516 | Force an exit of the application. Convenience for wx.GetApp().Exit() | |
7517 | """ | |
7518 | return _core_.Exit(*args) | |
7519 | ||
7520 | def Yield(*args): | |
7521 | """ | |
7522 | Yield() -> bool | |
7523 | ||
7524 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() | |
7525 | """ | |
7526 | return _core_.Yield(*args) | |
7527 | ||
7528 | def YieldIfNeeded(*args): | |
7529 | """ | |
7530 | YieldIfNeeded() -> bool | |
7531 | ||
7532 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) | |
7533 | """ | |
7534 | return _core_.YieldIfNeeded(*args) | |
7535 | ||
7536 | def SafeYield(*args, **kwargs): | |
7537 | """ | |
7538 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool | |
7539 | ||
7540 | This function is similar to `wx.Yield`, except that it disables the | |
7541 | user input to all program windows before calling `wx.Yield` and | |
7542 | re-enables it again afterwards. If ``win`` is not None, this window | |
7543 | will remain enabled, allowing the implementation of some limited user | |
7544 | interaction. | |
7545 | ||
7546 | :Returns: the result of the call to `wx.Yield`. | |
7547 | """ | |
7548 | return _core_.SafeYield(*args, **kwargs) | |
7549 | ||
7550 | def WakeUpIdle(*args): | |
7551 | """ | |
7552 | WakeUpIdle() | |
7553 | ||
7554 | Cause the message queue to become empty again, so idle events will be | |
7555 | sent. | |
7556 | """ | |
7557 | return _core_.WakeUpIdle(*args) | |
7558 | ||
7559 | def PostEvent(*args, **kwargs): | |
7560 | """ | |
7561 | PostEvent(EvtHandler dest, Event event) | |
7562 | ||
7563 | Send an event to a window or other wx.EvtHandler to be processed | |
7564 | later. | |
7565 | """ | |
7566 | return _core_.PostEvent(*args, **kwargs) | |
7567 | ||
7568 | def App_CleanUp(*args): | |
7569 | """ | |
7570 | App_CleanUp() | |
7571 | ||
7572 | For internal use only, it is used to cleanup after wxWidgets when | |
7573 | Python shuts down. | |
7574 | """ | |
7575 | return _core_.App_CleanUp(*args) | |
7576 | ||
7577 | def GetApp(*args): | |
7578 | """ | |
7579 | GetApp() -> PyApp | |
7580 | ||
7581 | Return a reference to the current wx.App object. | |
7582 | """ | |
7583 | return _core_.GetApp(*args) | |
7584 | ||
7585 | def SetDefaultPyEncoding(*args, **kwargs): | |
7586 | """ | |
7587 | SetDefaultPyEncoding(string encoding) | |
7588 | ||
7589 | Sets the encoding that wxPython will use when it needs to convert a | |
7590 | Python string or unicode object to or from a wxString. | |
7591 | ||
7592 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7593 | but please be aware that the default encoding within the same locale | |
7594 | may be slightly different on different platforms. For example, please | |
7595 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7596 | between the common latin/roman encodings. | |
7597 | """ | |
7598 | return _core_.SetDefaultPyEncoding(*args, **kwargs) | |
7599 | ||
7600 | def GetDefaultPyEncoding(*args): | |
7601 | """ | |
7602 | GetDefaultPyEncoding() -> string | |
7603 | ||
7604 | Gets the current encoding that wxPython will use when it needs to | |
7605 | convert a Python string or unicode object to or from a wxString. | |
7606 | """ | |
7607 | return _core_.GetDefaultPyEncoding(*args) | |
7608 | #---------------------------------------------------------------------- | |
7609 | ||
7610 | class PyOnDemandOutputWindow: | |
7611 | """ | |
7612 | A class that can be used for redirecting Python's stdout and | |
7613 | stderr streams. It will do nothing until something is wrriten to | |
7614 | the stream at which point it will create a Frame with a text area | |
7615 | and write the text there. | |
7616 | """ | |
7617 | def __init__(self, title = "wxPython: stdout/stderr"): | |
7618 | self.frame = None | |
7619 | self.title = title | |
7620 | self.pos = wx.DefaultPosition | |
7621 | self.size = (450, 300) | |
7622 | self.parent = None | |
7623 | ||
7624 | def SetParent(self, parent): | |
7625 | """Set the window to be used as the popup Frame's parent.""" | |
7626 | self.parent = parent | |
7627 | ||
7628 | ||
7629 | def CreateOutputWindow(self, st): | |
7630 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, | |
7631 | style=wx.DEFAULT_FRAME_STYLE) | |
7632 | self.text = wx.TextCtrl(self.frame, -1, "", | |
7633 | style=wx.TE_MULTILINE|wx.TE_READONLY) | |
7634 | self.text.AppendText(st) | |
7635 | self.frame.Show(True) | |
7636 | self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow) | |
7637 | ||
7638 | ||
7639 | def OnCloseWindow(self, event): | |
7640 | if self.frame is not None: | |
7641 | self.frame.Destroy() | |
7642 | self.frame = None | |
7643 | self.text = None | |
7644 | ||
7645 | ||
7646 | # These methods provide the file-like output behaviour. | |
7647 | def write(self, text): | |
7648 | """ | |
7649 | Create the output window if needed and write the string to it. | |
7650 | If not called in the context of the gui thread then uses | |
7651 | CallAfter to do the work there. | |
7652 | """ | |
7653 | if self.frame is None: | |
7654 | if not wx.Thread_IsMain(): | |
7655 | wx.CallAfter(self.CreateOutputWindow, text) | |
7656 | else: | |
7657 | self.CreateOutputWindow(text) | |
7658 | else: | |
7659 | if not wx.Thread_IsMain(): | |
7660 | wx.CallAfter(self.text.AppendText, text) | |
7661 | else: | |
7662 | self.text.AppendText(text) | |
7663 | ||
7664 | ||
7665 | def close(self): | |
7666 | if self.frame is not None: | |
7667 | wx.CallAfter(self.frame.Close) | |
7668 | ||
7669 | ||
7670 | def flush(self): | |
7671 | pass | |
7672 | ||
7673 | ||
7674 | ||
7675 | #---------------------------------------------------------------------- | |
7676 | ||
7677 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
7678 | ||
7679 | class App(wx.PyApp): | |
7680 | """ | |
7681 | The ``wx.App`` class represents the application and is used to: | |
7682 | ||
7683 | * bootstrap the wxPython system and initialize the underlying | |
7684 | gui toolkit | |
7685 | * set and get application-wide properties | |
7686 | * implement the windowing system main message or event loop, | |
7687 | and to dispatch events to window instances | |
7688 | * etc. | |
7689 | ||
7690 | Every application must have a ``wx.App`` instance, and all | |
7691 | creation of UI objects should be delayed until after the | |
7692 | ``wx.App`` object has been created in order to ensure that the gui | |
7693 | platform and wxWidgets have been fully initialized. | |
7694 | ||
7695 | Normally you would derive from this class and implement an | |
7696 | ``OnInit`` method that creates a frame and then calls | |
7697 | ``self.SetTopWindow(frame)``. | |
7698 | ||
7699 | :see: `wx.PySimpleApp` for a simpler app class that can be used | |
7700 | directly. | |
7701 | """ | |
7702 | ||
7703 | outputWindowClass = PyOnDemandOutputWindow | |
7704 | ||
7705 | def __init__(self, redirect=_defRedirect, filename=None, | |
7706 | useBestVisual=False, clearSigInt=True): | |
7707 | """ | |
7708 | Construct a ``wx.App`` object. | |
7709 | ||
7710 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be | |
7711 | redirected? Defaults to True on Windows and Mac, False | |
7712 | otherwise. If `filename` is None then output will be | |
7713 | redirected to a window that pops up as needed. (You can | |
7714 | control what kind of window is created for the output by | |
7715 | resetting the class variable ``outputWindowClass`` to a | |
7716 | class of your choosing.) | |
7717 | ||
7718 | :param filename: The name of a file to redirect output to, if | |
7719 | redirect is True. | |
7720 | ||
7721 | :param useBestVisual: Should the app try to use the best | |
7722 | available visual provided by the system (only relevant on | |
7723 | systems that have more than one visual.) This parameter | |
7724 | must be used instead of calling `SetUseBestVisual` later | |
7725 | on because it must be set before the underlying GUI | |
7726 | toolkit is initialized. | |
7727 | ||
7728 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7729 | app to terminate upon a Ctrl-C in the console like other | |
7730 | GUI apps will. | |
7731 | ||
7732 | :note: You should override OnInit to do applicaition | |
7733 | initialization to ensure that the system, toolkit and | |
7734 | wxWidgets are fully initialized. | |
7735 | """ | |
7736 | ||
7737 | wx.PyApp.__init__(self) | |
7738 | ||
7739 | # make sure we can create a GUI | |
7740 | if not self.IsDisplayAvailable(): | |
7741 | ||
7742 | if wx.Platform == "__WXMAC__": | |
7743 | msg = """This program needs access to the screen. | |
7744 | Please run with 'pythonw', not 'python', and only when you are logged | |
7745 | in on the main display of your Mac.""" | |
7746 | ||
7747 | elif wx.Platform == "__WXGTK__": | |
7748 | msg ="Unable to access the X Display, is $DISPLAY set properly?" | |
7749 | ||
7750 | else: | |
7751 | msg = "Unable to create GUI" | |
7752 | # TODO: more description is needed for wxMSW... | |
7753 | ||
7754 | raise SystemExit(msg) | |
7755 | ||
7756 | # This has to be done before OnInit | |
7757 | self.SetUseBestVisual(useBestVisual) | |
7758 | ||
7759 | # Set the default handler for SIGINT. This fixes a problem | |
7760 | # where if Ctrl-C is pressed in the console that started this | |
7761 | # app then it will not appear to do anything, (not even send | |
7762 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7763 | # setting the default handler then the app will exit, as | |
7764 | # expected (depending on platform.) | |
7765 | if clearSigInt: | |
7766 | try: | |
7767 | import signal | |
7768 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7769 | except: | |
7770 | pass | |
7771 | ||
7772 | # Save and redirect the stdio to a window? | |
7773 | self.stdioWin = None | |
7774 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7775 | if redirect: | |
7776 | self.RedirectStdio(filename) | |
7777 | ||
7778 | # Use Python's install prefix as the default | |
7779 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7780 | ||
7781 | # Until the new native control for wxMac is up to par, still use the generic one. | |
7782 | wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1) | |
7783 | ||
7784 | # This finishes the initialization of wxWindows and then calls | |
7785 | # the OnInit that should be present in the derived class | |
7786 | self._BootstrapApp() | |
7787 | ||
7788 | ||
7789 | def OnPreInit(self): | |
7790 | """ | |
7791 | Things that must be done after _BootstrapApp has done its | |
7792 | thing, but would be nice if they were already done by the time | |
7793 | that OnInit is called. | |
7794 | """ | |
7795 | wx.StockGDI._initStockObjects() | |
7796 | ||
7797 | ||
7798 | def __del__(self, destroy=wx.PyApp.__del__): | |
7799 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7800 | destroy(self) | |
7801 | ||
7802 | def Destroy(self): | |
7803 | self.this.own(False) | |
7804 | wx.PyApp.Destroy(self) | |
7805 | ||
7806 | def SetTopWindow(self, frame): | |
7807 | """Set the \"main\" top level window""" | |
7808 | if self.stdioWin: | |
7809 | self.stdioWin.SetParent(frame) | |
7810 | wx.PyApp.SetTopWindow(self, frame) | |
7811 | ||
7812 | ||
7813 | def MainLoop(self): | |
7814 | """Execute the main GUI event loop""" | |
7815 | wx.PyApp.MainLoop(self) | |
7816 | self.RestoreStdio() | |
7817 | ||
7818 | ||
7819 | def RedirectStdio(self, filename=None): | |
7820 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" | |
7821 | if filename: | |
7822 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7823 | else: | |
7824 | self.stdioWin = self.outputWindowClass() | |
7825 | _sys.stdout = _sys.stderr = self.stdioWin | |
7826 | ||
7827 | ||
7828 | def RestoreStdio(self): | |
7829 | try: | |
7830 | _sys.stdout, _sys.stderr = self.saveStdio | |
7831 | except: | |
7832 | pass | |
7833 | ||
7834 | ||
7835 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): | |
7836 | """ | |
7837 | Set the title, position and/or size of the output window if | |
7838 | the stdio has been redirected. This should be called before | |
7839 | any output would cause the output window to be created. | |
7840 | """ | |
7841 | if self.stdioWin: | |
7842 | if title is not None: | |
7843 | self.stdioWin.title = title | |
7844 | if pos is not None: | |
7845 | self.stdioWin.pos = pos | |
7846 | if size is not None: | |
7847 | self.stdioWin.size = size | |
7848 | ||
7849 | ||
7850 | ||
7851 | ||
7852 | # change from wx.PyApp_XX to wx.App_XX | |
7853 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts | |
7854 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7855 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7856 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7857 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7858 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7859 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7860 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7861 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7862 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7863 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
7864 | ||
7865 | #---------------------------------------------------------------------------- | |
7866 | ||
7867 | class PySimpleApp(wx.App): | |
7868 | """ | |
7869 | A simple application class. You can just create one of these and | |
7870 | then then make your top level windows later, and not have to worry | |
7871 | about OnInit. For example:: | |
7872 | ||
7873 | app = wx.PySimpleApp() | |
7874 | frame = wx.Frame(None, title='Hello World') | |
7875 | frame.Show() | |
7876 | app.MainLoop() | |
7877 | ||
7878 | :see: `wx.App` | |
7879 | """ | |
7880 | ||
7881 | def __init__(self, redirect=False, filename=None, | |
7882 | useBestVisual=False, clearSigInt=True): | |
7883 | """ | |
7884 | :see: `wx.App.__init__` | |
7885 | """ | |
7886 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) | |
7887 | ||
7888 | def OnInit(self): | |
7889 | return True | |
7890 | ||
7891 | ||
7892 | ||
7893 | # Is anybody using this one? | |
7894 | class PyWidgetTester(wx.App): | |
7895 | def __init__(self, size = (250, 100)): | |
7896 | self.size = size | |
7897 | wx.App.__init__(self, 0) | |
7898 | ||
7899 | def OnInit(self): | |
7900 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) | |
7901 | self.SetTopWindow(self.frame) | |
7902 | return True | |
7903 | ||
7904 | def SetWidget(self, widgetClass, *args, **kwargs): | |
7905 | w = widgetClass(self.frame, *args, **kwargs) | |
7906 | self.frame.Show(True) | |
7907 | ||
7908 | #---------------------------------------------------------------------------- | |
7909 | # DO NOT hold any other references to this object. This is how we | |
7910 | # know when to cleanup system resources that wxWidgets is holding. When | |
7911 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup | |
7912 | # goes to zero and it calls the wx.App_CleanUp function. | |
7913 | ||
7914 | class __wxPyCleanup: | |
7915 | def __init__(self): | |
7916 | self.cleanup = _core_.App_CleanUp | |
7917 | def __del__(self): | |
7918 | self.cleanup() | |
7919 | ||
7920 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7921 | ||
7922 | ## # another possible solution, but it gets called too early... | |
7923 | ## import atexit | |
7924 | ## atexit.register(_core_.wxApp_CleanUp) | |
7925 | ||
7926 | ||
7927 | #---------------------------------------------------------------------------- | |
7928 | ||
7929 | #--------------------------------------------------------------------------- | |
7930 | ||
7931 | class EventLoop(object): | |
7932 | """Proxy of C++ EventLoop class""" | |
7933 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
7934 | __repr__ = _swig_repr | |
7935 | def __init__(self, *args, **kwargs): | |
7936 | """__init__(self) -> EventLoop""" | |
7937 | _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs)) | |
7938 | __swig_destroy__ = _core_.delete_EventLoop | |
7939 | __del__ = lambda self : None; | |
7940 | def Run(*args, **kwargs): | |
7941 | """Run(self) -> int""" | |
7942 | return _core_.EventLoop_Run(*args, **kwargs) | |
7943 | ||
7944 | def Exit(*args, **kwargs): | |
7945 | """Exit(self, int rc=0)""" | |
7946 | return _core_.EventLoop_Exit(*args, **kwargs) | |
7947 | ||
7948 | def Pending(*args, **kwargs): | |
7949 | """Pending(self) -> bool""" | |
7950 | return _core_.EventLoop_Pending(*args, **kwargs) | |
7951 | ||
7952 | def Dispatch(*args, **kwargs): | |
7953 | """Dispatch(self) -> bool""" | |
7954 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
7955 | ||
7956 | def IsRunning(*args, **kwargs): | |
7957 | """IsRunning(self) -> bool""" | |
7958 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
7959 | ||
7960 | def GetActive(*args, **kwargs): | |
7961 | """GetActive() -> EventLoop""" | |
7962 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7963 | ||
7964 | GetActive = staticmethod(GetActive) | |
7965 | def SetActive(*args, **kwargs): | |
7966 | """SetActive(EventLoop loop)""" | |
7967 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7968 | ||
7969 | SetActive = staticmethod(SetActive) | |
7970 | _core_.EventLoop_swigregister(EventLoop) | |
7971 | ||
7972 | def EventLoop_GetActive(*args): | |
7973 | """EventLoop_GetActive() -> EventLoop""" | |
7974 | return _core_.EventLoop_GetActive(*args) | |
7975 | ||
7976 | def EventLoop_SetActive(*args, **kwargs): | |
7977 | """EventLoop_SetActive(EventLoop loop)""" | |
7978 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7979 | ||
7980 | class EventLoopActivator(object): | |
7981 | """Proxy of C++ EventLoopActivator class""" | |
7982 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
7983 | __repr__ = _swig_repr | |
7984 | def __init__(self, *args, **kwargs): | |
7985 | """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" | |
7986 | _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs)) | |
7987 | __swig_destroy__ = _core_.delete_EventLoopActivator | |
7988 | __del__ = lambda self : None; | |
7989 | _core_.EventLoopActivator_swigregister(EventLoopActivator) | |
7990 | ||
7991 | #--------------------------------------------------------------------------- | |
7992 | ||
7993 | ACCEL_ALT = _core_.ACCEL_ALT | |
7994 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
7995 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
7996 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
7997 | ACCEL_CMD = _core_.ACCEL_CMD | |
7998 | class AcceleratorEntry(object): | |
7999 | """ | |
8000 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
8001 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
8002 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
8003 | as well. See `__init__` for of the tuple values. | |
8004 | ||
8005 | :see: `wx.AcceleratorTable` | |
8006 | """ | |
8007 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
8008 | __repr__ = _swig_repr | |
8009 | def __init__(self, *args, **kwargs): | |
8010 | """ | |
8011 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
8012 | ||
8013 | Construct a wx.AcceleratorEntry. | |
8014 | """ | |
8015 | _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs)) | |
8016 | __swig_destroy__ = _core_.delete_AcceleratorEntry | |
8017 | __del__ = lambda self : None; | |
8018 | def Set(*args, **kwargs): | |
8019 | """ | |
8020 | Set(self, int flags, int keyCode, int cmd) | |
8021 | ||
8022 | (Re)set the attributes of a wx.AcceleratorEntry. | |
8023 | :see `__init__` | |
8024 | """ | |
8025 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
8026 | ||
8027 | def Create(*args, **kwargs): | |
8028 | """ | |
8029 | Create(String str) -> AcceleratorEntry | |
8030 | ||
8031 | Create accelerator corresponding to the specified string, or None if | |
8032 | it coulnd't be parsed. | |
8033 | """ | |
8034 | return _core_.AcceleratorEntry_Create(*args, **kwargs) | |
8035 | ||
8036 | Create = staticmethod(Create) | |
8037 | def GetFlags(*args, **kwargs): | |
8038 | """ | |
8039 | GetFlags(self) -> int | |
8040 | ||
8041 | Get the AcceleratorEntry's flags. | |
8042 | """ | |
8043 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) | |
8044 | ||
8045 | def GetKeyCode(*args, **kwargs): | |
8046 | """ | |
8047 | GetKeyCode(self) -> int | |
8048 | ||
8049 | Get the AcceleratorEntry's keycode. | |
8050 | """ | |
8051 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) | |
8052 | ||
8053 | def GetCommand(*args, **kwargs): | |
8054 | """ | |
8055 | GetCommand(self) -> int | |
8056 | ||
8057 | Get the AcceleratorEntry's command ID. | |
8058 | """ | |
8059 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) | |
8060 | ||
8061 | def IsOk(*args, **kwargs): | |
8062 | """IsOk(self) -> bool""" | |
8063 | return _core_.AcceleratorEntry_IsOk(*args, **kwargs) | |
8064 | ||
8065 | def ToString(*args, **kwargs): | |
8066 | """ | |
8067 | ToString(self) -> String | |
8068 | ||
8069 | Returns a string representation for the this accelerator. The string | |
8070 | is formatted using the <flags>-<keycode> format where <flags> maybe a | |
8071 | hyphen-separed list of "shift|alt|ctrl" | |
8072 | ||
8073 | """ | |
8074 | return _core_.AcceleratorEntry_ToString(*args, **kwargs) | |
8075 | ||
8076 | def FromString(*args, **kwargs): | |
8077 | """ | |
8078 | FromString(self, String str) -> bool | |
8079 | ||
8080 | Returns true if the given string correctly initialized this object. | |
8081 | """ | |
8082 | return _core_.AcceleratorEntry_FromString(*args, **kwargs) | |
8083 | ||
8084 | Command = property(GetCommand,doc="See `GetCommand`") | |
8085 | Flags = property(GetFlags,doc="See `GetFlags`") | |
8086 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") | |
8087 | _core_.AcceleratorEntry_swigregister(AcceleratorEntry) | |
8088 | ||
8089 | def AcceleratorEntry_Create(*args, **kwargs): | |
8090 | """ | |
8091 | AcceleratorEntry_Create(String str) -> AcceleratorEntry | |
8092 | ||
8093 | Create accelerator corresponding to the specified string, or None if | |
8094 | it coulnd't be parsed. | |
8095 | """ | |
8096 | return _core_.AcceleratorEntry_Create(*args, **kwargs) | |
8097 | ||
8098 | class AcceleratorTable(Object): | |
8099 | """ | |
8100 | An accelerator table allows the application to specify a table of | |
8101 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
8102 | button commands are supported; on GTK, only menu commands are | |
8103 | supported. | |
8104 | """ | |
8105 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
8106 | __repr__ = _swig_repr | |
8107 | def __init__(self, *args, **kwargs): | |
8108 | """ | |
8109 | __init__(entries) -> AcceleratorTable | |
8110 | ||
8111 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` | |
8112 | items or or of 3-tuples (flags, keyCode, cmdID) | |
8113 | ||
8114 | :see: `wx.AcceleratorEntry` | |
8115 | """ | |
8116 | _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs)) | |
8117 | __swig_destroy__ = _core_.delete_AcceleratorTable | |
8118 | __del__ = lambda self : None; | |
8119 | def IsOk(*args, **kwargs): | |
8120 | """IsOk(self) -> bool""" | |
8121 | return _core_.AcceleratorTable_IsOk(*args, **kwargs) | |
8122 | ||
8123 | Ok = IsOk | |
8124 | _core_.AcceleratorTable_swigregister(AcceleratorTable) | |
8125 | ||
8126 | def GetAccelFromString(label): | |
8127 | entry = AcceleratorEntry() | |
8128 | entry.FromString(label) | |
8129 | return entry | |
8130 | ||
8131 | #--------------------------------------------------------------------------- | |
8132 | ||
8133 | class VisualAttributes(object): | |
8134 | """struct containing all the visual attributes of a control""" | |
8135 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
8136 | __repr__ = _swig_repr | |
8137 | def __init__(self, *args, **kwargs): | |
8138 | """ | |
8139 | __init__(self) -> VisualAttributes | |
8140 | ||
8141 | struct containing all the visual attributes of a control | |
8142 | """ | |
8143 | _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs)) | |
8144 | __swig_destroy__ = _core_.delete_VisualAttributes | |
8145 | __del__ = lambda self : None; | |
8146 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) | |
8147 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
8148 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
8149 | _core_.VisualAttributes_swigregister(VisualAttributes) | |
8150 | NullAcceleratorTable = cvar.NullAcceleratorTable | |
8151 | PanelNameStr = cvar.PanelNameStr | |
8152 | ||
8153 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL | |
8154 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
8155 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
8156 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
8157 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
8158 | class Window(EvtHandler): | |
8159 | """ | |
8160 | wx.Window is the base class for all windows and represents any visible | |
8161 | object on the screen. All controls, top level windows and so on are | |
8162 | wx.Windows. Sizers and device contexts are not however, as they don't | |
8163 | appear on screen themselves. | |
8164 | ||
8165 | """ | |
8166 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
8167 | __repr__ = _swig_repr | |
8168 | def __init__(self, *args, **kwargs): | |
8169 | """ | |
8170 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, | |
8171 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window | |
8172 | ||
8173 | Construct and show a generic Window. | |
8174 | """ | |
8175 | _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs)) | |
8176 | self._setOORInfo(self) | |
8177 | ||
8178 | def Create(*args, **kwargs): | |
8179 | """ | |
8180 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, | |
8181 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool | |
8182 | ||
8183 | Create the GUI part of the Window for 2-phase creation mode. | |
8184 | """ | |
8185 | return _core_.Window_Create(*args, **kwargs) | |
8186 | ||
8187 | def Close(*args, **kwargs): | |
8188 | """ | |
8189 | Close(self, bool force=False) -> bool | |
8190 | ||
8191 | This function simply generates a EVT_CLOSE event whose handler usually | |
8192 | tries to close the window. It doesn't close the window itself, | |
8193 | however. If force is False (the default) then the window's close | |
8194 | handler will be allowed to veto the destruction of the window. | |
8195 | """ | |
8196 | return _core_.Window_Close(*args, **kwargs) | |
8197 | ||
8198 | def Destroy(*args, **kwargs): | |
8199 | """ | |
8200 | Destroy(self) -> bool | |
8201 | ||
8202 | Destroys the window safely. Frames and dialogs are not destroyed | |
8203 | immediately when this function is called -- they are added to a list | |
8204 | of windows to be deleted on idle time, when all the window's events | |
8205 | have been processed. This prevents problems with events being sent to | |
8206 | non-existent windows. | |
8207 | ||
8208 | Returns True if the window has either been successfully deleted, or it | |
8209 | has been added to the list of windows pending real deletion. | |
8210 | """ | |
8211 | args[0].this.own(False) | |
8212 | return _core_.Window_Destroy(*args, **kwargs) | |
8213 | ||
8214 | def DestroyChildren(*args, **kwargs): | |
8215 | """ | |
8216 | DestroyChildren(self) -> bool | |
8217 | ||
8218 | Destroys all children of a window. Called automatically by the | |
8219 | destructor. | |
8220 | """ | |
8221 | return _core_.Window_DestroyChildren(*args, **kwargs) | |
8222 | ||
8223 | def IsBeingDeleted(*args, **kwargs): | |
8224 | """ | |
8225 | IsBeingDeleted(self) -> bool | |
8226 | ||
8227 | Is the window in the process of being deleted? | |
8228 | """ | |
8229 | return _core_.Window_IsBeingDeleted(*args, **kwargs) | |
8230 | ||
8231 | def SetLabel(*args, **kwargs): | |
8232 | """ | |
8233 | SetLabel(self, String label) | |
8234 | ||
8235 | Set the text which the window shows in its label if applicable. | |
8236 | """ | |
8237 | return _core_.Window_SetLabel(*args, **kwargs) | |
8238 | ||
8239 | def GetLabel(*args, **kwargs): | |
8240 | """ | |
8241 | GetLabel(self) -> String | |
8242 | ||
8243 | Generic way of getting a label from any window, for identification | |
8244 | purposes. The interpretation of this function differs from class to | |
8245 | class. For frames and dialogs, the value returned is the title. For | |
8246 | buttons or static text controls, it is the button text. This function | |
8247 | can be useful for meta-programs such as testing tools or special-needs | |
8248 | access programs)which need to identify windows by name. | |
8249 | """ | |
8250 | return _core_.Window_GetLabel(*args, **kwargs) | |
8251 | ||
8252 | def SetName(*args, **kwargs): | |
8253 | """ | |
8254 | SetName(self, String name) | |
8255 | ||
8256 | Sets the window's name. The window name is used for ressource setting | |
8257 | in X, it is not the same as the window title/label | |
8258 | """ | |
8259 | return _core_.Window_SetName(*args, **kwargs) | |
8260 | ||
8261 | def GetName(*args, **kwargs): | |
8262 | """ | |
8263 | GetName(self) -> String | |
8264 | ||
8265 | Returns the windows name. This name is not guaranteed to be unique; | |
8266 | it is up to the programmer to supply an appropriate name in the window | |
8267 | constructor or via wx.Window.SetName. | |
8268 | """ | |
8269 | return _core_.Window_GetName(*args, **kwargs) | |
8270 | ||
8271 | def SetWindowVariant(*args, **kwargs): | |
8272 | """ | |
8273 | SetWindowVariant(self, int variant) | |
8274 | ||
8275 | Sets the variant of the window/font size to use for this window, if | |
8276 | the platform supports variants, for example, wxMac. | |
8277 | """ | |
8278 | return _core_.Window_SetWindowVariant(*args, **kwargs) | |
8279 | ||
8280 | def GetWindowVariant(*args, **kwargs): | |
8281 | """GetWindowVariant(self) -> int""" | |
8282 | return _core_.Window_GetWindowVariant(*args, **kwargs) | |
8283 | ||
8284 | def SetId(*args, **kwargs): | |
8285 | """ | |
8286 | SetId(self, int winid) | |
8287 | ||
8288 | Sets the identifier of the window. Each window has an integer | |
8289 | identifier. If the application has not provided one, an identifier | |
8290 | will be generated. Normally, the identifier should be provided on | |
8291 | creation and should not be modified subsequently. | |
8292 | """ | |
8293 | return _core_.Window_SetId(*args, **kwargs) | |
8294 | ||
8295 | def GetId(*args, **kwargs): | |
8296 | """ | |
8297 | GetId(self) -> int | |
8298 | ||
8299 | Returns the identifier of the window. Each window has an integer | |
8300 | identifier. If the application has not provided one (or the default Id | |
8301 | -1 is used) then an unique identifier with a negative value will be | |
8302 | generated. | |
8303 | """ | |
8304 | return _core_.Window_GetId(*args, **kwargs) | |
8305 | ||
8306 | def NewControlId(*args, **kwargs): | |
8307 | """ | |
8308 | NewControlId() -> int | |
8309 | ||
8310 | Generate a control id for the controls which were not given one. | |
8311 | """ | |
8312 | return _core_.Window_NewControlId(*args, **kwargs) | |
8313 | ||
8314 | NewControlId = staticmethod(NewControlId) | |
8315 | def NextControlId(*args, **kwargs): | |
8316 | """ | |
8317 | NextControlId(int winid) -> int | |
8318 | ||
8319 | Get the id of the control following the one with the given | |
8320 | autogenerated) id | |
8321 | """ | |
8322 | return _core_.Window_NextControlId(*args, **kwargs) | |
8323 | ||
8324 | NextControlId = staticmethod(NextControlId) | |
8325 | def PrevControlId(*args, **kwargs): | |
8326 | """ | |
8327 | PrevControlId(int winid) -> int | |
8328 | ||
8329 | Get the id of the control preceding the one with the given | |
8330 | autogenerated) id | |
8331 | """ | |
8332 | return _core_.Window_PrevControlId(*args, **kwargs) | |
8333 | ||
8334 | PrevControlId = staticmethod(PrevControlId) | |
8335 | def GetLayoutDirection(*args, **kwargs): | |
8336 | """ | |
8337 | GetLayoutDirection(self) -> int | |
8338 | ||
8339 | Get the layout direction (LTR or RTL) for this window. Returns | |
8340 | ``wx.Layout_Default`` if layout direction is not supported. | |
8341 | """ | |
8342 | return _core_.Window_GetLayoutDirection(*args, **kwargs) | |
8343 | ||
8344 | def SetLayoutDirection(*args, **kwargs): | |
8345 | """ | |
8346 | SetLayoutDirection(self, int dir) | |
8347 | ||
8348 | Set the layout direction (LTR or RTL) for this window. | |
8349 | """ | |
8350 | return _core_.Window_SetLayoutDirection(*args, **kwargs) | |
8351 | ||
8352 | def AdjustForLayoutDirection(*args, **kwargs): | |
8353 | """ | |
8354 | AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int | |
8355 | ||
8356 | Mirror coordinates for RTL layout if this window uses it and if the | |
8357 | mirroring is not done automatically like Win32. | |
8358 | """ | |
8359 | return _core_.Window_AdjustForLayoutDirection(*args, **kwargs) | |
8360 | ||
8361 | def SetSize(*args, **kwargs): | |
8362 | """ | |
8363 | SetSize(self, Size size) | |
8364 | ||
8365 | Sets the size of the window in pixels. | |
8366 | """ | |
8367 | return _core_.Window_SetSize(*args, **kwargs) | |
8368 | ||
8369 | def SetDimensions(*args, **kwargs): | |
8370 | """ | |
8371 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) | |
8372 | ||
8373 | Sets the position and size of the window in pixels. The sizeFlags | |
8374 | parameter indicates the interpretation of the other params if they are | |
8375 | equal to -1. | |
8376 | ||
8377 | ======================== ====================================== | |
8378 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
8379 | default should be used. | |
8380 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
8381 | -1 values are supplied. | |
8382 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
8383 | interpreted as real dimensions, not | |
8384 | default values. | |
8385 | ======================== ====================================== | |
8386 | ||
8387 | """ | |
8388 | return _core_.Window_SetDimensions(*args, **kwargs) | |
8389 | ||
8390 | def SetRect(*args, **kwargs): | |
8391 | """ | |
8392 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) | |
8393 | ||
8394 | Sets the position and size of the window in pixels using a wx.Rect. | |
8395 | """ | |
8396 | return _core_.Window_SetRect(*args, **kwargs) | |
8397 | ||
8398 | def SetSizeWH(*args, **kwargs): | |
8399 | """ | |
8400 | SetSizeWH(self, int width, int height) | |
8401 | ||
8402 | Sets the size of the window in pixels. | |
8403 | """ | |
8404 | return _core_.Window_SetSizeWH(*args, **kwargs) | |
8405 | ||
8406 | def Move(*args, **kwargs): | |
8407 | """ | |
8408 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) | |
8409 | ||
8410 | Moves the window to the given position. | |
8411 | """ | |
8412 | return _core_.Window_Move(*args, **kwargs) | |
8413 | ||
8414 | SetPosition = Move | |
8415 | def MoveXY(*args, **kwargs): | |
8416 | """ | |
8417 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) | |
8418 | ||
8419 | Moves the window to the given position. | |
8420 | """ | |
8421 | return _core_.Window_MoveXY(*args, **kwargs) | |
8422 | ||
8423 | def SetInitialSize(*args, **kwargs): | |
8424 | """ | |
8425 | SetInitialSize(self, Size size=DefaultSize) | |
8426 | ||
8427 | A 'Smart' SetSize that will fill in default size components with the | |
8428 | window's *best size* values. Also set's the minsize for use with sizers. | |
8429 | """ | |
8430 | return _core_.Window_SetInitialSize(*args, **kwargs) | |
8431 | ||
8432 | SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`') | |
8433 | def Raise(*args, **kwargs): | |
8434 | """ | |
8435 | Raise(self) | |
8436 | ||
8437 | Raises the window to the top of the window hierarchy. In current | |
8438 | version of wxWidgets this works both for managed and child windows. | |
8439 | """ | |
8440 | return _core_.Window_Raise(*args, **kwargs) | |
8441 | ||
8442 | def Lower(*args, **kwargs): | |
8443 | """ | |
8444 | Lower(self) | |
8445 | ||
8446 | Lowers the window to the bottom of the window hierarchy. In current | |
8447 | version of wxWidgets this works both for managed and child windows. | |
8448 | """ | |
8449 | return _core_.Window_Lower(*args, **kwargs) | |
8450 | ||
8451 | def SetClientSize(*args, **kwargs): | |
8452 | """ | |
8453 | SetClientSize(self, Size size) | |
8454 | ||
8455 | This sets the size of the window client area in pixels. Using this | |
8456 | function to size a window tends to be more device-independent than | |
8457 | wx.Window.SetSize, since the application need not worry about what | |
8458 | dimensions the border or title bar have when trying to fit the window | |
8459 | around panel items, for example. | |
8460 | """ | |
8461 | return _core_.Window_SetClientSize(*args, **kwargs) | |
8462 | ||
8463 | def SetClientSizeWH(*args, **kwargs): | |
8464 | """ | |
8465 | SetClientSizeWH(self, int width, int height) | |
8466 | ||
8467 | This sets the size of the window client area in pixels. Using this | |
8468 | function to size a window tends to be more device-independent than | |
8469 | wx.Window.SetSize, since the application need not worry about what | |
8470 | dimensions the border or title bar have when trying to fit the window | |
8471 | around panel items, for example. | |
8472 | """ | |
8473 | return _core_.Window_SetClientSizeWH(*args, **kwargs) | |
8474 | ||
8475 | def SetClientRect(*args, **kwargs): | |
8476 | """ | |
8477 | SetClientRect(self, Rect rect) | |
8478 | ||
8479 | This sets the size of the window client area in pixels. Using this | |
8480 | function to size a window tends to be more device-independent than | |
8481 | wx.Window.SetSize, since the application need not worry about what | |
8482 | dimensions the border or title bar have when trying to fit the window | |
8483 | around panel items, for example. | |
8484 | """ | |
8485 | return _core_.Window_SetClientRect(*args, **kwargs) | |
8486 | ||
8487 | def GetPosition(*args, **kwargs): | |
8488 | """ | |
8489 | GetPosition(self) -> Point | |
8490 | ||
8491 | Get the window's position. Notice that the position is in client | |
8492 | coordinates for child windows and screen coordinates for the top level | |
8493 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
8494 | kinds of windows. | |
8495 | """ | |
8496 | return _core_.Window_GetPosition(*args, **kwargs) | |
8497 | ||
8498 | def GetPositionTuple(*args, **kwargs): | |
8499 | """ | |
8500 | GetPositionTuple() -> (x,y) | |
8501 | ||
8502 | Get the window's position. Notice that the position is in client | |
8503 | coordinates for child windows and screen coordinates for the top level | |
8504 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
8505 | kinds of windows. | |
8506 | """ | |
8507 | return _core_.Window_GetPositionTuple(*args, **kwargs) | |
8508 | ||
8509 | def GetScreenPosition(*args, **kwargs): | |
8510 | """ | |
8511 | GetScreenPosition(self) -> Point | |
8512 | ||
8513 | Get the position of the window in screen coordinantes. | |
8514 | """ | |
8515 | return _core_.Window_GetScreenPosition(*args, **kwargs) | |
8516 | ||
8517 | def GetScreenPositionTuple(*args, **kwargs): | |
8518 | """ | |
8519 | GetScreenPositionTuple() -> (x,y) | |
8520 | ||
8521 | Get the position of the window in screen coordinantes. | |
8522 | """ | |
8523 | return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | |
8524 | ||
8525 | def GetScreenRect(*args, **kwargs): | |
8526 | """ | |
8527 | GetScreenRect(self) -> Rect | |
8528 | ||
8529 | Returns the size and position of the window in screen coordinantes as | |
8530 | a `wx.Rect` object. | |
8531 | """ | |
8532 | return _core_.Window_GetScreenRect(*args, **kwargs) | |
8533 | ||
8534 | def GetSize(*args, **kwargs): | |
8535 | """ | |
8536 | GetSize(self) -> Size | |
8537 | ||
8538 | Get the window size. | |
8539 | """ | |
8540 | return _core_.Window_GetSize(*args, **kwargs) | |
8541 | ||
8542 | def GetSizeTuple(*args, **kwargs): | |
8543 | """ | |
8544 | GetSizeTuple() -> (width, height) | |
8545 | ||
8546 | Get the window size. | |
8547 | """ | |
8548 | return _core_.Window_GetSizeTuple(*args, **kwargs) | |
8549 | ||
8550 | def GetRect(*args, **kwargs): | |
8551 | """ | |
8552 | GetRect(self) -> Rect | |
8553 | ||
8554 | Returns the size and position of the window as a `wx.Rect` object. | |
8555 | """ | |
8556 | return _core_.Window_GetRect(*args, **kwargs) | |
8557 | ||
8558 | def GetClientSize(*args, **kwargs): | |
8559 | """ | |
8560 | GetClientSize(self) -> Size | |
8561 | ||
8562 | This gets the size of the window's 'client area' in pixels. The client | |
8563 | area is the area which may be drawn on by the programmer, excluding | |
8564 | title bar, border, scrollbars, etc. | |
8565 | """ | |
8566 | return _core_.Window_GetClientSize(*args, **kwargs) | |
8567 | ||
8568 | def GetClientSizeTuple(*args, **kwargs): | |
8569 | """ | |
8570 | GetClientSizeTuple() -> (width, height) | |
8571 | ||
8572 | This gets the size of the window's 'client area' in pixels. The client | |
8573 | area is the area which may be drawn on by the programmer, excluding | |
8574 | title bar, border, scrollbars, etc. | |
8575 | """ | |
8576 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) | |
8577 | ||
8578 | def GetClientAreaOrigin(*args, **kwargs): | |
8579 | """ | |
8580 | GetClientAreaOrigin(self) -> Point | |
8581 | ||
8582 | Get the origin of the client area of the window relative to the | |
8583 | window's top left corner (the client area may be shifted because of | |
8584 | the borders, scrollbars, other decorations...) | |
8585 | """ | |
8586 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) | |
8587 | ||
8588 | def GetClientRect(*args, **kwargs): | |
8589 | """ | |
8590 | GetClientRect(self) -> Rect | |
8591 | ||
8592 | Get the client area position and size as a `wx.Rect` object. | |
8593 | """ | |
8594 | return _core_.Window_GetClientRect(*args, **kwargs) | |
8595 | ||
8596 | def GetBestSize(*args, **kwargs): | |
8597 | """ | |
8598 | GetBestSize(self) -> Size | |
8599 | ||
8600 | This function returns the best acceptable minimal size for the | |
8601 | window, if applicable. For example, for a static text control, it will | |
8602 | be the minimal size such that the control label is not truncated. For | |
8603 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8604 | this function will be the same as the size the window would have had | |
8605 | after calling Fit. | |
8606 | """ | |
8607 | return _core_.Window_GetBestSize(*args, **kwargs) | |
8608 | ||
8609 | def GetBestSizeTuple(*args, **kwargs): | |
8610 | """ | |
8611 | GetBestSizeTuple() -> (width, height) | |
8612 | ||
8613 | This function returns the best acceptable minimal size for the | |
8614 | window, if applicable. For example, for a static text control, it will | |
8615 | be the minimal size such that the control label is not truncated. For | |
8616 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8617 | this function will be the same as the size the window would have had | |
8618 | after calling Fit. | |
8619 | """ | |
8620 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) | |
8621 | ||
8622 | def InvalidateBestSize(*args, **kwargs): | |
8623 | """ | |
8624 | InvalidateBestSize(self) | |
8625 | ||
8626 | Reset the cached best size value so it will be recalculated the next | |
8627 | time it is needed. | |
8628 | """ | |
8629 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
8630 | ||
8631 | def CacheBestSize(*args, **kwargs): | |
8632 | """ | |
8633 | CacheBestSize(self, Size size) | |
8634 | ||
8635 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8636 | some properties of the window change.) | |
8637 | """ | |
8638 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8639 | ||
8640 | def GetEffectiveMinSize(*args, **kwargs): | |
8641 | """ | |
8642 | GetEffectiveMinSize(self) -> Size | |
8643 | ||
8644 | This function will merge the window's best size into the window's | |
8645 | minimum size, giving priority to the min size components, and returns | |
8646 | the results. | |
8647 | ||
8648 | """ | |
8649 | return _core_.Window_GetEffectiveMinSize(*args, **kwargs) | |
8650 | ||
8651 | GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.') | |
8652 | def GetAdjustedBestSize(self): | |
8653 | s = self.GetBestSize() | |
8654 | return wx.Size(max(s.width, self.GetMinWidth()), | |
8655 | max(s.height, self.GetMinHeight())) | |
8656 | GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.') | |
8657 | ||
8658 | def Center(*args, **kwargs): | |
8659 | """ | |
8660 | Center(self, int direction=BOTH) | |
8661 | ||
8662 | Centers the window. The parameter specifies the direction for | |
8663 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8664 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8665 | on the entire screen and not on its parent window. If it is a | |
8666 | top-level window and has no parent then it will always be centered | |
8667 | relative to the screen. | |
8668 | """ | |
8669 | return _core_.Window_Center(*args, **kwargs) | |
8670 | ||
8671 | Centre = Center | |
8672 | def CenterOnParent(*args, **kwargs): | |
8673 | """ | |
8674 | CenterOnParent(self, int dir=BOTH) | |
8675 | ||
8676 | Center with respect to the the parent window | |
8677 | """ | |
8678 | return _core_.Window_CenterOnParent(*args, **kwargs) | |
8679 | ||
8680 | CentreOnParent = CenterOnParent | |
8681 | def Fit(*args, **kwargs): | |
8682 | """ | |
8683 | Fit(self) | |
8684 | ||
8685 | Sizes the window so that it fits around its subwindows. This function | |
8686 | won't do anything if there are no subwindows and will only really work | |
8687 | correctly if sizers are used for the subwindows layout. Also, if the | |
8688 | window has exactly one subwindow it is better (faster and the result | |
8689 | is more precise as Fit adds some margin to account for fuzziness of | |
8690 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8691 | instead of calling Fit. | |
8692 | """ | |
8693 | return _core_.Window_Fit(*args, **kwargs) | |
8694 | ||
8695 | def FitInside(*args, **kwargs): | |
8696 | """ | |
8697 | FitInside(self) | |
8698 | ||
8699 | Similar to Fit, but sizes the interior (virtual) size of a | |
8700 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8701 | sizing changes that do not trigger a size event, and/or scrolled | |
8702 | windows without an interior sizer. This function similarly won't do | |
8703 | anything if there are no subwindows. | |
8704 | """ | |
8705 | return _core_.Window_FitInside(*args, **kwargs) | |
8706 | ||
8707 | def SetSizeHints(*args, **kwargs): | |
8708 | """ | |
8709 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, | |
8710 | int incH=-1) | |
8711 | ||
8712 | Allows specification of minimum and maximum window sizes, and window | |
8713 | size increments. If a pair of values is not set (or set to -1), the | |
8714 | default values will be used. If this function is called, the user | |
8715 | will not be able to size the window outside the given bounds (if it is | |
8716 | a top-level window.) Sizers will also inspect the minimum window size | |
8717 | and will use that value if set when calculating layout. | |
8718 | ||
8719 | The resizing increments are only significant under Motif or Xt. | |
8720 | """ | |
8721 | return _core_.Window_SetSizeHints(*args, **kwargs) | |
8722 | ||
8723 | def SetSizeHintsSz(*args, **kwargs): | |
8724 | """ | |
8725 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
8726 | ||
8727 | Allows specification of minimum and maximum window sizes, and window | |
8728 | size increments. If a pair of values is not set (or set to -1), the | |
8729 | default values will be used. If this function is called, the user | |
8730 | will not be able to size the window outside the given bounds (if it is | |
8731 | a top-level window.) Sizers will also inspect the minimum window size | |
8732 | and will use that value if set when calculating layout. | |
8733 | ||
8734 | The resizing increments are only significant under Motif or Xt. | |
8735 | """ | |
8736 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
8737 | ||
8738 | def SetVirtualSizeHints(*args, **kwargs): | |
8739 | """ | |
8740 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) | |
8741 | ||
8742 | Allows specification of minimum and maximum virtual window sizes. If a | |
8743 | pair of values is not set (or set to -1), the default values will be | |
8744 | used. If this function is called, the user will not be able to size | |
8745 | the virtual area of the window outside the given bounds. | |
8746 | """ | |
8747 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) | |
8748 | ||
8749 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8750 | """ | |
8751 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
8752 | ||
8753 | Allows specification of minimum and maximum virtual window sizes. If a | |
8754 | pair of values is not set (or set to -1), the default values will be | |
8755 | used. If this function is called, the user will not be able to size | |
8756 | the virtual area of the window outside the given bounds. | |
8757 | """ | |
8758 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
8759 | ||
8760 | def GetMaxSize(*args, **kwargs): | |
8761 | """GetMaxSize(self) -> Size""" | |
8762 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
8763 | ||
8764 | def GetMinSize(*args, **kwargs): | |
8765 | """GetMinSize(self) -> Size""" | |
8766 | return _core_.Window_GetMinSize(*args, **kwargs) | |
8767 | ||
8768 | def SetMinSize(*args, **kwargs): | |
8769 | """ | |
8770 | SetMinSize(self, Size minSize) | |
8771 | ||
8772 | A more convenient method than `SetSizeHints` for setting just the | |
8773 | min size. | |
8774 | """ | |
8775 | return _core_.Window_SetMinSize(*args, **kwargs) | |
8776 | ||
8777 | def SetMaxSize(*args, **kwargs): | |
8778 | """ | |
8779 | SetMaxSize(self, Size maxSize) | |
8780 | ||
8781 | A more convenient method than `SetSizeHints` for setting just the | |
8782 | max size. | |
8783 | """ | |
8784 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
8785 | ||
8786 | def GetMinWidth(*args, **kwargs): | |
8787 | """GetMinWidth(self) -> int""" | |
8788 | return _core_.Window_GetMinWidth(*args, **kwargs) | |
8789 | ||
8790 | def GetMinHeight(*args, **kwargs): | |
8791 | """GetMinHeight(self) -> int""" | |
8792 | return _core_.Window_GetMinHeight(*args, **kwargs) | |
8793 | ||
8794 | def GetMaxWidth(*args, **kwargs): | |
8795 | """GetMaxWidth(self) -> int""" | |
8796 | return _core_.Window_GetMaxWidth(*args, **kwargs) | |
8797 | ||
8798 | def GetMaxHeight(*args, **kwargs): | |
8799 | """GetMaxHeight(self) -> int""" | |
8800 | return _core_.Window_GetMaxHeight(*args, **kwargs) | |
8801 | ||
8802 | def SetVirtualSize(*args, **kwargs): | |
8803 | """ | |
8804 | SetVirtualSize(self, Size size) | |
8805 | ||
8806 | Set the the virtual size of a window in pixels. For most windows this | |
8807 | is just the client area of the window, but for some like scrolled | |
8808 | windows it is more or less independent of the screen window size. | |
8809 | """ | |
8810 | return _core_.Window_SetVirtualSize(*args, **kwargs) | |
8811 | ||
8812 | def SetVirtualSizeWH(*args, **kwargs): | |
8813 | """ | |
8814 | SetVirtualSizeWH(self, int w, int h) | |
8815 | ||
8816 | Set the the virtual size of a window in pixels. For most windows this | |
8817 | is just the client area of the window, but for some like scrolled | |
8818 | windows it is more or less independent of the screen window size. | |
8819 | """ | |
8820 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) | |
8821 | ||
8822 | def GetVirtualSize(*args, **kwargs): | |
8823 | """ | |
8824 | GetVirtualSize(self) -> Size | |
8825 | ||
8826 | Get the the virtual size of the window in pixels. For most windows | |
8827 | this is just the client area of the window, but for some like scrolled | |
8828 | windows it is more or less independent of the screen window size. | |
8829 | """ | |
8830 | return _core_.Window_GetVirtualSize(*args, **kwargs) | |
8831 | ||
8832 | def GetVirtualSizeTuple(*args, **kwargs): | |
8833 | """ | |
8834 | GetVirtualSizeTuple() -> (width, height) | |
8835 | ||
8836 | Get the the virtual size of the window in pixels. For most windows | |
8837 | this is just the client area of the window, but for some like scrolled | |
8838 | windows it is more or less independent of the screen window size. | |
8839 | """ | |
8840 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) | |
8841 | ||
8842 | def GetWindowBorderSize(*args, **kwargs): | |
8843 | """ | |
8844 | GetWindowBorderSize(self) -> Size | |
8845 | ||
8846 | Return the size of the left/right and top/bottom borders. | |
8847 | """ | |
8848 | return _core_.Window_GetWindowBorderSize(*args, **kwargs) | |
8849 | ||
8850 | def GetBestVirtualSize(*args, **kwargs): | |
8851 | """ | |
8852 | GetBestVirtualSize(self) -> Size | |
8853 | ||
8854 | Return the largest of ClientSize and BestSize (as determined by a | |
8855 | sizer, interior children, or other means) | |
8856 | """ | |
8857 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) | |
8858 | ||
8859 | def Show(*args, **kwargs): | |
8860 | """ | |
8861 | Show(self, bool show=True) -> bool | |
8862 | ||
8863 | Shows or hides the window. You may need to call Raise for a top level | |
8864 | window if you want to bring it to top, although this is not needed if | |
8865 | Show is called immediately after the frame creation. Returns True if | |
8866 | the window has been shown or hidden or False if nothing was done | |
8867 | because it already was in the requested state. | |
8868 | """ | |
8869 | return _core_.Window_Show(*args, **kwargs) | |
8870 | ||
8871 | def Hide(*args, **kwargs): | |
8872 | """ | |
8873 | Hide(self) -> bool | |
8874 | ||
8875 | Equivalent to calling Show(False). | |
8876 | """ | |
8877 | return _core_.Window_Hide(*args, **kwargs) | |
8878 | ||
8879 | def Enable(*args, **kwargs): | |
8880 | """ | |
8881 | Enable(self, bool enable=True) -> bool | |
8882 | ||
8883 | Enable or disable the window for user input. Note that when a parent | |
8884 | window is disabled, all of its children are disabled as well and they | |
8885 | are reenabled again when the parent is. Returns true if the window | |
8886 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8887 | window had already been in the specified state. | |
8888 | """ | |
8889 | return _core_.Window_Enable(*args, **kwargs) | |
8890 | ||
8891 | def Disable(*args, **kwargs): | |
8892 | """ | |
8893 | Disable(self) -> bool | |
8894 | ||
8895 | Disables the window, same as Enable(false). | |
8896 | """ | |
8897 | return _core_.Window_Disable(*args, **kwargs) | |
8898 | ||
8899 | def IsShown(*args, **kwargs): | |
8900 | """ | |
8901 | IsShown(self) -> bool | |
8902 | ||
8903 | Returns true if the window is shown, false if it has been hidden. | |
8904 | """ | |
8905 | return _core_.Window_IsShown(*args, **kwargs) | |
8906 | ||
8907 | def IsEnabled(*args, **kwargs): | |
8908 | """ | |
8909 | IsEnabled(self) -> bool | |
8910 | ||
8911 | Returns true if the window is enabled for input, false otherwise. | |
8912 | This method takes into account the enabled state of parent windows up | |
8913 | to the top-level window. | |
8914 | """ | |
8915 | return _core_.Window_IsEnabled(*args, **kwargs) | |
8916 | ||
8917 | def IsThisEnabled(*args, **kwargs): | |
8918 | """ | |
8919 | IsThisEnabled(self) -> bool | |
8920 | ||
8921 | Returns the internal enabled state independent of the parent(s) state, | |
8922 | i.e. the state in which the window would be if all of its parents are | |
8923 | enabled. Use `IsEnabled` to get the effective window state. | |
8924 | """ | |
8925 | return _core_.Window_IsThisEnabled(*args, **kwargs) | |
8926 | ||
8927 | def IsShownOnScreen(*args, **kwargs): | |
8928 | """ | |
8929 | IsShownOnScreen(self) -> bool | |
8930 | ||
8931 | Returns ``True`` if the window is physically visible on the screen, | |
8932 | i.e. it is shown and all its parents up to the toplevel window are | |
8933 | shown as well. | |
8934 | """ | |
8935 | return _core_.Window_IsShownOnScreen(*args, **kwargs) | |
8936 | ||
8937 | def SetWindowStyleFlag(*args, **kwargs): | |
8938 | """ | |
8939 | SetWindowStyleFlag(self, long style) | |
8940 | ||
8941 | Sets the style of the window. Please note that some styles cannot be | |
8942 | changed after the window creation and that Refresh() might need to be | |
8943 | called after changing the others for the change to take place | |
8944 | immediately. | |
8945 | """ | |
8946 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) | |
8947 | ||
8948 | def GetWindowStyleFlag(*args, **kwargs): | |
8949 | """ | |
8950 | GetWindowStyleFlag(self) -> long | |
8951 | ||
8952 | Gets the window style that was passed to the constructor or Create | |
8953 | method. | |
8954 | """ | |
8955 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) | |
8956 | ||
8957 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag | |
8958 | def HasFlag(*args, **kwargs): | |
8959 | """ | |
8960 | HasFlag(self, int flag) -> bool | |
8961 | ||
8962 | Test if the given style is set for this window. | |
8963 | """ | |
8964 | return _core_.Window_HasFlag(*args, **kwargs) | |
8965 | ||
8966 | def IsRetained(*args, **kwargs): | |
8967 | """ | |
8968 | IsRetained(self) -> bool | |
8969 | ||
8970 | Returns true if the window is retained, false otherwise. Retained | |
8971 | windows are only available on X platforms. | |
8972 | """ | |
8973 | return _core_.Window_IsRetained(*args, **kwargs) | |
8974 | ||
8975 | def ToggleWindowStyle(*args, **kwargs): | |
8976 | """ | |
8977 | ToggleWindowStyle(self, int flag) -> bool | |
8978 | ||
8979 | Turn the flag on if it had been turned off before and vice versa, | |
8980 | returns True if the flag is turned on by this function call. | |
8981 | """ | |
8982 | return _core_.Window_ToggleWindowStyle(*args, **kwargs) | |
8983 | ||
8984 | def SetExtraStyle(*args, **kwargs): | |
8985 | """ | |
8986 | SetExtraStyle(self, long exStyle) | |
8987 | ||
8988 | Sets the extra style bits for the window. Extra styles are the less | |
8989 | often used style bits which can't be set with the constructor or with | |
8990 | SetWindowStyleFlag() | |
8991 | """ | |
8992 | return _core_.Window_SetExtraStyle(*args, **kwargs) | |
8993 | ||
8994 | def GetExtraStyle(*args, **kwargs): | |
8995 | """ | |
8996 | GetExtraStyle(self) -> long | |
8997 | ||
8998 | Returns the extra style bits for the window. | |
8999 | """ | |
9000 | return _core_.Window_GetExtraStyle(*args, **kwargs) | |
9001 | ||
9002 | def MakeModal(*args, **kwargs): | |
9003 | """ | |
9004 | MakeModal(self, bool modal=True) | |
9005 | ||
9006 | Disables all other windows in the application so that the user can | |
9007 | only interact with this window. Passing False will reverse this | |
9008 | effect. | |
9009 | """ | |
9010 | return _core_.Window_MakeModal(*args, **kwargs) | |
9011 | ||
9012 | def SetThemeEnabled(*args, **kwargs): | |
9013 | """ | |
9014 | SetThemeEnabled(self, bool enableTheme) | |
9015 | ||
9016 | This function tells a window if it should use the system's "theme" | |
9017 | code to draw the windows' background instead if its own background | |
9018 | drawing code. This will only have an effect on platforms that support | |
9019 | the notion of themes in user defined windows. One such platform is | |
9020 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
9021 | user's selected theme. | |
9022 | ||
9023 | Dialogs, notebook pages and the status bar have this flag set to true | |
9024 | by default so that the default look and feel is simulated best. | |
9025 | """ | |
9026 | return _core_.Window_SetThemeEnabled(*args, **kwargs) | |
9027 | ||
9028 | def GetThemeEnabled(*args, **kwargs): | |
9029 | """ | |
9030 | GetThemeEnabled(self) -> bool | |
9031 | ||
9032 | Return the themeEnabled flag. | |
9033 | """ | |
9034 | return _core_.Window_GetThemeEnabled(*args, **kwargs) | |
9035 | ||
9036 | def SetFocus(*args, **kwargs): | |
9037 | """ | |
9038 | SetFocus(self) | |
9039 | ||
9040 | Set's the focus to this window, allowing it to receive keyboard input. | |
9041 | """ | |
9042 | return _core_.Window_SetFocus(*args, **kwargs) | |
9043 | ||
9044 | def SetFocusFromKbd(*args, **kwargs): | |
9045 | """ | |
9046 | SetFocusFromKbd(self) | |
9047 | ||
9048 | Set focus to this window as the result of a keyboard action. Normally | |
9049 | only called internally. | |
9050 | """ | |
9051 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) | |
9052 | ||
9053 | def FindFocus(*args, **kwargs): | |
9054 | """ | |
9055 | FindFocus() -> Window | |
9056 | ||
9057 | Returns the window or control that currently has the keyboard focus, | |
9058 | or None. | |
9059 | """ | |
9060 | return _core_.Window_FindFocus(*args, **kwargs) | |
9061 | ||
9062 | FindFocus = staticmethod(FindFocus) | |
9063 | def AcceptsFocus(*args, **kwargs): | |
9064 | """ | |
9065 | AcceptsFocus(self) -> bool | |
9066 | ||
9067 | Can this window have focus? | |
9068 | """ | |
9069 | return _core_.Window_AcceptsFocus(*args, **kwargs) | |
9070 | ||
9071 | def CanAcceptFocus(*args, **kwargs): | |
9072 | """ | |
9073 | CanAcceptFocus(self) -> bool | |
9074 | ||
9075 | Can this window have focus right now? | |
9076 | """ | |
9077 | return _core_.Window_CanAcceptFocus(*args, **kwargs) | |
9078 | ||
9079 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
9080 | """ | |
9081 | AcceptsFocusFromKeyboard(self) -> bool | |
9082 | ||
9083 | Can this window be given focus by keyboard navigation? if not, the | |
9084 | only way to give it focus (provided it accepts it at all) is to click | |
9085 | it. | |
9086 | """ | |
9087 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) | |
9088 | ||
9089 | def CanAcceptFocusFromKeyboard(*args, **kwargs): | |
9090 | """ | |
9091 | CanAcceptFocusFromKeyboard(self) -> bool | |
9092 | ||
9093 | Can this window be assigned focus from keyboard right now? | |
9094 | """ | |
9095 | return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs) | |
9096 | ||
9097 | def NavigateIn(*args, **kwargs): | |
9098 | """ | |
9099 | NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
9100 | ||
9101 | Navigates inside this window. | |
9102 | """ | |
9103 | return _core_.Window_NavigateIn(*args, **kwargs) | |
9104 | ||
9105 | def Navigate(*args, **kwargs): | |
9106 | """ | |
9107 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
9108 | ||
9109 | Does keyboard navigation starting from this window to another. This is | |
9110 | equivalient to self.GetParent().NavigateIn(). | |
9111 | """ | |
9112 | return _core_.Window_Navigate(*args, **kwargs) | |
9113 | ||
9114 | def MoveAfterInTabOrder(*args, **kwargs): | |
9115 | """ | |
9116 | MoveAfterInTabOrder(self, Window win) | |
9117 | ||
9118 | Moves this window in the tab navigation order after the specified | |
9119 | sibling window. This means that when the user presses the TAB key on | |
9120 | that other window, the focus switches to this window. | |
9121 | ||
9122 | The default tab order is the same as creation order. This function | |
9123 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
9124 | windows. | |
9125 | ||
9126 | """ | |
9127 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
9128 | ||
9129 | def MoveBeforeInTabOrder(*args, **kwargs): | |
9130 | """ | |
9131 | MoveBeforeInTabOrder(self, Window win) | |
9132 | ||
9133 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
9134 | before win instead of putting it right after it. | |
9135 | """ | |
9136 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
9137 | ||
9138 | def GetChildren(*args, **kwargs): | |
9139 | """ | |
9140 | GetChildren(self) -> PyObject | |
9141 | ||
9142 | Returns a list of the window's children. NOTE: Currently this is a | |
9143 | copy of the child window list maintained by the window, so the return | |
9144 | value of this function is only valid as long as the window's children | |
9145 | do not change. | |
9146 | """ | |
9147 | return _core_.Window_GetChildren(*args, **kwargs) | |
9148 | ||
9149 | def GetParent(*args, **kwargs): | |
9150 | """ | |
9151 | GetParent(self) -> Window | |
9152 | ||
9153 | Returns the parent window of this window, or None if there isn't one. | |
9154 | """ | |
9155 | return _core_.Window_GetParent(*args, **kwargs) | |
9156 | ||
9157 | def GetGrandParent(*args, **kwargs): | |
9158 | """ | |
9159 | GetGrandParent(self) -> Window | |
9160 | ||
9161 | Returns the parent of the parent of this window, or None if there | |
9162 | isn't one. | |
9163 | """ | |
9164 | return _core_.Window_GetGrandParent(*args, **kwargs) | |
9165 | ||
9166 | def GetTopLevelParent(*args, **kwargs): | |
9167 | """ | |
9168 | GetTopLevelParent(self) -> Window | |
9169 | ||
9170 | Returns the first frame or dialog in this window's parental hierarchy. | |
9171 | """ | |
9172 | return _core_.Window_GetTopLevelParent(*args, **kwargs) | |
9173 | ||
9174 | def IsTopLevel(*args, **kwargs): | |
9175 | """ | |
9176 | IsTopLevel(self) -> bool | |
9177 | ||
9178 | Returns true if the given window is a top-level one. Currently all | |
9179 | frames and dialogs are always considered to be top-level windows (even | |
9180 | if they have a parent window). | |
9181 | """ | |
9182 | return _core_.Window_IsTopLevel(*args, **kwargs) | |
9183 | ||
9184 | def Reparent(*args, **kwargs): | |
9185 | """ | |
9186 | Reparent(self, Window newParent) -> bool | |
9187 | ||
9188 | Reparents the window, i.e the window will be removed from its current | |
9189 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
9190 | re-inserted into another. Available on Windows and GTK. Returns True | |
9191 | if the parent was changed, False otherwise (error or newParent == | |
9192 | oldParent) | |
9193 | """ | |
9194 | return _core_.Window_Reparent(*args, **kwargs) | |
9195 | ||
9196 | def AddChild(*args, **kwargs): | |
9197 | """ | |
9198 | AddChild(self, Window child) | |
9199 | ||
9200 | Adds a child window. This is called automatically by window creation | |
9201 | functions so should not be required by the application programmer. | |
9202 | """ | |
9203 | return _core_.Window_AddChild(*args, **kwargs) | |
9204 | ||
9205 | def RemoveChild(*args, **kwargs): | |
9206 | """ | |
9207 | RemoveChild(self, Window child) | |
9208 | ||
9209 | Removes a child window. This is called automatically by window | |
9210 | deletion functions so should not be required by the application | |
9211 | programmer. | |
9212 | """ | |
9213 | return _core_.Window_RemoveChild(*args, **kwargs) | |
9214 | ||
9215 | def SetDoubleBuffered(*args, **kwargs): | |
9216 | """ | |
9217 | SetDoubleBuffered(self, bool on) | |
9218 | ||
9219 | Currently wxGTK2 only. | |
9220 | """ | |
9221 | return _core_.Window_SetDoubleBuffered(*args, **kwargs) | |
9222 | ||
9223 | def FindWindowById(*args, **kwargs): | |
9224 | """ | |
9225 | FindWindowById(self, long winid) -> Window | |
9226 | ||
9227 | Find a chld of this window by window ID | |
9228 | """ | |
9229 | return _core_.Window_FindWindowById(*args, **kwargs) | |
9230 | ||
9231 | def FindWindowByName(*args, **kwargs): | |
9232 | """ | |
9233 | FindWindowByName(self, String name) -> Window | |
9234 | ||
9235 | Find a child of this window by name | |
9236 | """ | |
9237 | return _core_.Window_FindWindowByName(*args, **kwargs) | |
9238 | ||
9239 | def GetEventHandler(*args, **kwargs): | |
9240 | """ | |
9241 | GetEventHandler(self) -> EvtHandler | |
9242 | ||
9243 | Returns the event handler for this window. By default, the window is | |
9244 | its own event handler. | |
9245 | """ | |
9246 | return _core_.Window_GetEventHandler(*args, **kwargs) | |
9247 | ||
9248 | def SetEventHandler(*args, **kwargs): | |
9249 | """ | |
9250 | SetEventHandler(self, EvtHandler handler) | |
9251 | ||
9252 | Sets the event handler for this window. An event handler is an object | |
9253 | that is capable of processing the events sent to a window. (In other | |
9254 | words, is able to dispatch the events to handler function.) By | |
9255 | default, the window is its own event handler, but an application may | |
9256 | wish to substitute another, for example to allow central | |
9257 | implementation of event-handling for a variety of different window | |
9258 | classes. | |
9259 | ||
9260 | It is usually better to use `wx.Window.PushEventHandler` since this sets | |
9261 | up a chain of event handlers, where an event not handled by one event | |
9262 | handler is handed off to the next one in the chain. | |
9263 | """ | |
9264 | return _core_.Window_SetEventHandler(*args, **kwargs) | |
9265 | ||
9266 | def PushEventHandler(*args, **kwargs): | |
9267 | """ | |
9268 | PushEventHandler(self, EvtHandler handler) | |
9269 | ||
9270 | Pushes this event handler onto the event handler stack for the window. | |
9271 | An event handler is an object that is capable of processing the events | |
9272 | sent to a window. (In other words, is able to dispatch the events to | |
9273 | handler function.) By default, the window is its own event handler, | |
9274 | but an application may wish to substitute another, for example to | |
9275 | allow central implementation of event-handling for a variety of | |
9276 | different window classes. | |
9277 | ||
9278 | wx.Window.PushEventHandler allows an application to set up a chain of | |
9279 | event handlers, where an event not handled by one event handler is | |
9280 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` | |
9281 | to remove the event handler. Ownership of the handler is *not* given | |
9282 | to the window, so you should be sure to pop the handler before the | |
9283 | window is destroyed and either let PopEventHandler destroy it, or call | |
9284 | its Destroy method yourself. | |
9285 | """ | |
9286 | return _core_.Window_PushEventHandler(*args, **kwargs) | |
9287 | ||
9288 | def PopEventHandler(*args, **kwargs): | |
9289 | """ | |
9290 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler | |
9291 | ||
9292 | Removes and returns the top-most event handler on the event handler | |
9293 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
9294 | destroyed after it is popped, and ``None`` will be returned instead. | |
9295 | """ | |
9296 | return _core_.Window_PopEventHandler(*args, **kwargs) | |
9297 | ||
9298 | def RemoveEventHandler(*args, **kwargs): | |
9299 | """ | |
9300 | RemoveEventHandler(self, EvtHandler handler) -> bool | |
9301 | ||
9302 | Find the given handler in the event handler chain and remove (but not | |
9303 | delete) it from the event handler chain, returns True if it was found | |
9304 | and False otherwise (this also results in an assert failure so this | |
9305 | function should only be called when the handler is supposed to be | |
9306 | there.) | |
9307 | """ | |
9308 | return _core_.Window_RemoveEventHandler(*args, **kwargs) | |
9309 | ||
9310 | def SetValidator(*args, **kwargs): | |
9311 | """ | |
9312 | SetValidator(self, Validator validator) | |
9313 | ||
9314 | Deletes the current validator (if any) and sets the window validator, | |
9315 | having called wx.Validator.Clone to create a new validator of this | |
9316 | type. | |
9317 | """ | |
9318 | return _core_.Window_SetValidator(*args, **kwargs) | |
9319 | ||
9320 | def GetValidator(*args, **kwargs): | |
9321 | """ | |
9322 | GetValidator(self) -> Validator | |
9323 | ||
9324 | Returns a pointer to the current validator for the window, or None if | |
9325 | there is none. | |
9326 | """ | |
9327 | return _core_.Window_GetValidator(*args, **kwargs) | |
9328 | ||
9329 | def Validate(*args, **kwargs): | |
9330 | """ | |
9331 | Validate(self) -> bool | |
9332 | ||
9333 | Validates the current values of the child controls using their | |
9334 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
9335 | style flag set, the method will also call Validate() of all child | |
9336 | windows. Returns false if any of the validations failed. | |
9337 | """ | |
9338 | return _core_.Window_Validate(*args, **kwargs) | |
9339 | ||
9340 | def TransferDataToWindow(*args, **kwargs): | |
9341 | """ | |
9342 | TransferDataToWindow(self) -> bool | |
9343 | ||
9344 | Transfers values to child controls from data areas specified by their | |
9345 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
9346 | style flag set, the method will also call TransferDataToWindow() of | |
9347 | all child windows. | |
9348 | """ | |
9349 | return _core_.Window_TransferDataToWindow(*args, **kwargs) | |
9350 | ||
9351 | def TransferDataFromWindow(*args, **kwargs): | |
9352 | """ | |
9353 | TransferDataFromWindow(self) -> bool | |
9354 | ||
9355 | Transfers values from child controls to data areas specified by their | |
9356 | validators. Returns false if a transfer failed. If the window has | |
9357 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
9358 | also call TransferDataFromWindow() of all child windows. | |
9359 | """ | |
9360 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) | |
9361 | ||
9362 | def InitDialog(*args, **kwargs): | |
9363 | """ | |
9364 | InitDialog(self) | |
9365 | ||
9366 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data | |
9367 | to the dialog via validators. | |
9368 | """ | |
9369 | return _core_.Window_InitDialog(*args, **kwargs) | |
9370 | ||
9371 | def SetAcceleratorTable(*args, **kwargs): | |
9372 | """ | |
9373 | SetAcceleratorTable(self, AcceleratorTable accel) | |
9374 | ||
9375 | Sets the accelerator table for this window. | |
9376 | """ | |
9377 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) | |
9378 | ||
9379 | def GetAcceleratorTable(*args, **kwargs): | |
9380 | """ | |
9381 | GetAcceleratorTable(self) -> AcceleratorTable | |
9382 | ||
9383 | Gets the accelerator table for this window. | |
9384 | """ | |
9385 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) | |
9386 | ||
9387 | def RegisterHotKey(*args, **kwargs): | |
9388 | """ | |
9389 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool | |
9390 | ||
9391 | Registers a system wide hotkey. Every time the user presses the hotkey | |
9392 | registered here, this window will receive a hotkey event. It will | |
9393 | receive the event even if the application is in the background and | |
9394 | does not have the input focus because the user is working with some | |
9395 | other application. To bind an event handler function to this hotkey | |
9396 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
9397 | hotkey was registered successfully. | |
9398 | """ | |
9399 | return _core_.Window_RegisterHotKey(*args, **kwargs) | |
9400 | ||
9401 | def UnregisterHotKey(*args, **kwargs): | |
9402 | """ | |
9403 | UnregisterHotKey(self, int hotkeyId) -> bool | |
9404 | ||
9405 | Unregisters a system wide hotkey. | |
9406 | """ | |
9407 | return _core_.Window_UnregisterHotKey(*args, **kwargs) | |
9408 | ||
9409 | def ConvertDialogPointToPixels(*args, **kwargs): | |
9410 | """ | |
9411 | ConvertDialogPointToPixels(self, Point pt) -> Point | |
9412 | ||
9413 | Converts a point or size from dialog units to pixels. Dialog units | |
9414 | are used for maintaining a dialog's proportions even if the font | |
9415 | changes. For the x dimension, the dialog units are multiplied by the | |
9416 | average character width and then divided by 4. For the y dimension, | |
9417 | the dialog units are multiplied by the average character height and | |
9418 | then divided by 8. | |
9419 | """ | |
9420 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) | |
9421 | ||
9422 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
9423 | """ | |
9424 | ConvertDialogSizeToPixels(self, Size sz) -> Size | |
9425 | ||
9426 | Converts a point or size from dialog units to pixels. Dialog units | |
9427 | are used for maintaining a dialog's proportions even if the font | |
9428 | changes. For the x dimension, the dialog units are multiplied by the | |
9429 | average character width and then divided by 4. For the y dimension, | |
9430 | the dialog units are multiplied by the average character height and | |
9431 | then divided by 8. | |
9432 | """ | |
9433 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) | |
9434 | ||
9435 | def DLG_PNT(*args, **kwargs): | |
9436 | """ | |
9437 | DLG_PNT(self, Point pt) -> Point | |
9438 | ||
9439 | Converts a point or size from dialog units to pixels. Dialog units | |
9440 | are used for maintaining a dialog's proportions even if the font | |
9441 | changes. For the x dimension, the dialog units are multiplied by the | |
9442 | average character width and then divided by 4. For the y dimension, | |
9443 | the dialog units are multiplied by the average character height and | |
9444 | then divided by 8. | |
9445 | """ | |
9446 | return _core_.Window_DLG_PNT(*args, **kwargs) | |
9447 | ||
9448 | def DLG_SZE(*args, **kwargs): | |
9449 | """ | |
9450 | DLG_SZE(self, Size sz) -> Size | |
9451 | ||
9452 | Converts a point or size from dialog units to pixels. Dialog units | |
9453 | are used for maintaining a dialog's proportions even if the font | |
9454 | changes. For the x dimension, the dialog units are multiplied by the | |
9455 | average character width and then divided by 4. For the y dimension, | |
9456 | the dialog units are multiplied by the average character height and | |
9457 | then divided by 8. | |
9458 | """ | |
9459 | return _core_.Window_DLG_SZE(*args, **kwargs) | |
9460 | ||
9461 | def ConvertPixelPointToDialog(*args, **kwargs): | |
9462 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" | |
9463 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) | |
9464 | ||
9465 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
9466 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" | |
9467 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) | |
9468 | ||
9469 | def WarpPointer(*args, **kwargs): | |
9470 | """ | |
9471 | WarpPointer(self, int x, int y) | |
9472 | ||
9473 | Moves the pointer to the given position on the window. | |
9474 | ||
9475 | NOTE: This function is not supported under Mac because Apple Human | |
9476 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
9477 | """ | |
9478 | return _core_.Window_WarpPointer(*args, **kwargs) | |
9479 | ||
9480 | def CaptureMouse(*args, **kwargs): | |
9481 | """ | |
9482 | CaptureMouse(self) | |
9483 | ||
9484 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
9485 | release the capture. | |
9486 | ||
9487 | Note that wxWindows maintains the stack of windows having captured the | |
9488 | mouse and when the mouse is released the capture returns to the window | |
9489 | which had had captured it previously and it is only really released if | |
9490 | there were no previous window. In particular, this means that you must | |
9491 | release the mouse as many times as you capture it, unless the window | |
9492 | receives the `wx.MouseCaptureLostEvent` event. | |
9493 | ||
9494 | Any application which captures the mouse in the beginning of some | |
9495 | operation *must* handle `wx.MouseCaptureLostEvent` and cancel this | |
9496 | operation when it receives the event. The event handler must not | |
9497 | recapture mouse. | |
9498 | """ | |
9499 | return _core_.Window_CaptureMouse(*args, **kwargs) | |
9500 | ||
9501 | def ReleaseMouse(*args, **kwargs): | |
9502 | """ | |
9503 | ReleaseMouse(self) | |
9504 | ||
9505 | Releases mouse input captured with wx.Window.CaptureMouse. | |
9506 | """ | |
9507 | return _core_.Window_ReleaseMouse(*args, **kwargs) | |
9508 | ||
9509 | def GetCapture(*args, **kwargs): | |
9510 | """ | |
9511 | GetCapture() -> Window | |
9512 | ||
9513 | Returns the window which currently captures the mouse or None | |
9514 | """ | |
9515 | return _core_.Window_GetCapture(*args, **kwargs) | |
9516 | ||
9517 | GetCapture = staticmethod(GetCapture) | |
9518 | def HasCapture(*args, **kwargs): | |
9519 | """ | |
9520 | HasCapture(self) -> bool | |
9521 | ||
9522 | Returns true if this window has the current mouse capture. | |
9523 | """ | |
9524 | return _core_.Window_HasCapture(*args, **kwargs) | |
9525 | ||
9526 | def Refresh(*args, **kwargs): | |
9527 | """ | |
9528 | Refresh(self, bool eraseBackground=True, Rect rect=None) | |
9529 | ||
9530 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
9531 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
9532 | to the window. | |
9533 | """ | |
9534 | return _core_.Window_Refresh(*args, **kwargs) | |
9535 | ||
9536 | def RefreshRect(*args, **kwargs): | |
9537 | """ | |
9538 | RefreshRect(self, Rect rect, bool eraseBackground=True) | |
9539 | ||
9540 | Redraws the contents of the given rectangle: the area inside it will | |
9541 | be repainted. This is the same as Refresh but has a nicer syntax. | |
9542 | """ | |
9543 | return _core_.Window_RefreshRect(*args, **kwargs) | |
9544 | ||
9545 | def Update(*args, **kwargs): | |
9546 | """ | |
9547 | Update(self) | |
9548 | ||
9549 | Calling this method immediately repaints the invalidated area of the | |
9550 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
9551 | this would usually only happen when the flow of control returns to the | |
9552 | event loop.) Notice that this function doesn't refresh the window and | |
9553 | does nothing if the window has been already repainted. Use `Refresh` | |
9554 | first if you want to immediately redraw the window (or some portion of | |
9555 | it) unconditionally. | |
9556 | """ | |
9557 | return _core_.Window_Update(*args, **kwargs) | |
9558 | ||
9559 | def ClearBackground(*args, **kwargs): | |
9560 | """ | |
9561 | ClearBackground(self) | |
9562 | ||
9563 | Clears the window by filling it with the current background | |
9564 | colour. Does not cause an erase background event to be generated. | |
9565 | """ | |
9566 | return _core_.Window_ClearBackground(*args, **kwargs) | |
9567 | ||
9568 | def Freeze(*args, **kwargs): | |
9569 | """ | |
9570 | Freeze(self) | |
9571 | ||
9572 | Freezes the window or, in other words, prevents any updates from | |
9573 | taking place on screen, the window is not redrawn at all. Thaw must be | |
9574 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
9575 | nested, with the actual Thaw being delayed until all the nesting has | |
9576 | been undone. | |
9577 | ||
9578 | This method is useful for visual appearance optimization (for example, | |
9579 | it is a good idea to use it before inserting large amount of text into | |
9580 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
9581 | for all controls so it is mostly just a hint to wxWindows and not a | |
9582 | mandatory directive. | |
9583 | """ | |
9584 | return _core_.Window_Freeze(*args, **kwargs) | |
9585 | ||
9586 | def IsFrozen(*args, **kwargs): | |
9587 | """ | |
9588 | IsFrozen(self) -> bool | |
9589 | ||
9590 | Returns ``True`` if the window has been frozen and not thawed yet. | |
9591 | ||
9592 | :see: `Freeze` and `Thaw` | |
9593 | """ | |
9594 | return _core_.Window_IsFrozen(*args, **kwargs) | |
9595 | ||
9596 | def Thaw(*args, **kwargs): | |
9597 | """ | |
9598 | Thaw(self) | |
9599 | ||
9600 | Reenables window updating after a previous call to Freeze. Calls to | |
9601 | Freeze/Thaw may be nested, so Thaw must be called the same number of | |
9602 | times that Freeze was before the window will be updated. | |
9603 | """ | |
9604 | return _core_.Window_Thaw(*args, **kwargs) | |
9605 | ||
9606 | def PrepareDC(*args, **kwargs): | |
9607 | """ | |
9608 | PrepareDC(self, DC dc) | |
9609 | ||
9610 | Call this function to prepare the device context for drawing a | |
9611 | scrolled image. It sets the device origin according to the current | |
9612 | scroll position. | |
9613 | """ | |
9614 | return _core_.Window_PrepareDC(*args, **kwargs) | |
9615 | ||
9616 | def IsDoubleBuffered(*args, **kwargs): | |
9617 | """ | |
9618 | IsDoubleBuffered(self) -> bool | |
9619 | ||
9620 | Returns ``True`` if the window contents is double-buffered by the | |
9621 | system, i.e. if any drawing done on the window is really done on a | |
9622 | temporary backing surface and transferred to the screen all at once | |
9623 | later. | |
9624 | """ | |
9625 | return _core_.Window_IsDoubleBuffered(*args, **kwargs) | |
9626 | ||
9627 | def GetUpdateRegion(*args, **kwargs): | |
9628 | """ | |
9629 | GetUpdateRegion(self) -> Region | |
9630 | ||
9631 | Returns the region specifying which parts of the window have been | |
9632 | damaged. Should only be called within an EVT_PAINT handler. | |
9633 | """ | |
9634 | return _core_.Window_GetUpdateRegion(*args, **kwargs) | |
9635 | ||
9636 | def GetUpdateClientRect(*args, **kwargs): | |
9637 | """ | |
9638 | GetUpdateClientRect(self) -> Rect | |
9639 | ||
9640 | Get the update rectangle region bounding box in client coords. | |
9641 | """ | |
9642 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) | |
9643 | ||
9644 | def IsExposed(*args, **kwargs): | |
9645 | """ | |
9646 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool | |
9647 | ||
9648 | Returns true if the given point or rectangle area has been exposed | |
9649 | since the last repaint. Call this in an paint event handler to | |
9650 | optimize redrawing by only redrawing those areas, which have been | |
9651 | exposed. | |
9652 | """ | |
9653 | return _core_.Window_IsExposed(*args, **kwargs) | |
9654 | ||
9655 | def IsExposedPoint(*args, **kwargs): | |
9656 | """ | |
9657 | IsExposedPoint(self, Point pt) -> bool | |
9658 | ||
9659 | Returns true if the given point or rectangle area has been exposed | |
9660 | since the last repaint. Call this in an paint event handler to | |
9661 | optimize redrawing by only redrawing those areas, which have been | |
9662 | exposed. | |
9663 | """ | |
9664 | return _core_.Window_IsExposedPoint(*args, **kwargs) | |
9665 | ||
9666 | def IsExposedRect(*args, **kwargs): | |
9667 | """ | |
9668 | IsExposedRect(self, Rect rect) -> bool | |
9669 | ||
9670 | Returns true if the given point or rectangle area has been exposed | |
9671 | since the last repaint. Call this in an paint event handler to | |
9672 | optimize redrawing by only redrawing those areas, which have been | |
9673 | exposed. | |
9674 | """ | |
9675 | return _core_.Window_IsExposedRect(*args, **kwargs) | |
9676 | ||
9677 | def GetDefaultAttributes(*args, **kwargs): | |
9678 | """ | |
9679 | GetDefaultAttributes(self) -> VisualAttributes | |
9680 | ||
9681 | Get the default attributes for an instance of this class. This is | |
9682 | useful if you want to use the same font or colour in your own control | |
9683 | as in a standard control -- which is a much better idea than hard | |
9684 | coding specific colours or fonts which might look completely out of | |
9685 | place on the user's system, especially if it uses themes. | |
9686 | """ | |
9687 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) | |
9688 | ||
9689 | def GetClassDefaultAttributes(*args, **kwargs): | |
9690 | """ | |
9691 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
9692 | ||
9693 | Get the default attributes for this class. This is useful if you want | |
9694 | to use the same font or colour in your own control as in a standard | |
9695 | control -- which is a much better idea than hard coding specific | |
9696 | colours or fonts which might look completely out of place on the | |
9697 | user's system, especially if it uses themes. | |
9698 | ||
9699 | The variant parameter is only relevant under Mac currently and is | |
9700 | ignore under other platforms. Under Mac, it will change the size of | |
9701 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
9702 | this. | |
9703 | """ | |
9704 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) | |
9705 | ||
9706 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
9707 | def SetBackgroundColour(*args, **kwargs): | |
9708 | """ | |
9709 | SetBackgroundColour(self, Colour colour) -> bool | |
9710 | ||
9711 | Sets the background colour of the window. Returns True if the colour | |
9712 | was changed. The background colour is usually painted by the default | |
9713 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
9714 | automatically under GTK. Using `wx.NullColour` will reset the window | |
9715 | to the default background colour. | |
9716 | ||
9717 | Note that setting the background colour may not cause an immediate | |
9718 | refresh, so you may wish to call `ClearBackground` or `Refresh` after | |
9719 | calling this function. | |
9720 | ||
9721 | Using this function will disable attempts to use themes for this | |
9722 | window, if the system supports them. Use with care since usually the | |
9723 | themes represent the appearance chosen by the user to be used for all | |
9724 | applications on the system. | |
9725 | """ | |
9726 | return _core_.Window_SetBackgroundColour(*args, **kwargs) | |
9727 | ||
9728 | def SetOwnBackgroundColour(*args, **kwargs): | |
9729 | """SetOwnBackgroundColour(self, Colour colour)""" | |
9730 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
9731 | ||
9732 | def SetForegroundColour(*args, **kwargs): | |
9733 | """ | |
9734 | SetForegroundColour(self, Colour colour) -> bool | |
9735 | ||
9736 | Sets the foreground colour of the window. Returns True is the colour | |
9737 | was changed. The interpretation of foreground colour is dependent on | |
9738 | the window class; it may be the text colour or other colour, or it may | |
9739 | not be used at all. | |
9740 | """ | |
9741 | return _core_.Window_SetForegroundColour(*args, **kwargs) | |
9742 | ||
9743 | def SetOwnForegroundColour(*args, **kwargs): | |
9744 | """SetOwnForegroundColour(self, Colour colour)""" | |
9745 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
9746 | ||
9747 | def GetBackgroundColour(*args, **kwargs): | |
9748 | """ | |
9749 | GetBackgroundColour(self) -> Colour | |
9750 | ||
9751 | Returns the background colour of the window. | |
9752 | """ | |
9753 | return _core_.Window_GetBackgroundColour(*args, **kwargs) | |
9754 | ||
9755 | def GetForegroundColour(*args, **kwargs): | |
9756 | """ | |
9757 | GetForegroundColour(self) -> Colour | |
9758 | ||
9759 | Returns the foreground colour of the window. The interpretation of | |
9760 | foreground colour is dependent on the window class; it may be the text | |
9761 | colour or other colour, or it may not be used at all. | |
9762 | """ | |
9763 | return _core_.Window_GetForegroundColour(*args, **kwargs) | |
9764 | ||
9765 | def InheritsBackgroundColour(*args, **kwargs): | |
9766 | """InheritsBackgroundColour(self) -> bool""" | |
9767 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
9768 | ||
9769 | def UseBgCol(*args, **kwargs): | |
9770 | """UseBgCol(self) -> bool""" | |
9771 | return _core_.Window_UseBgCol(*args, **kwargs) | |
9772 | ||
9773 | def SetBackgroundStyle(*args, **kwargs): | |
9774 | """ | |
9775 | SetBackgroundStyle(self, int style) -> bool | |
9776 | ||
9777 | Returns the background style of the window. The background style | |
9778 | indicates how the background of the window is drawn. | |
9779 | ||
9780 | ====================== ======================================== | |
9781 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9782 | be determined by the system | |
9783 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9784 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9785 | application. | |
9786 | ====================== ======================================== | |
9787 | ||
9788 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9789 | a custom background, such as a tiled bitmap. Currently the style has | |
9790 | no effect on other platforms. | |
9791 | ||
9792 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9793 | """ | |
9794 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
9795 | ||
9796 | def GetBackgroundStyle(*args, **kwargs): | |
9797 | """ | |
9798 | GetBackgroundStyle(self) -> int | |
9799 | ||
9800 | Returns the background style of the window. | |
9801 | ||
9802 | :see: `SetBackgroundStyle` | |
9803 | """ | |
9804 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
9805 | ||
9806 | def HasTransparentBackground(*args, **kwargs): | |
9807 | """ | |
9808 | HasTransparentBackground(self) -> bool | |
9809 | ||
9810 | Returns True if this window's background is transparent (as, for | |
9811 | example, for `wx.StaticText`) and should show the parent window's | |
9812 | background. | |
9813 | ||
9814 | This method is mostly used internally by the library itself and you | |
9815 | normally shouldn't have to call it. You may, however, have to override | |
9816 | it in your custom control classes to ensure that background is painted | |
9817 | correctly. | |
9818 | """ | |
9819 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
9820 | ||
9821 | def SetCursor(*args, **kwargs): | |
9822 | """ | |
9823 | SetCursor(self, Cursor cursor) -> bool | |
9824 | ||
9825 | Sets the window's cursor. Notice that the window cursor also sets it | |
9826 | for the children of the window implicitly. | |
9827 | ||
9828 | The cursor may be wx.NullCursor in which case the window cursor will | |
9829 | be reset back to default. | |
9830 | """ | |
9831 | return _core_.Window_SetCursor(*args, **kwargs) | |
9832 | ||
9833 | def GetCursor(*args, **kwargs): | |
9834 | """ | |
9835 | GetCursor(self) -> Cursor | |
9836 | ||
9837 | Return the cursor associated with this window. | |
9838 | """ | |
9839 | return _core_.Window_GetCursor(*args, **kwargs) | |
9840 | ||
9841 | def SetFont(*args, **kwargs): | |
9842 | """ | |
9843 | SetFont(self, Font font) -> bool | |
9844 | ||
9845 | Sets the font for this window. | |
9846 | """ | |
9847 | return _core_.Window_SetFont(*args, **kwargs) | |
9848 | ||
9849 | def SetOwnFont(*args, **kwargs): | |
9850 | """SetOwnFont(self, Font font)""" | |
9851 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
9852 | ||
9853 | def GetFont(*args, **kwargs): | |
9854 | """ | |
9855 | GetFont(self) -> Font | |
9856 | ||
9857 | Returns the default font used for this window. | |
9858 | """ | |
9859 | return _core_.Window_GetFont(*args, **kwargs) | |
9860 | ||
9861 | def SetCaret(*args, **kwargs): | |
9862 | """ | |
9863 | SetCaret(self, Caret caret) | |
9864 | ||
9865 | Sets the caret associated with the window. | |
9866 | """ | |
9867 | return _core_.Window_SetCaret(*args, **kwargs) | |
9868 | ||
9869 | def GetCaret(*args, **kwargs): | |
9870 | """ | |
9871 | GetCaret(self) -> Caret | |
9872 | ||
9873 | Returns the caret associated with the window. | |
9874 | """ | |
9875 | return _core_.Window_GetCaret(*args, **kwargs) | |
9876 | ||
9877 | def GetCharHeight(*args, **kwargs): | |
9878 | """ | |
9879 | GetCharHeight(self) -> int | |
9880 | ||
9881 | Get the (average) character size for the current font. | |
9882 | """ | |
9883 | return _core_.Window_GetCharHeight(*args, **kwargs) | |
9884 | ||
9885 | def GetCharWidth(*args, **kwargs): | |
9886 | """ | |
9887 | GetCharWidth(self) -> int | |
9888 | ||
9889 | Get the (average) character size for the current font. | |
9890 | """ | |
9891 | return _core_.Window_GetCharWidth(*args, **kwargs) | |
9892 | ||
9893 | def GetTextExtent(*args, **kwargs): | |
9894 | """ | |
9895 | GetTextExtent(String string) -> (width, height) | |
9896 | ||
9897 | Get the width and height of the text using the current font. | |
9898 | """ | |
9899 | return _core_.Window_GetTextExtent(*args, **kwargs) | |
9900 | ||
9901 | def GetFullTextExtent(*args, **kwargs): | |
9902 | """ | |
9903 | GetFullTextExtent(String string, Font font=None) -> | |
9904 | (width, height, descent, externalLeading) | |
9905 | ||
9906 | Get the width, height, decent and leading of the text using the | |
9907 | current or specified font. | |
9908 | """ | |
9909 | return _core_.Window_GetFullTextExtent(*args, **kwargs) | |
9910 | ||
9911 | def ClientToScreenXY(*args, **kwargs): | |
9912 | """ | |
9913 | ClientToScreenXY(int x, int y) -> (x,y) | |
9914 | ||
9915 | Converts to screen coordinates from coordinates relative to this window. | |
9916 | """ | |
9917 | return _core_.Window_ClientToScreenXY(*args, **kwargs) | |
9918 | ||
9919 | def ScreenToClientXY(*args, **kwargs): | |
9920 | """ | |
9921 | ScreenToClientXY(int x, int y) -> (x,y) | |
9922 | ||
9923 | Converts from screen to client window coordinates. | |
9924 | """ | |
9925 | return _core_.Window_ScreenToClientXY(*args, **kwargs) | |
9926 | ||
9927 | def ClientToScreen(*args, **kwargs): | |
9928 | """ | |
9929 | ClientToScreen(self, Point pt) -> Point | |
9930 | ||
9931 | Converts to screen coordinates from coordinates relative to this window. | |
9932 | """ | |
9933 | return _core_.Window_ClientToScreen(*args, **kwargs) | |
9934 | ||
9935 | def ScreenToClient(*args, **kwargs): | |
9936 | """ | |
9937 | ScreenToClient(self, Point pt) -> Point | |
9938 | ||
9939 | Converts from screen to client window coordinates. | |
9940 | """ | |
9941 | return _core_.Window_ScreenToClient(*args, **kwargs) | |
9942 | ||
9943 | def HitTestXY(*args, **kwargs): | |
9944 | """ | |
9945 | HitTestXY(self, int x, int y) -> int | |
9946 | ||
9947 | Test where the given (in client coords) point lies | |
9948 | """ | |
9949 | return _core_.Window_HitTestXY(*args, **kwargs) | |
9950 | ||
9951 | def HitTest(*args, **kwargs): | |
9952 | """ | |
9953 | HitTest(self, Point pt) -> int | |
9954 | ||
9955 | Test where the given (in client coords) point lies | |
9956 | """ | |
9957 | return _core_.Window_HitTest(*args, **kwargs) | |
9958 | ||
9959 | def GetBorder(*args): | |
9960 | """ | |
9961 | GetBorder(self, long flags) -> int | |
9962 | GetBorder(self) -> int | |
9963 | ||
9964 | Get border for the flags of this window | |
9965 | """ | |
9966 | return _core_.Window_GetBorder(*args) | |
9967 | ||
9968 | def UpdateWindowUI(*args, **kwargs): | |
9969 | """ | |
9970 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) | |
9971 | ||
9972 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9973 | implementation depends on the window; for example a wx.ToolBar will | |
9974 | send an update UI event for each toolbar button, and a wx.Frame will | |
9975 | send an update UI event for each menubar menu item. You can call this | |
9976 | function from your application to ensure that your UI is up-to-date at | |
9977 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9978 | concerned). This may be necessary if you have called | |
9979 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to | |
9980 | limit the overhead that wxWindows incurs by sending update UI events | |
9981 | in idle time. | |
9982 | """ | |
9983 | return _core_.Window_UpdateWindowUI(*args, **kwargs) | |
9984 | ||
9985 | def PopupMenuXY(*args, **kwargs): | |
9986 | """ | |
9987 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool | |
9988 | ||
9989 | Pops up the given menu at the specified coordinates, relative to this window, | |
9990 | and returns control when the user has dismissed the menu. If a menu item is | |
9991 | selected, the corresponding menu event is generated and will be processed as | |
9992 | usual. If the default position is given then the current position of the | |
9993 | mouse cursor will be used. | |
9994 | """ | |
9995 | return _core_.Window_PopupMenuXY(*args, **kwargs) | |
9996 | ||
9997 | def PopupMenu(*args, **kwargs): | |
9998 | """ | |
9999 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool | |
10000 | ||
10001 | Pops up the given menu at the specified coordinates, relative to this window, | |
10002 | and returns control when the user has dismissed the menu. If a menu item is | |
10003 | selected, the corresponding menu event is generated and will be processed as | |
10004 | usual. If the default position is given then the current position of the | |
10005 | mouse cursor will be used. | |
10006 | """ | |
10007 | return _core_.Window_PopupMenu(*args, **kwargs) | |
10008 | ||
10009 | def HasMultiplePages(*args, **kwargs): | |
10010 | """HasMultiplePages(self) -> bool""" | |
10011 | return _core_.Window_HasMultiplePages(*args, **kwargs) | |
10012 | ||
10013 | def GetHandle(*args, **kwargs): | |
10014 | """ | |
10015 | GetHandle(self) -> long | |
10016 | ||
10017 | Returns the platform-specific handle (as a long integer) of the | |
10018 | physical window. Currently on wxMac it returns the handle of the | |
10019 | toplevel parent of the window. | |
10020 | """ | |
10021 | return _core_.Window_GetHandle(*args, **kwargs) | |
10022 | ||
10023 | def AssociateHandle(*args, **kwargs): | |
10024 | """ | |
10025 | AssociateHandle(self, long handle) | |
10026 | ||
10027 | Associate the window with a new native handle | |
10028 | """ | |
10029 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
10030 | ||
10031 | def DissociateHandle(*args, **kwargs): | |
10032 | """ | |
10033 | DissociateHandle(self) | |
10034 | ||
10035 | Dissociate the current native handle from the window | |
10036 | """ | |
10037 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
10038 | ||
10039 | def HasScrollbar(*args, **kwargs): | |
10040 | """ | |
10041 | HasScrollbar(self, int orient) -> bool | |
10042 | ||
10043 | Does the window have the scrollbar for this orientation? | |
10044 | """ | |
10045 | return _core_.Window_HasScrollbar(*args, **kwargs) | |
10046 | ||
10047 | def SetScrollbar(*args, **kwargs): | |
10048 | """ | |
10049 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, | |
10050 | bool refresh=True) | |
10051 | ||
10052 | Sets the scrollbar properties of a built-in scrollbar. | |
10053 | """ | |
10054 | return _core_.Window_SetScrollbar(*args, **kwargs) | |
10055 | ||
10056 | def SetScrollPos(*args, **kwargs): | |
10057 | """ | |
10058 | SetScrollPos(self, int orientation, int pos, bool refresh=True) | |
10059 | ||
10060 | Sets the position of one of the built-in scrollbars. | |
10061 | """ | |
10062 | return _core_.Window_SetScrollPos(*args, **kwargs) | |
10063 | ||
10064 | def GetScrollPos(*args, **kwargs): | |
10065 | """ | |
10066 | GetScrollPos(self, int orientation) -> int | |
10067 | ||
10068 | Returns the built-in scrollbar position. | |
10069 | """ | |
10070 | return _core_.Window_GetScrollPos(*args, **kwargs) | |
10071 | ||
10072 | def GetScrollThumb(*args, **kwargs): | |
10073 | """ | |
10074 | GetScrollThumb(self, int orientation) -> int | |
10075 | ||
10076 | Returns the built-in scrollbar thumb size. | |
10077 | """ | |
10078 | return _core_.Window_GetScrollThumb(*args, **kwargs) | |
10079 | ||
10080 | def GetScrollRange(*args, **kwargs): | |
10081 | """ | |
10082 | GetScrollRange(self, int orientation) -> int | |
10083 | ||
10084 | Returns the built-in scrollbar range. | |
10085 | """ | |
10086 | return _core_.Window_GetScrollRange(*args, **kwargs) | |
10087 | ||
10088 | def ScrollWindow(*args, **kwargs): | |
10089 | """ | |
10090 | ScrollWindow(self, int dx, int dy, Rect rect=None) | |
10091 | ||
10092 | Physically scrolls the pixels in the window and move child windows | |
10093 | accordingly. Use this function to optimise your scrolling | |
10094 | implementations, to minimise the area that must be redrawn. Note that | |
10095 | it is rarely required to call this function from a user program. | |
10096 | """ | |
10097 | return _core_.Window_ScrollWindow(*args, **kwargs) | |
10098 | ||
10099 | def ScrollLines(*args, **kwargs): | |
10100 | """ | |
10101 | ScrollLines(self, int lines) -> bool | |
10102 | ||
10103 | If the platform and window class supports it, scrolls the window by | |
10104 | the given number of lines down, if lines is positive, or up if lines | |
10105 | is negative. Returns True if the window was scrolled, False if it was | |
10106 | already on top/bottom and nothing was done. | |
10107 | """ | |
10108 | return _core_.Window_ScrollLines(*args, **kwargs) | |
10109 | ||
10110 | def ScrollPages(*args, **kwargs): | |
10111 | """ | |
10112 | ScrollPages(self, int pages) -> bool | |
10113 | ||
10114 | If the platform and window class supports it, scrolls the window by | |
10115 | the given number of pages down, if pages is positive, or up if pages | |
10116 | is negative. Returns True if the window was scrolled, False if it was | |
10117 | already on top/bottom and nothing was done. | |
10118 | """ | |
10119 | return _core_.Window_ScrollPages(*args, **kwargs) | |
10120 | ||
10121 | def LineUp(*args, **kwargs): | |
10122 | """ | |
10123 | LineUp(self) -> bool | |
10124 | ||
10125 | This is just a wrapper for ScrollLines(-1). | |
10126 | """ | |
10127 | return _core_.Window_LineUp(*args, **kwargs) | |
10128 | ||
10129 | def LineDown(*args, **kwargs): | |
10130 | """ | |
10131 | LineDown(self) -> bool | |
10132 | ||
10133 | This is just a wrapper for ScrollLines(1). | |
10134 | """ | |
10135 | return _core_.Window_LineDown(*args, **kwargs) | |
10136 | ||
10137 | def PageUp(*args, **kwargs): | |
10138 | """ | |
10139 | PageUp(self) -> bool | |
10140 | ||
10141 | This is just a wrapper for ScrollPages(-1). | |
10142 | """ | |
10143 | return _core_.Window_PageUp(*args, **kwargs) | |
10144 | ||
10145 | def PageDown(*args, **kwargs): | |
10146 | """ | |
10147 | PageDown(self) -> bool | |
10148 | ||
10149 | This is just a wrapper for ScrollPages(1). | |
10150 | """ | |
10151 | return _core_.Window_PageDown(*args, **kwargs) | |
10152 | ||
10153 | def SetHelpText(*args, **kwargs): | |
10154 | """ | |
10155 | SetHelpText(self, String text) | |
10156 | ||
10157 | Sets the help text to be used as context-sensitive help for this | |
10158 | window. Note that the text is actually stored by the current | |
10159 | `wx.HelpProvider` implementation, and not in the window object itself. | |
10160 | """ | |
10161 | return _core_.Window_SetHelpText(*args, **kwargs) | |
10162 | ||
10163 | def SetHelpTextForId(*args, **kwargs): | |
10164 | """ | |
10165 | SetHelpTextForId(self, String text) | |
10166 | ||
10167 | Associate this help text with all windows with the same id as this | |
10168 | one. | |
10169 | """ | |
10170 | return _core_.Window_SetHelpTextForId(*args, **kwargs) | |
10171 | ||
10172 | def GetHelpTextAtPoint(*args, **kwargs): | |
10173 | """ | |
10174 | GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String | |
10175 | ||
10176 | Get the help string associated with the given position in this window. | |
10177 | ||
10178 | Notice that pt may be invalid if event origin is keyboard or unknown | |
10179 | and this method should return the global window help text then | |
10180 | ||
10181 | """ | |
10182 | return _core_.Window_GetHelpTextAtPoint(*args, **kwargs) | |
10183 | ||
10184 | def GetHelpText(*args, **kwargs): | |
10185 | """ | |
10186 | GetHelpText(self) -> String | |
10187 | ||
10188 | Gets the help text to be used as context-sensitive help for this | |
10189 | window. Note that the text is actually stored by the current | |
10190 | `wx.HelpProvider` implementation, and not in the window object itself. | |
10191 | """ | |
10192 | return _core_.Window_GetHelpText(*args, **kwargs) | |
10193 | ||
10194 | def SetToolTipString(*args, **kwargs): | |
10195 | """ | |
10196 | SetToolTipString(self, String tip) | |
10197 | ||
10198 | Attach a tooltip to the window. | |
10199 | """ | |
10200 | return _core_.Window_SetToolTipString(*args, **kwargs) | |
10201 | ||
10202 | def SetToolTip(*args, **kwargs): | |
10203 | """ | |
10204 | SetToolTip(self, ToolTip tip) | |
10205 | ||
10206 | Attach a tooltip to the window. | |
10207 | """ | |
10208 | return _core_.Window_SetToolTip(*args, **kwargs) | |
10209 | ||
10210 | def GetToolTip(*args, **kwargs): | |
10211 | """ | |
10212 | GetToolTip(self) -> ToolTip | |
10213 | ||
10214 | get the associated tooltip or None if none | |
10215 | """ | |
10216 | return _core_.Window_GetToolTip(*args, **kwargs) | |
10217 | ||
10218 | def SetDropTarget(*args, **kwargs): | |
10219 | """ | |
10220 | SetDropTarget(self, DropTarget dropTarget) | |
10221 | ||
10222 | Associates a drop target with this window. If the window already has | |
10223 | a drop target, it is deleted. | |
10224 | """ | |
10225 | return _core_.Window_SetDropTarget(*args, **kwargs) | |
10226 | ||
10227 | def GetDropTarget(*args, **kwargs): | |
10228 | """ | |
10229 | GetDropTarget(self) -> DropTarget | |
10230 | ||
10231 | Returns the associated drop target, which may be None. | |
10232 | """ | |
10233 | return _core_.Window_GetDropTarget(*args, **kwargs) | |
10234 | ||
10235 | def DragAcceptFiles(*args, **kwargs): | |
10236 | """ | |
10237 | DragAcceptFiles(self, bool accept) | |
10238 | ||
10239 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
10240 | Only functional on Windows. | |
10241 | """ | |
10242 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
10243 | ||
10244 | def SetConstraints(*args, **kwargs): | |
10245 | """ | |
10246 | SetConstraints(self, LayoutConstraints constraints) | |
10247 | ||
10248 | Sets the window to have the given layout constraints. If an existing | |
10249 | layout constraints object is already owned by the window, it will be | |
10250 | deleted. Pass None to disassociate and delete the window's current | |
10251 | constraints. | |
10252 | ||
10253 | You must call SetAutoLayout to tell a window to use the constraints | |
10254 | automatically in its default EVT_SIZE handler; otherwise, you must | |
10255 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
10256 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
10257 | effect. | |
10258 | """ | |
10259 | return _core_.Window_SetConstraints(*args, **kwargs) | |
10260 | ||
10261 | def GetConstraints(*args, **kwargs): | |
10262 | """ | |
10263 | GetConstraints(self) -> LayoutConstraints | |
10264 | ||
10265 | Returns a pointer to the window's layout constraints, or None if there | |
10266 | are none. | |
10267 | """ | |
10268 | return _core_.Window_GetConstraints(*args, **kwargs) | |
10269 | ||
10270 | def SetAutoLayout(*args, **kwargs): | |
10271 | """ | |
10272 | SetAutoLayout(self, bool autoLayout) | |
10273 | ||
10274 | Determines whether the Layout function will be called automatically | |
10275 | when the window is resized. lease note that this only happens for the | |
10276 | windows usually used to contain children, namely `wx.Panel` and | |
10277 | `wx.TopLevelWindow` (and the classes deriving from them). | |
10278 | ||
10279 | This method is called implicitly by `SetSizer` but if you use | |
10280 | `SetConstraints` you should call it manually or otherwise the window | |
10281 | layout won't be correctly updated when its size changes. | |
10282 | """ | |
10283 | return _core_.Window_SetAutoLayout(*args, **kwargs) | |
10284 | ||
10285 | def GetAutoLayout(*args, **kwargs): | |
10286 | """ | |
10287 | GetAutoLayout(self) -> bool | |
10288 | ||
10289 | Returns the current autoLayout setting | |
10290 | """ | |
10291 | return _core_.Window_GetAutoLayout(*args, **kwargs) | |
10292 | ||
10293 | def Layout(*args, **kwargs): | |
10294 | """ | |
10295 | Layout(self) -> bool | |
10296 | ||
10297 | Invokes the constraint-based layout algorithm or the sizer-based | |
10298 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
10299 | this function gets called automatically by the default EVT_SIZE | |
10300 | handler when the window is resized. | |
10301 | """ | |
10302 | return _core_.Window_Layout(*args, **kwargs) | |
10303 | ||
10304 | def SetSizer(*args, **kwargs): | |
10305 | """ | |
10306 | SetSizer(self, Sizer sizer, bool deleteOld=True) | |
10307 | ||
10308 | Sets the window to have the given layout sizer. The window will then | |
10309 | own the object, and will take care of its deletion. If an existing | |
10310 | layout sizer object is already owned by the window, it will be deleted | |
10311 | if the deleteOld parameter is true. Note that this function will also | |
10312 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
10313 | non-None, and False otherwise. | |
10314 | """ | |
10315 | return _core_.Window_SetSizer(*args, **kwargs) | |
10316 | ||
10317 | def SetSizerAndFit(*args, **kwargs): | |
10318 | """ | |
10319 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) | |
10320 | ||
10321 | The same as SetSizer, except it also sets the size hints for the | |
10322 | window based on the sizer's minimum size. | |
10323 | """ | |
10324 | return _core_.Window_SetSizerAndFit(*args, **kwargs) | |
10325 | ||
10326 | def GetSizer(*args, **kwargs): | |
10327 | """ | |
10328 | GetSizer(self) -> Sizer | |
10329 | ||
10330 | Return the sizer associated with the window by a previous call to | |
10331 | SetSizer or None if there isn't one. | |
10332 | """ | |
10333 | return _core_.Window_GetSizer(*args, **kwargs) | |
10334 | ||
10335 | def SetContainingSizer(*args, **kwargs): | |
10336 | """ | |
10337 | SetContainingSizer(self, Sizer sizer) | |
10338 | ||
10339 | This normally does not need to be called by application code. It is | |
10340 | called internally when a window is added to a sizer, and is used so | |
10341 | the window can remove itself from the sizer when it is destroyed. | |
10342 | """ | |
10343 | return _core_.Window_SetContainingSizer(*args, **kwargs) | |
10344 | ||
10345 | def GetContainingSizer(*args, **kwargs): | |
10346 | """ | |
10347 | GetContainingSizer(self) -> Sizer | |
10348 | ||
10349 | Return the sizer that this window is a member of, if any, otherwise None. | |
10350 | """ | |
10351 | return _core_.Window_GetContainingSizer(*args, **kwargs) | |
10352 | ||
10353 | def InheritAttributes(*args, **kwargs): | |
10354 | """ | |
10355 | InheritAttributes(self) | |
10356 | ||
10357 | This function is (or should be, in case of custom controls) called | |
10358 | during window creation to intelligently set up the window visual | |
10359 | attributes, that is the font and the foreground and background | |
10360 | colours. | |
10361 | ||
10362 | By 'intelligently' the following is meant: by default, all windows use | |
10363 | their own default attributes. However if some of the parent's | |
10364 | attributes are explicitly changed (that is, using SetFont and not | |
10365 | SetOwnFont) and if the corresponding attribute hadn't been | |
10366 | explicitly set for this window itself, then this window takes the same | |
10367 | value as used by the parent. In addition, if the window overrides | |
10368 | ShouldInheritColours to return false, the colours will not be changed | |
10369 | no matter what and only the font might. | |
10370 | ||
10371 | This rather complicated logic is necessary in order to accommodate the | |
10372 | different usage scenarios. The most common one is when all default | |
10373 | attributes are used and in this case, nothing should be inherited as | |
10374 | in modern GUIs different controls use different fonts (and colours) | |
10375 | than their siblings so they can't inherit the same value from the | |
10376 | parent. However it was also deemed desirable to allow to simply change | |
10377 | the attributes of all children at once by just changing the font or | |
10378 | colour of their common parent, hence in this case we do inherit the | |
10379 | parents attributes. | |
10380 | ||
10381 | """ | |
10382 | return _core_.Window_InheritAttributes(*args, **kwargs) | |
10383 | ||
10384 | def ShouldInheritColours(*args, **kwargs): | |
10385 | """ | |
10386 | ShouldInheritColours(self) -> bool | |
10387 | ||
10388 | Return true from here to allow the colours of this window to be | |
10389 | changed by InheritAttributes, returning false forbids inheriting them | |
10390 | from the parent window. | |
10391 | ||
10392 | The base class version returns false, but this method is overridden in | |
10393 | wxControl where it returns true. | |
10394 | """ | |
10395 | return _core_.Window_ShouldInheritColours(*args, **kwargs) | |
10396 | ||
10397 | def CanSetTransparent(*args, **kwargs): | |
10398 | """ | |
10399 | CanSetTransparent(self) -> bool | |
10400 | ||
10401 | Returns ``True`` if the platform supports setting the transparency for | |
10402 | this window. Note that this method will err on the side of caution, | |
10403 | so it is possible that this will return ``False`` when it is in fact | |
10404 | possible to set the transparency. | |
10405 | ||
10406 | NOTE: On X-windows systems the X server must have the composite | |
10407 | extension loaded, and there must be a composite manager program (such | |
10408 | as xcompmgr) running. | |
10409 | """ | |
10410 | return _core_.Window_CanSetTransparent(*args, **kwargs) | |
10411 | ||
10412 | def SetTransparent(*args, **kwargs): | |
10413 | """ | |
10414 | SetTransparent(self, byte alpha) -> bool | |
10415 | ||
10416 | Attempt to set the transparency of this window to the ``alpha`` value, | |
10417 | returns True on success. The ``alpha`` value is an integer in the | |
10418 | range of 0 to 255, where 0 is fully transparent and 255 is fully | |
10419 | opaque. | |
10420 | """ | |
10421 | return _core_.Window_SetTransparent(*args, **kwargs) | |
10422 | ||
10423 | def PostCreate(self, pre): | |
10424 | """ | |
10425 | Phase 3 of the 2-phase create <wink!> | |
10426 | Call this method after precreating the window with the 2-phase create method. | |
10427 | """ | |
10428 | self.this = pre.this | |
10429 | self.thisown = pre.thisown | |
10430 | pre.thisown = 0 | |
10431 | if hasattr(self, '_setOORInfo'): | |
10432 | try: | |
10433 | self._setOORInfo(self) | |
10434 | except TypeError: | |
10435 | pass | |
10436 | if hasattr(self, '_setCallbackInfo'): | |
10437 | try: | |
10438 | self._setCallbackInfo(self, pre.__class__) | |
10439 | except TypeError: | |
10440 | pass | |
10441 | ||
10442 | def SendSizeEvent(self): | |
10443 | self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1))) | |
10444 | ||
10445 | AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`") | |
10446 | AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`") | |
10447 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
10448 | BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`") | |
10449 | EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`") | |
10450 | BestSize = property(GetBestSize,doc="See `GetBestSize`") | |
10451 | BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`") | |
10452 | Border = property(GetBorder,doc="See `GetBorder`") | |
10453 | Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`") | |
10454 | CharHeight = property(GetCharHeight,doc="See `GetCharHeight`") | |
10455 | CharWidth = property(GetCharWidth,doc="See `GetCharWidth`") | |
10456 | Children = property(GetChildren,doc="See `GetChildren`") | |
10457 | ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`") | |
10458 | ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`") | |
10459 | ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`") | |
10460 | Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`") | |
10461 | ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`") | |
10462 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") | |
10463 | DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`") | |
10464 | DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`") | |
10465 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") | |
10466 | ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`") | |
10467 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
10468 | ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`") | |
10469 | GrandParent = property(GetGrandParent,doc="See `GetGrandParent`") | |
10470 | TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`") | |
10471 | Handle = property(GetHandle,doc="See `GetHandle`") | |
10472 | HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`") | |
10473 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
10474 | Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`") | |
10475 | LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`") | |
10476 | MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`") | |
10477 | MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`") | |
10478 | MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`") | |
10479 | MinHeight = property(GetMinHeight,doc="See `GetMinHeight`") | |
10480 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
10481 | MinWidth = property(GetMinWidth,doc="See `GetMinWidth`") | |
10482 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
10483 | Parent = property(GetParent,doc="See `GetParent`") | |
10484 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
10485 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
10486 | ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`") | |
10487 | ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`") | |
10488 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
10489 | Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`") | |
10490 | ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`") | |
10491 | ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`") | |
10492 | UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`") | |
10493 | UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`") | |
10494 | Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`") | |
10495 | VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`") | |
10496 | WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`") | |
10497 | WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`") | |
10498 | WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`") | |
10499 | Shown = property(IsShown,Show,doc="See `IsShown` and `Show`") | |
10500 | Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`") | |
10501 | TopLevel = property(IsTopLevel,doc="See `IsTopLevel`") | |
10502 | _core_.Window_swigregister(Window) | |
10503 | ||
10504 | def PreWindow(*args, **kwargs): | |
10505 | """ | |
10506 | PreWindow() -> Window | |
10507 | ||
10508 | Precreate a Window for 2-phase creation. | |
10509 | """ | |
10510 | val = _core_.new_PreWindow(*args, **kwargs) | |
10511 | return val | |
10512 | ||
10513 | def Window_NewControlId(*args): | |
10514 | """ | |
10515 | Window_NewControlId() -> int | |
10516 | ||
10517 | Generate a control id for the controls which were not given one. | |
10518 | """ | |
10519 | return _core_.Window_NewControlId(*args) | |
10520 | ||
10521 | def Window_NextControlId(*args, **kwargs): | |
10522 | """ | |
10523 | Window_NextControlId(int winid) -> int | |
10524 | ||
10525 | Get the id of the control following the one with the given | |
10526 | autogenerated) id | |
10527 | """ | |
10528 | return _core_.Window_NextControlId(*args, **kwargs) | |
10529 | ||
10530 | def Window_PrevControlId(*args, **kwargs): | |
10531 | """ | |
10532 | Window_PrevControlId(int winid) -> int | |
10533 | ||
10534 | Get the id of the control preceding the one with the given | |
10535 | autogenerated) id | |
10536 | """ | |
10537 | return _core_.Window_PrevControlId(*args, **kwargs) | |
10538 | ||
10539 | def Window_FindFocus(*args): | |
10540 | """ | |
10541 | Window_FindFocus() -> Window | |
10542 | ||
10543 | Returns the window or control that currently has the keyboard focus, | |
10544 | or None. | |
10545 | """ | |
10546 | return _core_.Window_FindFocus(*args) | |
10547 | ||
10548 | def Window_GetCapture(*args): | |
10549 | """ | |
10550 | Window_GetCapture() -> Window | |
10551 | ||
10552 | Returns the window which currently captures the mouse or None | |
10553 | """ | |
10554 | return _core_.Window_GetCapture(*args) | |
10555 | ||
10556 | def Window_GetClassDefaultAttributes(*args, **kwargs): | |
10557 | """ | |
10558 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
10559 | ||
10560 | Get the default attributes for this class. This is useful if you want | |
10561 | to use the same font or colour in your own control as in a standard | |
10562 | control -- which is a much better idea than hard coding specific | |
10563 | colours or fonts which might look completely out of place on the | |
10564 | user's system, especially if it uses themes. | |
10565 | ||
10566 | The variant parameter is only relevant under Mac currently and is | |
10567 | ignore under other platforms. Under Mac, it will change the size of | |
10568 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10569 | this. | |
10570 | """ | |
10571 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) | |
10572 | ||
10573 | def DLG_PNT(win, point_or_x, y=None): | |
10574 | """ | |
10575 | Convenience function for converting a Point or (x,y) in | |
10576 | dialog units to pixel units. | |
10577 | """ | |
10578 | if y is None: | |
10579 | return win.ConvertDialogPointToPixels(point_or_x) | |
10580 | else: | |
10581 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) | |
10582 | ||
10583 | def DLG_SZE(win, size_width, height=None): | |
10584 | """ | |
10585 | Convenience function for converting a Size or (w,h) in | |
10586 | dialog units to pixel units. | |
10587 | """ | |
10588 | if height is None: | |
10589 | return win.ConvertDialogSizeToPixels(size_width) | |
10590 | else: | |
10591 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) | |
10592 | ||
10593 | ||
10594 | def FindWindowById(*args, **kwargs): | |
10595 | """ | |
10596 | FindWindowById(long id, Window parent=None) -> Window | |
10597 | ||
10598 | Find the first window in the application with the given id. If parent | |
10599 | is None, the search will start from all top-level frames and dialog | |
10600 | boxes; if non-None, the search will be limited to the given window | |
10601 | hierarchy. The search is recursive in both cases. | |
10602 | """ | |
10603 | return _core_.FindWindowById(*args, **kwargs) | |
10604 | ||
10605 | def FindWindowByName(*args, **kwargs): | |
10606 | """ | |
10607 | FindWindowByName(String name, Window parent=None) -> Window | |
10608 | ||
10609 | Find a window by its name (as given in a window constructor or Create | |
10610 | function call). If parent is None, the search will start from all | |
10611 | top-level frames and dialog boxes; if non-None, the search will be | |
10612 | limited to the given window hierarchy. The search is recursive in both | |
10613 | cases. | |
10614 | ||
10615 | If no window with such name is found, wx.FindWindowByLabel is called. | |
10616 | """ | |
10617 | return _core_.FindWindowByName(*args, **kwargs) | |
10618 | ||
10619 | def FindWindowByLabel(*args, **kwargs): | |
10620 | """ | |
10621 | FindWindowByLabel(String label, Window parent=None) -> Window | |
10622 | ||
10623 | Find a window by its label. Depending on the type of window, the label | |
10624 | may be a window title or panel item label. If parent is None, the | |
10625 | search will start from all top-level frames and dialog boxes; if | |
10626 | non-None, the search will be limited to the given window | |
10627 | hierarchy. The search is recursive in both cases. | |
10628 | """ | |
10629 | return _core_.FindWindowByLabel(*args, **kwargs) | |
10630 | ||
10631 | def Window_FromHWND(*args, **kwargs): | |
10632 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" | |
10633 | return _core_.Window_FromHWND(*args, **kwargs) | |
10634 | ||
10635 | def GetTopLevelWindows(*args): | |
10636 | """ | |
10637 | GetTopLevelWindows() -> PyObject | |
10638 | ||
10639 | Returns a list of the the application's top-level windows, (frames, | |
10640 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
10641 | by wxWidgets, and so it is only valid as long as no top-level windows | |
10642 | are closed or new top-level windows are created. | |
10643 | ||
10644 | """ | |
10645 | return _core_.GetTopLevelWindows(*args) | |
10646 | #--------------------------------------------------------------------------- | |
10647 | ||
10648 | class Validator(EvtHandler): | |
10649 | """Proxy of C++ Validator class""" | |
10650 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
10651 | __repr__ = _swig_repr | |
10652 | def __init__(self, *args, **kwargs): | |
10653 | """__init__(self) -> Validator""" | |
10654 | _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs)) | |
10655 | self._setOORInfo(self) | |
10656 | ||
10657 | def Clone(*args, **kwargs): | |
10658 | """Clone(self) -> Validator""" | |
10659 | return _core_.Validator_Clone(*args, **kwargs) | |
10660 | ||
10661 | def Validate(*args, **kwargs): | |
10662 | """Validate(self, Window parent) -> bool""" | |
10663 | return _core_.Validator_Validate(*args, **kwargs) | |
10664 | ||
10665 | def TransferToWindow(*args, **kwargs): | |
10666 | """TransferToWindow(self) -> bool""" | |
10667 | return _core_.Validator_TransferToWindow(*args, **kwargs) | |
10668 | ||
10669 | def TransferFromWindow(*args, **kwargs): | |
10670 | """TransferFromWindow(self) -> bool""" | |
10671 | return _core_.Validator_TransferFromWindow(*args, **kwargs) | |
10672 | ||
10673 | def GetWindow(*args, **kwargs): | |
10674 | """GetWindow(self) -> Window""" | |
10675 | return _core_.Validator_GetWindow(*args, **kwargs) | |
10676 | ||
10677 | def SetWindow(*args, **kwargs): | |
10678 | """SetWindow(self, Window window)""" | |
10679 | return _core_.Validator_SetWindow(*args, **kwargs) | |
10680 | ||
10681 | def IsSilent(*args, **kwargs): | |
10682 | """IsSilent() -> bool""" | |
10683 | return _core_.Validator_IsSilent(*args, **kwargs) | |
10684 | ||
10685 | IsSilent = staticmethod(IsSilent) | |
10686 | def SetBellOnError(*args, **kwargs): | |
10687 | """SetBellOnError(int doIt=True)""" | |
10688 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
10689 | ||
10690 | SetBellOnError = staticmethod(SetBellOnError) | |
10691 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") | |
10692 | _core_.Validator_swigregister(Validator) | |
10693 | ||
10694 | def Validator_IsSilent(*args): | |
10695 | """Validator_IsSilent() -> bool""" | |
10696 | return _core_.Validator_IsSilent(*args) | |
10697 | ||
10698 | def Validator_SetBellOnError(*args, **kwargs): | |
10699 | """Validator_SetBellOnError(int doIt=True)""" | |
10700 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
10701 | ||
10702 | class PyValidator(Validator): | |
10703 | """Proxy of C++ PyValidator class""" | |
10704 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
10705 | __repr__ = _swig_repr | |
10706 | def __init__(self, *args, **kwargs): | |
10707 | """__init__(self) -> PyValidator""" | |
10708 | _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs)) | |
10709 | self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator) | |
10710 | ||
10711 | def _setCallbackInfo(*args, **kwargs): | |
10712 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)""" | |
10713 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) | |
10714 | ||
10715 | _core_.PyValidator_swigregister(PyValidator) | |
10716 | ||
10717 | #--------------------------------------------------------------------------- | |
10718 | ||
10719 | class Menu(EvtHandler): | |
10720 | """Proxy of C++ Menu class""" | |
10721 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
10722 | __repr__ = _swig_repr | |
10723 | def __init__(self, *args, **kwargs): | |
10724 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" | |
10725 | _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs)) | |
10726 | self._setOORInfo(self) | |
10727 | ||
10728 | def Append(*args, **kwargs): | |
10729 | """ | |
10730 | Append(self, int id, String text=EmptyString, String help=EmptyString, | |
10731 | int kind=ITEM_NORMAL) -> MenuItem | |
10732 | """ | |
10733 | return _core_.Menu_Append(*args, **kwargs) | |
10734 | ||
10735 | def AppendSeparator(*args, **kwargs): | |
10736 | """AppendSeparator(self) -> MenuItem""" | |
10737 | return _core_.Menu_AppendSeparator(*args, **kwargs) | |
10738 | ||
10739 | def AppendCheckItem(*args, **kwargs): | |
10740 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
10741 | return _core_.Menu_AppendCheckItem(*args, **kwargs) | |
10742 | ||
10743 | def AppendRadioItem(*args, **kwargs): | |
10744 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
10745 | return _core_.Menu_AppendRadioItem(*args, **kwargs) | |
10746 | ||
10747 | def AppendMenu(*args, **kwargs): | |
10748 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
10749 | return _core_.Menu_AppendMenu(*args, **kwargs) | |
10750 | ||
10751 | def AppendSubMenu(*args, **kwargs): | |
10752 | """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem""" | |
10753 | return _core_.Menu_AppendSubMenu(*args, **kwargs) | |
10754 | ||
10755 | def AppendItem(*args, **kwargs): | |
10756 | """AppendItem(self, MenuItem item) -> MenuItem""" | |
10757 | return _core_.Menu_AppendItem(*args, **kwargs) | |
10758 | ||
10759 | def InsertItem(*args, **kwargs): | |
10760 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" | |
10761 | return _core_.Menu_InsertItem(*args, **kwargs) | |
10762 | ||
10763 | def PrependItem(*args, **kwargs): | |
10764 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
10765 | return _core_.Menu_PrependItem(*args, **kwargs) | |
10766 | ||
10767 | def Break(*args, **kwargs): | |
10768 | """Break(self)""" | |
10769 | return _core_.Menu_Break(*args, **kwargs) | |
10770 | ||
10771 | def Insert(*args, **kwargs): | |
10772 | """ | |
10773 | Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString, | |
10774 | int kind=ITEM_NORMAL) -> MenuItem | |
10775 | """ | |
10776 | return _core_.Menu_Insert(*args, **kwargs) | |
10777 | ||
10778 | def InsertSeparator(*args, **kwargs): | |
10779 | """InsertSeparator(self, size_t pos) -> MenuItem""" | |
10780 | return _core_.Menu_InsertSeparator(*args, **kwargs) | |
10781 | ||
10782 | def InsertCheckItem(*args, **kwargs): | |
10783 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" | |
10784 | return _core_.Menu_InsertCheckItem(*args, **kwargs) | |
10785 | ||
10786 | def InsertRadioItem(*args, **kwargs): | |
10787 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" | |
10788 | return _core_.Menu_InsertRadioItem(*args, **kwargs) | |
10789 | ||
10790 | def InsertMenu(*args, **kwargs): | |
10791 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
10792 | return _core_.Menu_InsertMenu(*args, **kwargs) | |
10793 | ||
10794 | def Prepend(*args, **kwargs): | |
10795 | """ | |
10796 | Prepend(self, int id, String text=EmptyString, String help=EmptyString, | |
10797 | int kind=ITEM_NORMAL) -> MenuItem | |
10798 | """ | |
10799 | return _core_.Menu_Prepend(*args, **kwargs) | |
10800 | ||
10801 | def PrependSeparator(*args, **kwargs): | |
10802 | """PrependSeparator(self) -> MenuItem""" | |
10803 | return _core_.Menu_PrependSeparator(*args, **kwargs) | |
10804 | ||
10805 | def PrependCheckItem(*args, **kwargs): | |
10806 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
10807 | return _core_.Menu_PrependCheckItem(*args, **kwargs) | |
10808 | ||
10809 | def PrependRadioItem(*args, **kwargs): | |
10810 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" | |
10811 | return _core_.Menu_PrependRadioItem(*args, **kwargs) | |
10812 | ||
10813 | def PrependMenu(*args, **kwargs): | |
10814 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" | |
10815 | return _core_.Menu_PrependMenu(*args, **kwargs) | |
10816 | ||
10817 | def Remove(*args, **kwargs): | |
10818 | """Remove(self, int id) -> MenuItem""" | |
10819 | return _core_.Menu_Remove(*args, **kwargs) | |
10820 | ||
10821 | def RemoveItem(self, item): | |
10822 | """RemoveItem(self, MenuItem item) -> MenuItem""" | |
10823 | #// The return object is always the parameter, so return that | |
10824 | #// proxy instead of the new one | |
10825 | val = _core_.Menu_RemoveItem(self, item) | |
10826 | item.this.own(val.this.own()) | |
10827 | val.this.disown() | |
10828 | return item | |
10829 | ||
10830 | ||
10831 | def Delete(*args, **kwargs): | |
10832 | """Delete(self, int id) -> bool""" | |
10833 | return _core_.Menu_Delete(*args, **kwargs) | |
10834 | ||
10835 | def DeleteItem(*args, **kwargs): | |
10836 | """DeleteItem(self, MenuItem item) -> bool""" | |
10837 | return _core_.Menu_DeleteItem(*args, **kwargs) | |
10838 | ||
10839 | def Destroy(*args, **kwargs): | |
10840 | """ | |
10841 | Destroy(self) | |
10842 | ||
10843 | Deletes the C++ object this Python object is a proxy for. | |
10844 | """ | |
10845 | args[0].this.own(False) | |
10846 | return _core_.Menu_Destroy(*args, **kwargs) | |
10847 | ||
10848 | def DestroyId(*args, **kwargs): | |
10849 | """DestroyId(self, int id) -> bool""" | |
10850 | return _core_.Menu_DestroyId(*args, **kwargs) | |
10851 | ||
10852 | def DestroyItem(*args, **kwargs): | |
10853 | """DestroyItem(self, MenuItem item) -> bool""" | |
10854 | return _core_.Menu_DestroyItem(*args, **kwargs) | |
10855 | ||
10856 | def GetMenuItemCount(*args, **kwargs): | |
10857 | """GetMenuItemCount(self) -> size_t""" | |
10858 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) | |
10859 | ||
10860 | def GetMenuItems(*args, **kwargs): | |
10861 | """GetMenuItems(self) -> PyObject""" | |
10862 | return _core_.Menu_GetMenuItems(*args, **kwargs) | |
10863 | ||
10864 | def FindItem(*args, **kwargs): | |
10865 | """FindItem(self, String item) -> int""" | |
10866 | return _core_.Menu_FindItem(*args, **kwargs) | |
10867 | ||
10868 | def FindItemById(*args, **kwargs): | |
10869 | """FindItemById(self, int id) -> MenuItem""" | |
10870 | return _core_.Menu_FindItemById(*args, **kwargs) | |
10871 | ||
10872 | def FindItemByPosition(*args, **kwargs): | |
10873 | """FindItemByPosition(self, size_t position) -> MenuItem""" | |
10874 | return _core_.Menu_FindItemByPosition(*args, **kwargs) | |
10875 | ||
10876 | def Enable(*args, **kwargs): | |
10877 | """Enable(self, int id, bool enable)""" | |
10878 | return _core_.Menu_Enable(*args, **kwargs) | |
10879 | ||
10880 | def IsEnabled(*args, **kwargs): | |
10881 | """IsEnabled(self, int id) -> bool""" | |
10882 | return _core_.Menu_IsEnabled(*args, **kwargs) | |
10883 | ||
10884 | def Check(*args, **kwargs): | |
10885 | """Check(self, int id, bool check)""" | |
10886 | return _core_.Menu_Check(*args, **kwargs) | |
10887 | ||
10888 | def IsChecked(*args, **kwargs): | |
10889 | """IsChecked(self, int id) -> bool""" | |
10890 | return _core_.Menu_IsChecked(*args, **kwargs) | |
10891 | ||
10892 | def SetLabel(*args, **kwargs): | |
10893 | """SetLabel(self, int id, String label)""" | |
10894 | return _core_.Menu_SetLabel(*args, **kwargs) | |
10895 | ||
10896 | def GetLabel(*args, **kwargs): | |
10897 | """GetLabel(self, int id) -> String""" | |
10898 | return _core_.Menu_GetLabel(*args, **kwargs) | |
10899 | ||
10900 | def SetHelpString(*args, **kwargs): | |
10901 | """SetHelpString(self, int id, String helpString)""" | |
10902 | return _core_.Menu_SetHelpString(*args, **kwargs) | |
10903 | ||
10904 | def GetHelpString(*args, **kwargs): | |
10905 | """GetHelpString(self, int id) -> String""" | |
10906 | return _core_.Menu_GetHelpString(*args, **kwargs) | |
10907 | ||
10908 | def SetTitle(*args, **kwargs): | |
10909 | """SetTitle(self, String title)""" | |
10910 | return _core_.Menu_SetTitle(*args, **kwargs) | |
10911 | ||
10912 | def GetTitle(*args, **kwargs): | |
10913 | """GetTitle(self) -> String""" | |
10914 | return _core_.Menu_GetTitle(*args, **kwargs) | |
10915 | ||
10916 | def SetEventHandler(*args, **kwargs): | |
10917 | """SetEventHandler(self, EvtHandler handler)""" | |
10918 | return _core_.Menu_SetEventHandler(*args, **kwargs) | |
10919 | ||
10920 | def GetEventHandler(*args, **kwargs): | |
10921 | """GetEventHandler(self) -> EvtHandler""" | |
10922 | return _core_.Menu_GetEventHandler(*args, **kwargs) | |
10923 | ||
10924 | def SetInvokingWindow(*args, **kwargs): | |
10925 | """SetInvokingWindow(self, Window win)""" | |
10926 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) | |
10927 | ||
10928 | def GetInvokingWindow(*args, **kwargs): | |
10929 | """GetInvokingWindow(self) -> Window""" | |
10930 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) | |
10931 | ||
10932 | def GetStyle(*args, **kwargs): | |
10933 | """GetStyle(self) -> long""" | |
10934 | return _core_.Menu_GetStyle(*args, **kwargs) | |
10935 | ||
10936 | def UpdateUI(*args, **kwargs): | |
10937 | """UpdateUI(self, EvtHandler source=None)""" | |
10938 | return _core_.Menu_UpdateUI(*args, **kwargs) | |
10939 | ||
10940 | def GetMenuBar(*args, **kwargs): | |
10941 | """GetMenuBar(self) -> MenuBar""" | |
10942 | return _core_.Menu_GetMenuBar(*args, **kwargs) | |
10943 | ||
10944 | def Attach(*args, **kwargs): | |
10945 | """Attach(self, wxMenuBarBase menubar)""" | |
10946 | return _core_.Menu_Attach(*args, **kwargs) | |
10947 | ||
10948 | def Detach(*args, **kwargs): | |
10949 | """Detach(self)""" | |
10950 | return _core_.Menu_Detach(*args, **kwargs) | |
10951 | ||
10952 | def IsAttached(*args, **kwargs): | |
10953 | """IsAttached(self) -> bool""" | |
10954 | return _core_.Menu_IsAttached(*args, **kwargs) | |
10955 | ||
10956 | def SetParent(*args, **kwargs): | |
10957 | """SetParent(self, Menu parent)""" | |
10958 | return _core_.Menu_SetParent(*args, **kwargs) | |
10959 | ||
10960 | def GetParent(*args, **kwargs): | |
10961 | """GetParent(self) -> Menu""" | |
10962 | return _core_.Menu_GetParent(*args, **kwargs) | |
10963 | ||
10964 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") | |
10965 | HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`") | |
10966 | InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`") | |
10967 | MenuBar = property(GetMenuBar,doc="See `GetMenuBar`") | |
10968 | MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`") | |
10969 | MenuItems = property(GetMenuItems,doc="See `GetMenuItems`") | |
10970 | Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`") | |
10971 | Style = property(GetStyle,doc="See `GetStyle`") | |
10972 | Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`") | |
10973 | _core_.Menu_swigregister(Menu) | |
10974 | DefaultValidator = cvar.DefaultValidator | |
10975 | ||
10976 | #--------------------------------------------------------------------------- | |
10977 | ||
10978 | class MenuBar(Window): | |
10979 | """Proxy of C++ MenuBar class""" | |
10980 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
10981 | __repr__ = _swig_repr | |
10982 | def __init__(self, *args, **kwargs): | |
10983 | """__init__(self, long style=0) -> MenuBar""" | |
10984 | _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs)) | |
10985 | self._setOORInfo(self) | |
10986 | ||
10987 | def Append(*args, **kwargs): | |
10988 | """Append(self, Menu menu, String title) -> bool""" | |
10989 | return _core_.MenuBar_Append(*args, **kwargs) | |
10990 | ||
10991 | def Insert(*args, **kwargs): | |
10992 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" | |
10993 | return _core_.MenuBar_Insert(*args, **kwargs) | |
10994 | ||
10995 | def GetMenuCount(*args, **kwargs): | |
10996 | """GetMenuCount(self) -> size_t""" | |
10997 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) | |
10998 | ||
10999 | def GetMenu(*args, **kwargs): | |
11000 | """GetMenu(self, size_t pos) -> Menu""" | |
11001 | return _core_.MenuBar_GetMenu(*args, **kwargs) | |
11002 | ||
11003 | def Replace(*args, **kwargs): | |
11004 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" | |
11005 | return _core_.MenuBar_Replace(*args, **kwargs) | |
11006 | ||
11007 | def Remove(*args, **kwargs): | |
11008 | """Remove(self, size_t pos) -> Menu""" | |
11009 | return _core_.MenuBar_Remove(*args, **kwargs) | |
11010 | ||
11011 | def EnableTop(*args, **kwargs): | |
11012 | """EnableTop(self, size_t pos, bool enable)""" | |
11013 | return _core_.MenuBar_EnableTop(*args, **kwargs) | |
11014 | ||
11015 | def IsEnabledTop(*args, **kwargs): | |
11016 | """IsEnabledTop(self, size_t pos) -> bool""" | |
11017 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) | |
11018 | ||
11019 | def SetLabelTop(*args, **kwargs): | |
11020 | """SetLabelTop(self, size_t pos, String label)""" | |
11021 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) | |
11022 | ||
11023 | def GetLabelTop(*args, **kwargs): | |
11024 | """GetLabelTop(self, size_t pos) -> String""" | |
11025 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) | |
11026 | ||
11027 | def FindMenuItem(*args, **kwargs): | |
11028 | """FindMenuItem(self, String menu, String item) -> int""" | |
11029 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) | |
11030 | ||
11031 | def FindItemById(*args, **kwargs): | |
11032 | """FindItemById(self, int id) -> MenuItem""" | |
11033 | return _core_.MenuBar_FindItemById(*args, **kwargs) | |
11034 | ||
11035 | def FindMenu(*args, **kwargs): | |
11036 | """FindMenu(self, String title) -> int""" | |
11037 | return _core_.MenuBar_FindMenu(*args, **kwargs) | |
11038 | ||
11039 | def Enable(*args, **kwargs): | |
11040 | """Enable(self, int id, bool enable)""" | |
11041 | return _core_.MenuBar_Enable(*args, **kwargs) | |
11042 | ||
11043 | def Check(*args, **kwargs): | |
11044 | """Check(self, int id, bool check)""" | |
11045 | return _core_.MenuBar_Check(*args, **kwargs) | |
11046 | ||
11047 | def IsChecked(*args, **kwargs): | |
11048 | """IsChecked(self, int id) -> bool""" | |
11049 | return _core_.MenuBar_IsChecked(*args, **kwargs) | |
11050 | ||
11051 | def IsEnabled(*args, **kwargs): | |
11052 | """IsEnabled(self, int id) -> bool""" | |
11053 | return _core_.MenuBar_IsEnabled(*args, **kwargs) | |
11054 | ||
11055 | def SetLabel(*args, **kwargs): | |
11056 | """SetLabel(self, int id, String label)""" | |
11057 | return _core_.MenuBar_SetLabel(*args, **kwargs) | |
11058 | ||
11059 | def GetLabel(*args, **kwargs): | |
11060 | """GetLabel(self, int id) -> String""" | |
11061 | return _core_.MenuBar_GetLabel(*args, **kwargs) | |
11062 | ||
11063 | def SetHelpString(*args, **kwargs): | |
11064 | """SetHelpString(self, int id, String helpString)""" | |
11065 | return _core_.MenuBar_SetHelpString(*args, **kwargs) | |
11066 | ||
11067 | def GetHelpString(*args, **kwargs): | |
11068 | """GetHelpString(self, int id) -> String""" | |
11069 | return _core_.MenuBar_GetHelpString(*args, **kwargs) | |
11070 | ||
11071 | def GetFrame(*args, **kwargs): | |
11072 | """GetFrame(self) -> wxFrame""" | |
11073 | return _core_.MenuBar_GetFrame(*args, **kwargs) | |
11074 | ||
11075 | def IsAttached(*args, **kwargs): | |
11076 | """IsAttached(self) -> bool""" | |
11077 | return _core_.MenuBar_IsAttached(*args, **kwargs) | |
11078 | ||
11079 | def Attach(*args, **kwargs): | |
11080 | """Attach(self, wxFrame frame)""" | |
11081 | return _core_.MenuBar_Attach(*args, **kwargs) | |
11082 | ||
11083 | def Detach(*args, **kwargs): | |
11084 | """Detach(self)""" | |
11085 | return _core_.MenuBar_Detach(*args, **kwargs) | |
11086 | ||
11087 | def UpdateMenus(*args, **kwargs): | |
11088 | """UpdateMenus(self)""" | |
11089 | return _core_.MenuBar_UpdateMenus(*args, **kwargs) | |
11090 | ||
11091 | def SetAutoWindowMenu(*args, **kwargs): | |
11092 | """SetAutoWindowMenu(bool enable)""" | |
11093 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
11094 | ||
11095 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
11096 | def GetAutoWindowMenu(*args, **kwargs): | |
11097 | """GetAutoWindowMenu() -> bool""" | |
11098 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
11099 | ||
11100 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
11101 | def GetMenus(self): | |
11102 | """Return a list of (menu, label) items for the menus in the MenuBar. """ | |
11103 | return [(self.GetMenu(i), self.GetLabelTop(i)) | |
11104 | for i in range(self.GetMenuCount())] | |
11105 | ||
11106 | def SetMenus(self, items): | |
11107 | """Clear and add new menus to the MenuBar from a list of (menu, label) items. """ | |
11108 | for i in range(self.GetMenuCount()-1, -1, -1): | |
11109 | self.Remove(i) | |
11110 | for m, l in items: | |
11111 | self.Append(m, l) | |
11112 | ||
11113 | Frame = property(GetFrame,doc="See `GetFrame`") | |
11114 | MenuCount = property(GetMenuCount,doc="See `GetMenuCount`") | |
11115 | Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`") | |
11116 | _core_.MenuBar_swigregister(MenuBar) | |
11117 | ||
11118 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): | |
11119 | """MenuBar_SetAutoWindowMenu(bool enable)""" | |
11120 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
11121 | ||
11122 | def MenuBar_GetAutoWindowMenu(*args): | |
11123 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
11124 | return _core_.MenuBar_GetAutoWindowMenu(*args) | |
11125 | ||
11126 | #--------------------------------------------------------------------------- | |
11127 | ||
11128 | class MenuItem(Object): | |
11129 | """Proxy of C++ MenuItem class""" | |
11130 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
11131 | __repr__ = _swig_repr | |
11132 | def __init__(self, *args, **kwargs): | |
11133 | """ | |
11134 | __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString, | |
11135 | String help=EmptyString, int kind=ITEM_NORMAL, | |
11136 | Menu subMenu=None) -> MenuItem | |
11137 | """ | |
11138 | _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs)) | |
11139 | __swig_destroy__ = _core_.delete_MenuItem | |
11140 | __del__ = lambda self : None; | |
11141 | def Destroy(self): pass | |
11142 | def GetMenu(*args, **kwargs): | |
11143 | """GetMenu(self) -> Menu""" | |
11144 | return _core_.MenuItem_GetMenu(*args, **kwargs) | |
11145 | ||
11146 | def SetMenu(*args, **kwargs): | |
11147 | """SetMenu(self, Menu menu)""" | |
11148 | return _core_.MenuItem_SetMenu(*args, **kwargs) | |
11149 | ||
11150 | def SetId(*args, **kwargs): | |
11151 | """SetId(self, int id)""" | |
11152 | return _core_.MenuItem_SetId(*args, **kwargs) | |
11153 | ||
11154 | def GetId(*args, **kwargs): | |
11155 | """GetId(self) -> int""" | |
11156 | return _core_.MenuItem_GetId(*args, **kwargs) | |
11157 | ||
11158 | def IsSeparator(*args, **kwargs): | |
11159 | """IsSeparator(self) -> bool""" | |
11160 | return _core_.MenuItem_IsSeparator(*args, **kwargs) | |
11161 | ||
11162 | def SetText(*args, **kwargs): | |
11163 | """SetText(self, String str)""" | |
11164 | return _core_.MenuItem_SetText(*args, **kwargs) | |
11165 | ||
11166 | def GetLabel(*args, **kwargs): | |
11167 | """GetLabel(self) -> String""" | |
11168 | return _core_.MenuItem_GetLabel(*args, **kwargs) | |
11169 | ||
11170 | def GetText(*args, **kwargs): | |
11171 | """GetText(self) -> String""" | |
11172 | return _core_.MenuItem_GetText(*args, **kwargs) | |
11173 | ||
11174 | def GetLabelFromText(*args, **kwargs): | |
11175 | """GetLabelFromText(String text) -> String""" | |
11176 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
11177 | ||
11178 | GetLabelFromText = staticmethod(GetLabelFromText) | |
11179 | def GetKind(*args, **kwargs): | |
11180 | """GetKind(self) -> int""" | |
11181 | return _core_.MenuItem_GetKind(*args, **kwargs) | |
11182 | ||
11183 | def SetKind(*args, **kwargs): | |
11184 | """SetKind(self, int kind)""" | |
11185 | return _core_.MenuItem_SetKind(*args, **kwargs) | |
11186 | ||
11187 | def SetCheckable(*args, **kwargs): | |
11188 | """SetCheckable(self, bool checkable)""" | |
11189 | return _core_.MenuItem_SetCheckable(*args, **kwargs) | |
11190 | ||
11191 | def IsCheckable(*args, **kwargs): | |
11192 | """IsCheckable(self) -> bool""" | |
11193 | return _core_.MenuItem_IsCheckable(*args, **kwargs) | |
11194 | ||
11195 | def IsSubMenu(*args, **kwargs): | |
11196 | """IsSubMenu(self) -> bool""" | |
11197 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) | |
11198 | ||
11199 | def SetSubMenu(*args, **kwargs): | |
11200 | """SetSubMenu(self, Menu menu)""" | |
11201 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) | |
11202 | ||
11203 | def GetSubMenu(*args, **kwargs): | |
11204 | """GetSubMenu(self) -> Menu""" | |
11205 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) | |
11206 | ||
11207 | def Enable(*args, **kwargs): | |
11208 | """Enable(self, bool enable=True)""" | |
11209 | return _core_.MenuItem_Enable(*args, **kwargs) | |
11210 | ||
11211 | def IsEnabled(*args, **kwargs): | |
11212 | """IsEnabled(self) -> bool""" | |
11213 | return _core_.MenuItem_IsEnabled(*args, **kwargs) | |
11214 | ||
11215 | def Check(*args, **kwargs): | |
11216 | """Check(self, bool check=True)""" | |
11217 | return _core_.MenuItem_Check(*args, **kwargs) | |
11218 | ||
11219 | def IsChecked(*args, **kwargs): | |
11220 | """IsChecked(self) -> bool""" | |
11221 | return _core_.MenuItem_IsChecked(*args, **kwargs) | |
11222 | ||
11223 | def Toggle(*args, **kwargs): | |
11224 | """Toggle(self)""" | |
11225 | return _core_.MenuItem_Toggle(*args, **kwargs) | |
11226 | ||
11227 | def SetHelp(*args, **kwargs): | |
11228 | """SetHelp(self, String str)""" | |
11229 | return _core_.MenuItem_SetHelp(*args, **kwargs) | |
11230 | ||
11231 | def GetHelp(*args, **kwargs): | |
11232 | """GetHelp(self) -> String""" | |
11233 | return _core_.MenuItem_GetHelp(*args, **kwargs) | |
11234 | ||
11235 | def GetAccel(*args, **kwargs): | |
11236 | """GetAccel(self) -> AcceleratorEntry""" | |
11237 | return _core_.MenuItem_GetAccel(*args, **kwargs) | |
11238 | ||
11239 | def SetAccel(*args, **kwargs): | |
11240 | """SetAccel(self, AcceleratorEntry accel)""" | |
11241 | return _core_.MenuItem_SetAccel(*args, **kwargs) | |
11242 | ||
11243 | def SetBitmap(*args, **kwargs): | |
11244 | """SetBitmap(self, Bitmap bitmap)""" | |
11245 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
11246 | ||
11247 | def GetBitmap(*args, **kwargs): | |
11248 | """GetBitmap(self) -> Bitmap""" | |
11249 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
11250 | ||
11251 | def SetFont(*args, **kwargs): | |
11252 | """SetFont(self, Font font)""" | |
11253 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
11254 | ||
11255 | def GetFont(*args, **kwargs): | |
11256 | """GetFont(self) -> Font""" | |
11257 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
11258 | ||
11259 | def SetTextColour(*args, **kwargs): | |
11260 | """SetTextColour(self, Colour colText)""" | |
11261 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
11262 | ||
11263 | def GetTextColour(*args, **kwargs): | |
11264 | """GetTextColour(self) -> Colour""" | |
11265 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
11266 | ||
11267 | def SetBackgroundColour(*args, **kwargs): | |
11268 | """SetBackgroundColour(self, Colour colBack)""" | |
11269 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
11270 | ||
11271 | def GetBackgroundColour(*args, **kwargs): | |
11272 | """GetBackgroundColour(self) -> Colour""" | |
11273 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
11274 | ||
11275 | def SetBitmaps(*args, **kwargs): | |
11276 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
11277 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
11278 | ||
11279 | def SetDisabledBitmap(*args, **kwargs): | |
11280 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
11281 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
11282 | ||
11283 | def GetDisabledBitmap(*args, **kwargs): | |
11284 | """GetDisabledBitmap(self) -> Bitmap""" | |
11285 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
11286 | ||
11287 | def SetMarginWidth(*args, **kwargs): | |
11288 | """SetMarginWidth(self, int nWidth)""" | |
11289 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
11290 | ||
11291 | def GetMarginWidth(*args, **kwargs): | |
11292 | """GetMarginWidth(self) -> int""" | |
11293 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
11294 | ||
11295 | def GetDefaultMarginWidth(*args, **kwargs): | |
11296 | """GetDefaultMarginWidth() -> int""" | |
11297 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) | |
11298 | ||
11299 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
11300 | def IsOwnerDrawn(*args, **kwargs): | |
11301 | """IsOwnerDrawn(self) -> bool""" | |
11302 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
11303 | ||
11304 | def SetOwnerDrawn(*args, **kwargs): | |
11305 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
11306 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
11307 | ||
11308 | def ResetOwnerDrawn(*args, **kwargs): | |
11309 | """ResetOwnerDrawn(self)""" | |
11310 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
11311 | ||
11312 | Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`") | |
11313 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
11314 | Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`") | |
11315 | DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`") | |
11316 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
11317 | Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`") | |
11318 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
11319 | Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`") | |
11320 | Label = property(GetLabel,doc="See `GetLabel`") | |
11321 | MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`") | |
11322 | Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`") | |
11323 | SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`") | |
11324 | Text = property(GetText,SetText,doc="See `GetText` and `SetText`") | |
11325 | TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`") | |
11326 | _core_.MenuItem_swigregister(MenuItem) | |
11327 | ||
11328 | def MenuItem_GetLabelFromText(*args, **kwargs): | |
11329 | """MenuItem_GetLabelFromText(String text) -> String""" | |
11330 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
11331 | ||
11332 | def MenuItem_GetDefaultMarginWidth(*args): | |
11333 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
11334 | return _core_.MenuItem_GetDefaultMarginWidth(*args) | |
11335 | ||
11336 | #--------------------------------------------------------------------------- | |
11337 | ||
11338 | class Control(Window): | |
11339 | """ | |
11340 | This is the base class for a control or 'widget'. | |
11341 | ||
11342 | A control is generally a small window which processes user input | |
11343 | and/or displays one or more item of data. | |
11344 | """ | |
11345 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
11346 | __repr__ = _swig_repr | |
11347 | def __init__(self, *args, **kwargs): | |
11348 | """ | |
11349 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, | |
11350 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
11351 | String name=ControlNameStr) -> Control | |
11352 | ||
11353 | Create a Control. Normally you should only call this from a subclass' | |
11354 | __init__ as a plain old wx.Control is not very useful. | |
11355 | """ | |
11356 | _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs)) | |
11357 | self._setOORInfo(self) | |
11358 | ||
11359 | def Create(*args, **kwargs): | |
11360 | """ | |
11361 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, | |
11362 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
11363 | String name=ControlNameStr) -> bool | |
11364 | ||
11365 | Do the 2nd phase and create the GUI control. | |
11366 | """ | |
11367 | return _core_.Control_Create(*args, **kwargs) | |
11368 | ||
11369 | def GetAlignment(*args, **kwargs): | |
11370 | """ | |
11371 | GetAlignment(self) -> int | |
11372 | ||
11373 | Get the control alignment (left/right/centre, top/bottom/centre) | |
11374 | """ | |
11375 | return _core_.Control_GetAlignment(*args, **kwargs) | |
11376 | ||
11377 | def GetLabelText(*args, **kwargs): | |
11378 | """ | |
11379 | GetLabelText(self) -> String | |
11380 | ||
11381 | Get just the text of the label, without mnemonic characters ('&') | |
11382 | """ | |
11383 | return _core_.Control_GetLabelText(*args, **kwargs) | |
11384 | ||
11385 | def Command(*args, **kwargs): | |
11386 | """ | |
11387 | Command(self, CommandEvent event) | |
11388 | ||
11389 | Simulates the effect of the user issuing a command to the item. | |
11390 | ||
11391 | :see: `wx.CommandEvent` | |
11392 | ||
11393 | """ | |
11394 | return _core_.Control_Command(*args, **kwargs) | |
11395 | ||
11396 | def GetClassDefaultAttributes(*args, **kwargs): | |
11397 | """ | |
11398 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
11399 | ||
11400 | Get the default attributes for this class. This is useful if you want | |
11401 | to use the same font or colour in your own control as in a standard | |
11402 | control -- which is a much better idea than hard coding specific | |
11403 | colours or fonts which might look completely out of place on the | |
11404 | user's system, especially if it uses themes. | |
11405 | ||
11406 | The variant parameter is only relevant under Mac currently and is | |
11407 | ignore under other platforms. Under Mac, it will change the size of | |
11408 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11409 | this. | |
11410 | """ | |
11411 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) | |
11412 | ||
11413 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
11414 | Alignment = property(GetAlignment,doc="See `GetAlignment`") | |
11415 | LabelText = property(GetLabelText,doc="See `GetLabelText`") | |
11416 | _core_.Control_swigregister(Control) | |
11417 | ControlNameStr = cvar.ControlNameStr | |
11418 | ||
11419 | def PreControl(*args, **kwargs): | |
11420 | """ | |
11421 | PreControl() -> Control | |
11422 | ||
11423 | Precreate a Control control for 2-phase creation | |
11424 | """ | |
11425 | val = _core_.new_PreControl(*args, **kwargs) | |
11426 | return val | |
11427 | ||
11428 | def Control_GetClassDefaultAttributes(*args, **kwargs): | |
11429 | """ | |
11430 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
11431 | ||
11432 | Get the default attributes for this class. This is useful if you want | |
11433 | to use the same font or colour in your own control as in a standard | |
11434 | control -- which is a much better idea than hard coding specific | |
11435 | colours or fonts which might look completely out of place on the | |
11436 | user's system, especially if it uses themes. | |
11437 | ||
11438 | The variant parameter is only relevant under Mac currently and is | |
11439 | ignore under other platforms. Under Mac, it will change the size of | |
11440 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11441 | this. | |
11442 | """ | |
11443 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) | |
11444 | ||
11445 | #--------------------------------------------------------------------------- | |
11446 | ||
11447 | class ItemContainer(object): | |
11448 | """ | |
11449 | The wx.ItemContainer class defines an interface which is implemented | |
11450 | by all controls which have string subitems, each of which may be | |
11451 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
11452 | as `wx.ComboBox` which implements an extended interface deriving from | |
11453 | this one. | |
11454 | ||
11455 | It defines the methods for accessing the control's items and although | |
11456 | each of the derived classes implements them differently, they still | |
11457 | all conform to the same interface. | |
11458 | ||
11459 | The items in a wx.ItemContainer have (non empty) string labels and, | |
11460 | optionally, client data associated with them. | |
11461 | ||
11462 | """ | |
11463 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
11464 | def __init__(self): raise AttributeError, "No constructor defined" | |
11465 | __repr__ = _swig_repr | |
11466 | def Append(*args, **kwargs): | |
11467 | """ | |
11468 | Append(self, String item, PyObject clientData=None) -> int | |
11469 | ||
11470 | Adds the item to the control, associating the given data with the item | |
11471 | if not None. The return value is the index of the newly added item | |
11472 | which may be different from the last one if the control is sorted (e.g. | |
11473 | has wx.LB_SORT or wx.CB_SORT style). | |
11474 | """ | |
11475 | return _core_.ItemContainer_Append(*args, **kwargs) | |
11476 | ||
11477 | def AppendItems(*args, **kwargs): | |
11478 | """ | |
11479 | AppendItems(self, List strings) | |
11480 | ||
11481 | Apend several items at once to the control. Notice that calling this | |
11482 | method may be much faster than appending the items one by one if you | |
11483 | need to add a lot of items. | |
11484 | """ | |
11485 | return _core_.ItemContainer_AppendItems(*args, **kwargs) | |
11486 | ||
11487 | def Insert(*args, **kwargs): | |
11488 | """ | |
11489 | Insert(self, String item, int pos, PyObject clientData=None) -> int | |
11490 | ||
11491 | Insert an item into the control before the item at the ``pos`` index, | |
11492 | optionally associating some data object with the item. | |
11493 | """ | |
11494 | return _core_.ItemContainer_Insert(*args, **kwargs) | |
11495 | ||
11496 | def Clear(*args, **kwargs): | |
11497 | """ | |
11498 | Clear(self) | |
11499 | ||
11500 | Removes all items from the control. | |
11501 | """ | |
11502 | return _core_.ItemContainer_Clear(*args, **kwargs) | |
11503 | ||
11504 | def Delete(*args, **kwargs): | |
11505 | """ | |
11506 | Delete(self, int n) | |
11507 | ||
11508 | Deletes the item at the zero-based index 'n' from the control. Note | |
11509 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
11510 | enabled) to remove an item with the index negative or greater or equal | |
11511 | than the number of items in the control. | |
11512 | """ | |
11513 | return _core_.ItemContainer_Delete(*args, **kwargs) | |
11514 | ||
11515 | def GetClientData(*args, **kwargs): | |
11516 | """ | |
11517 | GetClientData(self, int n) -> PyObject | |
11518 | ||
11519 | Returns the client data associated with the given item, (if any.) | |
11520 | """ | |
11521 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
11522 | ||
11523 | def SetClientData(*args, **kwargs): | |
11524 | """ | |
11525 | SetClientData(self, int n, PyObject clientData) | |
11526 | ||
11527 | Associate the given client data with the item at position n. | |
11528 | """ | |
11529 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
11530 | ||
11531 | def GetCount(*args, **kwargs): | |
11532 | """ | |
11533 | GetCount(self) -> int | |
11534 | ||
11535 | Returns the number of items in the control. | |
11536 | """ | |
11537 | return _core_.ItemContainer_GetCount(*args, **kwargs) | |
11538 | ||
11539 | def IsEmpty(*args, **kwargs): | |
11540 | """ | |
11541 | IsEmpty(self) -> bool | |
11542 | ||
11543 | Returns True if the control is empty or False if it has some items. | |
11544 | """ | |
11545 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) | |
11546 | ||
11547 | def GetString(*args, **kwargs): | |
11548 | """ | |
11549 | GetString(self, int n) -> String | |
11550 | ||
11551 | Returns the label of the item with the given index. | |
11552 | """ | |
11553 | return _core_.ItemContainer_GetString(*args, **kwargs) | |
11554 | ||
11555 | def GetStrings(*args, **kwargs): | |
11556 | """GetStrings(self) -> wxArrayString""" | |
11557 | return _core_.ItemContainer_GetStrings(*args, **kwargs) | |
11558 | ||
11559 | def SetString(*args, **kwargs): | |
11560 | """ | |
11561 | SetString(self, int n, String s) | |
11562 | ||
11563 | Sets the label for the given item. | |
11564 | """ | |
11565 | return _core_.ItemContainer_SetString(*args, **kwargs) | |
11566 | ||
11567 | def FindString(*args, **kwargs): | |
11568 | """ | |
11569 | FindString(self, String s) -> int | |
11570 | ||
11571 | Finds an item whose label matches the given string. Returns the | |
11572 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not | |
11573 | found. | |
11574 | """ | |
11575 | return _core_.ItemContainer_FindString(*args, **kwargs) | |
11576 | ||
11577 | def SetSelection(*args, **kwargs): | |
11578 | """ | |
11579 | SetSelection(self, int n) | |
11580 | ||
11581 | Sets the item at index 'n' to be the selected item. | |
11582 | """ | |
11583 | return _core_.ItemContainer_SetSelection(*args, **kwargs) | |
11584 | ||
11585 | def GetSelection(*args, **kwargs): | |
11586 | """ | |
11587 | GetSelection(self) -> int | |
11588 | ||
11589 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item | |
11590 | is selected. | |
11591 | """ | |
11592 | return _core_.ItemContainer_GetSelection(*args, **kwargs) | |
11593 | ||
11594 | def SetStringSelection(*args, **kwargs): | |
11595 | """SetStringSelection(self, String s) -> bool""" | |
11596 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
11597 | ||
11598 | def GetStringSelection(*args, **kwargs): | |
11599 | """ | |
11600 | GetStringSelection(self) -> String | |
11601 | ||
11602 | Returns the label of the selected item or an empty string if no item | |
11603 | is selected. | |
11604 | """ | |
11605 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) | |
11606 | ||
11607 | def Select(*args, **kwargs): | |
11608 | """ | |
11609 | Select(self, int n) | |
11610 | ||
11611 | This is the same as `SetSelection` and exists only because it is | |
11612 | slightly more natural for controls which support multiple selection. | |
11613 | """ | |
11614 | return _core_.ItemContainer_Select(*args, **kwargs) | |
11615 | ||
11616 | def GetItems(self): | |
11617 | """Return a list of the strings in the control""" | |
11618 | return [self.GetString(i) for i in xrange(self.GetCount())] | |
11619 | ||
11620 | def SetItems(self, items): | |
11621 | """Clear and set the strings in the control from a list""" | |
11622 | self.Clear() | |
11623 | for i in items: | |
11624 | self.Append(i) | |
11625 | ||
11626 | Count = property(GetCount,doc="See `GetCount`") | |
11627 | Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`") | |
11628 | Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`") | |
11629 | StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`") | |
11630 | Strings = property(GetStrings,doc="See `GetStrings`") | |
11631 | _core_.ItemContainer_swigregister(ItemContainer) | |
11632 | ||
11633 | #--------------------------------------------------------------------------- | |
11634 | ||
11635 | class ControlWithItems(Control,ItemContainer): | |
11636 | """ | |
11637 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the | |
11638 | wx.Control class, and is used for the base class of various controls | |
11639 | that have items. | |
11640 | """ | |
11641 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
11642 | def __init__(self): raise AttributeError, "No constructor defined" | |
11643 | __repr__ = _swig_repr | |
11644 | _core_.ControlWithItems_swigregister(ControlWithItems) | |
11645 | ||
11646 | #--------------------------------------------------------------------------- | |
11647 | ||
11648 | class SizerFlags(object): | |
11649 | """ | |
11650 | Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have | |
11651 | to specify a lot of flags and parameters which can be unwieldy. This | |
11652 | is where wx.SizerFlags comes in: it allows you to specify all | |
11653 | parameters using the named methods instead. For example, instead of:: | |
11654 | ||
11655 | sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10) | |
11656 | ||
11657 | you can now write:: | |
11658 | ||
11659 | sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10)) | |
11660 | ||
11661 | This is more readable and also allows you to create wx.SizerFlags | |
11662 | objects which can be reused for several sizer items.:: | |
11663 | ||
11664 | flagsExpand = wx.SizerFlags(1) | |
11665 | flagsExpand.Expand().Border(wx.ALL, 10) | |
11666 | sizer.AddF(ctrl1, flagsExpand) | |
11667 | sizer.AddF(ctrl2, flagsExpand) | |
11668 | ||
11669 | Note that by specification, all methods of wx.SizerFlags return the | |
11670 | wx.SizerFlags object itself allowing chaining multiple method calls | |
11671 | like in the examples above. | |
11672 | """ | |
11673 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
11674 | __repr__ = _swig_repr | |
11675 | def __init__(self, *args, **kwargs): | |
11676 | """ | |
11677 | __init__(self, int proportion=0) -> SizerFlags | |
11678 | ||
11679 | Constructs the flags object with the specified proportion. | |
11680 | """ | |
11681 | _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs)) | |
11682 | __swig_destroy__ = _core_.delete_SizerFlags | |
11683 | __del__ = lambda self : None; | |
11684 | def Proportion(*args, **kwargs): | |
11685 | """ | |
11686 | Proportion(self, int proportion) -> SizerFlags | |
11687 | ||
11688 | Sets the item's proportion value. | |
11689 | """ | |
11690 | return _core_.SizerFlags_Proportion(*args, **kwargs) | |
11691 | ||
11692 | def Align(*args, **kwargs): | |
11693 | """ | |
11694 | Align(self, int alignment) -> SizerFlags | |
11695 | ||
11696 | Sets the item's alignment | |
11697 | """ | |
11698 | return _core_.SizerFlags_Align(*args, **kwargs) | |
11699 | ||
11700 | def Expand(*args, **kwargs): | |
11701 | """ | |
11702 | Expand(self) -> SizerFlags | |
11703 | ||
11704 | Sets the wx.EXPAND flag, which will cause the item to be expanded to | |
11705 | fill as much space as it is given by the sizer. | |
11706 | """ | |
11707 | return _core_.SizerFlags_Expand(*args, **kwargs) | |
11708 | ||
11709 | def Centre(*args, **kwargs): | |
11710 | """ | |
11711 | Centre(self) -> SizerFlags | |
11712 | ||
11713 | Same as `Center` for those with an alternate dialect of English. | |
11714 | """ | |
11715 | return _core_.SizerFlags_Centre(*args, **kwargs) | |
11716 | ||
11717 | def Center(*args, **kwargs): | |
11718 | """ | |
11719 | Center(self) -> SizerFlags | |
11720 | ||
11721 | Sets the centering alignment flags. | |
11722 | """ | |
11723 | return _core_.SizerFlags_Center(*args, **kwargs) | |
11724 | ||
11725 | def Left(*args, **kwargs): | |
11726 | """ | |
11727 | Left(self) -> SizerFlags | |
11728 | ||
11729 | Aligns the object to the left, a shortcut for calling | |
11730 | Align(wx.ALIGN_LEFT) | |
11731 | """ | |
11732 | return _core_.SizerFlags_Left(*args, **kwargs) | |
11733 | ||
11734 | def Right(*args, **kwargs): | |
11735 | """ | |
11736 | Right(self) -> SizerFlags | |
11737 | ||
11738 | Aligns the object to the right, a shortcut for calling | |
11739 | Align(wx.ALIGN_RIGHT) | |
11740 | """ | |
11741 | return _core_.SizerFlags_Right(*args, **kwargs) | |
11742 | ||
11743 | def Top(*args, **kwargs): | |
11744 | """ | |
11745 | Top(self) -> SizerFlags | |
11746 | ||
11747 | Aligns the object to the top of the available space, a shortcut for | |
11748 | calling Align(wx.ALIGN_TOP) | |
11749 | """ | |
11750 | return _core_.SizerFlags_Top(*args, **kwargs) | |
11751 | ||
11752 | def Bottom(*args, **kwargs): | |
11753 | """ | |
11754 | Bottom(self) -> SizerFlags | |
11755 | ||
11756 | Aligns the object to the bottom of the available space, a shortcut for | |
11757 | calling Align(wx.ALIGN_BOTTOM) | |
11758 | """ | |
11759 | return _core_.SizerFlags_Bottom(*args, **kwargs) | |
11760 | ||
11761 | def Shaped(*args, **kwargs): | |
11762 | """ | |
11763 | Shaped(self) -> SizerFlags | |
11764 | ||
11765 | Sets the wx.SHAPED flag. | |
11766 | """ | |
11767 | return _core_.SizerFlags_Shaped(*args, **kwargs) | |
11768 | ||
11769 | def FixedMinSize(*args, **kwargs): | |
11770 | """ | |
11771 | FixedMinSize(self) -> SizerFlags | |
11772 | ||
11773 | Sets the wx.FIXED_MINSIZE flag. | |
11774 | """ | |
11775 | return _core_.SizerFlags_FixedMinSize(*args, **kwargs) | |
11776 | ||
11777 | def Border(*args, **kwargs): | |
11778 | """ | |
11779 | Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags | |
11780 | ||
11781 | Sets the border of the item in the direction(s) or sides given by the | |
11782 | direction parameter. If the borderInPixels value is not given then | |
11783 | the default border size (see `GetDefaultBorder`) will be used. | |
11784 | """ | |
11785 | return _core_.SizerFlags_Border(*args, **kwargs) | |
11786 | ||
11787 | def DoubleBorder(*args, **kwargs): | |
11788 | """ | |
11789 | DoubleBorder(self, int direction=ALL) -> SizerFlags | |
11790 | ||
11791 | Sets the border in the given direction to twice the default border | |
11792 | size. | |
11793 | """ | |
11794 | return _core_.SizerFlags_DoubleBorder(*args, **kwargs) | |
11795 | ||
11796 | def TripleBorder(*args, **kwargs): | |
11797 | """ | |
11798 | TripleBorder(self, int direction=ALL) -> SizerFlags | |
11799 | ||
11800 | Sets the border in the given direction to three times the default | |
11801 | border size. | |
11802 | """ | |
11803 | return _core_.SizerFlags_TripleBorder(*args, **kwargs) | |
11804 | ||
11805 | def HorzBorder(*args, **kwargs): | |
11806 | """ | |
11807 | HorzBorder(self) -> SizerFlags | |
11808 | ||
11809 | Sets the left and right borders to the default border size. | |
11810 | """ | |
11811 | return _core_.SizerFlags_HorzBorder(*args, **kwargs) | |
11812 | ||
11813 | def DoubleHorzBorder(*args, **kwargs): | |
11814 | """ | |
11815 | DoubleHorzBorder(self) -> SizerFlags | |
11816 | ||
11817 | Sets the left and right borders to twice the default border size. | |
11818 | """ | |
11819 | return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs) | |
11820 | ||
11821 | def GetDefaultBorder(*args, **kwargs): | |
11822 | """ | |
11823 | GetDefaultBorder() -> int | |
11824 | ||
11825 | Returns the default border size used by the other border methods | |
11826 | """ | |
11827 | return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs) | |
11828 | ||
11829 | GetDefaultBorder = staticmethod(GetDefaultBorder) | |
11830 | def GetProportion(*args, **kwargs): | |
11831 | """ | |
11832 | GetProportion(self) -> int | |
11833 | ||
11834 | Returns the proportion value to be used in the sizer item. | |
11835 | """ | |
11836 | return _core_.SizerFlags_GetProportion(*args, **kwargs) | |
11837 | ||
11838 | def GetFlags(*args, **kwargs): | |
11839 | """ | |
11840 | GetFlags(self) -> int | |
11841 | ||
11842 | Returns the flags value to be used in the sizer item. | |
11843 | """ | |
11844 | return _core_.SizerFlags_GetFlags(*args, **kwargs) | |
11845 | ||
11846 | def GetBorderInPixels(*args, **kwargs): | |
11847 | """ | |
11848 | GetBorderInPixels(self) -> int | |
11849 | ||
11850 | Returns the border value in pixels to be used in the sizer item. | |
11851 | """ | |
11852 | return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs) | |
11853 | ||
11854 | _core_.SizerFlags_swigregister(SizerFlags) | |
11855 | ||
11856 | def SizerFlags_GetDefaultBorder(*args): | |
11857 | """ | |
11858 | SizerFlags_GetDefaultBorder() -> int | |
11859 | ||
11860 | Returns the default border size used by the other border methods | |
11861 | """ | |
11862 | return _core_.SizerFlags_GetDefaultBorder(*args) | |
11863 | ||
11864 | class SizerItem(Object): | |
11865 | """ | |
11866 | The wx.SizerItem class is used to track the position, size and other | |
11867 | attributes of each item managed by a `wx.Sizer`. It is not usually | |
11868 | necessary to use this class because the sizer elements can also be | |
11869 | identified by their positions or window or sizer references but | |
11870 | sometimes it may be more convenient to use wx.SizerItem directly. | |
11871 | Also, custom classes derived from `wx.PySizer` will probably need to | |
11872 | use the collection of wx.SizerItems held by wx.Sizer when calculating | |
11873 | layout. | |
11874 | ||
11875 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
11876 | """ | |
11877 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
11878 | __repr__ = _swig_repr | |
11879 | def __init__(self, *args, **kwargs): | |
11880 | """ | |
11881 | __init__(self) -> SizerItem | |
11882 | ||
11883 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
11884 | size will need to be set before this item can be used in a Sizer. | |
11885 | ||
11886 | You will probably never need to create a wx.SizerItem directly as they | |
11887 | are created automatically when the sizer's Add, Insert or Prepend | |
11888 | methods are called. | |
11889 | ||
11890 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
11891 | """ | |
11892 | _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs)) | |
11893 | __swig_destroy__ = _core_.delete_SizerItem | |
11894 | __del__ = lambda self : None; | |
11895 | def DeleteWindows(*args, **kwargs): | |
11896 | """ | |
11897 | DeleteWindows(self) | |
11898 | ||
11899 | Destroy the window or the windows in a subsizer, depending on the type | |
11900 | of item. | |
11901 | """ | |
11902 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) | |
11903 | ||
11904 | def DetachSizer(*args, **kwargs): | |
11905 | """ | |
11906 | DetachSizer(self) | |
11907 | ||
11908 | Enable deleting the SizerItem without destroying the contained sizer. | |
11909 | """ | |
11910 | return _core_.SizerItem_DetachSizer(*args, **kwargs) | |
11911 | ||
11912 | def GetSize(*args, **kwargs): | |
11913 | """ | |
11914 | GetSize(self) -> Size | |
11915 | ||
11916 | Get the current size of the item, as set in the last Layout. | |
11917 | """ | |
11918 | return _core_.SizerItem_GetSize(*args, **kwargs) | |
11919 | ||
11920 | def CalcMin(*args, **kwargs): | |
11921 | """ | |
11922 | CalcMin(self) -> Size | |
11923 | ||
11924 | Calculates the minimum desired size for the item, including any space | |
11925 | needed by borders. | |
11926 | """ | |
11927 | return _core_.SizerItem_CalcMin(*args, **kwargs) | |
11928 | ||
11929 | def SetDimension(*args, **kwargs): | |
11930 | """ | |
11931 | SetDimension(self, Point pos, Size size) | |
11932 | ||
11933 | Set the position and size of the space allocated for this item by the | |
11934 | sizer, and adjust the position and size of the item (window or | |
11935 | subsizer) to be within that space taking alignment and borders into | |
11936 | account. | |
11937 | """ | |
11938 | return _core_.SizerItem_SetDimension(*args, **kwargs) | |
11939 | ||
11940 | def GetMinSize(*args, **kwargs): | |
11941 | """ | |
11942 | GetMinSize(self) -> Size | |
11943 | ||
11944 | Get the minimum size needed for the item. | |
11945 | """ | |
11946 | return _core_.SizerItem_GetMinSize(*args, **kwargs) | |
11947 | ||
11948 | def GetMinSizeWithBorder(*args, **kwargs): | |
11949 | """ | |
11950 | GetMinSizeWithBorder(self) -> Size | |
11951 | ||
11952 | Get the minimum size needed for the item with space for the borders | |
11953 | added, if needed. | |
11954 | """ | |
11955 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
11956 | ||
11957 | def SetInitSize(*args, **kwargs): | |
11958 | """SetInitSize(self, int x, int y)""" | |
11959 | return _core_.SizerItem_SetInitSize(*args, **kwargs) | |
11960 | ||
11961 | def SetRatioWH(*args, **kwargs): | |
11962 | """ | |
11963 | SetRatioWH(self, int width, int height) | |
11964 | ||
11965 | Set the ratio item attribute. | |
11966 | """ | |
11967 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) | |
11968 | ||
11969 | def SetRatioSize(*args, **kwargs): | |
11970 | """ | |
11971 | SetRatioSize(self, Size size) | |
11972 | ||
11973 | Set the ratio item attribute. | |
11974 | """ | |
11975 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) | |
11976 | ||
11977 | def SetRatio(*args, **kwargs): | |
11978 | """ | |
11979 | SetRatio(self, float ratio) | |
11980 | ||
11981 | Set the ratio item attribute. | |
11982 | """ | |
11983 | return _core_.SizerItem_SetRatio(*args, **kwargs) | |
11984 | ||
11985 | def GetRatio(*args, **kwargs): | |
11986 | """ | |
11987 | GetRatio(self) -> float | |
11988 | ||
11989 | Set the ratio item attribute. | |
11990 | """ | |
11991 | return _core_.SizerItem_GetRatio(*args, **kwargs) | |
11992 | ||
11993 | def GetRect(*args, **kwargs): | |
11994 | """ | |
11995 | GetRect(self) -> Rect | |
11996 | ||
11997 | Returns the rectangle that the sizer item should occupy | |
11998 | """ | |
11999 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
12000 | ||
12001 | def IsWindow(*args, **kwargs): | |
12002 | """ | |
12003 | IsWindow(self) -> bool | |
12004 | ||
12005 | Is this sizer item a window? | |
12006 | """ | |
12007 | return _core_.SizerItem_IsWindow(*args, **kwargs) | |
12008 | ||
12009 | def IsSizer(*args, **kwargs): | |
12010 | """ | |
12011 | IsSizer(self) -> bool | |
12012 | ||
12013 | Is this sizer item a subsizer? | |
12014 | """ | |
12015 | return _core_.SizerItem_IsSizer(*args, **kwargs) | |
12016 | ||
12017 | def IsSpacer(*args, **kwargs): | |
12018 | """ | |
12019 | IsSpacer(self) -> bool | |
12020 | ||
12021 | Is this sizer item a spacer? | |
12022 | """ | |
12023 | return _core_.SizerItem_IsSpacer(*args, **kwargs) | |
12024 | ||
12025 | def SetProportion(*args, **kwargs): | |
12026 | """ | |
12027 | SetProportion(self, int proportion) | |
12028 | ||
12029 | Set the proportion value for this item. | |
12030 | """ | |
12031 | return _core_.SizerItem_SetProportion(*args, **kwargs) | |
12032 | ||
12033 | def GetProportion(*args, **kwargs): | |
12034 | """ | |
12035 | GetProportion(self) -> int | |
12036 | ||
12037 | Get the proportion value for this item. | |
12038 | """ | |
12039 | return _core_.SizerItem_GetProportion(*args, **kwargs) | |
12040 | ||
12041 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") | |
12042 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
12043 | def SetFlag(*args, **kwargs): | |
12044 | """ | |
12045 | SetFlag(self, int flag) | |
12046 | ||
12047 | Set the flag value for this item. | |
12048 | """ | |
12049 | return _core_.SizerItem_SetFlag(*args, **kwargs) | |
12050 | ||
12051 | def GetFlag(*args, **kwargs): | |
12052 | """ | |
12053 | GetFlag(self) -> int | |
12054 | ||
12055 | Get the flag value for this item. | |
12056 | """ | |
12057 | return _core_.SizerItem_GetFlag(*args, **kwargs) | |
12058 | ||
12059 | def SetBorder(*args, **kwargs): | |
12060 | """ | |
12061 | SetBorder(self, int border) | |
12062 | ||
12063 | Set the border value for this item. | |
12064 | """ | |
12065 | return _core_.SizerItem_SetBorder(*args, **kwargs) | |
12066 | ||
12067 | def GetBorder(*args, **kwargs): | |
12068 | """ | |
12069 | GetBorder(self) -> int | |
12070 | ||
12071 | Get the border value for this item. | |
12072 | """ | |
12073 | return _core_.SizerItem_GetBorder(*args, **kwargs) | |
12074 | ||
12075 | def GetWindow(*args, **kwargs): | |
12076 | """ | |
12077 | GetWindow(self) -> Window | |
12078 | ||
12079 | Get the window (if any) that is managed by this sizer item. | |
12080 | """ | |
12081 | return _core_.SizerItem_GetWindow(*args, **kwargs) | |
12082 | ||
12083 | def SetWindow(*args, **kwargs): | |
12084 | """ | |
12085 | SetWindow(self, Window window) | |
12086 | ||
12087 | Set the window to be managed by this sizer item. | |
12088 | """ | |
12089 | return _core_.SizerItem_SetWindow(*args, **kwargs) | |
12090 | ||
12091 | def GetSizer(*args, **kwargs): | |
12092 | """ | |
12093 | GetSizer(self) -> Sizer | |
12094 | ||
12095 | Get the subsizer (if any) that is managed by this sizer item. | |
12096 | """ | |
12097 | return _core_.SizerItem_GetSizer(*args, **kwargs) | |
12098 | ||
12099 | def SetSizer(*args, **kwargs): | |
12100 | """ | |
12101 | SetSizer(self, Sizer sizer) | |
12102 | ||
12103 | Set the subsizer to be managed by this sizer item. | |
12104 | """ | |
12105 | return _core_.SizerItem_SetSizer(*args, **kwargs) | |
12106 | ||
12107 | def GetSpacer(*args, **kwargs): | |
12108 | """ | |
12109 | GetSpacer(self) -> Size | |
12110 | ||
12111 | Get the size of the spacer managed by this sizer item. | |
12112 | """ | |
12113 | return _core_.SizerItem_GetSpacer(*args, **kwargs) | |
12114 | ||
12115 | def SetSpacer(*args, **kwargs): | |
12116 | """ | |
12117 | SetSpacer(self, Size size) | |
12118 | ||
12119 | Set the size of the spacer to be managed by this sizer item. | |
12120 | """ | |
12121 | return _core_.SizerItem_SetSpacer(*args, **kwargs) | |
12122 | ||
12123 | def Show(*args, **kwargs): | |
12124 | """ | |
12125 | Show(self, bool show) | |
12126 | ||
12127 | Set the show item attribute, which sizers use to determine if the item | |
12128 | is to be made part of the layout or not. If the item is tracking a | |
12129 | window then it is shown or hidden as needed. | |
12130 | """ | |
12131 | return _core_.SizerItem_Show(*args, **kwargs) | |
12132 | ||
12133 | def IsShown(*args, **kwargs): | |
12134 | """ | |
12135 | IsShown(self) -> bool | |
12136 | ||
12137 | Is the item to be shown in the layout? | |
12138 | """ | |
12139 | return _core_.SizerItem_IsShown(*args, **kwargs) | |
12140 | ||
12141 | def GetPosition(*args, **kwargs): | |
12142 | """ | |
12143 | GetPosition(self) -> Point | |
12144 | ||
12145 | Returns the current position of the item, as set in the last Layout. | |
12146 | """ | |
12147 | return _core_.SizerItem_GetPosition(*args, **kwargs) | |
12148 | ||
12149 | def GetUserData(*args, **kwargs): | |
12150 | """ | |
12151 | GetUserData(self) -> PyObject | |
12152 | ||
12153 | Returns the userData associated with this sizer item, or None if there | |
12154 | isn't any. | |
12155 | """ | |
12156 | return _core_.SizerItem_GetUserData(*args, **kwargs) | |
12157 | ||
12158 | def SetUserData(*args, **kwargs): | |
12159 | """ | |
12160 | SetUserData(self, PyObject userData) | |
12161 | ||
12162 | Associate a Python object with this sizer item. | |
12163 | """ | |
12164 | return _core_.SizerItem_SetUserData(*args, **kwargs) | |
12165 | ||
12166 | Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`") | |
12167 | Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`") | |
12168 | MinSize = property(GetMinSize,doc="See `GetMinSize`") | |
12169 | MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`") | |
12170 | Position = property(GetPosition,doc="See `GetPosition`") | |
12171 | Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`") | |
12172 | Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`") | |
12173 | Rect = property(GetRect,doc="See `GetRect`") | |
12174 | Size = property(GetSize,doc="See `GetSize`") | |
12175 | Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`") | |
12176 | Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`") | |
12177 | UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`") | |
12178 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") | |
12179 | _core_.SizerItem_swigregister(SizerItem) | |
12180 | ||
12181 | def SizerItemWindow(*args, **kwargs): | |
12182 | """ | |
12183 | SizerItemWindow(Window window, int proportion, int flag, int border, | |
12184 | PyObject userData=None) -> SizerItem | |
12185 | ||
12186 | Constructs a `wx.SizerItem` for tracking a window. | |
12187 | """ | |
12188 | val = _core_.new_SizerItemWindow(*args, **kwargs) | |
12189 | return val | |
12190 | ||
12191 | def SizerItemSpacer(*args, **kwargs): | |
12192 | """ | |
12193 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, | |
12194 | PyObject userData=None) -> SizerItem | |
12195 | ||
12196 | Constructs a `wx.SizerItem` for tracking a spacer. | |
12197 | """ | |
12198 | val = _core_.new_SizerItemSpacer(*args, **kwargs) | |
12199 | return val | |
12200 | ||
12201 | def SizerItemSizer(*args, **kwargs): | |
12202 | """ | |
12203 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
12204 | PyObject userData=None) -> SizerItem | |
12205 | ||
12206 | Constructs a `wx.SizerItem` for tracking a subsizer | |
12207 | """ | |
12208 | val = _core_.new_SizerItemSizer(*args, **kwargs) | |
12209 | return val | |
12210 | ||
12211 | class Sizer(Object): | |
12212 | """ | |
12213 | wx.Sizer is the abstract base class used for laying out subwindows in | |
12214 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
12215 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
12216 | `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and | |
12217 | `wx.GridBagSizer`. | |
12218 | ||
12219 | The concept implemented by sizers in wxWidgets is closely related to | |
12220 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
12221 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
12222 | subwindows reporting their minimal required size and their ability to | |
12223 | get stretched if the size of the parent window has changed. This will | |
12224 | most often mean that the programmer does not set the original size of | |
12225 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
12226 | this sizer will be queried about the recommended size. The sizer in | |
12227 | turn will query its children, which can be normal windows or contorls, | |
12228 | empty space or other sizers, so that a hierarchy of sizers can be | |
12229 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
12230 | do not interfere with tab ordering and requires very little resources | |
12231 | compared to a real window on screen. | |
12232 | ||
12233 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
12234 | every control reports its own minimal size and the algorithm can | |
12235 | handle differences in font sizes or different window (dialog item) | |
12236 | sizes on different platforms without problems. If for example the | |
12237 | standard font as well as the overall design of Mac widgets requires | |
12238 | more space than on Windows, then the initial size of a dialog using a | |
12239 | sizer will automatically be bigger on Mac than on Windows. | |
12240 | """ | |
12241 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
12242 | def __init__(self): raise AttributeError, "No constructor defined" | |
12243 | __repr__ = _swig_repr | |
12244 | __swig_destroy__ = _core_.delete_Sizer | |
12245 | __del__ = lambda self : None; | |
12246 | def _setOORInfo(*args, **kwargs): | |
12247 | """_setOORInfo(self, PyObject _self)""" | |
12248 | return _core_.Sizer__setOORInfo(*args, **kwargs) | |
12249 | ||
12250 | def Add(*args, **kwargs): | |
12251 | """ | |
12252 | Add(self, item, int proportion=0, int flag=0, int border=0, | |
12253 | PyObject userData=None) -> wx.SizerItem | |
12254 | ||
12255 | Appends a child item to the sizer. | |
12256 | """ | |
12257 | return _core_.Sizer_Add(*args, **kwargs) | |
12258 | ||
12259 | def AddF(*args, **kwargs): | |
12260 | """ | |
12261 | AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem | |
12262 | ||
12263 | Similar to `Add` but uses the `wx.SizerFlags` convenience class for | |
12264 | setting the various flags, options and borders. | |
12265 | """ | |
12266 | return _core_.Sizer_AddF(*args, **kwargs) | |
12267 | ||
12268 | def Insert(*args, **kwargs): | |
12269 | """ | |
12270 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, | |
12271 | PyObject userData=None) -> wx.SizerItem | |
12272 | ||
12273 | Inserts a new item into the list of items managed by this sizer before | |
12274 | the item at index *before*. See `Add` for a description of the parameters. | |
12275 | """ | |
12276 | return _core_.Sizer_Insert(*args, **kwargs) | |
12277 | ||
12278 | def InsertF(*args, **kwargs): | |
12279 | """ | |
12280 | InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem | |
12281 | ||
12282 | Similar to `Insert`, but uses the `wx.SizerFlags` convenience class | |
12283 | for setting the various flags, options and borders. | |
12284 | """ | |
12285 | return _core_.Sizer_InsertF(*args, **kwargs) | |
12286 | ||
12287 | def Prepend(*args, **kwargs): | |
12288 | """ | |
12289 | Prepend(self, item, int proportion=0, int flag=0, int border=0, | |
12290 | PyObject userData=None) -> wx.SizerItem | |
12291 | ||
12292 | Adds a new item to the begining of the list of sizer items managed by | |
12293 | this sizer. See `Add` for a description of the parameters. | |
12294 | """ | |
12295 | return _core_.Sizer_Prepend(*args, **kwargs) | |
12296 | ||
12297 | def PrependF(*args, **kwargs): | |
12298 | """ | |
12299 | PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem | |
12300 | ||
12301 | Similar to `Prepend` but uses the `wx.SizerFlags` convenience class | |
12302 | for setting the various flags, options and borders. | |
12303 | """ | |
12304 | return _core_.Sizer_PrependF(*args, **kwargs) | |
12305 | ||
12306 | def Remove(*args, **kwargs): | |
12307 | """ | |
12308 | Remove(self, item) -> bool | |
12309 | ||
12310 | Removes an item from the sizer and destroys it. This method does not | |
12311 | cause any layout or resizing to take place, call `Layout` to update | |
12312 | the layout on screen after removing a child from the sizer. The | |
12313 | *item* parameter can be either a window, a sizer, or the zero-based | |
12314 | index of an item to remove. Returns True if the child item was found | |
12315 | and removed. | |
12316 | """ | |
12317 | return _core_.Sizer_Remove(*args, **kwargs) | |
12318 | ||
12319 | def Detach(*args, **kwargs): | |
12320 | """ | |
12321 | Detach(self, item) -> bool | |
12322 | ||
12323 | Detaches an item from the sizer without destroying it. This method | |
12324 | does not cause any layout or resizing to take place, call `Layout` to | |
12325 | do so. The *item* parameter can be either a window, a sizer, or the | |
12326 | zero-based index of the item to be detached. Returns True if the child item | |
12327 | was found and detached. | |
12328 | """ | |
12329 | return _core_.Sizer_Detach(*args, **kwargs) | |
12330 | ||
12331 | def GetItem(*args, **kwargs): | |
12332 | """ | |
12333 | GetItem(self, item, recursive=False) -> wx.SizerItem | |
12334 | ||
12335 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
12336 | parameter can be either a window, a sizer, or the zero-based index of | |
12337 | the item to be found. | |
12338 | """ | |
12339 | return _core_.Sizer_GetItem(*args, **kwargs) | |
12340 | ||
12341 | def _SetItemMinSize(*args, **kwargs): | |
12342 | """_SetItemMinSize(self, PyObject item, Size size)""" | |
12343 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) | |
12344 | ||
12345 | def _ReplaceWin(*args, **kwargs): | |
12346 | """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool""" | |
12347 | return _core_.Sizer__ReplaceWin(*args, **kwargs) | |
12348 | ||
12349 | def _ReplaceSizer(*args, **kwargs): | |
12350 | """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool""" | |
12351 | return _core_.Sizer__ReplaceSizer(*args, **kwargs) | |
12352 | ||
12353 | def _ReplaceItem(*args, **kwargs): | |
12354 | """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool""" | |
12355 | return _core_.Sizer__ReplaceItem(*args, **kwargs) | |
12356 | ||
12357 | def Replace(self, olditem, item, recursive=False): | |
12358 | """ | |
12359 | Detaches the given ``olditem`` from the sizer and replaces it with | |
12360 | ``item`` which can be a window, sizer, or `wx.SizerItem`. The | |
12361 | detached child is destroyed only if it is not a window, (because | |
12362 | windows are owned by their parent, not the sizer.) The | |
12363 | ``recursive`` parameter can be used to search for the given | |
12364 | element recursivly in subsizers. | |
12365 | ||
12366 | This method does not cause any layout or resizing to take place, | |
12367 | call `Layout` to do so. | |
12368 | ||
12369 | Returns ``True`` if the child item was found and removed. | |
12370 | """ | |
12371 | if isinstance(olditem, wx.Window): | |
12372 | return self._ReplaceWin(olditem, item, recursive) | |
12373 | elif isinstance(olditem, wx.Sizer): | |
12374 | return self._ReplaceSizer(olditem, item, recursive) | |
12375 | elif isinstance(olditem, int): | |
12376 | return self._ReplaceItem(olditem, item) | |
12377 | else: | |
12378 | raise TypeError("Expected Window, Sizer, or integer for first parameter.") | |
12379 | ||
12380 | def SetContainingWindow(*args, **kwargs): | |
12381 | """ | |
12382 | SetContainingWindow(self, Window window) | |
12383 | ||
12384 | Set (or unset) the window this sizer is used in. | |
12385 | """ | |
12386 | return _core_.Sizer_SetContainingWindow(*args, **kwargs) | |
12387 | ||
12388 | def GetContainingWindow(*args, **kwargs): | |
12389 | """ | |
12390 | GetContainingWindow(self) -> Window | |
12391 | ||
12392 | Get the window this sizer is used in. | |
12393 | """ | |
12394 | return _core_.Sizer_GetContainingWindow(*args, **kwargs) | |
12395 | ||
12396 | def SetItemMinSize(self, item, *args): | |
12397 | """ | |
12398 | SetItemMinSize(self, item, Size size) | |
12399 | ||
12400 | Sets the minimum size that will be allocated for an item in the sizer. | |
12401 | The *item* parameter can be either a window, a sizer, or the | |
12402 | zero-based index of the item. If a window or sizer is given then it | |
12403 | will be searched for recursivly in subsizers if neccessary. | |
12404 | """ | |
12405 | if len(args) == 2: | |
12406 | # for backward compatibility accept separate width,height args too | |
12407 | return self._SetItemMinSize(item, args) | |
12408 | else: | |
12409 | return self._SetItemMinSize(item, args[0]) | |
12410 | ||
12411 | def AddItem(*args, **kwargs): | |
12412 | """ | |
12413 | AddItem(self, SizerItem item) | |
12414 | ||
12415 | Adds a `wx.SizerItem` to the sizer. | |
12416 | """ | |
12417 | return _core_.Sizer_AddItem(*args, **kwargs) | |
12418 | ||
12419 | def InsertItem(*args, **kwargs): | |
12420 | """ | |
12421 | InsertItem(self, int index, SizerItem item) | |
12422 | ||
12423 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
12424 | """ | |
12425 | return _core_.Sizer_InsertItem(*args, **kwargs) | |
12426 | ||
12427 | def PrependItem(*args, **kwargs): | |
12428 | """ | |
12429 | PrependItem(self, SizerItem item) | |
12430 | ||
12431 | Prepends a `wx.SizerItem` to the sizer. | |
12432 | """ | |
12433 | return _core_.Sizer_PrependItem(*args, **kwargs) | |
12434 | ||
12435 | def AddMany(self, items): | |
12436 | """ | |
12437 | AddMany is a convenience method for adding several items | |
12438 | to a sizer at one time. Simply pass it a list of tuples, | |
12439 | where each tuple consists of the parameters that you | |
12440 | would normally pass to the `Add` method. | |
12441 | """ | |
12442 | for item in items: | |
12443 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
12444 | item = (item, ) | |
12445 | self.Add(*item) | |
12446 | ||
12447 | def AddSpacer(self, *args, **kw): | |
12448 | """AddSpacer(int size) --> SizerItem | |
12449 | ||
12450 | Add a spacer that is (size,size) pixels. | |
12451 | """ | |
12452 | if args and type(args[0]) == int: | |
12453 | return self.Add( (args[0],args[0] ), 0) | |
12454 | else: # otherwise stay compatible with old AddSpacer | |
12455 | return self.Add(*args, **kw) | |
12456 | def PrependSpacer(self, *args, **kw): | |
12457 | """PrependSpacer(int size) --> SizerItem | |
12458 | ||
12459 | Prepend a spacer that is (size, size) pixels.""" | |
12460 | if args and type(args[0]) == int: | |
12461 | return self.Prepend( (args[0],args[0] ), 0) | |
12462 | else: # otherwise stay compatible with old PrependSpacer | |
12463 | return self.Prepend(*args, **kw) | |
12464 | def InsertSpacer(self, index, *args, **kw): | |
12465 | """InsertSpacer(int index, int size) --> SizerItem | |
12466 | ||
12467 | Insert a spacer at position index that is (size, size) pixels.""" | |
12468 | if args and type(args[0]) == int: | |
12469 | return self.Insert( index, (args[0],args[0] ), 0) | |
12470 | else: # otherwise stay compatible with old InsertSpacer | |
12471 | return self.Insert(index, *args, **kw) | |
12472 | ||
12473 | ||
12474 | def AddStretchSpacer(self, prop=1): | |
12475 | """AddStretchSpacer(int prop=1) --> SizerItem | |
12476 | ||
12477 | Add a stretchable spacer.""" | |
12478 | return self.Add((0,0), prop) | |
12479 | def PrependStretchSpacer(self, prop=1): | |
12480 | """PrependStretchSpacer(int prop=1) --> SizerItem | |
12481 | ||
12482 | Prepend a stretchable spacer.""" | |
12483 | return self.Prepend((0,0), prop) | |
12484 | def InsertStretchSpacer(self, index, prop=1): | |
12485 | """InsertStretchSpacer(int index, int prop=1) --> SizerItem | |
12486 | ||
12487 | Insert a stretchable spacer.""" | |
12488 | return self.Insert(index, (0,0), prop) | |
12489 | ||
12490 | ||
12491 | # for backwards compatibility only, please do not use in new code | |
12492 | def AddWindow(self, *args, **kw): | |
12493 | """Compatibility alias for `Add`.""" | |
12494 | return self.Add(*args, **kw) | |
12495 | def AddSizer(self, *args, **kw): | |
12496 | """Compatibility alias for `Add`.""" | |
12497 | return self.Add(*args, **kw) | |
12498 | ||
12499 | def PrependWindow(self, *args, **kw): | |
12500 | """Compatibility alias for `Prepend`.""" | |
12501 | return self.Prepend(*args, **kw) | |
12502 | def PrependSizer(self, *args, **kw): | |
12503 | """Compatibility alias for `Prepend`.""" | |
12504 | return self.Prepend(*args, **kw) | |
12505 | ||
12506 | def InsertWindow(self, *args, **kw): | |
12507 | """Compatibility alias for `Insert`.""" | |
12508 | return self.Insert(*args, **kw) | |
12509 | def InsertSizer(self, *args, **kw): | |
12510 | """Compatibility alias for `Insert`.""" | |
12511 | return self.Insert(*args, **kw) | |
12512 | ||
12513 | def RemoveWindow(self, *args, **kw): | |
12514 | """Compatibility alias for `Remove`.""" | |
12515 | return self.Remove(*args, **kw) | |
12516 | def RemoveSizer(self, *args, **kw): | |
12517 | """Compatibility alias for `Remove`.""" | |
12518 | return self.Remove(*args, **kw) | |
12519 | def RemovePos(self, *args, **kw): | |
12520 | """Compatibility alias for `Remove`.""" | |
12521 | return self.Remove(*args, **kw) | |
12522 | ||
12523 | ||
12524 | def SetDimension(*args, **kwargs): | |
12525 | """ | |
12526 | SetDimension(self, int x, int y, int width, int height) | |
12527 | ||
12528 | Call this to force the sizer to take the given dimension and thus | |
12529 | force the items owned by the sizer to resize themselves according to | |
12530 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
12531 | methods. | |
12532 | """ | |
12533 | return _core_.Sizer_SetDimension(*args, **kwargs) | |
12534 | ||
12535 | def SetMinSize(*args, **kwargs): | |
12536 | """ | |
12537 | SetMinSize(self, Size size) | |
12538 | ||
12539 | Call this to give the sizer a minimal size. Normally, the sizer will | |
12540 | calculate its minimal size based purely on how much space its children | |
12541 | need. After calling this method `GetMinSize` will return either the | |
12542 | minimal size as requested by its children or the minimal size set | |
12543 | here, depending on which is bigger. | |
12544 | """ | |
12545 | return _core_.Sizer_SetMinSize(*args, **kwargs) | |
12546 | ||
12547 | def GetSize(*args, **kwargs): | |
12548 | """ | |
12549 | GetSize(self) -> Size | |
12550 | ||
12551 | Returns the current size of the space managed by the sizer. | |
12552 | """ | |
12553 | return _core_.Sizer_GetSize(*args, **kwargs) | |
12554 | ||
12555 | def GetPosition(*args, **kwargs): | |
12556 | """ | |
12557 | GetPosition(self) -> Point | |
12558 | ||
12559 | Returns the current position of the sizer's managed space. | |
12560 | """ | |
12561 | return _core_.Sizer_GetPosition(*args, **kwargs) | |
12562 | ||
12563 | def GetMinSize(*args, **kwargs): | |
12564 | """ | |
12565 | GetMinSize(self) -> Size | |
12566 | ||
12567 | Returns the minimal size of the sizer. This is either the combined | |
12568 | minimal size of all the children and their borders or the minimal size | |
12569 | set by SetMinSize, depending on which is bigger. | |
12570 | """ | |
12571 | return _core_.Sizer_GetMinSize(*args, **kwargs) | |
12572 | ||
12573 | def GetSizeTuple(self): | |
12574 | return self.GetSize().Get() | |
12575 | def GetPositionTuple(self): | |
12576 | return self.GetPosition().Get() | |
12577 | def GetMinSizeTuple(self): | |
12578 | return self.GetMinSize().Get() | |
12579 | ||
12580 | def RecalcSizes(*args, **kwargs): | |
12581 | """ | |
12582 | RecalcSizes(self) | |
12583 | ||
12584 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
12585 | items managed by this sizer. You should not need to call this directly as | |
12586 | it is called by `Layout`. | |
12587 | """ | |
12588 | return _core_.Sizer_RecalcSizes(*args, **kwargs) | |
12589 | ||
12590 | def CalcMin(*args, **kwargs): | |
12591 | """ | |
12592 | CalcMin(self) -> Size | |
12593 | ||
12594 | This method is where the sizer will do the actual calculation of its | |
12595 | children's minimal sizes. You should not need to call this directly as | |
12596 | it is called by `Layout`. | |
12597 | """ | |
12598 | return _core_.Sizer_CalcMin(*args, **kwargs) | |
12599 | ||
12600 | def Layout(*args, **kwargs): | |
12601 | """ | |
12602 | Layout(self) | |
12603 | ||
12604 | This method will force the recalculation and layout of the items | |
12605 | controlled by the sizer using the current space allocated to the | |
12606 | sizer. Normally this is called automatically from the owning window's | |
12607 | EVT_SIZE handler, but it is also useful to call it from user code when | |
12608 | one of the items in a sizer change size, or items are added or | |
12609 | removed. | |
12610 | """ | |
12611 | return _core_.Sizer_Layout(*args, **kwargs) | |
12612 | ||
12613 | def Fit(*args, **kwargs): | |
12614 | """ | |
12615 | Fit(self, Window window) -> Size | |
12616 | ||
12617 | Tell the sizer to resize the *window* to match the sizer's minimal | |
12618 | size. This is commonly done in the constructor of the window itself in | |
12619 | order to set its initial size to match the needs of the children as | |
12620 | determined by the sizer. Returns the new size. | |
12621 | ||
12622 | For a top level window this is the total window size, not the client size. | |
12623 | """ | |
12624 | return _core_.Sizer_Fit(*args, **kwargs) | |
12625 | ||
12626 | def FitInside(*args, **kwargs): | |
12627 | """ | |
12628 | FitInside(self, Window window) | |
12629 | ||
12630 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
12631 | sizer's minimal size. This will not alter the on screen size of the | |
12632 | window, but may cause the addition/removal/alteration of scrollbars | |
12633 | required to view the virtual area in windows which manage it. | |
12634 | ||
12635 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
12636 | ||
12637 | """ | |
12638 | return _core_.Sizer_FitInside(*args, **kwargs) | |
12639 | ||
12640 | def SetSizeHints(*args, **kwargs): | |
12641 | """ | |
12642 | SetSizeHints(self, Window window) | |
12643 | ||
12644 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
12645 | match the sizer's minimal size. This is commonly done in the | |
12646 | constructor of the window itself if the window is resizable (as are | |
12647 | many dialogs under Unix and frames on probably all platforms) in order | |
12648 | to prevent the window from being sized smaller than the minimal size | |
12649 | required by the sizer. | |
12650 | """ | |
12651 | return _core_.Sizer_SetSizeHints(*args, **kwargs) | |
12652 | ||
12653 | def SetVirtualSizeHints(*args, **kwargs): | |
12654 | """ | |
12655 | SetVirtualSizeHints(self, Window window) | |
12656 | ||
12657 | Tell the sizer to set the minimal size of the window virtual area to | |
12658 | match the sizer's minimal size. For windows with managed scrollbars | |
12659 | this will set them appropriately. | |
12660 | ||
12661 | :see: `wx.ScrolledWindow.SetScrollbars` | |
12662 | ||
12663 | """ | |
12664 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) | |
12665 | ||
12666 | def Clear(*args, **kwargs): | |
12667 | """ | |
12668 | Clear(self, bool deleteWindows=False) | |
12669 | ||
12670 | Clear all items from the sizer, optionally destroying the window items | |
12671 | as well. | |
12672 | """ | |
12673 | return _core_.Sizer_Clear(*args, **kwargs) | |
12674 | ||
12675 | def DeleteWindows(*args, **kwargs): | |
12676 | """ | |
12677 | DeleteWindows(self) | |
12678 | ||
12679 | Destroy all windows managed by the sizer. | |
12680 | """ | |
12681 | return _core_.Sizer_DeleteWindows(*args, **kwargs) | |
12682 | ||
12683 | def GetChildren(*args, **kwargs): | |
12684 | """ | |
12685 | GetChildren(self) -> list | |
12686 | ||
12687 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
12688 | """ | |
12689 | return _core_.Sizer_GetChildren(*args, **kwargs) | |
12690 | ||
12691 | def Show(*args, **kwargs): | |
12692 | """ | |
12693 | Show(self, item, bool show=True, bool recursive=false) -> bool | |
12694 | ||
12695 | Shows or hides an item managed by the sizer. To make a sizer item | |
12696 | disappear or reappear, use Show followed by `Layout`. The *item* | |
12697 | parameter can be either a window, a sizer, or the zero-based index of | |
12698 | the item. Use the recursive parameter to show or hide an item in a | |
12699 | subsizer. Returns True if the item was found. | |
12700 | """ | |
12701 | return _core_.Sizer_Show(*args, **kwargs) | |
12702 | ||
12703 | def IsShown(*args, **kwargs): | |
12704 | """ | |
12705 | IsShown(self, item) | |
12706 | ||
12707 | Determines if the item is currently shown. To make a sizer | |
12708 | item disappear or reappear, use Show followed by `Layout`. The *item* | |
12709 | parameter can be either a window, a sizer, or the zero-based index of | |
12710 | the item. | |
12711 | """ | |
12712 | return _core_.Sizer_IsShown(*args, **kwargs) | |
12713 | ||
12714 | def Hide(self, item, recursive=False): | |
12715 | """ | |
12716 | A convenience method for `Show` (item, False, recursive). | |
12717 | """ | |
12718 | return self.Show(item, False, recursive) | |
12719 | ||
12720 | def ShowItems(*args, **kwargs): | |
12721 | """ | |
12722 | ShowItems(self, bool show) | |
12723 | ||
12724 | Recursively call `wx.SizerItem.Show` on all sizer items. | |
12725 | """ | |
12726 | return _core_.Sizer_ShowItems(*args, **kwargs) | |
12727 | ||
12728 | Children = property(GetChildren,doc="See `GetChildren`") | |
12729 | ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`") | |
12730 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
12731 | Position = property(GetPosition,doc="See `GetPosition`") | |
12732 | Size = property(GetSize,doc="See `GetSize`") | |
12733 | _core_.Sizer_swigregister(Sizer) | |
12734 | ||
12735 | class PySizer(Sizer): | |
12736 | """ | |
12737 | wx.PySizer is a special version of `wx.Sizer` that has been | |
12738 | instrumented to allow the C++ virtual methods to be overloaded in | |
12739 | Python derived classes. You would derive from this class if you are | |
12740 | wanting to implement a custom sizer in Python code. Simply implement | |
12741 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
12742 | For example:: | |
12743 | ||
12744 | class MySizer(wx.PySizer): | |
12745 | def __init__(self): | |
12746 | wx.PySizer.__init__(self) | |
12747 | ||
12748 | def CalcMin(self): | |
12749 | for item in self.GetChildren(): | |
12750 | # calculate the total minimum width and height needed | |
12751 | # by all items in the sizer according to this sizer's | |
12752 | # layout algorithm. | |
12753 | ... | |
12754 | return wx.Size(width, height) | |
12755 | ||
12756 | def RecalcSizes(self): | |
12757 | # find the space allotted to this sizer | |
12758 | pos = self.GetPosition() | |
12759 | size = self.GetSize() | |
12760 | for item in self.GetChildren(): | |
12761 | # Recalculate (if necessary) the position and size of | |
12762 | # each item and then call item.SetDimension to do the | |
12763 | # actual positioning and sizing of the items within the | |
12764 | # space alloted to this sizer. | |
12765 | ... | |
12766 | item.SetDimension(itemPos, itemSize) | |
12767 | ||
12768 | ||
12769 | When `Layout` is called it first calls `CalcMin` followed by | |
12770 | `RecalcSizes` so you can optimize a bit by saving the results of | |
12771 | `CalcMin` and reusing them in `RecalcSizes`. | |
12772 | ||
12773 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
12774 | ||
12775 | ||
12776 | """ | |
12777 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
12778 | __repr__ = _swig_repr | |
12779 | def __init__(self, *args, **kwargs): | |
12780 | """ | |
12781 | __init__(self) -> PySizer | |
12782 | ||
12783 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
12784 | class. | |
12785 | """ | |
12786 | _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs)) | |
12787 | self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer) | |
12788 | ||
12789 | def _setCallbackInfo(*args, **kwargs): | |
12790 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
12791 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) | |
12792 | ||
12793 | _core_.PySizer_swigregister(PySizer) | |
12794 | ||
12795 | #--------------------------------------------------------------------------- | |
12796 | ||
12797 | class BoxSizer(Sizer): | |
12798 | """ | |
12799 | The basic idea behind a box sizer is that windows will most often be | |
12800 | laid out in rather simple basic geometry, typically in a row or a | |
12801 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
12802 | its items in a simple row or column, depending on the orientation | |
12803 | parameter passed to the constructor. | |
12804 | """ | |
12805 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
12806 | __repr__ = _swig_repr | |
12807 | def __init__(self, *args, **kwargs): | |
12808 | """ | |
12809 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
12810 | ||
12811 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
12812 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
12813 | sizer. | |
12814 | """ | |
12815 | _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs)) | |
12816 | self._setOORInfo(self) | |
12817 | ||
12818 | def GetOrientation(*args, **kwargs): | |
12819 | """ | |
12820 | GetOrientation(self) -> int | |
12821 | ||
12822 | Returns the current orientation of the sizer. | |
12823 | """ | |
12824 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) | |
12825 | ||
12826 | def SetOrientation(*args, **kwargs): | |
12827 | """ | |
12828 | SetOrientation(self, int orient) | |
12829 | ||
12830 | Resets the orientation of the sizer. | |
12831 | """ | |
12832 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
12833 | ||
12834 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") | |
12835 | _core_.BoxSizer_swigregister(BoxSizer) | |
12836 | ||
12837 | #--------------------------------------------------------------------------- | |
12838 | ||
12839 | class StaticBoxSizer(BoxSizer): | |
12840 | """ | |
12841 | wx.StaticBoxSizer derives from and functions identically to the | |
12842 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
12843 | manages. Note that this static box must be created separately and | |
12844 | passed to the sizer constructor. | |
12845 | """ | |
12846 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
12847 | __repr__ = _swig_repr | |
12848 | def __init__(self, *args, **kwargs): | |
12849 | """ | |
12850 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
12851 | ||
12852 | Constructor. It takes an associated static box and the orientation | |
12853 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
12854 | ``wx.HORIZONTAL``. | |
12855 | """ | |
12856 | _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs)) | |
12857 | self._setOORInfo(self) | |
12858 | ||
12859 | def GetStaticBox(*args, **kwargs): | |
12860 | """ | |
12861 | GetStaticBox(self) -> StaticBox | |
12862 | ||
12863 | Returns the static box associated with this sizer. | |
12864 | """ | |
12865 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
12866 | ||
12867 | StaticBox = property(GetStaticBox,doc="See `GetStaticBox`") | |
12868 | _core_.StaticBoxSizer_swigregister(StaticBoxSizer) | |
12869 | ||
12870 | #--------------------------------------------------------------------------- | |
12871 | ||
12872 | class GridSizer(Sizer): | |
12873 | """ | |
12874 | A grid sizer is a sizer which lays out its children in a | |
12875 | two-dimensional table with all cells having the same size. In other | |
12876 | words, the width of each cell within the grid is the width of the | |
12877 | widest item added to the sizer and the height of each grid cell is the | |
12878 | height of the tallest item. An optional vertical and/or horizontal | |
12879 | gap between items can also be specified (in pixels.) | |
12880 | ||
12881 | Items are placed in the cells of the grid in the order they are added, | |
12882 | in row-major order. In other words, the first row is filled first, | |
12883 | then the second, and so on until all items have been added. (If | |
12884 | neccessary, additional rows will be added as items are added.) If you | |
12885 | need to have greater control over the cells that items are placed in | |
12886 | then use the `wx.GridBagSizer`. | |
12887 | ||
12888 | """ | |
12889 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
12890 | __repr__ = _swig_repr | |
12891 | def __init__(self, *args, **kwargs): | |
12892 | """ | |
12893 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
12894 | ||
12895 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
12896 | of columns and rows in the sizer - if either of the parameters is | |
12897 | zero, it will be calculated to from the total number of children in | |
12898 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12899 | define extra space between all children. | |
12900 | """ | |
12901 | _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs)) | |
12902 | self._setOORInfo(self) | |
12903 | ||
12904 | def SetCols(*args, **kwargs): | |
12905 | """ | |
12906 | SetCols(self, int cols) | |
12907 | ||
12908 | Sets the number of columns in the sizer. | |
12909 | """ | |
12910 | return _core_.GridSizer_SetCols(*args, **kwargs) | |
12911 | ||
12912 | def SetRows(*args, **kwargs): | |
12913 | """ | |
12914 | SetRows(self, int rows) | |
12915 | ||
12916 | Sets the number of rows in the sizer. | |
12917 | """ | |
12918 | return _core_.GridSizer_SetRows(*args, **kwargs) | |
12919 | ||
12920 | def SetVGap(*args, **kwargs): | |
12921 | """ | |
12922 | SetVGap(self, int gap) | |
12923 | ||
12924 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
12925 | """ | |
12926 | return _core_.GridSizer_SetVGap(*args, **kwargs) | |
12927 | ||
12928 | def SetHGap(*args, **kwargs): | |
12929 | """ | |
12930 | SetHGap(self, int gap) | |
12931 | ||
12932 | Sets the horizontal gap (in pixels) between cells in the sizer | |
12933 | """ | |
12934 | return _core_.GridSizer_SetHGap(*args, **kwargs) | |
12935 | ||
12936 | def GetCols(*args, **kwargs): | |
12937 | """ | |
12938 | GetCols(self) -> int | |
12939 | ||
12940 | Returns the number of columns in the sizer. | |
12941 | """ | |
12942 | return _core_.GridSizer_GetCols(*args, **kwargs) | |
12943 | ||
12944 | def GetRows(*args, **kwargs): | |
12945 | """ | |
12946 | GetRows(self) -> int | |
12947 | ||
12948 | Returns the number of rows in the sizer. | |
12949 | """ | |
12950 | return _core_.GridSizer_GetRows(*args, **kwargs) | |
12951 | ||
12952 | def GetVGap(*args, **kwargs): | |
12953 | """ | |
12954 | GetVGap(self) -> int | |
12955 | ||
12956 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
12957 | """ | |
12958 | return _core_.GridSizer_GetVGap(*args, **kwargs) | |
12959 | ||
12960 | def GetHGap(*args, **kwargs): | |
12961 | """ | |
12962 | GetHGap(self) -> int | |
12963 | ||
12964 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
12965 | """ | |
12966 | return _core_.GridSizer_GetHGap(*args, **kwargs) | |
12967 | ||
12968 | def CalcRowsCols(self): | |
12969 | """ | |
12970 | CalcRowsCols() -> (rows, cols) | |
12971 | ||
12972 | Calculates how many rows and columns will be in the sizer based | |
12973 | on the current number of items and also the rows, cols specified | |
12974 | in the constructor. | |
12975 | """ | |
12976 | nitems = len(self.GetChildren()) | |
12977 | rows = self.GetRows() | |
12978 | cols = self.GetCols() | |
12979 | assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed" | |
12980 | if cols != 0: | |
12981 | rows = (nitems + cols - 1) / cols | |
12982 | elif rows != 0: | |
12983 | cols = (nitems + rows - 1) / rows | |
12984 | return (rows, cols) | |
12985 | ||
12986 | Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`") | |
12987 | HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`") | |
12988 | Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`") | |
12989 | VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`") | |
12990 | _core_.GridSizer_swigregister(GridSizer) | |
12991 | ||
12992 | #--------------------------------------------------------------------------- | |
12993 | ||
12994 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE | |
12995 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
12996 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
12997 | class FlexGridSizer(GridSizer): | |
12998 | """ | |
12999 | A flex grid sizer is a sizer which lays out its children in a | |
13000 | two-dimensional table with all table cells in one row having the same | |
13001 | height and all cells in one column having the same width, but all | |
13002 | rows or all columns are not necessarily the same height or width as in | |
13003 | the `wx.GridSizer`. | |
13004 | ||
13005 | wx.FlexGridSizer can also size items equally in one direction but | |
13006 | unequally ("flexibly") in the other. If the sizer is only flexible | |
13007 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
13008 | needs to be decided how the sizer should grow in the other ("non | |
13009 | flexible") direction in order to fill the available space. The | |
13010 | `SetNonFlexibleGrowMode` method serves this purpose. | |
13011 | ||
13012 | ||
13013 | """ | |
13014 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
13015 | __repr__ = _swig_repr | |
13016 | def __init__(self, *args, **kwargs): | |
13017 | """ | |
13018 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
13019 | ||
13020 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
13021 | number of columns and rows in the sizer - if either of the parameters | |
13022 | is zero, it will be calculated to from the total number of children in | |
13023 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
13024 | define extra space between all children. | |
13025 | """ | |
13026 | _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs)) | |
13027 | self._setOORInfo(self) | |
13028 | ||
13029 | def AddGrowableRow(*args, **kwargs): | |
13030 | """ | |
13031 | AddGrowableRow(self, size_t idx, int proportion=0) | |
13032 | ||
13033 | Specifies that row *idx* (starting from zero) should be grown if there | |
13034 | is extra space available to the sizer. | |
13035 | ||
13036 | The *proportion* parameter has the same meaning as the stretch factor | |
13037 | for the box sizers except that if all proportions are 0, then all | |
13038 | columns are resized equally (instead of not being resized at all). | |
13039 | """ | |
13040 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) | |
13041 | ||
13042 | def RemoveGrowableRow(*args, **kwargs): | |
13043 | """ | |
13044 | RemoveGrowableRow(self, size_t idx) | |
13045 | ||
13046 | Specifies that row *idx* is no longer growable. | |
13047 | """ | |
13048 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) | |
13049 | ||
13050 | def AddGrowableCol(*args, **kwargs): | |
13051 | """ | |
13052 | AddGrowableCol(self, size_t idx, int proportion=0) | |
13053 | ||
13054 | Specifies that column *idx* (starting from zero) should be grown if | |
13055 | there is extra space available to the sizer. | |
13056 | ||
13057 | The *proportion* parameter has the same meaning as the stretch factor | |
13058 | for the box sizers except that if all proportions are 0, then all | |
13059 | columns are resized equally (instead of not being resized at all). | |
13060 | """ | |
13061 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) | |
13062 | ||
13063 | def RemoveGrowableCol(*args, **kwargs): | |
13064 | """ | |
13065 | RemoveGrowableCol(self, size_t idx) | |
13066 | ||
13067 | Specifies that column *idx* is no longer growable. | |
13068 | """ | |
13069 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) | |
13070 | ||
13071 | def SetFlexibleDirection(*args, **kwargs): | |
13072 | """ | |
13073 | SetFlexibleDirection(self, int direction) | |
13074 | ||
13075 | Specifies whether the sizer should flexibly resize its columns, rows, | |
13076 | or both. Argument *direction* can be one of the following values. Any | |
13077 | other value is ignored. | |
13078 | ||
13079 | ============== ======================================= | |
13080 | wx.VERTICAL Rows are flexibly sized. | |
13081 | wx.HORIZONTAL Columns are flexibly sized. | |
13082 | wx.BOTH Both rows and columns are flexibly sized | |
13083 | (this is the default value). | |
13084 | ============== ======================================= | |
13085 | ||
13086 | Note that this method does not trigger relayout. | |
13087 | ||
13088 | """ | |
13089 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) | |
13090 | ||
13091 | def GetFlexibleDirection(*args, **kwargs): | |
13092 | """ | |
13093 | GetFlexibleDirection(self) -> int | |
13094 | ||
13095 | Returns a value that specifies whether the sizer | |
13096 | flexibly resizes its columns, rows, or both (default). | |
13097 | ||
13098 | :see: `SetFlexibleDirection` | |
13099 | """ | |
13100 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) | |
13101 | ||
13102 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
13103 | """ | |
13104 | SetNonFlexibleGrowMode(self, int mode) | |
13105 | ||
13106 | Specifies how the sizer should grow in the non-flexible direction if | |
13107 | there is one (so `SetFlexibleDirection` must have been called | |
13108 | previously). Argument *mode* can be one of the following values: | |
13109 | ||
13110 | ========================== ================================================= | |
13111 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
13112 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
13113 | `AddGrowableCol` and `AddGrowableRow`. In this | |
13114 | case equal sizing applies to minimum sizes of | |
13115 | columns or rows (this is the default value). | |
13116 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
13117 | the non flexible direction, whether they are | |
13118 | growable or not in the flexbile direction. | |
13119 | ========================== ================================================= | |
13120 | ||
13121 | Note that this method does not trigger relayout. | |
13122 | """ | |
13123 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) | |
13124 | ||
13125 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
13126 | """ | |
13127 | GetNonFlexibleGrowMode(self) -> int | |
13128 | ||
13129 | Returns the value that specifies how the sizer grows in the | |
13130 | non-flexible direction if there is one. | |
13131 | ||
13132 | :see: `SetNonFlexibleGrowMode` | |
13133 | """ | |
13134 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) | |
13135 | ||
13136 | def GetRowHeights(*args, **kwargs): | |
13137 | """ | |
13138 | GetRowHeights(self) -> list | |
13139 | ||
13140 | Returns a list of integers representing the heights of each of the | |
13141 | rows in the sizer. | |
13142 | """ | |
13143 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) | |
13144 | ||
13145 | def GetColWidths(*args, **kwargs): | |
13146 | """ | |
13147 | GetColWidths(self) -> list | |
13148 | ||
13149 | Returns a list of integers representing the widths of each of the | |
13150 | columns in the sizer. | |
13151 | """ | |
13152 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) | |
13153 | ||
13154 | ColWidths = property(GetColWidths,doc="See `GetColWidths`") | |
13155 | FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`") | |
13156 | NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`") | |
13157 | RowHeights = property(GetRowHeights,doc="See `GetRowHeights`") | |
13158 | _core_.FlexGridSizer_swigregister(FlexGridSizer) | |
13159 | ||
13160 | class StdDialogButtonSizer(BoxSizer): | |
13161 | """ | |
13162 | A special sizer that knows how to order and position standard buttons | |
13163 | in order to conform to the current platform's standards. You simply | |
13164 | need to add each `wx.Button` to the sizer, and be sure to create the | |
13165 | buttons using the standard ID's. Then call `Realize` and the sizer | |
13166 | will take care of the rest. | |
13167 | ||
13168 | """ | |
13169 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
13170 | __repr__ = _swig_repr | |
13171 | def __init__(self, *args, **kwargs): | |
13172 | """__init__(self) -> StdDialogButtonSizer""" | |
13173 | _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs)) | |
13174 | def AddButton(*args, **kwargs): | |
13175 | """ | |
13176 | AddButton(self, wxButton button) | |
13177 | ||
13178 | Use this to add the buttons to this sizer. Do not use the `Add` | |
13179 | method in the base class. | |
13180 | """ | |
13181 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
13182 | ||
13183 | def Realize(*args, **kwargs): | |
13184 | """ | |
13185 | Realize(self) | |
13186 | ||
13187 | This funciton needs to be called after all the buttons have been added | |
13188 | to the sizer. It will reorder them and position them in a platform | |
13189 | specifc manner. | |
13190 | """ | |
13191 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) | |
13192 | ||
13193 | def SetAffirmativeButton(*args, **kwargs): | |
13194 | """SetAffirmativeButton(self, wxButton button)""" | |
13195 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
13196 | ||
13197 | def SetNegativeButton(*args, **kwargs): | |
13198 | """SetNegativeButton(self, wxButton button)""" | |
13199 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
13200 | ||
13201 | def SetCancelButton(*args, **kwargs): | |
13202 | """SetCancelButton(self, wxButton button)""" | |
13203 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
13204 | ||
13205 | def GetAffirmativeButton(*args, **kwargs): | |
13206 | """GetAffirmativeButton(self) -> wxButton""" | |
13207 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
13208 | ||
13209 | def GetApplyButton(*args, **kwargs): | |
13210 | """GetApplyButton(self) -> wxButton""" | |
13211 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
13212 | ||
13213 | def GetNegativeButton(*args, **kwargs): | |
13214 | """GetNegativeButton(self) -> wxButton""" | |
13215 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
13216 | ||
13217 | def GetCancelButton(*args, **kwargs): | |
13218 | """GetCancelButton(self) -> wxButton""" | |
13219 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
13220 | ||
13221 | def GetHelpButton(*args, **kwargs): | |
13222 | """GetHelpButton(self) -> wxButton""" | |
13223 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
13224 | ||
13225 | AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`") | |
13226 | ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`") | |
13227 | CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`") | |
13228 | HelpButton = property(GetHelpButton,doc="See `GetHelpButton`") | |
13229 | NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`") | |
13230 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer) | |
13231 | ||
13232 | #--------------------------------------------------------------------------- | |
13233 | ||
13234 | class GBPosition(object): | |
13235 | """ | |
13236 | This class represents the position of an item in a virtual grid of | |
13237 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
13238 | typemaps that will automatically convert from a 2-element sequence of | |
13239 | integers to a wx.GBPosition, so you can use the more pythonic | |
13240 | representation of the position nearly transparently in Python code. | |
13241 | """ | |
13242 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
13243 | __repr__ = _swig_repr | |
13244 | def __init__(self, *args, **kwargs): | |
13245 | """ | |
13246 | __init__(self, int row=0, int col=0) -> GBPosition | |
13247 | ||
13248 | This class represents the position of an item in a virtual grid of | |
13249 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
13250 | typemaps that will automatically convert from a 2-element sequence of | |
13251 | integers to a wx.GBPosition, so you can use the more pythonic | |
13252 | representation of the position nearly transparently in Python code. | |
13253 | """ | |
13254 | _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs)) | |
13255 | __swig_destroy__ = _core_.delete_GBPosition | |
13256 | __del__ = lambda self : None; | |
13257 | def GetRow(*args, **kwargs): | |
13258 | """GetRow(self) -> int""" | |
13259 | return _core_.GBPosition_GetRow(*args, **kwargs) | |
13260 | ||
13261 | def GetCol(*args, **kwargs): | |
13262 | """GetCol(self) -> int""" | |
13263 | return _core_.GBPosition_GetCol(*args, **kwargs) | |
13264 | ||
13265 | def SetRow(*args, **kwargs): | |
13266 | """SetRow(self, int row)""" | |
13267 | return _core_.GBPosition_SetRow(*args, **kwargs) | |
13268 | ||
13269 | def SetCol(*args, **kwargs): | |
13270 | """SetCol(self, int col)""" | |
13271 | return _core_.GBPosition_SetCol(*args, **kwargs) | |
13272 | ||
13273 | def __eq__(*args, **kwargs): | |
13274 | """ | |
13275 | __eq__(self, PyObject other) -> bool | |
13276 | ||
13277 | Compare GBPosition for equality. | |
13278 | """ | |
13279 | return _core_.GBPosition___eq__(*args, **kwargs) | |
13280 | ||
13281 | def __ne__(*args, **kwargs): | |
13282 | """ | |
13283 | __ne__(self, PyObject other) -> bool | |
13284 | ||
13285 | Compare GBPosition for inequality. | |
13286 | """ | |
13287 | return _core_.GBPosition___ne__(*args, **kwargs) | |
13288 | ||
13289 | def Set(*args, **kwargs): | |
13290 | """Set(self, int row=0, int col=0)""" | |
13291 | return _core_.GBPosition_Set(*args, **kwargs) | |
13292 | ||
13293 | def Get(*args, **kwargs): | |
13294 | """Get(self) -> PyObject""" | |
13295 | return _core_.GBPosition_Get(*args, **kwargs) | |
13296 | ||
13297 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") | |
13298 | def __str__(self): return str(self.Get()) | |
13299 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
13300 | def __len__(self): return len(self.Get()) | |
13301 | def __getitem__(self, index): return self.Get()[index] | |
13302 | def __setitem__(self, index, val): | |
13303 | if index == 0: self.SetRow(val) | |
13304 | elif index == 1: self.SetCol(val) | |
13305 | else: raise IndexError | |
13306 | def __nonzero__(self): return self.Get() != (0,0) | |
13307 | __safe_for_unpickling__ = True | |
13308 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
13309 | ||
13310 | row = property(GetRow, SetRow) | |
13311 | col = property(GetCol, SetCol) | |
13312 | ||
13313 | _core_.GBPosition_swigregister(GBPosition) | |
13314 | ||
13315 | class GBSpan(object): | |
13316 | """ | |
13317 | This class is used to hold the row and column spanning attributes of | |
13318 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
13319 | automatically convert from a 2-element sequence of integers to a | |
13320 | wx.GBSpan, so you can use the more pythonic representation of the span | |
13321 | nearly transparently in Python code. | |
13322 | ||
13323 | """ | |
13324 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
13325 | __repr__ = _swig_repr | |
13326 | def __init__(self, *args, **kwargs): | |
13327 | """ | |
13328 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
13329 | ||
13330 | Construct a new wxGBSpan, optionally setting the rowspan and | |
13331 | colspan. The default is (1,1). (Meaning that the item occupies one | |
13332 | cell in each direction. | |
13333 | """ | |
13334 | _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs)) | |
13335 | __swig_destroy__ = _core_.delete_GBSpan | |
13336 | __del__ = lambda self : None; | |
13337 | def GetRowspan(*args, **kwargs): | |
13338 | """GetRowspan(self) -> int""" | |
13339 | return _core_.GBSpan_GetRowspan(*args, **kwargs) | |
13340 | ||
13341 | def GetColspan(*args, **kwargs): | |
13342 | """GetColspan(self) -> int""" | |
13343 | return _core_.GBSpan_GetColspan(*args, **kwargs) | |
13344 | ||
13345 | def SetRowspan(*args, **kwargs): | |
13346 | """SetRowspan(self, int rowspan)""" | |
13347 | return _core_.GBSpan_SetRowspan(*args, **kwargs) | |
13348 | ||
13349 | def SetColspan(*args, **kwargs): | |
13350 | """SetColspan(self, int colspan)""" | |
13351 | return _core_.GBSpan_SetColspan(*args, **kwargs) | |
13352 | ||
13353 | def __eq__(*args, **kwargs): | |
13354 | """ | |
13355 | __eq__(self, PyObject other) -> bool | |
13356 | ||
13357 | Compare wxGBSpan for equality. | |
13358 | """ | |
13359 | return _core_.GBSpan___eq__(*args, **kwargs) | |
13360 | ||
13361 | def __ne__(*args, **kwargs): | |
13362 | """ | |
13363 | __ne__(self, PyObject other) -> bool | |
13364 | ||
13365 | Compare GBSpan for inequality. | |
13366 | """ | |
13367 | return _core_.GBSpan___ne__(*args, **kwargs) | |
13368 | ||
13369 | def Set(*args, **kwargs): | |
13370 | """Set(self, int rowspan=1, int colspan=1)""" | |
13371 | return _core_.GBSpan_Set(*args, **kwargs) | |
13372 | ||
13373 | def Get(*args, **kwargs): | |
13374 | """Get(self) -> PyObject""" | |
13375 | return _core_.GBSpan_Get(*args, **kwargs) | |
13376 | ||
13377 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") | |
13378 | def __str__(self): return str(self.Get()) | |
13379 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
13380 | def __len__(self): return len(self.Get()) | |
13381 | def __getitem__(self, index): return self.Get()[index] | |
13382 | def __setitem__(self, index, val): | |
13383 | if index == 0: self.SetRowspan(val) | |
13384 | elif index == 1: self.SetColspan(val) | |
13385 | else: raise IndexError | |
13386 | def __nonzero__(self): return self.Get() != (0,0) | |
13387 | __safe_for_unpickling__ = True | |
13388 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
13389 | ||
13390 | rowspan = property(GetRowspan, SetRowspan) | |
13391 | colspan = property(GetColspan, SetColspan) | |
13392 | ||
13393 | _core_.GBSpan_swigregister(GBSpan) | |
13394 | ||
13395 | class GBSizerItem(SizerItem): | |
13396 | """ | |
13397 | The wx.GBSizerItem class is used to track the additional data about | |
13398 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
13399 | and how many rows or columns it spans. | |
13400 | ||
13401 | """ | |
13402 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
13403 | __repr__ = _swig_repr | |
13404 | def __init__(self, *args, **kwargs): | |
13405 | """ | |
13406 | __init__(self) -> GBSizerItem | |
13407 | ||
13408 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
13409 | size will need to be set, as well as a position and span before this | |
13410 | item can be used in a Sizer. | |
13411 | ||
13412 | You will probably never need to create a wx.GBSizerItem directly as they | |
13413 | are created automatically when the sizer's Add method is called. | |
13414 | """ | |
13415 | _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs)) | |
13416 | __swig_destroy__ = _core_.delete_GBSizerItem | |
13417 | __del__ = lambda self : None; | |
13418 | def GetPos(*args, **kwargs): | |
13419 | """ | |
13420 | GetPos(self) -> GBPosition | |
13421 | ||
13422 | Get the grid position of the item | |
13423 | """ | |
13424 | return _core_.GBSizerItem_GetPos(*args, **kwargs) | |
13425 | ||
13426 | def GetPosTuple(self): return self.GetPos().Get() | |
13427 | def GetSpan(*args, **kwargs): | |
13428 | """ | |
13429 | GetSpan(self) -> GBSpan | |
13430 | ||
13431 | Get the row and column spanning of the item | |
13432 | """ | |
13433 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) | |
13434 | ||
13435 | def GetSpanTuple(self): return self.GetSpan().Get() | |
13436 | def SetPos(*args, **kwargs): | |
13437 | """ | |
13438 | SetPos(self, GBPosition pos) -> bool | |
13439 | ||
13440 | If the item is already a member of a sizer then first ensure that | |
13441 | there is no other item that would intersect with this one at the new | |
13442 | position, then set the new position. Returns True if the change is | |
13443 | successful and after the next Layout() the item will be moved. | |
13444 | """ | |
13445 | return _core_.GBSizerItem_SetPos(*args, **kwargs) | |
13446 | ||
13447 | def SetSpan(*args, **kwargs): | |
13448 | """ | |
13449 | SetSpan(self, GBSpan span) -> bool | |
13450 | ||
13451 | If the item is already a member of a sizer then first ensure that | |
13452 | there is no other item that would intersect with this one with its new | |
13453 | spanning size, then set the new spanning. Returns True if the change | |
13454 | is successful and after the next Layout() the item will be resized. | |
13455 | ||
13456 | """ | |
13457 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) | |
13458 | ||
13459 | def Intersects(*args, **kwargs): | |
13460 | """ | |
13461 | Intersects(self, GBSizerItem other) -> bool | |
13462 | ||
13463 | Returns True if this item and the other item instersect. | |
13464 | """ | |
13465 | return _core_.GBSizerItem_Intersects(*args, **kwargs) | |
13466 | ||
13467 | def IntersectsPos(*args, **kwargs): | |
13468 | """ | |
13469 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
13470 | ||
13471 | Returns True if the given pos/span would intersect with this item. | |
13472 | """ | |
13473 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
13474 | ||
13475 | def GetEndPos(*args, **kwargs): | |
13476 | """ | |
13477 | GetEndPos(self) -> GBPosition | |
13478 | ||
13479 | Get the row and column of the endpoint of this item. | |
13480 | """ | |
13481 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) | |
13482 | ||
13483 | def GetGBSizer(*args, **kwargs): | |
13484 | """ | |
13485 | GetGBSizer(self) -> GridBagSizer | |
13486 | ||
13487 | Get the sizer this item is a member of. | |
13488 | """ | |
13489 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) | |
13490 | ||
13491 | def SetGBSizer(*args, **kwargs): | |
13492 | """ | |
13493 | SetGBSizer(self, GridBagSizer sizer) | |
13494 | ||
13495 | Set the sizer this item is a member of. | |
13496 | """ | |
13497 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) | |
13498 | ||
13499 | EndPos = property(GetEndPos,doc="See `GetEndPos`") | |
13500 | GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`") | |
13501 | Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`") | |
13502 | Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`") | |
13503 | _core_.GBSizerItem_swigregister(GBSizerItem) | |
13504 | DefaultSpan = cvar.DefaultSpan | |
13505 | ||
13506 | def GBSizerItemWindow(*args, **kwargs): | |
13507 | """ | |
13508 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
13509 | int border, PyObject userData=None) -> GBSizerItem | |
13510 | ||
13511 | Construct a `wx.GBSizerItem` for a window. | |
13512 | """ | |
13513 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) | |
13514 | return val | |
13515 | ||
13516 | def GBSizerItemSizer(*args, **kwargs): | |
13517 | """ | |
13518 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
13519 | int border, PyObject userData=None) -> GBSizerItem | |
13520 | ||
13521 | Construct a `wx.GBSizerItem` for a sizer | |
13522 | """ | |
13523 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) | |
13524 | return val | |
13525 | ||
13526 | def GBSizerItemSpacer(*args, **kwargs): | |
13527 | """ | |
13528 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
13529 | int flag, int border, PyObject userData=None) -> GBSizerItem | |
13530 | ||
13531 | Construct a `wx.GBSizerItem` for a spacer. | |
13532 | """ | |
13533 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) | |
13534 | return val | |
13535 | ||
13536 | class GridBagSizer(FlexGridSizer): | |
13537 | """ | |
13538 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
13539 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
13540 | is allowed using `wx.GBPosition`, and items can optionally span more | |
13541 | than one row and/or column using `wx.GBSpan`. The total size of the | |
13542 | virtual grid is determined by the largest row and column that items are | |
13543 | positioned at, adjusted for spanning. | |
13544 | ||
13545 | """ | |
13546 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
13547 | __repr__ = _swig_repr | |
13548 | def __init__(self, *args, **kwargs): | |
13549 | """ | |
13550 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
13551 | ||
13552 | Constructor, with optional parameters to specify the gap between the | |
13553 | rows and columns. | |
13554 | """ | |
13555 | _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs)) | |
13556 | self._setOORInfo(self) | |
13557 | ||
13558 | def Add(*args, **kwargs): | |
13559 | """ | |
13560 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, | |
13561 | int border=0, userData=None) -> wx.GBSizerItem | |
13562 | ||
13563 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
13564 | more than one row or column as specified with *span*. The remaining | |
13565 | args behave similarly to `wx.Sizer.Add`. | |
13566 | ||
13567 | Returns True if the item was successfully placed at the given cell | |
13568 | position, False if something was already there. | |
13569 | ||
13570 | """ | |
13571 | return _core_.GridBagSizer_Add(*args, **kwargs) | |
13572 | ||
13573 | def AddItem(*args, **kwargs): | |
13574 | """ | |
13575 | Add(self, GBSizerItem item) -> wx.GBSizerItem | |
13576 | ||
13577 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
13578 | the item was successfully placed at its given cell position, False if | |
13579 | something was already there. | |
13580 | """ | |
13581 | return _core_.GridBagSizer_AddItem(*args, **kwargs) | |
13582 | ||
13583 | def GetCellSize(*args, **kwargs): | |
13584 | """ | |
13585 | GetCellSize(self, int row, int col) -> Size | |
13586 | ||
13587 | Get the size of the specified cell, including hgap and | |
13588 | vgap. Only valid after a Layout. | |
13589 | """ | |
13590 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
13591 | ||
13592 | def GetEmptyCellSize(*args, **kwargs): | |
13593 | """ | |
13594 | GetEmptyCellSize(self) -> Size | |
13595 | ||
13596 | Get the size used for cells in the grid with no item. | |
13597 | """ | |
13598 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) | |
13599 | ||
13600 | def SetEmptyCellSize(*args, **kwargs): | |
13601 | """ | |
13602 | SetEmptyCellSize(self, Size sz) | |
13603 | ||
13604 | Set the size used for cells in the grid with no item. | |
13605 | """ | |
13606 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) | |
13607 | ||
13608 | def GetItemPosition(*args): | |
13609 | """ | |
13610 | GetItemPosition(self, item) -> GBPosition | |
13611 | ||
13612 | Get the grid position of the specified *item* where *item* is either a | |
13613 | window or subsizer that is a member of this sizer, or a zero-based | |
13614 | index of an item. | |
13615 | """ | |
13616 | return _core_.GridBagSizer_GetItemPosition(*args) | |
13617 | ||
13618 | def SetItemPosition(*args): | |
13619 | """ | |
13620 | SetItemPosition(self, item, GBPosition pos) -> bool | |
13621 | ||
13622 | Set the grid position of the specified *item* where *item* is either a | |
13623 | window or subsizer that is a member of this sizer, or a zero-based | |
13624 | index of an item. Returns True on success. If the move is not | |
13625 | allowed (because an item is already there) then False is returned. | |
13626 | ||
13627 | """ | |
13628 | return _core_.GridBagSizer_SetItemPosition(*args) | |
13629 | ||
13630 | def GetItemSpan(*args): | |
13631 | """ | |
13632 | GetItemSpan(self, item) -> GBSpan | |
13633 | ||
13634 | Get the row/col spanning of the specified *item* where *item* is | |
13635 | either a window or subsizer that is a member of this sizer, or a | |
13636 | zero-based index of an item. | |
13637 | """ | |
13638 | return _core_.GridBagSizer_GetItemSpan(*args) | |
13639 | ||
13640 | def SetItemSpan(*args): | |
13641 | """ | |
13642 | SetItemSpan(self, item, GBSpan span) -> bool | |
13643 | ||
13644 | Set the row/col spanning of the specified *item* where *item* is | |
13645 | either a window or subsizer that is a member of this sizer, or a | |
13646 | zero-based index of an item. Returns True on success. If the move is | |
13647 | not allowed (because an item is already there) then False is returned. | |
13648 | """ | |
13649 | return _core_.GridBagSizer_SetItemSpan(*args) | |
13650 | ||
13651 | def FindItem(*args): | |
13652 | """ | |
13653 | FindItem(self, item) -> GBSizerItem | |
13654 | ||
13655 | Find the sizer item for the given window or subsizer, returns None if | |
13656 | not found. (non-recursive) | |
13657 | """ | |
13658 | return _core_.GridBagSizer_FindItem(*args) | |
13659 | ||
13660 | def GetItem(self, item): | |
13661 | gbsi = None | |
13662 | si = wx.FlexGridSizer.GetItem(self, item) | |
13663 | if not si: | |
13664 | return None | |
13665 | if type(item) is not int: | |
13666 | gbsi = self.FindItem(item) | |
13667 | if gbsi: return gbsi | |
13668 | return si | |
13669 | ||
13670 | def FindItemAtPosition(*args, **kwargs): | |
13671 | """ | |
13672 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
13673 | ||
13674 | Return the sizer item for the given grid cell, or None if there is no | |
13675 | item at that position. (non-recursive) | |
13676 | """ | |
13677 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) | |
13678 | ||
13679 | def FindItemAtPoint(*args, **kwargs): | |
13680 | """ | |
13681 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
13682 | ||
13683 | Return the sizer item located at the point given in *pt*, or None if | |
13684 | there is no item at that point. The (x,y) coordinates in pt correspond | |
13685 | to the client coordinates of the window using the sizer for | |
13686 | layout. (non-recursive) | |
13687 | """ | |
13688 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) | |
13689 | ||
13690 | def CheckForIntersection(*args, **kwargs): | |
13691 | """ | |
13692 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
13693 | ||
13694 | Look at all items and see if any intersect (or would overlap) the | |
13695 | given *item*. Returns True if so, False if there would be no overlap. | |
13696 | If an *excludeItem* is given then it will not be checked for | |
13697 | intersection, for example it may be the item we are checking the | |
13698 | position of. | |
13699 | ||
13700 | """ | |
13701 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
13702 | ||
13703 | def CheckForIntersectionPos(*args, **kwargs): | |
13704 | """ | |
13705 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool | |
13706 | ||
13707 | Look at all items and see if any intersect (or would overlap) the | |
13708 | given position and span. Returns True if so, False if there would be | |
13709 | no overlap. If an *excludeItem* is given then it will not be checked | |
13710 | for intersection, for example it may be the item we are checking the | |
13711 | position of. | |
13712 | """ | |
13713 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) | |
13714 | ||
13715 | _core_.GridBagSizer_swigregister(GridBagSizer) | |
13716 | ||
13717 | #--------------------------------------------------------------------------- | |
13718 | ||
13719 | Left = _core_.Left | |
13720 | Top = _core_.Top | |
13721 | Right = _core_.Right | |
13722 | Bottom = _core_.Bottom | |
13723 | Width = _core_.Width | |
13724 | Height = _core_.Height | |
13725 | Centre = _core_.Centre | |
13726 | Center = _core_.Center | |
13727 | CentreX = _core_.CentreX | |
13728 | CentreY = _core_.CentreY | |
13729 | Unconstrained = _core_.Unconstrained | |
13730 | AsIs = _core_.AsIs | |
13731 | PercentOf = _core_.PercentOf | |
13732 | Above = _core_.Above | |
13733 | Below = _core_.Below | |
13734 | LeftOf = _core_.LeftOf | |
13735 | RightOf = _core_.RightOf | |
13736 | SameAs = _core_.SameAs | |
13737 | Absolute = _core_.Absolute | |
13738 | class IndividualLayoutConstraint(Object): | |
13739 | """ | |
13740 | Objects of this class are stored in the `wx.LayoutConstraints` class as | |
13741 | one of eight possible constraints that a window can be involved in. | |
13742 | You will never need to create an instance of | |
13743 | wx.IndividualLayoutConstraint, rather you should create a | |
13744 | `wx.LayoutConstraints` instance and use the individual contstraints | |
13745 | that it contains. | |
13746 | """ | |
13747 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
13748 | def __init__(self): raise AttributeError, "No constructor defined" | |
13749 | __repr__ = _swig_repr | |
13750 | def Set(*args, **kwargs): | |
13751 | """ | |
13752 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
13753 | ||
13754 | Sets the properties of the constraint. Normally called by one of the | |
13755 | convenience functions such as Above, RightOf, SameAs. | |
13756 | """ | |
13757 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) | |
13758 | ||
13759 | def LeftOf(*args, **kwargs): | |
13760 | """ | |
13761 | LeftOf(self, Window sibling, int marg=0) | |
13762 | ||
13763 | Constrains this edge to be to the left of the given window, with an | |
13764 | optional margin. Implicitly, this is relative to the left edge of the | |
13765 | other window. | |
13766 | """ | |
13767 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) | |
13768 | ||
13769 | def RightOf(*args, **kwargs): | |
13770 | """ | |
13771 | RightOf(self, Window sibling, int marg=0) | |
13772 | ||
13773 | Constrains this edge to be to the right of the given window, with an | |
13774 | optional margin. Implicitly, this is relative to the right edge of the | |
13775 | other window. | |
13776 | """ | |
13777 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) | |
13778 | ||
13779 | def Above(*args, **kwargs): | |
13780 | """ | |
13781 | Above(self, Window sibling, int marg=0) | |
13782 | ||
13783 | Constrains this edge to be above the given window, with an optional | |
13784 | margin. Implicitly, this is relative to the top edge of the other | |
13785 | window. | |
13786 | """ | |
13787 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) | |
13788 | ||
13789 | def Below(*args, **kwargs): | |
13790 | """ | |
13791 | Below(self, Window sibling, int marg=0) | |
13792 | ||
13793 | Constrains this edge to be below the given window, with an optional | |
13794 | margin. Implicitly, this is relative to the bottom edge of the other | |
13795 | window. | |
13796 | """ | |
13797 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) | |
13798 | ||
13799 | def SameAs(*args, **kwargs): | |
13800 | """ | |
13801 | SameAs(self, Window otherW, int edge, int marg=0) | |
13802 | ||
13803 | Constrains this edge or dimension to be to the same as the edge of the | |
13804 | given window, with an optional margin. | |
13805 | """ | |
13806 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) | |
13807 | ||
13808 | def PercentOf(*args, **kwargs): | |
13809 | """ | |
13810 | PercentOf(self, Window otherW, int wh, int per) | |
13811 | ||
13812 | Constrains this edge or dimension to be to a percentage of the given | |
13813 | window, with an optional margin. | |
13814 | """ | |
13815 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) | |
13816 | ||
13817 | def Absolute(*args, **kwargs): | |
13818 | """ | |
13819 | Absolute(self, int val) | |
13820 | ||
13821 | Constrains this edge or dimension to be the given absolute value. | |
13822 | """ | |
13823 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) | |
13824 | ||
13825 | def Unconstrained(*args, **kwargs): | |
13826 | """ | |
13827 | Unconstrained(self) | |
13828 | ||
13829 | Sets this edge or dimension to be unconstrained, that is, dependent on | |
13830 | other edges and dimensions from which this value can be deduced. | |
13831 | """ | |
13832 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) | |
13833 | ||
13834 | def AsIs(*args, **kwargs): | |
13835 | """ | |
13836 | AsIs(self) | |
13837 | ||
13838 | Sets this edge or constraint to be whatever the window's value is at | |
13839 | the moment. If either of the width and height constraints are *as is*, | |
13840 | the window will not be resized, but moved instead. This is important | |
13841 | when considering panel items which are intended to have a default | |
13842 | size, such as a button, which may take its size from the size of the | |
13843 | button label. | |
13844 | """ | |
13845 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) | |
13846 | ||
13847 | def GetOtherWindow(*args, **kwargs): | |
13848 | """GetOtherWindow(self) -> Window""" | |
13849 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) | |
13850 | ||
13851 | def GetMyEdge(*args, **kwargs): | |
13852 | """GetMyEdge(self) -> int""" | |
13853 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) | |
13854 | ||
13855 | def SetEdge(*args, **kwargs): | |
13856 | """SetEdge(self, int which)""" | |
13857 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) | |
13858 | ||
13859 | def SetValue(*args, **kwargs): | |
13860 | """SetValue(self, int v)""" | |
13861 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) | |
13862 | ||
13863 | def GetMargin(*args, **kwargs): | |
13864 | """GetMargin(self) -> int""" | |
13865 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) | |
13866 | ||
13867 | def SetMargin(*args, **kwargs): | |
13868 | """SetMargin(self, int m)""" | |
13869 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) | |
13870 | ||
13871 | def GetValue(*args, **kwargs): | |
13872 | """GetValue(self) -> int""" | |
13873 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) | |
13874 | ||
13875 | def GetPercent(*args, **kwargs): | |
13876 | """GetPercent(self) -> int""" | |
13877 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) | |
13878 | ||
13879 | def GetOtherEdge(*args, **kwargs): | |
13880 | """GetOtherEdge(self) -> int""" | |
13881 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) | |
13882 | ||
13883 | def GetDone(*args, **kwargs): | |
13884 | """GetDone(self) -> bool""" | |
13885 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) | |
13886 | ||
13887 | def SetDone(*args, **kwargs): | |
13888 | """SetDone(self, bool d)""" | |
13889 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) | |
13890 | ||
13891 | def GetRelationship(*args, **kwargs): | |
13892 | """GetRelationship(self) -> int""" | |
13893 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) | |
13894 | ||
13895 | def SetRelationship(*args, **kwargs): | |
13896 | """SetRelationship(self, int r)""" | |
13897 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) | |
13898 | ||
13899 | def ResetIfWin(*args, **kwargs): | |
13900 | """ | |
13901 | ResetIfWin(self, Window otherW) -> bool | |
13902 | ||
13903 | Reset constraint if it mentions otherWin | |
13904 | """ | |
13905 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) | |
13906 | ||
13907 | def SatisfyConstraint(*args, **kwargs): | |
13908 | """ | |
13909 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool | |
13910 | ||
13911 | Try to satisfy constraint | |
13912 | """ | |
13913 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) | |
13914 | ||
13915 | def GetEdge(*args, **kwargs): | |
13916 | """ | |
13917 | GetEdge(self, int which, Window thisWin, Window other) -> int | |
13918 | ||
13919 | Get the value of this edge or dimension, or if this | |
13920 | is not determinable, -1. | |
13921 | """ | |
13922 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) | |
13923 | ||
13924 | Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`") | |
13925 | Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`") | |
13926 | MyEdge = property(GetMyEdge,doc="See `GetMyEdge`") | |
13927 | OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`") | |
13928 | OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`") | |
13929 | Percent = property(GetPercent,doc="See `GetPercent`") | |
13930 | Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`") | |
13931 | Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`") | |
13932 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint) | |
13933 | ||
13934 | class LayoutConstraints(Object): | |
13935 | """ | |
13936 | **Note:** constraints are now deprecated and you should use sizers | |
13937 | instead. | |
13938 | ||
13939 | Objects of this class can be associated with a window to define its | |
13940 | layout constraints, with respect to siblings or its parent. | |
13941 | ||
13942 | The class consists of the following eight constraints of class | |
13943 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
13944 | directly to set the appropriate constraints. | |
13945 | ||
13946 | * left: represents the left hand edge of the window | |
13947 | * right: represents the right hand edge of the window | |
13948 | * top: represents the top edge of the window | |
13949 | * bottom: represents the bottom edge of the window | |
13950 | * width: represents the width of the window | |
13951 | * height: represents the height of the window | |
13952 | * centreX: represents the horizontal centre point of the window | |
13953 | * centreY: represents the vertical centre point of the window | |
13954 | ||
13955 | Most constraints are initially set to have the relationship | |
13956 | wxUnconstrained, which means that their values should be calculated by | |
13957 | looking at known constraints. The exceptions are width and height, | |
13958 | which are set to wxAsIs to ensure that if the user does not specify a | |
13959 | constraint, the existing width and height will be used, to be | |
13960 | compatible with panel items which often have take a default size. If | |
13961 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
13962 | ||
13963 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
13964 | ||
13965 | """ | |
13966 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
13967 | __repr__ = _swig_repr | |
13968 | left = property(_core_.LayoutConstraints_left_get) | |
13969 | top = property(_core_.LayoutConstraints_top_get) | |
13970 | right = property(_core_.LayoutConstraints_right_get) | |
13971 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
13972 | width = property(_core_.LayoutConstraints_width_get) | |
13973 | height = property(_core_.LayoutConstraints_height_get) | |
13974 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
13975 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
13976 | def __init__(self, *args, **kwargs): | |
13977 | """__init__(self) -> LayoutConstraints""" | |
13978 | _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs)) | |
13979 | __swig_destroy__ = _core_.delete_LayoutConstraints | |
13980 | __del__ = lambda self : None; | |
13981 | def SatisfyConstraints(*args, **kwargs): | |
13982 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" | |
13983 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) | |
13984 | ||
13985 | def AreSatisfied(*args, **kwargs): | |
13986 | """AreSatisfied(self) -> bool""" | |
13987 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) | |
13988 | ||
13989 | _core_.LayoutConstraints_swigregister(LayoutConstraints) | |
13990 | ||
13991 | #---------------------------------------------------------------------------- | |
13992 | ||
13993 | # Use Python's bool constants if available, make some if not | |
13994 | try: | |
13995 | True | |
13996 | except NameError: | |
13997 | __builtins__.True = 1==1 | |
13998 | __builtins__.False = 1==0 | |
13999 | def bool(value): return not not value | |
14000 | __builtins__.bool = bool | |
14001 | ||
14002 | ||
14003 | ||
14004 | # workarounds for bad wxRTTI names | |
14005 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
14006 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
14007 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
14008 | ||
14009 | ||
14010 | #---------------------------------------------------------------------------- | |
14011 | # Load version numbers from __version__... Ensure that major and minor | |
14012 | # versions are the same for both wxPython and wxWidgets. | |
14013 | ||
14014 | from __version__ import * | |
14015 | __version__ = VERSION_STRING | |
14016 | ||
14017 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" | |
14018 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
14019 | if RELEASE_VERSION != _core_.RELEASE_VERSION: | |
14020 | import warnings | |
14021 | warnings.warn("wxPython/wxWidgets release number mismatch") | |
14022 | ||
14023 | ||
14024 | def version(): | |
14025 | """Returns a string containing version and port info""" | |
14026 | ctype = wx.USE_UNICODE and 'unicode' or 'ansi' | |
14027 | if wx.Platform == '__WXMSW__': | |
14028 | port = 'msw' | |
14029 | elif wx.Platform == '__WXMAC__': | |
14030 | port = 'mac' | |
14031 | elif wx.Platform == '__WXGTK__': | |
14032 | port = 'gtk' | |
14033 | if 'gtk2' in wx.PlatformInfo: | |
14034 | port = 'gtk2' | |
14035 | else: | |
14036 | port = '?' | |
14037 | ||
14038 | return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype) | |
14039 | ||
14040 | ||
14041 | #---------------------------------------------------------------------------- | |
14042 | ||
14043 | # Set wxPython's default string<-->unicode conversion encoding from | |
14044 | # the locale, but only if Python's default hasn't been changed. (We | |
14045 | # assume that if the user has customized it already then that is the | |
14046 | # encoding we need to use as well.) | |
14047 | # | |
14048 | # The encoding selected here is used when string or unicode objects | |
14049 | # need to be converted in order to pass them to wxWidgets. Please be | |
14050 | # aware that the default encoding within the same locale may be | |
14051 | # slightly different on different platforms. For example, please see | |
14052 | # http://www.alanwood.net/demos/charsetdiffs.html for differences | |
14053 | # between the common latin/roman encodings. | |
14054 | ||
14055 | default = _sys.getdefaultencoding() | |
14056 | if default == 'ascii': | |
14057 | import locale | |
14058 | import codecs | |
14059 | try: | |
14060 | if hasattr(locale, 'getpreferredencoding'): | |
14061 | default = locale.getpreferredencoding() | |
14062 | else: | |
14063 | default = locale.getdefaultlocale()[1] | |
14064 | codecs.lookup(default) | |
14065 | except (ValueError, LookupError, TypeError): | |
14066 | default = _sys.getdefaultencoding() | |
14067 | del locale | |
14068 | del codecs | |
14069 | if default: | |
14070 | wx.SetDefaultPyEncoding(default) | |
14071 | del default | |
14072 | ||
14073 | #---------------------------------------------------------------------------- | |
14074 | ||
14075 | class PyDeadObjectError(AttributeError): | |
14076 | pass | |
14077 | ||
14078 | class _wxPyDeadObject(object): | |
14079 | """ | |
14080 | Instances of wx objects that are OOR capable will have their __class__ | |
14081 | changed to this class when the C++ object is deleted. This should help | |
14082 | prevent crashes due to referencing a bogus C++ pointer. | |
14083 | """ | |
14084 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
14085 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
14086 | ||
14087 | def __repr__(self): | |
14088 | if not hasattr(self, "_name"): | |
14089 | self._name = "[unknown]" | |
14090 | return self.reprStr % self._name | |
14091 | ||
14092 | def __getattr__(self, *args): | |
14093 | if not hasattr(self, "_name"): | |
14094 | self._name = "[unknown]" | |
14095 | raise PyDeadObjectError(self.attrStr % self._name) | |
14096 | ||
14097 | def __nonzero__(self): | |
14098 | return 0 | |
14099 | ||
14100 | ||
14101 | ||
14102 | class PyUnbornObjectError(AttributeError): | |
14103 | pass | |
14104 | ||
14105 | class _wxPyUnbornObject(object): | |
14106 | """ | |
14107 | Some stock objects are created when the wx._core module is | |
14108 | imported, but their C++ instance is not created until the wx.App | |
14109 | object is created and initialized. These object instances will | |
14110 | temporarily have their __class__ changed to this class so an | |
14111 | exception will be raised if they are used before the C++ instance | |
14112 | is ready. | |
14113 | """ | |
14114 | ||
14115 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
14116 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
14117 | ||
14118 | def __repr__(self): | |
14119 | #if not hasattr(self, "_name"): | |
14120 | # self._name = "[unknown]" | |
14121 | return self.reprStr #% self._name | |
14122 | ||
14123 | def __getattr__(self, *args): | |
14124 | #if not hasattr(self, "_name"): | |
14125 | # self._name = "[unknown]" | |
14126 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
14127 | ||
14128 | def __nonzero__(self): | |
14129 | return 0 | |
14130 | ||
14131 | ||
14132 | #---------------------------------------------------------------------------- | |
14133 | ||
14134 | def CallAfter(callable, *args, **kw): | |
14135 | """ | |
14136 | Call the specified function after the current and pending event | |
14137 | handlers have been completed. This is also good for making GUI | |
14138 | method calls from non-GUI threads. Any extra positional or | |
14139 | keyword args are passed on to the callable when it is called. | |
14140 | ||
14141 | :see: `wx.CallLater` | |
14142 | """ | |
14143 | app = wx.GetApp() | |
14144 | assert app is not None, 'No wx.App created yet' | |
14145 | ||
14146 | if not hasattr(app, "_CallAfterId"): | |
14147 | app._CallAfterId = wx.NewEventType() | |
14148 | app.Connect(-1, -1, app._CallAfterId, | |
14149 | lambda event: event.callable(*event.args, **event.kw) ) | |
14150 | evt = wx.PyEvent() | |
14151 | evt.SetEventType(app._CallAfterId) | |
14152 | evt.callable = callable | |
14153 | evt.args = args | |
14154 | evt.kw = kw | |
14155 | wx.PostEvent(app, evt) | |
14156 | ||
14157 | #---------------------------------------------------------------------------- | |
14158 | ||
14159 | ||
14160 | class CallLater: | |
14161 | """ | |
14162 | A convenience class for `wx.Timer`, that calls the given callable | |
14163 | object once after the given amount of milliseconds, passing any | |
14164 | positional or keyword args. The return value of the callable is | |
14165 | availbale after it has been run with the `GetResult` method. | |
14166 | ||
14167 | If you don't need to get the return value or restart the timer | |
14168 | then there is no need to hold a reference to this object. It will | |
14169 | hold a reference to itself while the timer is running (the timer | |
14170 | has a reference to self.Notify) but the cycle will be broken when | |
14171 | the timer completes, automatically cleaning up the wx.CallLater | |
14172 | object. | |
14173 | ||
14174 | :see: `wx.CallAfter` | |
14175 | """ | |
14176 | def __init__(self, millis, callable, *args, **kwargs): | |
14177 | self.millis = millis | |
14178 | self.callable = callable | |
14179 | self.SetArgs(*args, **kwargs) | |
14180 | self.runCount = 0 | |
14181 | self.running = False | |
14182 | self.hasRun = False | |
14183 | self.result = None | |
14184 | self.timer = None | |
14185 | self.Start() | |
14186 | ||
14187 | def __del__(self): | |
14188 | self.Stop() | |
14189 | ||
14190 | ||
14191 | def Start(self, millis=None, *args, **kwargs): | |
14192 | """ | |
14193 | (Re)start the timer | |
14194 | """ | |
14195 | self.hasRun = False | |
14196 | if millis is not None: | |
14197 | self.millis = millis | |
14198 | if args or kwargs: | |
14199 | self.SetArgs(*args, **kwargs) | |
14200 | self.Stop() | |
14201 | self.timer = wx.PyTimer(self.Notify) | |
14202 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
14203 | self.running = True | |
14204 | Restart = Start | |
14205 | ||
14206 | ||
14207 | def Stop(self): | |
14208 | """ | |
14209 | Stop and destroy the timer. | |
14210 | """ | |
14211 | if self.timer is not None: | |
14212 | self.timer.Stop() | |
14213 | self.timer = None | |
14214 | ||
14215 | ||
14216 | def GetInterval(self): | |
14217 | if self.timer is not None: | |
14218 | return self.timer.GetInterval() | |
14219 | else: | |
14220 | return 0 | |
14221 | ||
14222 | ||
14223 | def IsRunning(self): | |
14224 | return self.timer is not None and self.timer.IsRunning() | |
14225 | ||
14226 | ||
14227 | def SetArgs(self, *args, **kwargs): | |
14228 | """ | |
14229 | (Re)set the args passed to the callable object. This is | |
14230 | useful in conjunction with Restart if you want to schedule a | |
14231 | new call to the same callable object but with different | |
14232 | parameters. | |
14233 | """ | |
14234 | self.args = args | |
14235 | self.kwargs = kwargs | |
14236 | ||
14237 | ||
14238 | def HasRun(self): | |
14239 | return self.hasRun | |
14240 | ||
14241 | def GetResult(self): | |
14242 | return self.result | |
14243 | ||
14244 | def Notify(self): | |
14245 | """ | |
14246 | The timer has expired so call the callable. | |
14247 | """ | |
14248 | if self.callable and getattr(self.callable, 'im_self', True): | |
14249 | self.runCount += 1 | |
14250 | self.running = False | |
14251 | self.result = self.callable(*self.args, **self.kwargs) | |
14252 | self.hasRun = True | |
14253 | if not self.running: | |
14254 | # if it wasn't restarted, then cleanup | |
14255 | wx.CallAfter(self.Stop) | |
14256 | ||
14257 | Interval = property(GetInterval) | |
14258 | Result = property(GetResult) | |
14259 | ||
14260 | ||
14261 | class FutureCall(CallLater): | |
14262 | """A compatibility alias for `CallLater`.""" | |
14263 | ||
14264 | #---------------------------------------------------------------------------- | |
14265 | # Control which items in this module should be documented by epydoc. | |
14266 | # We allow only classes and functions, which will help reduce the size | |
14267 | # of the docs by filtering out the zillions of constants, EVT objects, | |
14268 | # and etc that don't make much sense by themselves, but are instead | |
14269 | # documented (or will be) as part of the classes/functions/methods | |
14270 | # where they should be used. | |
14271 | ||
14272 | class __DocFilter: | |
14273 | """ | |
14274 | A filter for epydoc that only allows non-Ptr classes and | |
14275 | functions, in order to reduce the clutter in the API docs. | |
14276 | """ | |
14277 | def __init__(self, globals): | |
14278 | self._globals = globals | |
14279 | ||
14280 | def __call__(self, name): | |
14281 | import types | |
14282 | obj = self._globals.get(name, None) | |
14283 | ||
14284 | # only document classes and function | |
14285 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: | |
14286 | return False | |
14287 | ||
14288 | # skip other things that are private or will be documented as part of somethign else | |
14289 | if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') : | |
14290 | return False | |
14291 | ||
14292 | # skip functions that are duplicates of static functions in a class | |
14293 | if name.find('_') != -1: | |
14294 | cls = self._globals.get(name.split('_')[0], None) | |
14295 | methname = name.split('_')[1] | |
14296 | if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType: | |
14297 | return False | |
14298 | ||
14299 | return True | |
14300 | ||
14301 | #---------------------------------------------------------------------------- | |
14302 | #---------------------------------------------------------------------------- | |
14303 | ||
14304 | # Import other modules in this package that should show up in the | |
14305 | # "core" wx namespace | |
14306 | from _gdi import * | |
14307 | from _windows import * | |
14308 | from _controls import * | |
14309 | from _misc import * | |
14310 | ||
14311 | #---------------------------------------------------------------------------- | |
14312 | #---------------------------------------------------------------------------- | |
14313 | ||
14314 | ||
14315 |