]>
Commit | Line | Data |
---|---|---|
1bd55598 | 1 | # This file was created automatically by SWIG 1.3.29. |
d55e5bfc RD |
2 | # Don't modify this file, modify the SWIG interface instead. |
3 | ||
5b5c9bc7 | 4 | import _core_ |
1bd55598 RD |
5 | import new |
6 | new_instancemethod = new.instancemethod | |
36ed4f51 | 7 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1): |
1bd55598 | 8 | if (name == "thisown"): return self.this.own(value) |
36ed4f51 | 9 | if (name == "this"): |
1bd55598 RD |
10 | if type(value).__name__ == 'PySwigObject': |
11 | self.__dict__[name] = value | |
36ed4f51 RD |
12 | return |
13 | method = class_type.__swig_setmethods__.get(name,None) | |
14 | if method: return method(self,value) | |
1bd55598 | 15 | if (not static) or hasattr(self,name): |
36ed4f51 RD |
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): | |
1bd55598 | 24 | if (name == "thisown"): return self.this.own() |
36ed4f51 RD |
25 | method = class_type.__swig_getmethods__.get(name,None) |
26 | if method: return method(self) | |
27 | raise AttributeError,name | |
28 | ||
1bd55598 RD |
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 | ||
36ed4f51 RD |
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): | |
1bd55598 RD |
46 | if (name == "thisown"): return self.this.own(value) |
47 | if hasattr(self,name) or (name == "this"): | |
36ed4f51 RD |
48 | set(self,name,value) |
49 | else: | |
50 | raise AttributeError("You cannot add attributes to %s" % self) | |
51 | return set_attr | |
52 | ||
53 | ||
d55e5bfc RD |
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 | ||
d6c14a4c RD |
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 | ||
5b5c9bc7 RD |
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 | |
6d88e192 | 96 | DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE |
5b5c9bc7 RD |
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 | |
092f0ed7 | 105 | WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK |
5b5c9bc7 RD |
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 | PROCESS_ENTER = _core_.PROCESS_ENTER | |
120 | PASSWORD = _core_.PASSWORD | |
121 | CB_SIMPLE = _core_.CB_SIMPLE | |
122 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
123 | CB_SORT = _core_.CB_SORT | |
124 | CB_READONLY = _core_.CB_READONLY | |
125 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
126 | RA_VERTICAL = _core_.RA_VERTICAL | |
127 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
128 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
129 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX | |
130 | RB_GROUP = _core_.RB_GROUP | |
131 | RB_SINGLE = _core_.RB_SINGLE | |
132 | SB_HORIZONTAL = _core_.SB_HORIZONTAL | |
133 | SB_VERTICAL = _core_.SB_VERTICAL | |
134 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX | |
135 | ST_SIZEGRIP = _core_.ST_SIZEGRIP | |
136 | ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE | |
e9d6f3a4 RD |
137 | ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE |
138 | ST_DOTS_END = _core_.ST_DOTS_END | |
5b5c9bc7 RD |
139 | FLOOD_SURFACE = _core_.FLOOD_SURFACE |
140 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
141 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
142 | WINDING_RULE = _core_.WINDING_RULE | |
143 | TOOL_TOP = _core_.TOOL_TOP | |
144 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
145 | TOOL_LEFT = _core_.TOOL_LEFT | |
146 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
147 | OK = _core_.OK | |
148 | YES_NO = _core_.YES_NO | |
149 | CANCEL = _core_.CANCEL | |
150 | YES = _core_.YES | |
151 | NO = _core_.NO | |
152 | NO_DEFAULT = _core_.NO_DEFAULT | |
153 | YES_DEFAULT = _core_.YES_DEFAULT | |
154 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION | |
155 | ICON_HAND = _core_.ICON_HAND | |
156 | ICON_QUESTION = _core_.ICON_QUESTION | |
157 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
158 | ICON_STOP = _core_.ICON_STOP | |
159 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
160 | ICON_MASK = _core_.ICON_MASK | |
161 | ICON_WARNING = _core_.ICON_WARNING | |
162 | ICON_ERROR = _core_.ICON_ERROR | |
163 | FORWARD = _core_.FORWARD | |
164 | BACKWARD = _core_.BACKWARD | |
165 | RESET = _core_.RESET | |
166 | HELP = _core_.HELP | |
167 | MORE = _core_.MORE | |
168 | SETUP = _core_.SETUP | |
169 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
170 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
171 | SIZE_AUTO = _core_.SIZE_AUTO | |
172 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
173 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
943e8dfd | 174 | SIZE_FORCE = _core_.SIZE_FORCE |
5b5c9bc7 RD |
175 | PORTRAIT = _core_.PORTRAIT |
176 | LANDSCAPE = _core_.LANDSCAPE | |
177 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
178 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
179 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
180 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
181 | ID_ANY = _core_.ID_ANY | |
182 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
943e8dfd | 183 | ID_NONE = _core_.ID_NONE |
5b5c9bc7 RD |
184 | ID_LOWEST = _core_.ID_LOWEST |
185 | ID_OPEN = _core_.ID_OPEN | |
186 | ID_CLOSE = _core_.ID_CLOSE | |
187 | ID_NEW = _core_.ID_NEW | |
188 | ID_SAVE = _core_.ID_SAVE | |
189 | ID_SAVEAS = _core_.ID_SAVEAS | |
190 | ID_REVERT = _core_.ID_REVERT | |
191 | ID_EXIT = _core_.ID_EXIT | |
192 | ID_UNDO = _core_.ID_UNDO | |
193 | ID_REDO = _core_.ID_REDO | |
194 | ID_HELP = _core_.ID_HELP | |
195 | ID_PRINT = _core_.ID_PRINT | |
196 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
fc46b7f3 | 197 | ID_PAGE_SETUP = _core_.ID_PAGE_SETUP |
5b5c9bc7 RD |
198 | ID_PREVIEW = _core_.ID_PREVIEW |
199 | ID_ABOUT = _core_.ID_ABOUT | |
200 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
201 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
202 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
203 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
1eeb270e RD |
204 | ID_HELP_INDEX = _core_.ID_HELP_INDEX |
205 | ID_HELP_SEARCH = _core_.ID_HELP_SEARCH | |
5b5c9bc7 RD |
206 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL |
207 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
208 | ID_CUT = _core_.ID_CUT | |
209 | ID_COPY = _core_.ID_COPY | |
210 | ID_PASTE = _core_.ID_PASTE | |
211 | ID_CLEAR = _core_.ID_CLEAR | |
212 | ID_FIND = _core_.ID_FIND | |
213 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
214 | ID_SELECTALL = _core_.ID_SELECTALL | |
215 | ID_DELETE = _core_.ID_DELETE | |
216 | ID_REPLACE = _core_.ID_REPLACE | |
217 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
218 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
219 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
220 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
221 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
222 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
223 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
224 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
225 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
226 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
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 | |
5b5c9bc7 RD |
278 | PD_AUTO_HIDE = _core_.PD_AUTO_HIDE |
279 | PD_APP_MODAL = _core_.PD_APP_MODAL | |
280 | PD_CAN_ABORT = _core_.PD_CAN_ABORT | |
281 | PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME | |
282 | PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME | |
283 | PD_REMAINING_TIME = _core_.PD_REMAINING_TIME | |
284 | PD_SMOOTH = _core_.PD_SMOOTH | |
285 | PD_CAN_SKIP = _core_.PD_CAN_SKIP | |
5b5c9bc7 RD |
286 | MENU_TEAROFF = _core_.MENU_TEAROFF |
287 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
288 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
289 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
290 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
291 | LI_VERTICAL = _core_.LI_VERTICAL | |
292 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
293 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
294 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
295 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
296 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
297 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
298 | MM_TEXT = _core_.MM_TEXT | |
299 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
300 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
301 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
302 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
303 | MM_TWIPS = _core_.MM_TWIPS | |
304 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
305 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
306 | MM_POINTS = _core_.MM_POINTS | |
307 | MM_METRIC = _core_.MM_METRIC | |
308 | CENTRE = _core_.CENTRE | |
309 | CENTER = _core_.CENTER | |
310 | HORIZONTAL = _core_.HORIZONTAL | |
311 | VERTICAL = _core_.VERTICAL | |
312 | BOTH = _core_.BOTH | |
313 | LEFT = _core_.LEFT | |
314 | RIGHT = _core_.RIGHT | |
315 | UP = _core_.UP | |
316 | DOWN = _core_.DOWN | |
317 | TOP = _core_.TOP | |
318 | BOTTOM = _core_.BOTTOM | |
319 | NORTH = _core_.NORTH | |
320 | SOUTH = _core_.SOUTH | |
321 | WEST = _core_.WEST | |
322 | EAST = _core_.EAST | |
323 | ALL = _core_.ALL | |
324 | ALIGN_NOT = _core_.ALIGN_NOT | |
325 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
326 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
327 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
328 | ALIGN_TOP = _core_.ALIGN_TOP | |
329 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
330 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
331 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
332 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
333 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
334 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
335 | ALIGN_MASK = _core_.ALIGN_MASK | |
336 | STRETCH_NOT = _core_.STRETCH_NOT | |
337 | SHRINK = _core_.SHRINK | |
338 | GROW = _core_.GROW | |
339 | EXPAND = _core_.EXPAND | |
340 | SHAPED = _core_.SHAPED | |
341 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
342 | TILE = _core_.TILE | |
343 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
344 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
345 | BORDER_NONE = _core_.BORDER_NONE | |
346 | BORDER_STATIC = _core_.BORDER_STATIC | |
347 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
348 | BORDER_RAISED = _core_.BORDER_RAISED | |
349 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
350 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
351 | BORDER_MASK = _core_.BORDER_MASK | |
352 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM | |
353 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
354 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
355 | DEFAULT = _core_.DEFAULT | |
356 | DECORATIVE = _core_.DECORATIVE | |
357 | ROMAN = _core_.ROMAN | |
358 | SCRIPT = _core_.SCRIPT | |
359 | SWISS = _core_.SWISS | |
360 | MODERN = _core_.MODERN | |
361 | TELETYPE = _core_.TELETYPE | |
362 | VARIABLE = _core_.VARIABLE | |
363 | FIXED = _core_.FIXED | |
364 | NORMAL = _core_.NORMAL | |
365 | LIGHT = _core_.LIGHT | |
366 | BOLD = _core_.BOLD | |
367 | ITALIC = _core_.ITALIC | |
368 | SLANT = _core_.SLANT | |
369 | SOLID = _core_.SOLID | |
370 | DOT = _core_.DOT | |
371 | LONG_DASH = _core_.LONG_DASH | |
372 | SHORT_DASH = _core_.SHORT_DASH | |
373 | DOT_DASH = _core_.DOT_DASH | |
374 | USER_DASH = _core_.USER_DASH | |
375 | TRANSPARENT = _core_.TRANSPARENT | |
376 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
377 | STIPPLE_MASK = _core_.STIPPLE_MASK |
378 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
5b5c9bc7 RD |
379 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH |
380 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
381 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
382 | CROSS_HATCH = _core_.CROSS_HATCH | |
383 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
384 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
385 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
386 | JOIN_MITER = _core_.JOIN_MITER | |
387 | JOIN_ROUND = _core_.JOIN_ROUND | |
388 | CAP_ROUND = _core_.CAP_ROUND | |
389 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
390 | CAP_BUTT = _core_.CAP_BUTT | |
391 | CLEAR = _core_.CLEAR | |
392 | XOR = _core_.XOR | |
393 | INVERT = _core_.INVERT | |
394 | OR_REVERSE = _core_.OR_REVERSE | |
395 | AND_REVERSE = _core_.AND_REVERSE | |
396 | COPY = _core_.COPY | |
397 | AND = _core_.AND | |
398 | AND_INVERT = _core_.AND_INVERT | |
399 | NO_OP = _core_.NO_OP | |
400 | NOR = _core_.NOR | |
401 | EQUIV = _core_.EQUIV | |
402 | SRC_INVERT = _core_.SRC_INVERT | |
403 | OR_INVERT = _core_.OR_INVERT | |
404 | NAND = _core_.NAND | |
405 | OR = _core_.OR | |
406 | SET = _core_.SET | |
407 | WXK_BACK = _core_.WXK_BACK | |
408 | WXK_TAB = _core_.WXK_TAB | |
409 | WXK_RETURN = _core_.WXK_RETURN | |
410 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
411 | WXK_SPACE = _core_.WXK_SPACE | |
412 | WXK_DELETE = _core_.WXK_DELETE | |
413 | WXK_START = _core_.WXK_START | |
414 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
415 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
416 | WXK_CANCEL = _core_.WXK_CANCEL | |
417 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
418 | WXK_CLEAR = _core_.WXK_CLEAR | |
419 | WXK_SHIFT = _core_.WXK_SHIFT | |
420 | WXK_ALT = _core_.WXK_ALT | |
421 | WXK_CONTROL = _core_.WXK_CONTROL | |
422 | WXK_MENU = _core_.WXK_MENU | |
423 | WXK_PAUSE = _core_.WXK_PAUSE | |
424 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
425 | WXK_PRIOR = _core_.WXK_PRIOR | |
426 | WXK_NEXT = _core_.WXK_NEXT | |
427 | WXK_END = _core_.WXK_END | |
428 | WXK_HOME = _core_.WXK_HOME | |
429 | WXK_LEFT = _core_.WXK_LEFT | |
430 | WXK_UP = _core_.WXK_UP | |
431 | WXK_RIGHT = _core_.WXK_RIGHT | |
432 | WXK_DOWN = _core_.WXK_DOWN | |
433 | WXK_SELECT = _core_.WXK_SELECT | |
434 | WXK_PRINT = _core_.WXK_PRINT | |
435 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
436 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
437 | WXK_INSERT = _core_.WXK_INSERT | |
438 | WXK_HELP = _core_.WXK_HELP | |
439 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
440 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
441 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
442 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
443 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
444 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
445 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
446 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
447 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
448 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
449 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
450 | WXK_ADD = _core_.WXK_ADD | |
451 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
452 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
453 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
454 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
455 | WXK_F1 = _core_.WXK_F1 | |
456 | WXK_F2 = _core_.WXK_F2 | |
457 | WXK_F3 = _core_.WXK_F3 | |
458 | WXK_F4 = _core_.WXK_F4 | |
459 | WXK_F5 = _core_.WXK_F5 | |
460 | WXK_F6 = _core_.WXK_F6 | |
461 | WXK_F7 = _core_.WXK_F7 | |
462 | WXK_F8 = _core_.WXK_F8 | |
463 | WXK_F9 = _core_.WXK_F9 | |
464 | WXK_F10 = _core_.WXK_F10 | |
465 | WXK_F11 = _core_.WXK_F11 | |
466 | WXK_F12 = _core_.WXK_F12 | |
467 | WXK_F13 = _core_.WXK_F13 | |
468 | WXK_F14 = _core_.WXK_F14 | |
469 | WXK_F15 = _core_.WXK_F15 | |
470 | WXK_F16 = _core_.WXK_F16 | |
471 | WXK_F17 = _core_.WXK_F17 | |
472 | WXK_F18 = _core_.WXK_F18 | |
473 | WXK_F19 = _core_.WXK_F19 | |
474 | WXK_F20 = _core_.WXK_F20 | |
475 | WXK_F21 = _core_.WXK_F21 | |
476 | WXK_F22 = _core_.WXK_F22 | |
477 | WXK_F23 = _core_.WXK_F23 | |
478 | WXK_F24 = _core_.WXK_F24 | |
479 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
480 | WXK_SCROLL = _core_.WXK_SCROLL | |
481 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
482 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
483 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
484 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
485 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
486 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
487 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
488 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
489 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
490 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
491 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
492 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
493 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
494 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
495 | WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR | |
496 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
497 | WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT | |
498 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
499 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
500 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
501 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
502 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
503 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
504 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
505 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
506 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
507 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
508 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
509 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
510 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
511 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
512 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
513 | WXK_COMMAND = _core_.WXK_COMMAND | |
514 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
515 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
516 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
517 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
518 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
519 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
520 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
521 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
522 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
523 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
524 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
525 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
526 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
527 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
528 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
529 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
530 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
531 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
532 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
533 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
534 | PAPER_NONE = _core_.PAPER_NONE | |
535 | PAPER_LETTER = _core_.PAPER_LETTER | |
536 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
537 | PAPER_A4 = _core_.PAPER_A4 | |
538 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
539 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
540 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
541 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
542 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
543 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
544 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
545 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
546 | PAPER_A3 = _core_.PAPER_A3 | |
547 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
548 | PAPER_A5 = _core_.PAPER_A5 | |
549 | PAPER_B4 = _core_.PAPER_B4 | |
550 | PAPER_B5 = _core_.PAPER_B5 | |
551 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
552 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
553 | PAPER_10X14 = _core_.PAPER_10X14 | |
554 | PAPER_11X17 = _core_.PAPER_11X17 | |
555 | PAPER_NOTE = _core_.PAPER_NOTE | |
556 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
557 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
558 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
559 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
560 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
561 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
562 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
563 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
564 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
565 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
566 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
567 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
568 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
569 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
570 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
571 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
572 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
573 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
574 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
575 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
576 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
577 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
578 | PAPER_9X11 = _core_.PAPER_9X11 | |
579 | PAPER_10X11 = _core_.PAPER_10X11 | |
580 | PAPER_15X11 = _core_.PAPER_15X11 | |
581 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
582 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
583 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
584 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
585 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
586 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
587 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
588 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
589 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
590 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
591 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
592 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
593 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
594 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
595 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
596 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
597 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
598 | PAPER_A2 = _core_.PAPER_A2 | |
599 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
600 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
034e3677 RD |
601 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD |
602 | PAPER_A6 = _core_.PAPER_A6 | |
603 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
604 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
605 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
606 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
607 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
608 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
609 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
610 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
611 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
612 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
613 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
614 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
615 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
616 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
617 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
618 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
619 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
620 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
621 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
622 | PAPER_12X11 = _core_.PAPER_12X11 | |
623 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
624 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
625 | PAPER_P16K = _core_.PAPER_P16K | |
626 | PAPER_P32K = _core_.PAPER_P32K | |
627 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
628 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
629 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
630 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
631 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
632 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
633 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
634 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
635 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
636 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
637 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
638 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
639 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
640 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
641 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
642 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
643 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
644 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
645 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
646 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
647 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
648 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
649 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
650 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
5b5c9bc7 RD |
651 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX |
652 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
653 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
654 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
655 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
656 | ITEM_CHECK = _core_.ITEM_CHECK | |
657 | ITEM_RADIO = _core_.ITEM_RADIO | |
658 | ITEM_MAX = _core_.ITEM_MAX | |
659 | HT_NOWHERE = _core_.HT_NOWHERE | |
660 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
661 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
662 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
663 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
664 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
665 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
666 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
667 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
668 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
669 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
670 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
671 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
672 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
673 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
674 | HT_MAX = _core_.HT_MAX | |
675 | MOD_NONE = _core_.MOD_NONE | |
676 | MOD_ALT = _core_.MOD_ALT | |
677 | MOD_CONTROL = _core_.MOD_CONTROL | |
943e8dfd | 678 | MOD_ALTGR = _core_.MOD_ALTGR |
5b5c9bc7 | 679 | MOD_SHIFT = _core_.MOD_SHIFT |
943e8dfd | 680 | MOD_META = _core_.MOD_META |
5b5c9bc7 | 681 | MOD_WIN = _core_.MOD_WIN |
943e8dfd RD |
682 | MOD_CMD = _core_.MOD_CMD |
683 | MOD_ALL = _core_.MOD_ALL | |
5b5c9bc7 RD |
684 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE |
685 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
686 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
d55e5bfc RD |
687 | #--------------------------------------------------------------------------- |
688 | ||
5b5c9bc7 | 689 | class Object(object): |
d55e5bfc RD |
690 | """ |
691 | The base class for most wx objects, although in wxPython not | |
692 | much functionality is needed nor exposed. | |
693 | """ | |
1bd55598 RD |
694 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
695 | def __init__(self): raise AttributeError, "No constructor defined" | |
696 | __repr__ = _swig_repr | |
d55e5bfc RD |
697 | def GetClassName(*args, **kwargs): |
698 | """ | |
5b5c9bc7 | 699 | GetClassName(self) -> String |
d55e5bfc RD |
700 | |
701 | Returns the class name of the C++ class using wxRTTI. | |
702 | """ | |
5b5c9bc7 | 703 | return _core_.Object_GetClassName(*args, **kwargs) |
d55e5bfc RD |
704 | |
705 | def Destroy(*args, **kwargs): | |
706 | """ | |
707 | Destroy(self) | |
708 | ||
709 | Deletes the C++ object this Python object is a proxy for. | |
710 | """ | |
7e08d4ef RD |
711 | val = _core_.Object_Destroy(*args, **kwargs) |
712 | args[0].thisown = 0 | |
713 | return val | |
d55e5bfc | 714 | |
2131d850 | 715 | _core_.Object_swigregister(Object) |
5b5c9bc7 | 716 | _wxPySetDictionary = _core_._wxPySetDictionary |
5b5c9bc7 | 717 | cvar = _core_.cvar |
d55e5bfc RD |
718 | EmptyString = cvar.EmptyString |
719 | ||
720 | #--------------------------------------------------------------------------- | |
721 | ||
5b5c9bc7 RD |
722 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID |
723 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
724 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
725 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
726 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
727 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
728 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
729 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
730 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
731 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
732 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
733 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
734 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
735 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
736 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
737 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
738 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
739 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
740 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
741 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
742 | CURSOR_NONE = _core_.CURSOR_NONE | |
743 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
744 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
745 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
746 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
747 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
748 | CURSOR_HAND = _core_.CURSOR_HAND | |
749 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
750 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
751 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
752 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
753 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
754 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
755 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
756 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
757 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
758 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
759 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
760 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
761 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
762 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
763 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
764 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
765 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
766 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
767 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
768 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
769 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
770 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
771 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
772 | CURSOR_MAX = _core_.CURSOR_MAX | |
d55e5bfc RD |
773 | #--------------------------------------------------------------------------- |
774 | ||
5b5c9bc7 | 775 | class Size(object): |
d55e5bfc | 776 | """ |
15817c7e | 777 | wx.Size is a useful data structure used to represent the size of |
1bd55598 RD |
778 | something. It simply contains integer width and height |
779 | properties. In most places in wxPython where a wx.Size is | |
36ed4f51 | 780 | expected a (width, height) tuple can be used instead. |
d55e5bfc | 781 | """ |
1bd55598 RD |
782 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
783 | __repr__ = _swig_repr | |
5b5c9bc7 RD |
784 | width = property(_core_.Size_width_get, _core_.Size_width_set) |
785 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
d55e5bfc | 786 | x = width; y = height |
1bd55598 | 787 | def __init__(self, *args, **kwargs): |
d55e5bfc | 788 | """ |
5b5c9bc7 | 789 | __init__(self, int w=0, int h=0) -> Size |
d55e5bfc RD |
790 | |
791 | Creates a size object. | |
792 | """ | |
1bd55598 RD |
793 | _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs)) |
794 | __swig_destroy__ = _core_.delete_Size | |
795 | __del__ = lambda self : None; | |
d55e5bfc RD |
796 | def __eq__(*args, **kwargs): |
797 | """ | |
e9d6f3a4 | 798 | __eq__(self, PyObject other) -> bool |
d55e5bfc RD |
799 | |
800 | Test for equality of wx.Size objects. | |
801 | """ | |
5b5c9bc7 | 802 | return _core_.Size___eq__(*args, **kwargs) |
d55e5bfc RD |
803 | |
804 | def __ne__(*args, **kwargs): | |
805 | """ | |
e9d6f3a4 | 806 | __ne__(self, PyObject other) -> bool |
d55e5bfc | 807 | |
e9d6f3a4 | 808 | Test for inequality of wx.Size objects. |
d55e5bfc | 809 | """ |
5b5c9bc7 | 810 | return _core_.Size___ne__(*args, **kwargs) |
d55e5bfc RD |
811 | |
812 | def __add__(*args, **kwargs): | |
813 | """ | |
5b5c9bc7 | 814 | __add__(self, Size sz) -> Size |
d55e5bfc RD |
815 | |
816 | Add sz's proprties to this and return the result. | |
817 | """ | |
5b5c9bc7 | 818 | return _core_.Size___add__(*args, **kwargs) |
d55e5bfc RD |
819 | |
820 | def __sub__(*args, **kwargs): | |
821 | """ | |
5b5c9bc7 | 822 | __sub__(self, Size sz) -> Size |
d55e5bfc RD |
823 | |
824 | Subtract sz's properties from this and return the result. | |
825 | """ | |
5b5c9bc7 | 826 | return _core_.Size___sub__(*args, **kwargs) |
d55e5bfc RD |
827 | |
828 | def IncTo(*args, **kwargs): | |
829 | """ | |
5b5c9bc7 | 830 | IncTo(self, Size sz) |
d55e5bfc RD |
831 | |
832 | Increments this object so that both of its dimensions are not less | |
833 | than the corresponding dimensions of the size. | |
834 | """ | |
5b5c9bc7 | 835 | return _core_.Size_IncTo(*args, **kwargs) |
d55e5bfc RD |
836 | |
837 | def DecTo(*args, **kwargs): | |
838 | """ | |
5b5c9bc7 | 839 | DecTo(self, Size sz) |
d55e5bfc RD |
840 | |
841 | Decrements this object so that both of its dimensions are not greater | |
842 | than the corresponding dimensions of the size. | |
843 | """ | |
5b5c9bc7 | 844 | return _core_.Size_DecTo(*args, **kwargs) |
d55e5bfc | 845 | |
1eeb270e RD |
846 | def Scale(*args, **kwargs): |
847 | """ | |
848 | Scale(self, float xscale, float yscale) | |
849 | ||
850 | Scales the dimensions of this object by the given factors. | |
851 | """ | |
852 | return _core_.Size_Scale(*args, **kwargs) | |
853 | ||
d55e5bfc RD |
854 | def Set(*args, **kwargs): |
855 | """ | |
856 | Set(self, int w, int h) | |
857 | ||
858 | Set both width and height. | |
859 | """ | |
5b5c9bc7 | 860 | return _core_.Size_Set(*args, **kwargs) |
d55e5bfc RD |
861 | |
862 | def SetWidth(*args, **kwargs): | |
863 | """SetWidth(self, int w)""" | |
5b5c9bc7 | 864 | return _core_.Size_SetWidth(*args, **kwargs) |
d55e5bfc RD |
865 | |
866 | def SetHeight(*args, **kwargs): | |
867 | """SetHeight(self, int h)""" | |
5b5c9bc7 | 868 | return _core_.Size_SetHeight(*args, **kwargs) |
d55e5bfc RD |
869 | |
870 | def GetWidth(*args, **kwargs): | |
871 | """GetWidth(self) -> int""" | |
5b5c9bc7 | 872 | return _core_.Size_GetWidth(*args, **kwargs) |
d55e5bfc RD |
873 | |
874 | def GetHeight(*args, **kwargs): | |
875 | """GetHeight(self) -> int""" | |
5b5c9bc7 | 876 | return _core_.Size_GetHeight(*args, **kwargs) |
d55e5bfc RD |
877 | |
878 | def IsFullySpecified(*args, **kwargs): | |
879 | """ | |
880 | IsFullySpecified(self) -> bool | |
881 | ||
882 | Returns True if both components of the size are non-default values. | |
883 | """ | |
5b5c9bc7 | 884 | return _core_.Size_IsFullySpecified(*args, **kwargs) |
d55e5bfc RD |
885 | |
886 | def SetDefaults(*args, **kwargs): | |
887 | """ | |
5b5c9bc7 | 888 | SetDefaults(self, Size size) |
d55e5bfc | 889 | |
15817c7e RD |
890 | Combine this size with the other one replacing the default components |
891 | of this object (i.e. equal to -1) with those of the other. | |
d55e5bfc | 892 | """ |
5b5c9bc7 | 893 | return _core_.Size_SetDefaults(*args, **kwargs) |
d55e5bfc RD |
894 | |
895 | def Get(*args, **kwargs): | |
896 | """ | |
897 | Get() -> (width,height) | |
898 | ||
899 | Returns the width and height properties as a tuple. | |
900 | """ | |
5b5c9bc7 | 901 | return _core_.Size_Get(*args, **kwargs) |
d55e5bfc | 902 | |
15817c7e | 903 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
904 | def __str__(self): return str(self.Get()) |
905 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
906 | def __len__(self): return len(self.Get()) | |
907 | def __getitem__(self, index): return self.Get()[index] | |
908 | def __setitem__(self, index, val): | |
909 | if index == 0: self.width = val | |
910 | elif index == 1: self.height = val | |
911 | else: raise IndexError | |
912 | def __nonzero__(self): return self.Get() != (0,0) | |
913 | __safe_for_unpickling__ = True | |
914 | def __reduce__(self): return (wx.Size, self.Get()) | |
915 | ||
2131d850 | 916 | _core_.Size_swigregister(Size) |
d55e5bfc RD |
917 | |
918 | #--------------------------------------------------------------------------- | |
919 | ||
5b5c9bc7 | 920 | class RealPoint(object): |
d55e5bfc | 921 | """ |
15817c7e RD |
922 | A data structure for representing a point or position with floating |
923 | point x and y properties. In wxPython most places that expect a | |
924 | wx.RealPoint can also accept a (x,y) tuple. | |
d55e5bfc | 925 | """ |
1bd55598 RD |
926 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
927 | __repr__ = _swig_repr | |
5b5c9bc7 RD |
928 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
929 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
1bd55598 | 930 | def __init__(self, *args, **kwargs): |
d55e5bfc | 931 | """ |
5b5c9bc7 | 932 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
d55e5bfc RD |
933 | |
934 | Create a wx.RealPoint object | |
935 | """ | |
1bd55598 RD |
936 | _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs)) |
937 | __swig_destroy__ = _core_.delete_RealPoint | |
938 | __del__ = lambda self : None; | |
d55e5bfc RD |
939 | def __eq__(*args, **kwargs): |
940 | """ | |
e9d6f3a4 | 941 | __eq__(self, PyObject other) -> bool |
d55e5bfc RD |
942 | |
943 | Test for equality of wx.RealPoint objects. | |
944 | """ | |
5b5c9bc7 | 945 | return _core_.RealPoint___eq__(*args, **kwargs) |
d55e5bfc RD |
946 | |
947 | def __ne__(*args, **kwargs): | |
948 | """ | |
e9d6f3a4 | 949 | __ne__(self, PyObject other) -> bool |
d55e5bfc RD |
950 | |
951 | Test for inequality of wx.RealPoint objects. | |
952 | """ | |
5b5c9bc7 | 953 | return _core_.RealPoint___ne__(*args, **kwargs) |
d55e5bfc RD |
954 | |
955 | def __add__(*args, **kwargs): | |
956 | """ | |
5b5c9bc7 | 957 | __add__(self, RealPoint pt) -> RealPoint |
d55e5bfc RD |
958 | |
959 | Add pt's proprties to this and return the result. | |
960 | """ | |
5b5c9bc7 | 961 | return _core_.RealPoint___add__(*args, **kwargs) |
d55e5bfc RD |
962 | |
963 | def __sub__(*args, **kwargs): | |
964 | """ | |
5b5c9bc7 | 965 | __sub__(self, RealPoint pt) -> RealPoint |
d55e5bfc RD |
966 | |
967 | Subtract pt's proprties from this and return the result | |
968 | """ | |
5b5c9bc7 | 969 | return _core_.RealPoint___sub__(*args, **kwargs) |
d55e5bfc RD |
970 | |
971 | def Set(*args, **kwargs): | |
972 | """ | |
973 | Set(self, double x, double y) | |
974 | ||
975 | Set both the x and y properties | |
976 | """ | |
5b5c9bc7 | 977 | return _core_.RealPoint_Set(*args, **kwargs) |
d55e5bfc RD |
978 | |
979 | def Get(*args, **kwargs): | |
980 | """ | |
981 | Get() -> (x,y) | |
982 | ||
983 | Return the x and y properties as a tuple. | |
984 | """ | |
5b5c9bc7 | 985 | return _core_.RealPoint_Get(*args, **kwargs) |
d55e5bfc | 986 | |
15817c7e | 987 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
988 | def __str__(self): return str(self.Get()) |
989 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
990 | def __len__(self): return len(self.Get()) | |
991 | def __getitem__(self, index): return self.Get()[index] | |
992 | def __setitem__(self, index, val): | |
993 | if index == 0: self.x = val | |
994 | elif index == 1: self.y = val | |
995 | else: raise IndexError | |
996 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
997 | __safe_for_unpickling__ = True | |
998 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
999 | ||
2131d850 | 1000 | _core_.RealPoint_swigregister(RealPoint) |
d55e5bfc RD |
1001 | |
1002 | #--------------------------------------------------------------------------- | |
1003 | ||
5b5c9bc7 | 1004 | class Point(object): |
d55e5bfc | 1005 | """ |
15817c7e RD |
1006 | A data structure for representing a point or position with integer x |
1007 | and y properties. Most places in wxPython that expect a wx.Point can | |
1008 | also accept a (x,y) tuple. | |
d55e5bfc | 1009 | """ |
1bd55598 RD |
1010 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1011 | __repr__ = _swig_repr | |
5b5c9bc7 RD |
1012 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1013 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
1bd55598 | 1014 | def __init__(self, *args, **kwargs): |
d55e5bfc | 1015 | """ |
5b5c9bc7 | 1016 | __init__(self, int x=0, int y=0) -> Point |
d55e5bfc RD |
1017 | |
1018 | Create a wx.Point object | |
1019 | """ | |
1bd55598 RD |
1020 | _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs)) |
1021 | __swig_destroy__ = _core_.delete_Point | |
1022 | __del__ = lambda self : None; | |
d55e5bfc RD |
1023 | def __eq__(*args, **kwargs): |
1024 | """ | |
e9d6f3a4 | 1025 | __eq__(self, PyObject other) -> bool |
d55e5bfc RD |
1026 | |
1027 | Test for equality of wx.Point objects. | |
1028 | """ | |
5b5c9bc7 | 1029 | return _core_.Point___eq__(*args, **kwargs) |
d55e5bfc RD |
1030 | |
1031 | def __ne__(*args, **kwargs): | |
1032 | """ | |
e9d6f3a4 | 1033 | __ne__(self, PyObject other) -> bool |
d55e5bfc RD |
1034 | |
1035 | Test for inequality of wx.Point objects. | |
1036 | """ | |
5b5c9bc7 | 1037 | return _core_.Point___ne__(*args, **kwargs) |
d55e5bfc RD |
1038 | |
1039 | def __add__(*args, **kwargs): | |
1040 | """ | |
5b5c9bc7 | 1041 | __add__(self, Point pt) -> Point |
d55e5bfc RD |
1042 | |
1043 | Add pt's proprties to this and return the result. | |
1044 | """ | |
5b5c9bc7 | 1045 | return _core_.Point___add__(*args, **kwargs) |
d55e5bfc RD |
1046 | |
1047 | def __sub__(*args, **kwargs): | |
1048 | """ | |
5b5c9bc7 | 1049 | __sub__(self, Point pt) -> Point |
d55e5bfc RD |
1050 | |
1051 | Subtract pt's proprties from this and return the result | |
1052 | """ | |
5b5c9bc7 | 1053 | return _core_.Point___sub__(*args, **kwargs) |
d55e5bfc RD |
1054 | |
1055 | def __iadd__(*args, **kwargs): | |
1056 | """ | |
5b5c9bc7 | 1057 | __iadd__(self, Point pt) -> Point |
d55e5bfc RD |
1058 | |
1059 | Add pt to this object. | |
1060 | """ | |
5b5c9bc7 | 1061 | return _core_.Point___iadd__(*args, **kwargs) |
d55e5bfc RD |
1062 | |
1063 | def __isub__(*args, **kwargs): | |
1064 | """ | |
5b5c9bc7 | 1065 | __isub__(self, Point pt) -> Point |
d55e5bfc RD |
1066 | |
1067 | Subtract pt from this object. | |
1068 | """ | |
5b5c9bc7 | 1069 | return _core_.Point___isub__(*args, **kwargs) |
d55e5bfc RD |
1070 | |
1071 | def Set(*args, **kwargs): | |
1072 | """ | |
1073 | Set(self, long x, long y) | |
1074 | ||
1075 | Set both the x and y properties | |
1076 | """ | |
5b5c9bc7 | 1077 | return _core_.Point_Set(*args, **kwargs) |
d55e5bfc RD |
1078 | |
1079 | def Get(*args, **kwargs): | |
1080 | """ | |
1081 | Get() -> (x,y) | |
1082 | ||
1083 | Return the x and y properties as a tuple. | |
1084 | """ | |
5b5c9bc7 | 1085 | return _core_.Point_Get(*args, **kwargs) |
d55e5bfc | 1086 | |
15817c7e | 1087 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1088 | def __str__(self): return str(self.Get()) |
1089 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1090 | def __len__(self): return len(self.Get()) | |
1091 | def __getitem__(self, index): return self.Get()[index] | |
1092 | def __setitem__(self, index, val): | |
1093 | if index == 0: self.x = val | |
1094 | elif index == 1: self.y = val | |
1095 | else: raise IndexError | |
1096 | def __nonzero__(self): return self.Get() != (0,0) | |
1097 | __safe_for_unpickling__ = True | |
1098 | def __reduce__(self): return (wx.Point, self.Get()) | |
1099 | ||
2131d850 | 1100 | _core_.Point_swigregister(Point) |
d55e5bfc RD |
1101 | |
1102 | #--------------------------------------------------------------------------- | |
1103 | ||
5b5c9bc7 | 1104 | class Rect(object): |
d55e5bfc | 1105 | """ |
15817c7e RD |
1106 | A class for representing and manipulating rectangles. It has x, y, |
1107 | width and height properties. In wxPython most palces that expect a | |
1108 | wx.Rect can also accept a (x,y,width,height) tuple. | |
d55e5bfc | 1109 | """ |
1bd55598 RD |
1110 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1111 | __repr__ = _swig_repr | |
1112 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 1113 | """ |
5b5c9bc7 | 1114 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
d55e5bfc RD |
1115 | |
1116 | Create a new Rect object. | |
1117 | """ | |
1bd55598 RD |
1118 | _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs)) |
1119 | __swig_destroy__ = _core_.delete_Rect | |
1120 | __del__ = lambda self : None; | |
d55e5bfc RD |
1121 | def GetX(*args, **kwargs): |
1122 | """GetX(self) -> int""" | |
5b5c9bc7 | 1123 | return _core_.Rect_GetX(*args, **kwargs) |
d55e5bfc RD |
1124 | |
1125 | def SetX(*args, **kwargs): | |
1126 | """SetX(self, int x)""" | |
5b5c9bc7 | 1127 | return _core_.Rect_SetX(*args, **kwargs) |
d55e5bfc RD |
1128 | |
1129 | def GetY(*args, **kwargs): | |
1130 | """GetY(self) -> int""" | |
5b5c9bc7 | 1131 | return _core_.Rect_GetY(*args, **kwargs) |
d55e5bfc RD |
1132 | |
1133 | def SetY(*args, **kwargs): | |
1134 | """SetY(self, int y)""" | |
5b5c9bc7 | 1135 | return _core_.Rect_SetY(*args, **kwargs) |
d55e5bfc RD |
1136 | |
1137 | def GetWidth(*args, **kwargs): | |
1138 | """GetWidth(self) -> int""" | |
5b5c9bc7 | 1139 | return _core_.Rect_GetWidth(*args, **kwargs) |
d55e5bfc RD |
1140 | |
1141 | def SetWidth(*args, **kwargs): | |
1142 | """SetWidth(self, int w)""" | |
5b5c9bc7 | 1143 | return _core_.Rect_SetWidth(*args, **kwargs) |
d55e5bfc RD |
1144 | |
1145 | def GetHeight(*args, **kwargs): | |
1146 | """GetHeight(self) -> int""" | |
5b5c9bc7 | 1147 | return _core_.Rect_GetHeight(*args, **kwargs) |
d55e5bfc RD |
1148 | |
1149 | def SetHeight(*args, **kwargs): | |
1150 | """SetHeight(self, int h)""" | |
5b5c9bc7 | 1151 | return _core_.Rect_SetHeight(*args, **kwargs) |
d55e5bfc RD |
1152 | |
1153 | def GetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
1154 | """GetPosition(self) -> Point""" |
1155 | return _core_.Rect_GetPosition(*args, **kwargs) | |
d55e5bfc RD |
1156 | |
1157 | def SetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
1158 | """SetPosition(self, Point p)""" |
1159 | return _core_.Rect_SetPosition(*args, **kwargs) | |
d55e5bfc RD |
1160 | |
1161 | def GetSize(*args, **kwargs): | |
5b5c9bc7 RD |
1162 | """GetSize(self) -> Size""" |
1163 | return _core_.Rect_GetSize(*args, **kwargs) | |
d55e5bfc RD |
1164 | |
1165 | def SetSize(*args, **kwargs): | |
5b5c9bc7 RD |
1166 | """SetSize(self, Size s)""" |
1167 | return _core_.Rect_SetSize(*args, **kwargs) | |
d55e5bfc | 1168 | |
aff4cc5c RD |
1169 | def IsEmpty(*args, **kwargs): |
1170 | """IsEmpty(self) -> bool""" | |
5b5c9bc7 | 1171 | return _core_.Rect_IsEmpty(*args, **kwargs) |
aff4cc5c | 1172 | |
d55e5bfc | 1173 | def GetTopLeft(*args, **kwargs): |
5b5c9bc7 RD |
1174 | """GetTopLeft(self) -> Point""" |
1175 | return _core_.Rect_GetTopLeft(*args, **kwargs) | |
d55e5bfc RD |
1176 | |
1177 | def SetTopLeft(*args, **kwargs): | |
5b5c9bc7 RD |
1178 | """SetTopLeft(self, Point p)""" |
1179 | return _core_.Rect_SetTopLeft(*args, **kwargs) | |
d55e5bfc RD |
1180 | |
1181 | def GetBottomRight(*args, **kwargs): | |
5b5c9bc7 RD |
1182 | """GetBottomRight(self) -> Point""" |
1183 | return _core_.Rect_GetBottomRight(*args, **kwargs) | |
d55e5bfc RD |
1184 | |
1185 | def SetBottomRight(*args, **kwargs): | |
5b5c9bc7 RD |
1186 | """SetBottomRight(self, Point p)""" |
1187 | return _core_.Rect_SetBottomRight(*args, **kwargs) | |
d55e5bfc RD |
1188 | |
1189 | def GetLeft(*args, **kwargs): | |
1190 | """GetLeft(self) -> int""" | |
5b5c9bc7 | 1191 | return _core_.Rect_GetLeft(*args, **kwargs) |
d55e5bfc RD |
1192 | |
1193 | def GetTop(*args, **kwargs): | |
1194 | """GetTop(self) -> int""" | |
5b5c9bc7 | 1195 | return _core_.Rect_GetTop(*args, **kwargs) |
d55e5bfc RD |
1196 | |
1197 | def GetBottom(*args, **kwargs): | |
1198 | """GetBottom(self) -> int""" | |
5b5c9bc7 | 1199 | return _core_.Rect_GetBottom(*args, **kwargs) |
d55e5bfc RD |
1200 | |
1201 | def GetRight(*args, **kwargs): | |
1202 | """GetRight(self) -> int""" | |
5b5c9bc7 | 1203 | return _core_.Rect_GetRight(*args, **kwargs) |
d55e5bfc RD |
1204 | |
1205 | def SetLeft(*args, **kwargs): | |
1206 | """SetLeft(self, int left)""" | |
5b5c9bc7 | 1207 | return _core_.Rect_SetLeft(*args, **kwargs) |
d55e5bfc RD |
1208 | |
1209 | def SetRight(*args, **kwargs): | |
1210 | """SetRight(self, int right)""" | |
5b5c9bc7 | 1211 | return _core_.Rect_SetRight(*args, **kwargs) |
d55e5bfc RD |
1212 | |
1213 | def SetTop(*args, **kwargs): | |
1214 | """SetTop(self, int top)""" | |
5b5c9bc7 | 1215 | return _core_.Rect_SetTop(*args, **kwargs) |
d55e5bfc RD |
1216 | |
1217 | def SetBottom(*args, **kwargs): | |
1218 | """SetBottom(self, int bottom)""" | |
5b5c9bc7 | 1219 | return _core_.Rect_SetBottom(*args, **kwargs) |
d55e5bfc RD |
1220 | |
1221 | position = property(GetPosition, SetPosition) | |
1222 | size = property(GetSize, SetSize) | |
1223 | left = property(GetLeft, SetLeft) | |
1224 | right = property(GetRight, SetRight) | |
1225 | top = property(GetTop, SetTop) | |
1226 | bottom = property(GetBottom, SetBottom) | |
1227 | ||
1228 | def Inflate(*args, **kwargs): | |
1229 | """ | |
5b5c9bc7 | 1230 | Inflate(self, int dx, int dy) -> Rect |
d55e5bfc | 1231 | |
091fdbfa RD |
1232 | Increases the size of the rectangle. |
1233 | ||
1234 | The left border is moved farther left and the right border is moved | |
1235 | farther right by ``dx``. The upper border is moved farther up and the | |
1236 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1237 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1238 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1239 | opposite happens: the rectangle size decreases in the respective | |
1240 | direction. | |
1241 | ||
1242 | The change is made to the rectangle inplace, if instead you need a | |
1243 | copy that is inflated, preserving the original then make the copy | |
1244 | first:: | |
1245 | ||
1246 | copy = wx.Rect(*original) | |
1247 | copy.Inflate(10,15) | |
1248 | ||
1249 | ||
d55e5bfc | 1250 | """ |
5b5c9bc7 | 1251 | return _core_.Rect_Inflate(*args, **kwargs) |
d55e5bfc RD |
1252 | |
1253 | def Deflate(*args, **kwargs): | |
1254 | """ | |
5b5c9bc7 | 1255 | Deflate(self, int dx, int dy) -> Rect |
d55e5bfc | 1256 | |
091fdbfa RD |
1257 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1258 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1259 | `Inflate` for a full description. | |
d55e5bfc | 1260 | """ |
5b5c9bc7 | 1261 | return _core_.Rect_Deflate(*args, **kwargs) |
d55e5bfc RD |
1262 | |
1263 | def OffsetXY(*args, **kwargs): | |
1264 | """ | |
1265 | OffsetXY(self, int dx, int dy) | |
1266 | ||
15817c7e RD |
1267 | Moves the rectangle by the specified offset. If dx is positive, the |
1268 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1269 | bottom, otherwise it is moved to the left or top respectively. | |
d55e5bfc | 1270 | """ |
5b5c9bc7 | 1271 | return _core_.Rect_OffsetXY(*args, **kwargs) |
d55e5bfc RD |
1272 | |
1273 | def Offset(*args, **kwargs): | |
1274 | """ | |
5b5c9bc7 | 1275 | Offset(self, Point pt) |
d55e5bfc | 1276 | |
b1fcee84 | 1277 | Same as `OffsetXY` but uses dx,dy from Point |
d55e5bfc | 1278 | """ |
5b5c9bc7 | 1279 | return _core_.Rect_Offset(*args, **kwargs) |
d55e5bfc RD |
1280 | |
1281 | def Intersect(*args, **kwargs): | |
1282 | """ | |
5b5c9bc7 | 1283 | Intersect(self, Rect rect) -> Rect |
d55e5bfc | 1284 | |
5cbf236d | 1285 | Returns the intersectsion of this rectangle and rect. |
d55e5bfc | 1286 | """ |
5b5c9bc7 | 1287 | return _core_.Rect_Intersect(*args, **kwargs) |
d55e5bfc | 1288 | |
5cbf236d RD |
1289 | def Union(*args, **kwargs): |
1290 | """ | |
5b5c9bc7 | 1291 | Union(self, Rect rect) -> Rect |
5cbf236d RD |
1292 | |
1293 | Returns the union of this rectangle and rect. | |
1294 | """ | |
5b5c9bc7 | 1295 | return _core_.Rect_Union(*args, **kwargs) |
5cbf236d | 1296 | |
d55e5bfc RD |
1297 | def __add__(*args, **kwargs): |
1298 | """ | |
5b5c9bc7 | 1299 | __add__(self, Rect rect) -> Rect |
d55e5bfc RD |
1300 | |
1301 | Add the properties of rect to this rectangle and return the result. | |
1302 | """ | |
5b5c9bc7 | 1303 | return _core_.Rect___add__(*args, **kwargs) |
d55e5bfc RD |
1304 | |
1305 | def __iadd__(*args, **kwargs): | |
1306 | """ | |
5b5c9bc7 | 1307 | __iadd__(self, Rect rect) -> Rect |
d55e5bfc RD |
1308 | |
1309 | Add the properties of rect to this rectangle, updating this rectangle. | |
1310 | """ | |
5b5c9bc7 | 1311 | return _core_.Rect___iadd__(*args, **kwargs) |
d55e5bfc RD |
1312 | |
1313 | def __eq__(*args, **kwargs): | |
1314 | """ | |
e9d6f3a4 | 1315 | __eq__(self, PyObject other) -> bool |
d55e5bfc | 1316 | |
e9d6f3a4 | 1317 | Test for equality of wx.Rect objects. |
d55e5bfc | 1318 | """ |
5b5c9bc7 | 1319 | return _core_.Rect___eq__(*args, **kwargs) |
d55e5bfc RD |
1320 | |
1321 | def __ne__(*args, **kwargs): | |
1322 | """ | |
e9d6f3a4 | 1323 | __ne__(self, PyObject other) -> bool |
d55e5bfc | 1324 | |
e9d6f3a4 | 1325 | Test for inequality of wx.Rect objects. |
d55e5bfc | 1326 | """ |
5b5c9bc7 | 1327 | return _core_.Rect___ne__(*args, **kwargs) |
d55e5bfc RD |
1328 | |
1329 | def InsideXY(*args, **kwargs): | |
1330 | """ | |
1331 | InsideXY(self, int x, int y) -> bool | |
1332 | ||
1333 | Return True if the point is (not strcitly) inside the rect. | |
1334 | """ | |
5b5c9bc7 | 1335 | return _core_.Rect_InsideXY(*args, **kwargs) |
d55e5bfc RD |
1336 | |
1337 | def Inside(*args, **kwargs): | |
1338 | """ | |
5b5c9bc7 | 1339 | Inside(self, Point pt) -> bool |
d55e5bfc RD |
1340 | |
1341 | Return True if the point is (not strcitly) inside the rect. | |
1342 | """ | |
5b5c9bc7 | 1343 | return _core_.Rect_Inside(*args, **kwargs) |
d55e5bfc | 1344 | |
fc46b7f3 RD |
1345 | def InsideRect(*args, **kwargs): |
1346 | """ | |
1347 | InsideRect(self, Rect rect) -> bool | |
1348 | ||
1349 | Returns ``True`` if the given rectangle is completely inside this | |
1350 | rectangle or touches its boundary. | |
1351 | """ | |
1352 | return _core_.Rect_InsideRect(*args, **kwargs) | |
1353 | ||
d55e5bfc RD |
1354 | def Intersects(*args, **kwargs): |
1355 | """ | |
5b5c9bc7 | 1356 | Intersects(self, Rect rect) -> bool |
d55e5bfc RD |
1357 | |
1358 | Returns True if the rectangles have a non empty intersection. | |
1359 | """ | |
5b5c9bc7 | 1360 | return _core_.Rect_Intersects(*args, **kwargs) |
d55e5bfc | 1361 | |
b1fcee84 RD |
1362 | def CenterIn(*args, **kwargs): |
1363 | """ | |
1364 | CenterIn(self, Rect r, int dir=BOTH) -> Rect | |
1365 | ||
1366 | Center this rectangle within the one passed to the method, which is | |
1367 | usually, but not necessarily, the larger one. | |
1368 | """ | |
1369 | return _core_.Rect_CenterIn(*args, **kwargs) | |
1370 | ||
1371 | CentreIn = CenterIn | |
5b5c9bc7 RD |
1372 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) |
1373 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1374 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1375 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
d55e5bfc RD |
1376 | def Set(*args, **kwargs): |
1377 | """ | |
1378 | Set(self, int x=0, int y=0, int width=0, int height=0) | |
1379 | ||
1380 | Set all rectangle properties. | |
1381 | """ | |
5b5c9bc7 | 1382 | return _core_.Rect_Set(*args, **kwargs) |
d55e5bfc RD |
1383 | |
1384 | def Get(*args, **kwargs): | |
1385 | """ | |
1386 | Get() -> (x,y,width,height) | |
1387 | ||
1388 | Return the rectangle properties as a tuple. | |
1389 | """ | |
5b5c9bc7 | 1390 | return _core_.Rect_Get(*args, **kwargs) |
d55e5bfc | 1391 | |
15817c7e | 1392 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1393 | def __str__(self): return str(self.Get()) |
1394 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1395 | def __len__(self): return len(self.Get()) | |
1396 | def __getitem__(self, index): return self.Get()[index] | |
1397 | def __setitem__(self, index, val): | |
1398 | if index == 0: self.x = val | |
1399 | elif index == 1: self.y = val | |
1400 | elif index == 2: self.width = val | |
1401 | elif index == 3: self.height = val | |
1402 | else: raise IndexError | |
1403 | def __nonzero__(self): return self.Get() != (0,0,0,0) | |
1404 | __safe_for_unpickling__ = True | |
1405 | def __reduce__(self): return (wx.Rect, self.Get()) | |
1406 | ||
2131d850 | 1407 | _core_.Rect_swigregister(Rect) |
d55e5bfc RD |
1408 | |
1409 | def RectPP(*args, **kwargs): | |
1410 | """ | |
5b5c9bc7 | 1411 | RectPP(Point topLeft, Point bottomRight) -> Rect |
d55e5bfc RD |
1412 | |
1413 | Create a new Rect object from Points representing two corners. | |
1414 | """ | |
5b5c9bc7 | 1415 | val = _core_.new_RectPP(*args, **kwargs) |
d55e5bfc RD |
1416 | return val |
1417 | ||
1418 | def RectPS(*args, **kwargs): | |
1419 | """ | |
5b5c9bc7 | 1420 | RectPS(Point pos, Size size) -> Rect |
d55e5bfc RD |
1421 | |
1422 | Create a new Rect from a position and size. | |
1423 | """ | |
5b5c9bc7 | 1424 | val = _core_.new_RectPS(*args, **kwargs) |
d55e5bfc RD |
1425 | return val |
1426 | ||
070c48b4 RD |
1427 | def RectS(*args, **kwargs): |
1428 | """ | |
5b5c9bc7 | 1429 | RectS(Size size) -> Rect |
070c48b4 RD |
1430 | |
1431 | Create a new Rect from a size only. | |
1432 | """ | |
5b5c9bc7 | 1433 | val = _core_.new_RectS(*args, **kwargs) |
070c48b4 RD |
1434 | return val |
1435 | ||
d55e5bfc | 1436 | |
5b5c9bc7 | 1437 | def IntersectRect(*args, **kwargs): |
1bd55598 | 1438 | """ |
d55e5bfc RD |
1439 | IntersectRect(Rect r1, Rect r2) -> Rect |
1440 | ||
1441 | Calculate and return the intersection of r1 and r2. | |
1442 | """ | |
1bd55598 | 1443 | return _core_.IntersectRect(*args, **kwargs) |
d55e5bfc RD |
1444 | #--------------------------------------------------------------------------- |
1445 | ||
5b5c9bc7 | 1446 | class Point2D(object): |
15817c7e RD |
1447 | """ |
1448 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1449 | with floating point values. | |
1450 | """ | |
1bd55598 RD |
1451 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1452 | __repr__ = _swig_repr | |
1453 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 1454 | """ |
5b5c9bc7 | 1455 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
d55e5bfc RD |
1456 | |
1457 | Create a w.Point2D object. | |
1458 | """ | |
1bd55598 | 1459 | _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs)) |
d55e5bfc | 1460 | def GetFloor(*args, **kwargs): |
fd2dc343 RD |
1461 | """ |
1462 | GetFloor() -> (x,y) | |
1463 | ||
1464 | Convert to integer | |
1465 | """ | |
5b5c9bc7 | 1466 | return _core_.Point2D_GetFloor(*args, **kwargs) |
d55e5bfc RD |
1467 | |
1468 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1469 | """ |
1470 | GetRounded() -> (x,y) | |
1471 | ||
1472 | Convert to integer | |
1473 | """ | |
5b5c9bc7 | 1474 | return _core_.Point2D_GetRounded(*args, **kwargs) |
d55e5bfc RD |
1475 | |
1476 | def GetVectorLength(*args, **kwargs): | |
1477 | """GetVectorLength(self) -> double""" | |
5b5c9bc7 | 1478 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
d55e5bfc RD |
1479 | |
1480 | def GetVectorAngle(*args, **kwargs): | |
1481 | """GetVectorAngle(self) -> double""" | |
5b5c9bc7 | 1482 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
d55e5bfc RD |
1483 | |
1484 | def SetVectorLength(*args, **kwargs): | |
1485 | """SetVectorLength(self, double length)""" | |
5b5c9bc7 | 1486 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
d55e5bfc RD |
1487 | |
1488 | def SetVectorAngle(*args, **kwargs): | |
1489 | """SetVectorAngle(self, double degrees)""" | |
5b5c9bc7 | 1490 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
d55e5bfc RD |
1491 | |
1492 | def SetPolarCoordinates(self, angle, length): | |
1493 | self.SetVectorLength(length) | |
1494 | self.SetVectorAngle(angle) | |
1495 | def Normalize(self): | |
1496 | self.SetVectorLength(1.0) | |
1497 | ||
1498 | def GetDistance(*args, **kwargs): | |
5b5c9bc7 RD |
1499 | """GetDistance(self, Point2D pt) -> double""" |
1500 | return _core_.Point2D_GetDistance(*args, **kwargs) | |
d55e5bfc RD |
1501 | |
1502 | def GetDistanceSquare(*args, **kwargs): | |
5b5c9bc7 RD |
1503 | """GetDistanceSquare(self, Point2D pt) -> double""" |
1504 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) | |
d55e5bfc RD |
1505 | |
1506 | def GetDotProduct(*args, **kwargs): | |
5b5c9bc7 RD |
1507 | """GetDotProduct(self, Point2D vec) -> double""" |
1508 | return _core_.Point2D_GetDotProduct(*args, **kwargs) | |
d55e5bfc RD |
1509 | |
1510 | def GetCrossProduct(*args, **kwargs): | |
5b5c9bc7 RD |
1511 | """GetCrossProduct(self, Point2D vec) -> double""" |
1512 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) | |
d55e5bfc RD |
1513 | |
1514 | def __neg__(*args, **kwargs): | |
1515 | """ | |
5b5c9bc7 | 1516 | __neg__(self) -> Point2D |
d55e5bfc RD |
1517 | |
1518 | the reflection of this point | |
1519 | """ | |
5b5c9bc7 | 1520 | return _core_.Point2D___neg__(*args, **kwargs) |
d55e5bfc RD |
1521 | |
1522 | def __iadd__(*args, **kwargs): | |
5b5c9bc7 RD |
1523 | """__iadd__(self, Point2D pt) -> Point2D""" |
1524 | return _core_.Point2D___iadd__(*args, **kwargs) | |
d55e5bfc RD |
1525 | |
1526 | def __isub__(*args, **kwargs): | |
5b5c9bc7 RD |
1527 | """__isub__(self, Point2D pt) -> Point2D""" |
1528 | return _core_.Point2D___isub__(*args, **kwargs) | |
d55e5bfc RD |
1529 | |
1530 | def __imul__(*args, **kwargs): | |
5b5c9bc7 RD |
1531 | """__imul__(self, Point2D pt) -> Point2D""" |
1532 | return _core_.Point2D___imul__(*args, **kwargs) | |
d55e5bfc RD |
1533 | |
1534 | def __idiv__(*args, **kwargs): | |
5b5c9bc7 RD |
1535 | """__idiv__(self, Point2D pt) -> Point2D""" |
1536 | return _core_.Point2D___idiv__(*args, **kwargs) | |
d55e5bfc RD |
1537 | |
1538 | def __eq__(*args, **kwargs): | |
1539 | """ | |
e9d6f3a4 | 1540 | __eq__(self, PyObject other) -> bool |
d55e5bfc | 1541 | |
e9d6f3a4 | 1542 | Test for equality of wx.Point2D objects. |
d55e5bfc | 1543 | """ |
5b5c9bc7 | 1544 | return _core_.Point2D___eq__(*args, **kwargs) |
d55e5bfc RD |
1545 | |
1546 | def __ne__(*args, **kwargs): | |
1547 | """ | |
e9d6f3a4 | 1548 | __ne__(self, PyObject other) -> bool |
d55e5bfc | 1549 | |
e9d6f3a4 | 1550 | Test for inequality of wx.Point2D objects. |
d55e5bfc | 1551 | """ |
5b5c9bc7 | 1552 | return _core_.Point2D___ne__(*args, **kwargs) |
d55e5bfc | 1553 | |
5b5c9bc7 RD |
1554 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1555 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
d55e5bfc RD |
1556 | def Set(*args, **kwargs): |
1557 | """Set(self, double x=0, double y=0)""" | |
5b5c9bc7 | 1558 | return _core_.Point2D_Set(*args, **kwargs) |
d55e5bfc RD |
1559 | |
1560 | def Get(*args, **kwargs): | |
1561 | """ | |
1562 | Get() -> (x,y) | |
1563 | ||
1564 | Return x and y properties as a tuple. | |
1565 | """ | |
5b5c9bc7 | 1566 | return _core_.Point2D_Get(*args, **kwargs) |
d55e5bfc | 1567 | |
15817c7e | 1568 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1569 | def __str__(self): return str(self.Get()) |
1570 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1571 | def __len__(self): return len(self.Get()) | |
1572 | def __getitem__(self, index): return self.Get()[index] | |
1573 | def __setitem__(self, index, val): | |
1574 | if index == 0: self.x = val | |
1575 | elif index == 1: self.y = val | |
1576 | else: raise IndexError | |
1577 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1578 | __safe_for_unpickling__ = True | |
1579 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
1580 | ||
2131d850 | 1581 | _core_.Point2D_swigregister(Point2D) |
d55e5bfc RD |
1582 | |
1583 | def Point2DCopy(*args, **kwargs): | |
1584 | """ | |
5b5c9bc7 | 1585 | Point2DCopy(Point2D pt) -> Point2D |
d55e5bfc RD |
1586 | |
1587 | Create a w.Point2D object. | |
1588 | """ | |
5b5c9bc7 | 1589 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d55e5bfc RD |
1590 | return val |
1591 | ||
1592 | def Point2DFromPoint(*args, **kwargs): | |
1593 | """ | |
5b5c9bc7 | 1594 | Point2DFromPoint(Point pt) -> Point2D |
d55e5bfc RD |
1595 | |
1596 | Create a w.Point2D object. | |
1597 | """ | |
5b5c9bc7 | 1598 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d55e5bfc RD |
1599 | return val |
1600 | ||
1601 | #--------------------------------------------------------------------------- | |
1602 | ||
5b5c9bc7 RD |
1603 | FromStart = _core_.FromStart |
1604 | FromCurrent = _core_.FromCurrent | |
1605 | FromEnd = _core_.FromEnd | |
d55e5bfc | 1606 | class InputStream(object): |
36ed4f51 | 1607 | """Proxy of C++ InputStream class""" |
1bd55598 RD |
1608 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1609 | __repr__ = _swig_repr | |
1610 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 1611 | """__init__(self, PyObject p) -> InputStream""" |
1bd55598 RD |
1612 | _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs)) |
1613 | __swig_destroy__ = _core_.delete_InputStream | |
1614 | __del__ = lambda self : None; | |
d55e5bfc RD |
1615 | def close(*args, **kwargs): |
1616 | """close(self)""" | |
5b5c9bc7 | 1617 | return _core_.InputStream_close(*args, **kwargs) |
d55e5bfc RD |
1618 | |
1619 | def flush(*args, **kwargs): | |
1620 | """flush(self)""" | |
5b5c9bc7 | 1621 | return _core_.InputStream_flush(*args, **kwargs) |
d55e5bfc RD |
1622 | |
1623 | def eof(*args, **kwargs): | |
1624 | """eof(self) -> bool""" | |
5b5c9bc7 | 1625 | return _core_.InputStream_eof(*args, **kwargs) |
d55e5bfc RD |
1626 | |
1627 | def read(*args, **kwargs): | |
1628 | """read(self, int size=-1) -> PyObject""" | |
5b5c9bc7 | 1629 | return _core_.InputStream_read(*args, **kwargs) |
d55e5bfc RD |
1630 | |
1631 | def readline(*args, **kwargs): | |
1632 | """readline(self, int size=-1) -> PyObject""" | |
5b5c9bc7 | 1633 | return _core_.InputStream_readline(*args, **kwargs) |
d55e5bfc RD |
1634 | |
1635 | def readlines(*args, **kwargs): | |
1636 | """readlines(self, int sizehint=-1) -> PyObject""" | |
5b5c9bc7 | 1637 | return _core_.InputStream_readlines(*args, **kwargs) |
d55e5bfc RD |
1638 | |
1639 | def seek(*args, **kwargs): | |
1640 | """seek(self, int offset, int whence=0)""" | |
5b5c9bc7 | 1641 | return _core_.InputStream_seek(*args, **kwargs) |
d55e5bfc RD |
1642 | |
1643 | def tell(*args, **kwargs): | |
1644 | """tell(self) -> int""" | |
5b5c9bc7 | 1645 | return _core_.InputStream_tell(*args, **kwargs) |
d55e5bfc RD |
1646 | |
1647 | def Peek(*args, **kwargs): | |
1648 | """Peek(self) -> char""" | |
5b5c9bc7 | 1649 | return _core_.InputStream_Peek(*args, **kwargs) |
d55e5bfc RD |
1650 | |
1651 | def GetC(*args, **kwargs): | |
1652 | """GetC(self) -> char""" | |
5b5c9bc7 | 1653 | return _core_.InputStream_GetC(*args, **kwargs) |
d55e5bfc RD |
1654 | |
1655 | def LastRead(*args, **kwargs): | |
1656 | """LastRead(self) -> size_t""" | |
5b5c9bc7 | 1657 | return _core_.InputStream_LastRead(*args, **kwargs) |
d55e5bfc RD |
1658 | |
1659 | def CanRead(*args, **kwargs): | |
1660 | """CanRead(self) -> bool""" | |
5b5c9bc7 | 1661 | return _core_.InputStream_CanRead(*args, **kwargs) |
d55e5bfc RD |
1662 | |
1663 | def Eof(*args, **kwargs): | |
1664 | """Eof(self) -> bool""" | |
5b5c9bc7 | 1665 | return _core_.InputStream_Eof(*args, **kwargs) |
d55e5bfc RD |
1666 | |
1667 | def Ungetch(*args, **kwargs): | |
1668 | """Ungetch(self, char c) -> bool""" | |
5b5c9bc7 | 1669 | return _core_.InputStream_Ungetch(*args, **kwargs) |
d55e5bfc RD |
1670 | |
1671 | def SeekI(*args, **kwargs): | |
5b5c9bc7 RD |
1672 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
1673 | return _core_.InputStream_SeekI(*args, **kwargs) | |
d55e5bfc RD |
1674 | |
1675 | def TellI(*args, **kwargs): | |
1676 | """TellI(self) -> long""" | |
5b5c9bc7 | 1677 | return _core_.InputStream_TellI(*args, **kwargs) |
d55e5bfc | 1678 | |
2131d850 | 1679 | _core_.InputStream_swigregister(InputStream) |
5b5c9bc7 RD |
1680 | DefaultPosition = cvar.DefaultPosition |
1681 | DefaultSize = cvar.DefaultSize | |
d55e5bfc | 1682 | |
5b5c9bc7 RD |
1683 | class OutputStream(object): |
1684 | """Proxy of C++ OutputStream class""" | |
1bd55598 RD |
1685 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1686 | def __init__(self): raise AttributeError, "No constructor defined" | |
1687 | __repr__ = _swig_repr | |
d55e5bfc RD |
1688 | def write(*args, **kwargs): |
1689 | """write(self, PyObject obj)""" | |
5b5c9bc7 | 1690 | return _core_.OutputStream_write(*args, **kwargs) |
d55e5bfc | 1691 | |
1bd55598 RD |
1692 | def LastWrite(*args, **kwargs): |
1693 | """LastWrite(self) -> size_t""" | |
1694 | return _core_.OutputStream_LastWrite(*args, **kwargs) | |
d55e5bfc | 1695 | |
2131d850 | 1696 | _core_.OutputStream_swigregister(OutputStream) |
d55e5bfc RD |
1697 | |
1698 | #--------------------------------------------------------------------------- | |
1699 | ||
5b5c9bc7 RD |
1700 | class FSFile(Object): |
1701 | """Proxy of C++ FSFile class""" | |
1bd55598 RD |
1702 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1703 | __repr__ = _swig_repr | |
1704 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 1705 | """ |
5b5c9bc7 RD |
1706 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
1707 | DateTime modif) -> FSFile | |
d55e5bfc | 1708 | """ |
1bd55598 | 1709 | _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs)) |
1bd55598 RD |
1710 | __swig_destroy__ = _core_.delete_FSFile |
1711 | __del__ = lambda self : None; | |
d55e5bfc | 1712 | def GetStream(*args, **kwargs): |
5b5c9bc7 RD |
1713 | """GetStream(self) -> InputStream""" |
1714 | return _core_.FSFile_GetStream(*args, **kwargs) | |
d55e5bfc RD |
1715 | |
1716 | def GetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
1717 | """GetMimeType(self) -> String""" |
1718 | return _core_.FSFile_GetMimeType(*args, **kwargs) | |
d55e5bfc RD |
1719 | |
1720 | def GetLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1721 | """GetLocation(self) -> String""" |
1722 | return _core_.FSFile_GetLocation(*args, **kwargs) | |
d55e5bfc RD |
1723 | |
1724 | def GetAnchor(*args, **kwargs): | |
5b5c9bc7 RD |
1725 | """GetAnchor(self) -> String""" |
1726 | return _core_.FSFile_GetAnchor(*args, **kwargs) | |
d55e5bfc RD |
1727 | |
1728 | def GetModificationTime(*args, **kwargs): | |
5b5c9bc7 RD |
1729 | """GetModificationTime(self) -> DateTime""" |
1730 | return _core_.FSFile_GetModificationTime(*args, **kwargs) | |
d55e5bfc | 1731 | |
2131d850 | 1732 | _core_.FSFile_swigregister(FSFile) |
d55e5bfc RD |
1733 | |
1734 | class CPPFileSystemHandler(object): | |
36ed4f51 | 1735 | """Proxy of C++ CPPFileSystemHandler class""" |
1bd55598 RD |
1736 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1737 | def __init__(self): raise AttributeError, "No constructor defined" | |
1738 | __repr__ = _swig_repr | |
50f151d7 RD |
1739 | __swig_destroy__ = _core_.delete_CPPFileSystemHandler |
1740 | __del__ = lambda self : None; | |
2131d850 | 1741 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler) |
d55e5bfc RD |
1742 | |
1743 | class FileSystemHandler(CPPFileSystemHandler): | |
36ed4f51 | 1744 | """Proxy of C++ FileSystemHandler class""" |
1bd55598 RD |
1745 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1746 | __repr__ = _swig_repr | |
1747 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 1748 | """__init__(self) -> FileSystemHandler""" |
1bd55598 | 1749 | _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs)) |
d55e5bfc RD |
1750 | self._setCallbackInfo(self, FileSystemHandler) |
1751 | ||
1752 | def _setCallbackInfo(*args, **kwargs): | |
1753 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
5b5c9bc7 | 1754 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
1755 | |
1756 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
1757 | """CanOpen(self, String location) -> bool""" |
1758 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1759 | |
1760 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1761 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1762 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1763 | |
1764 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
1765 | """FindFirst(self, String spec, int flags=0) -> String""" |
1766 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
1767 | |
1768 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
1769 | """FindNext(self) -> String""" |
1770 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) | |
d55e5bfc RD |
1771 | |
1772 | def GetProtocol(*args, **kwargs): | |
5b5c9bc7 RD |
1773 | """GetProtocol(self, String location) -> String""" |
1774 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) | |
d55e5bfc RD |
1775 | |
1776 | def GetLeftLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1777 | """GetLeftLocation(self, String location) -> String""" |
1778 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | |
d55e5bfc RD |
1779 | |
1780 | def GetAnchor(*args, **kwargs): | |
5b5c9bc7 RD |
1781 | """GetAnchor(self, String location) -> String""" |
1782 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) | |
d55e5bfc RD |
1783 | |
1784 | def GetRightLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1785 | """GetRightLocation(self, String location) -> String""" |
1786 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) | |
d55e5bfc RD |
1787 | |
1788 | def GetMimeTypeFromExt(*args, **kwargs): | |
5b5c9bc7 RD |
1789 | """GetMimeTypeFromExt(self, String location) -> String""" |
1790 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) | |
d55e5bfc | 1791 | |
2131d850 | 1792 | _core_.FileSystemHandler_swigregister(FileSystemHandler) |
d55e5bfc | 1793 | |
5b5c9bc7 RD |
1794 | class FileSystem(Object): |
1795 | """Proxy of C++ FileSystem class""" | |
1bd55598 RD |
1796 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1797 | __repr__ = _swig_repr | |
1798 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 1799 | """__init__(self) -> FileSystem""" |
1bd55598 RD |
1800 | _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs)) |
1801 | __swig_destroy__ = _core_.delete_FileSystem | |
1802 | __del__ = lambda self : None; | |
d55e5bfc | 1803 | def ChangePathTo(*args, **kwargs): |
5b5c9bc7 RD |
1804 | """ChangePathTo(self, String location, bool is_dir=False)""" |
1805 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) | |
d55e5bfc RD |
1806 | |
1807 | def GetPath(*args, **kwargs): | |
5b5c9bc7 RD |
1808 | """GetPath(self) -> String""" |
1809 | return _core_.FileSystem_GetPath(*args, **kwargs) | |
d55e5bfc RD |
1810 | |
1811 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1812 | """OpenFile(self, String location) -> FSFile""" |
1813 | return _core_.FileSystem_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1814 | |
1815 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
1816 | """FindFirst(self, String spec, int flags=0) -> String""" |
1817 | return _core_.FileSystem_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
1818 | |
1819 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
1820 | """FindNext(self) -> String""" |
1821 | return _core_.FileSystem_FindNext(*args, **kwargs) | |
d55e5bfc RD |
1822 | |
1823 | def AddHandler(*args, **kwargs): | |
d6c14a4c | 1824 | """AddHandler(CPPFileSystemHandler handler)""" |
5b5c9bc7 | 1825 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
d55e5bfc RD |
1826 | |
1827 | AddHandler = staticmethod(AddHandler) | |
1828 | def CleanUpHandlers(*args, **kwargs): | |
d6c14a4c | 1829 | """CleanUpHandlers()""" |
5b5c9bc7 | 1830 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
d55e5bfc RD |
1831 | |
1832 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1833 | def FileNameToURL(*args, **kwargs): | |
5b5c9bc7 RD |
1834 | """FileNameToURL(String filename) -> String""" |
1835 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d55e5bfc RD |
1836 | |
1837 | FileNameToURL = staticmethod(FileNameToURL) | |
b411df4a | 1838 | def URLToFileName(*args, **kwargs): |
5b5c9bc7 RD |
1839 | """URLToFileName(String url) -> String""" |
1840 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
b411df4a RD |
1841 | |
1842 | URLToFileName = staticmethod(URLToFileName) | |
2131d850 | 1843 | _core_.FileSystem_swigregister(FileSystem) |
d55e5bfc | 1844 | |
5b5c9bc7 | 1845 | def FileSystem_AddHandler(*args, **kwargs): |
1bd55598 RD |
1846 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" |
1847 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
d55e5bfc | 1848 | |
1bd55598 RD |
1849 | def FileSystem_CleanUpHandlers(*args): |
1850 | """FileSystem_CleanUpHandlers()""" | |
1851 | return _core_.FileSystem_CleanUpHandlers(*args) | |
d55e5bfc | 1852 | |
5b5c9bc7 | 1853 | def FileSystem_FileNameToURL(*args, **kwargs): |
1bd55598 RD |
1854 | """FileSystem_FileNameToURL(String filename) -> String""" |
1855 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d55e5bfc | 1856 | |
5b5c9bc7 | 1857 | def FileSystem_URLToFileName(*args, **kwargs): |
1bd55598 RD |
1858 | """FileSystem_URLToFileName(String url) -> String""" |
1859 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
b411df4a | 1860 | |
5b5c9bc7 RD |
1861 | class InternetFSHandler(CPPFileSystemHandler): |
1862 | """Proxy of C++ InternetFSHandler class""" | |
1bd55598 RD |
1863 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1864 | __repr__ = _swig_repr | |
1865 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 1866 | """__init__(self) -> InternetFSHandler""" |
1bd55598 | 1867 | _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs)) |
d55e5bfc | 1868 | def CanOpen(*args, **kwargs): |
5b5c9bc7 RD |
1869 | """CanOpen(self, String location) -> bool""" |
1870 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1871 | |
1872 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1873 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1874 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc | 1875 | |
2131d850 | 1876 | _core_.InternetFSHandler_swigregister(InternetFSHandler) |
d55e5bfc | 1877 | |
5b5c9bc7 RD |
1878 | class ZipFSHandler(CPPFileSystemHandler): |
1879 | """Proxy of C++ ZipFSHandler class""" | |
1bd55598 RD |
1880 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1881 | __repr__ = _swig_repr | |
1882 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 1883 | """__init__(self) -> ZipFSHandler""" |
1bd55598 | 1884 | _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs)) |
d55e5bfc | 1885 | def CanOpen(*args, **kwargs): |
5b5c9bc7 RD |
1886 | """CanOpen(self, String location) -> bool""" |
1887 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1888 | |
1889 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1890 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1891 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1892 | |
1893 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
1894 | """FindFirst(self, String spec, int flags=0) -> String""" |
1895 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
1896 | |
1897 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
1898 | """FindNext(self) -> String""" |
1899 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) | |
d55e5bfc | 1900 | |
2131d850 | 1901 | _core_.ZipFSHandler_swigregister(ZipFSHandler) |
d55e5bfc RD |
1902 | |
1903 | ||
1904 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): | |
1bd55598 RD |
1905 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
1906 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
d55e5bfc RD |
1907 | |
1908 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): | |
1bd55598 RD |
1909 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
1910 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
d55e5bfc RD |
1911 | |
1912 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): | |
1bd55598 RD |
1913 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
1914 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
b411df4a RD |
1915 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
1916 | """ | |
1917 | Add 'file' to the memory filesystem. The dataItem parameter can | |
1918 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
1919 | arbitrary data. If a bitmap or image is used then the imgType | |
1920 | parameter should specify what kind of image file it should be | |
1921 | written as, wx.BITMAP_TYPE_PNG, etc. | |
1922 | """ | |
1923 | if isinstance(dataItem, wx.Image): | |
1924 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
1925 | elif isinstance(dataItem, wx.Bitmap): | |
1926 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
1927 | elif type(dataItem) == str: | |
1928 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
1929 | else: | |
1930 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d55e5bfc | 1931 | |
5b5c9bc7 RD |
1932 | class MemoryFSHandler(CPPFileSystemHandler): |
1933 | """Proxy of C++ MemoryFSHandler class""" | |
1bd55598 RD |
1934 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1935 | __repr__ = _swig_repr | |
1936 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 1937 | """__init__(self) -> MemoryFSHandler""" |
1bd55598 | 1938 | _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs)) |
d55e5bfc | 1939 | def RemoveFile(*args, **kwargs): |
5b5c9bc7 RD |
1940 | """RemoveFile(String filename)""" |
1941 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d55e5bfc RD |
1942 | |
1943 | RemoveFile = staticmethod(RemoveFile) | |
1944 | AddFile = staticmethod(MemoryFSHandler_AddFile) | |
1945 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
1946 | """CanOpen(self, String location) -> bool""" |
1947 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1948 | |
1949 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1950 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1951 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1952 | |
1953 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
1954 | """FindFirst(self, String spec, int flags=0) -> String""" |
1955 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
1956 | |
1957 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
1958 | """FindNext(self) -> String""" |
1959 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) | |
d55e5bfc | 1960 | |
2131d850 | 1961 | _core_.MemoryFSHandler_swigregister(MemoryFSHandler) |
d55e5bfc | 1962 | |
5b5c9bc7 | 1963 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
1bd55598 RD |
1964 | """MemoryFSHandler_RemoveFile(String filename)""" |
1965 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d55e5bfc | 1966 | |
5b5c9bc7 RD |
1967 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
1968 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
1969 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
d55e5bfc RD |
1970 | #--------------------------------------------------------------------------- |
1971 | ||
5b5c9bc7 | 1972 | class ImageHandler(Object): |
27fb7603 RD |
1973 | """ |
1974 | This is the base class for implementing image file loading/saving, and | |
1975 | image creation from data. It is used within `wx.Image` and is not | |
1976 | normally seen by the application. | |
1977 | """ | |
1bd55598 RD |
1978 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1979 | def __init__(self): raise AttributeError, "No constructor defined" | |
1980 | __repr__ = _swig_repr | |
d55e5bfc | 1981 | def GetName(*args, **kwargs): |
5b5c9bc7 RD |
1982 | """GetName(self) -> String""" |
1983 | return _core_.ImageHandler_GetName(*args, **kwargs) | |
d55e5bfc RD |
1984 | |
1985 | def GetExtension(*args, **kwargs): | |
5b5c9bc7 RD |
1986 | """GetExtension(self) -> String""" |
1987 | return _core_.ImageHandler_GetExtension(*args, **kwargs) | |
d55e5bfc RD |
1988 | |
1989 | def GetType(*args, **kwargs): | |
1990 | """GetType(self) -> long""" | |
5b5c9bc7 | 1991 | return _core_.ImageHandler_GetType(*args, **kwargs) |
d55e5bfc RD |
1992 | |
1993 | def GetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
1994 | """GetMimeType(self) -> String""" |
1995 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) | |
d55e5bfc RD |
1996 | |
1997 | def CanRead(*args, **kwargs): | |
5b5c9bc7 RD |
1998 | """CanRead(self, String name) -> bool""" |
1999 | return _core_.ImageHandler_CanRead(*args, **kwargs) | |
d55e5bfc | 2000 | |
b02396e8 RD |
2001 | def CanReadStream(*args, **kwargs): |
2002 | """CanReadStream(self, InputStream stream) -> bool""" | |
2003 | return _core_.ImageHandler_CanReadStream(*args, **kwargs) | |
2004 | ||
d55e5bfc | 2005 | def SetName(*args, **kwargs): |
5b5c9bc7 RD |
2006 | """SetName(self, String name)""" |
2007 | return _core_.ImageHandler_SetName(*args, **kwargs) | |
d55e5bfc RD |
2008 | |
2009 | def SetExtension(*args, **kwargs): | |
5b5c9bc7 RD |
2010 | """SetExtension(self, String extension)""" |
2011 | return _core_.ImageHandler_SetExtension(*args, **kwargs) | |
d55e5bfc RD |
2012 | |
2013 | def SetType(*args, **kwargs): | |
2014 | """SetType(self, long type)""" | |
5b5c9bc7 | 2015 | return _core_.ImageHandler_SetType(*args, **kwargs) |
d55e5bfc RD |
2016 | |
2017 | def SetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
2018 | """SetMimeType(self, String mimetype)""" |
2019 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) | |
d55e5bfc | 2020 | |
2131d850 | 2021 | _core_.ImageHandler_swigregister(ImageHandler) |
d55e5bfc | 2022 | |
943e8dfd RD |
2023 | class PyImageHandler(ImageHandler): |
2024 | """ | |
2025 | This is the base class for implementing image file loading/saving, and | |
2026 | image creation from data, all written in Python. To create a custom | |
2027 | image handler derive a new class from wx.PyImageHandler and provide | |
2028 | the following methods:: | |
2029 | ||
2030 | def DoCanRead(self, stream) --> bool | |
2031 | '''Check if this handler can read the image on the stream''' | |
2032 | ||
2033 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2034 | '''Load image data from the stream and load it into image.''' | |
2035 | ||
2036 | def SaveFile(self, image, stream, verbose) --> bool | |
2037 | '''Save the iamge data in image to the stream using | |
2038 | this handler's image file format.''' | |
2039 | ||
2040 | def GetImageCount(self, stream) --> int | |
2041 | '''If this image format can hold more than one image, | |
2042 | how many does the image on the stream have?''' | |
2043 | ||
2044 | To activate your handler create an instance of it and pass it to | |
2045 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2046 | `SetExtension` from your constructor. | |
2047 | ||
2048 | """ | |
1bd55598 RD |
2049 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2050 | __repr__ = _swig_repr | |
2051 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2052 | """ |
2053 | __init__(self) -> PyImageHandler | |
2054 | ||
2055 | This is the base class for implementing image file loading/saving, and | |
2056 | image creation from data, all written in Python. To create a custom | |
2057 | image handler derive a new class from wx.PyImageHandler and provide | |
2058 | the following methods:: | |
2059 | ||
2060 | def DoCanRead(self, stream) --> bool | |
2061 | '''Check if this handler can read the image on the stream''' | |
2062 | ||
2063 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2064 | '''Load image data from the stream and load it into image.''' | |
2065 | ||
2066 | def SaveFile(self, image, stream, verbose) --> bool | |
2067 | '''Save the iamge data in image to the stream using | |
2068 | this handler's image file format.''' | |
2069 | ||
2070 | def GetImageCount(self, stream) --> int | |
2071 | '''If this image format can hold more than one image, | |
2072 | how many does the image on the stream have?''' | |
2073 | ||
2074 | To activate your handler create an instance of it and pass it to | |
2075 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2076 | `SetExtension` from your constructor. | |
2077 | ||
2078 | """ | |
1bd55598 | 2079 | _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs)) |
943e8dfd RD |
2080 | self._SetSelf(self) |
2081 | ||
2082 | def _SetSelf(*args, **kwargs): | |
2083 | """_SetSelf(self, PyObject self)""" | |
2084 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2085 | ||
2131d850 | 2086 | _core_.PyImageHandler_swigregister(PyImageHandler) |
943e8dfd | 2087 | |
5b5c9bc7 RD |
2088 | class ImageHistogram(object): |
2089 | """Proxy of C++ ImageHistogram class""" | |
1bd55598 RD |
2090 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2091 | __repr__ = _swig_repr | |
2092 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 2093 | """__init__(self) -> ImageHistogram""" |
1bd55598 | 2094 | _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs)) |
d55e5bfc RD |
2095 | def MakeKey(*args, **kwargs): |
2096 | """ | |
7a27cf7c | 2097 | MakeKey(byte r, byte g, byte b) -> unsigned long |
d55e5bfc RD |
2098 | |
2099 | Get the key in the histogram for the given RGB values | |
2100 | """ | |
5b5c9bc7 | 2101 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d55e5bfc RD |
2102 | |
2103 | MakeKey = staticmethod(MakeKey) | |
2104 | def FindFirstUnusedColour(*args, **kwargs): | |
fd2dc343 RD |
2105 | """ |
2106 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2107 | ||
2108 | Find first colour that is not used in the image and has higher RGB | |
2109 | values than startR, startG, startB. Returns a tuple consisting of a | |
2110 | success flag and rgb values. | |
2111 | """ | |
5b5c9bc7 | 2112 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
d55e5bfc | 2113 | |
f1cbd8fa RD |
2114 | def GetCount(*args, **kwargs): |
2115 | """ | |
2116 | GetCount(self, unsigned long key) -> unsigned long | |
2117 | ||
2118 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2119 | key value from a RGB tripple. | |
2120 | """ | |
5b5c9bc7 | 2121 | return _core_.ImageHistogram_GetCount(*args, **kwargs) |
f1cbd8fa RD |
2122 | |
2123 | def GetCountRGB(*args, **kwargs): | |
2124 | """ | |
7a27cf7c | 2125 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2126 | |
2127 | Returns the pixel count for the given RGB values. | |
2128 | """ | |
5b5c9bc7 | 2129 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) |
f1cbd8fa RD |
2130 | |
2131 | def GetCountColour(*args, **kwargs): | |
2132 | """ | |
5b5c9bc7 | 2133 | GetCountColour(self, Colour colour) -> unsigned long |
f1cbd8fa RD |
2134 | |
2135 | Returns the pixel count for the given `wx.Colour` value. | |
2136 | """ | |
5b5c9bc7 | 2137 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) |
f1cbd8fa | 2138 | |
2131d850 | 2139 | _core_.ImageHistogram_swigregister(ImageHistogram) |
d55e5bfc | 2140 | |
5b5c9bc7 | 2141 | def ImageHistogram_MakeKey(*args, **kwargs): |
1bd55598 | 2142 | """ |
7a27cf7c | 2143 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
d55e5bfc RD |
2144 | |
2145 | Get the key in the histogram for the given RGB values | |
2146 | """ | |
1bd55598 | 2147 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d55e5bfc | 2148 | |
943e8dfd RD |
2149 | class Image_RGBValue(object): |
2150 | """ | |
2151 | An object that contains values for red, green and blue which represent | |
2152 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2153 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2154 | color space. | |
2155 | """ | |
1bd55598 RD |
2156 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2157 | __repr__ = _swig_repr | |
2158 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2159 | """ |
2160 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2161 | ||
2162 | Constructor. | |
2163 | """ | |
1bd55598 | 2164 | _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs)) |
943e8dfd RD |
2165 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) |
2166 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2167 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2131d850 | 2168 | _core_.Image_RGBValue_swigregister(Image_RGBValue) |
943e8dfd RD |
2169 | |
2170 | class Image_HSVValue(object): | |
2171 | """ | |
2172 | An object that contains values for hue, saturation and value which | |
2173 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2174 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2175 | color space. | |
2176 | """ | |
1bd55598 RD |
2177 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2178 | __repr__ = _swig_repr | |
2179 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2180 | """ |
2181 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2182 | ||
2183 | Constructor. | |
2184 | """ | |
1bd55598 | 2185 | _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs)) |
943e8dfd RD |
2186 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) |
2187 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2188 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2131d850 | 2189 | _core_.Image_HSVValue_swigregister(Image_HSVValue) |
943e8dfd | 2190 | |
5b5c9bc7 | 2191 | class Image(Object): |
7a27cf7c RD |
2192 | """ |
2193 | A platform-independent image class. An image can be created from | |
2194 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2195 | variety of formats. Functions are available to set and get image | |
2196 | bits, so it can be used for basic image manipulation. | |
2197 | ||
2198 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2199 | platform-specific `wx.Bitmap` object must be created from it using the | |
2200 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2201 | device context, using `wx.DC.DrawBitmap`. | |
2202 | ||
2203 | One colour value of the image may be used as a mask colour which will | |
2204 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2205 | bitmap object. | |
2206 | ||
2207 | wx.Image supports alpha channel data, that is in addition to a byte | |
2208 | for the red, green and blue colour components for each pixel it also | |
2209 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2210 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2211 | means that the pixel is 100% opaque. | |
2212 | ||
2213 | Unlike RGB data, not all images have an alpha channel and before using | |
2214 | `GetAlpha` you should check if this image contains an alpha channel | |
2215 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2216 | with transparency information will have an alpha channel. | |
2217 | """ | |
1bd55598 RD |
2218 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2219 | __repr__ = _swig_repr | |
2220 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2221 | """ |
2222 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2223 | ||
2224 | Loads an image from a file. | |
2225 | """ | |
1bd55598 RD |
2226 | _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs)) |
2227 | __swig_destroy__ = _core_.delete_Image | |
2228 | __del__ = lambda self : None; | |
d55e5bfc | 2229 | def Create(*args, **kwargs): |
7a27cf7c RD |
2230 | """ |
2231 | Create(self, int width, int height, bool clear=True) | |
2232 | ||
2233 | Creates a fresh image. If clear is ``True``, the new image will be | |
2234 | initialized to black. Otherwise, the image data will be uninitialized. | |
2235 | """ | |
5b5c9bc7 | 2236 | return _core_.Image_Create(*args, **kwargs) |
d55e5bfc RD |
2237 | |
2238 | def Destroy(*args, **kwargs): | |
2239 | """ | |
2240 | Destroy(self) | |
2241 | ||
7a27cf7c | 2242 | Destroys the image data. |
d55e5bfc | 2243 | """ |
7e08d4ef RD |
2244 | val = _core_.Image_Destroy(*args, **kwargs) |
2245 | args[0].thisown = 0 | |
2246 | return val | |
d55e5bfc RD |
2247 | |
2248 | def Scale(*args, **kwargs): | |
7a27cf7c RD |
2249 | """ |
2250 | Scale(self, int width, int height) -> Image | |
2251 | ||
2252 | Returns a scaled version of the image. This is also useful for scaling | |
2253 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
2254 | `wx.MemoryDC` into another `wx.MemoryDC`. | |
2255 | """ | |
5b5c9bc7 | 2256 | return _core_.Image_Scale(*args, **kwargs) |
d55e5bfc RD |
2257 | |
2258 | def ShrinkBy(*args, **kwargs): | |
7a27cf7c RD |
2259 | """ |
2260 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2261 | ||
2262 | Return a version of the image scaled smaller by the given factors. | |
2263 | """ | |
5b5c9bc7 | 2264 | return _core_.Image_ShrinkBy(*args, **kwargs) |
d55e5bfc RD |
2265 | |
2266 | def Rescale(*args, **kwargs): | |
7a27cf7c RD |
2267 | """ |
2268 | Rescale(self, int width, int height) -> Image | |
2269 | ||
2270 | Changes the size of the image in-place by scaling it: after a call to | |
2271 | this function, the image will have the given width and height. | |
2272 | ||
2273 | Returns the (modified) image itself. | |
2274 | """ | |
5b5c9bc7 | 2275 | return _core_.Image_Rescale(*args, **kwargs) |
d55e5bfc | 2276 | |
aff4cc5c | 2277 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2278 | """ |
2279 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2280 | ||
2281 | Changes the size of the image in-place without scaling it, by adding | |
2282 | either a border with the given colour or cropping as necessary. The | |
2283 | image is pasted into a new image with the given size and background | |
2284 | colour at the position pos relative to the upper left of the new | |
2285 | image. If red = green = blue = -1 then use either the current mask | |
2286 | colour if set or find, use, and set a suitable mask colour for any | |
2287 | newly exposed areas. | |
2288 | ||
2289 | Returns the (modified) image itself. | |
2290 | """ | |
5b5c9bc7 | 2291 | return _core_.Image_Resize(*args, **kwargs) |
aff4cc5c | 2292 | |
d55e5bfc | 2293 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2294 | """ |
2295 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2296 | ||
2297 | Sets the pixel at the given coordinate. This routine performs | |
2298 | bounds-checks for the coordinate so it can be considered a safe way to | |
2299 | manipulate the data, but in some cases this might be too slow so that | |
2300 | the data will have to be set directly. In that case you will have to | |
2301 | get access to the image data using the `GetData` method. | |
2302 | """ | |
5b5c9bc7 | 2303 | return _core_.Image_SetRGB(*args, **kwargs) |
d55e5bfc | 2304 | |
aff4cc5c | 2305 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2306 | """ |
2307 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2308 | ||
2309 | Sets the colour of the pixels within the given rectangle. This routine | |
2310 | performs bounds-checks for the rectangle so it can be considered a | |
2311 | safe way to manipulate the data. | |
2312 | """ | |
5b5c9bc7 | 2313 | return _core_.Image_SetRGBRect(*args, **kwargs) |
aff4cc5c | 2314 | |
d55e5bfc | 2315 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2316 | """ |
2317 | GetRed(self, int x, int y) -> byte | |
2318 | ||
2319 | Returns the red intensity at the given coordinate. | |
2320 | """ | |
5b5c9bc7 | 2321 | return _core_.Image_GetRed(*args, **kwargs) |
d55e5bfc RD |
2322 | |
2323 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2324 | """ |
2325 | GetGreen(self, int x, int y) -> byte | |
2326 | ||
2327 | Returns the green intensity at the given coordinate. | |
2328 | """ | |
5b5c9bc7 | 2329 | return _core_.Image_GetGreen(*args, **kwargs) |
d55e5bfc RD |
2330 | |
2331 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2332 | """ |
2333 | GetBlue(self, int x, int y) -> byte | |
2334 | ||
2335 | Returns the blue intensity at the given coordinate. | |
2336 | """ | |
5b5c9bc7 | 2337 | return _core_.Image_GetBlue(*args, **kwargs) |
d55e5bfc RD |
2338 | |
2339 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2340 | """ |
2341 | SetAlpha(self, int x, int y, byte alpha) | |
2342 | ||
2343 | Sets the alpha value for the given pixel. This function should only be | |
2344 | called if the image has alpha channel data, use `HasAlpha` to check | |
2345 | for this. | |
2346 | """ | |
5b5c9bc7 | 2347 | return _core_.Image_SetAlpha(*args, **kwargs) |
d55e5bfc RD |
2348 | |
2349 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2350 | """ |
2351 | GetAlpha(self, int x, int y) -> byte | |
2352 | ||
2353 | Returns the alpha value for the given pixel. This function may only be | |
2354 | called for the images with alpha channel, use `HasAlpha` to check for | |
2355 | this. | |
2356 | ||
2357 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2358 | corresponds to the fully transparent pixels while the value of 255 to | |
2359 | the fully opaque pixels. | |
2360 | """ | |
5b5c9bc7 | 2361 | return _core_.Image_GetAlpha(*args, **kwargs) |
d55e5bfc RD |
2362 | |
2363 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2364 | """ |
2365 | HasAlpha(self) -> bool | |
2366 | ||
2367 | Returns true if this image has alpha channel, false otherwise. | |
2368 | """ | |
5b5c9bc7 | 2369 | return _core_.Image_HasAlpha(*args, **kwargs) |
d55e5bfc | 2370 | |
68350608 RD |
2371 | def InitAlpha(*args, **kwargs): |
2372 | """ | |
2373 | InitAlpha(self) | |
2374 | ||
2375 | Initializes the image alpha channel data. It is an error to call it if | |
2376 | the image already has alpha data. If it doesn't, alpha data will be by | |
2377 | default initialized to all pixels being fully opaque. But if the image | |
2378 | has a a mask colour, all mask pixels will be completely transparent. | |
2379 | """ | |
5b5c9bc7 RD |
2380 | return _core_.Image_InitAlpha(*args, **kwargs) |
2381 | ||
2382 | def IsTransparent(*args, **kwargs): | |
2383 | """ | |
7a27cf7c | 2384 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
5b5c9bc7 | 2385 | |
7a27cf7c RD |
2386 | Returns ``True`` if this pixel is masked or has an alpha value less |
2387 | than the spcified threshold. | |
5b5c9bc7 RD |
2388 | """ |
2389 | return _core_.Image_IsTransparent(*args, **kwargs) | |
68350608 | 2390 | |
d55e5bfc | 2391 | def FindFirstUnusedColour(*args, **kwargs): |
fd2dc343 RD |
2392 | """ |
2393 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2394 | ||
2395 | Find first colour that is not used in the image and has higher RGB | |
2396 | values than startR, startG, startB. Returns a tuple consisting of a | |
2397 | success flag and rgb values. | |
2398 | """ | |
5b5c9bc7 | 2399 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
d55e5bfc | 2400 | |
4cf4100f RD |
2401 | def ConvertAlphaToMask(*args, **kwargs): |
2402 | """ | |
5b5c9bc7 | 2403 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2404 | |
7a27cf7c RD |
2405 | If the image has alpha channel, this method converts it to mask. All |
2406 | pixels with alpha value less than ``threshold`` are replaced with the | |
2407 | mask colour and the alpha channel is removed. The mask colour is | |
2408 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2409 | |
2410 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2411 | nothing. | |
2412 | """ | |
5b5c9bc7 | 2413 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) |
4cf4100f | 2414 | |
8fb0e70a RD |
2415 | def ConvertColourToAlpha(*args, **kwargs): |
2416 | """ | |
7a27cf7c | 2417 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2418 | |
2419 | This method converts an image where the original alpha information is | |
2420 | only available as a shades of a colour (actually shades of grey) | |
2421 | typically when you draw anti-aliased text into a bitmap. The DC | |
2422 | drawing routines draw grey values on the black background although | |
2423 | they actually mean to draw white with differnt alpha values. This | |
2424 | method reverses it, assuming a black (!) background and white text. | |
2425 | The method will then fill up the whole image with the colour given. | |
2426 | """ | |
5b5c9bc7 | 2427 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) |
8fb0e70a | 2428 | |
d55e5bfc | 2429 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2430 | """ |
2431 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2432 | ||
2433 | Sets the image's mask so that the pixels that have RGB value of | |
2434 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2435 | by first finding an unused colour in the image, setting this colour as | |
2436 | the mask colour and then using this colour to draw all pixels in the | |
2437 | image who corresponding pixel in mask has given RGB value. | |
2438 | ||
2439 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2440 | image or if there is no unused colour left. Returns ``True`` if the | |
2441 | mask was successfully applied. | |
2442 | ||
2443 | Note that this method involves computing the histogram, which is | |
2444 | computationally intensive operation. | |
2445 | """ | |
5b5c9bc7 | 2446 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
d55e5bfc RD |
2447 | |
2448 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2449 | """ |
2450 | CanRead(String filename) -> bool | |
2451 | ||
2452 | Returns True if the image handlers can read this file. | |
2453 | """ | |
5b5c9bc7 | 2454 | return _core_.Image_CanRead(*args, **kwargs) |
d55e5bfc RD |
2455 | |
2456 | CanRead = staticmethod(CanRead) | |
2457 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2458 | """ |
2459 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2460 | ||
2461 | If the image file contains more than one image and the image handler | |
2462 | is capable of retrieving these individually, this function will return | |
2463 | the number of available images. | |
2464 | """ | |
5b5c9bc7 | 2465 | return _core_.Image_GetImageCount(*args, **kwargs) |
d55e5bfc RD |
2466 | |
2467 | GetImageCount = staticmethod(GetImageCount) | |
2468 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2469 | """ |
2470 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2471 | ||
2472 | Loads an image from a file. If no handler type is provided, the | |
2473 | library will try to autodetect the format. | |
2474 | """ | |
5b5c9bc7 | 2475 | return _core_.Image_LoadFile(*args, **kwargs) |
d55e5bfc RD |
2476 | |
2477 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2478 | """ |
2479 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2480 | ||
2481 | Loads an image from a file, specifying the image type with a MIME type | |
2482 | string. | |
2483 | """ | |
5b5c9bc7 | 2484 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
d55e5bfc RD |
2485 | |
2486 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2487 | """ |
2488 | SaveFile(self, String name, int type) -> bool | |
2489 | ||
2490 | Saves an image in the named file. | |
2491 | """ | |
5b5c9bc7 | 2492 | return _core_.Image_SaveFile(*args, **kwargs) |
d55e5bfc RD |
2493 | |
2494 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2495 | """ |
2496 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2497 | ||
2498 | Saves an image in the named file. | |
2499 | """ | |
5b5c9bc7 | 2500 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
d55e5bfc RD |
2501 | |
2502 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2503 | """ |
2504 | CanReadStream(InputStream stream) -> bool | |
2505 | ||
2506 | Returns True if the image handlers can read an image file from the | |
2507 | data currently on the input stream, or a readable Python file-like | |
2508 | object. | |
2509 | """ | |
5b5c9bc7 | 2510 | return _core_.Image_CanReadStream(*args, **kwargs) |
d55e5bfc RD |
2511 | |
2512 | CanReadStream = staticmethod(CanReadStream) | |
2513 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2514 | """ |
2515 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2516 | ||
2517 | Loads an image from an input stream or a readable Python file-like | |
2518 | object. If no handler type is provided, the library will try to | |
2519 | autodetect the format. | |
2520 | """ | |
5b5c9bc7 | 2521 | return _core_.Image_LoadStream(*args, **kwargs) |
d55e5bfc RD |
2522 | |
2523 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2524 | """ |
2525 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2526 | ||
2527 | Loads an image from an input stream or a readable Python file-like | |
2528 | object, using a MIME type string to specify the image file format. | |
2529 | """ | |
5b5c9bc7 | 2530 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
d55e5bfc RD |
2531 | |
2532 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2533 | """ |
2534 | Ok(self) -> bool | |
2535 | ||
2536 | Returns true if image data is present. | |
2537 | """ | |
5b5c9bc7 | 2538 | return _core_.Image_Ok(*args, **kwargs) |
d55e5bfc RD |
2539 | |
2540 | def GetWidth(*args, **kwargs): | |
7a27cf7c RD |
2541 | """ |
2542 | GetWidth(self) -> int | |
2543 | ||
2544 | Gets the width of the image in pixels. | |
2545 | """ | |
5b5c9bc7 | 2546 | return _core_.Image_GetWidth(*args, **kwargs) |
d55e5bfc RD |
2547 | |
2548 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
2549 | """ |
2550 | GetHeight(self) -> int | |
2551 | ||
2552 | Gets the height of the image in pixels. | |
2553 | """ | |
5b5c9bc7 | 2554 | return _core_.Image_GetHeight(*args, **kwargs) |
d55e5bfc RD |
2555 | |
2556 | def GetSize(*args, **kwargs): | |
7a27cf7c RD |
2557 | """ |
2558 | GetSize(self) -> Size | |
2559 | ||
2560 | Returns the size of the image in pixels. | |
2561 | """ | |
5b5c9bc7 | 2562 | return _core_.Image_GetSize(*args, **kwargs) |
d55e5bfc RD |
2563 | |
2564 | def GetSubImage(*args, **kwargs): | |
7a27cf7c RD |
2565 | """ |
2566 | GetSubImage(self, Rect rect) -> Image | |
2567 | ||
2568 | Returns a sub image of the current one as long as the rect belongs | |
2569 | entirely to the image. | |
2570 | """ | |
5b5c9bc7 | 2571 | return _core_.Image_GetSubImage(*args, **kwargs) |
d55e5bfc | 2572 | |
aff4cc5c | 2573 | def Size(*args, **kwargs): |
7a27cf7c RD |
2574 | """ |
2575 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2576 | ||
2577 | Returns a resized version of this image without scaling it by adding | |
2578 | either a border with the given colour or cropping as necessary. The | |
2579 | image is pasted into a new image with the given size and background | |
2580 | colour at the position ``pos`` relative to the upper left of the new | |
2581 | image. If red = green = blue = -1 then use either the current mask | |
2582 | colour if set or find, use, and set a suitable mask colour for any | |
2583 | newly exposed areas. | |
2584 | """ | |
5b5c9bc7 | 2585 | return _core_.Image_Size(*args, **kwargs) |
aff4cc5c | 2586 | |
d55e5bfc | 2587 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2588 | """ |
2589 | Copy(self) -> Image | |
2590 | ||
2591 | Returns an identical copy of the image. | |
2592 | """ | |
5b5c9bc7 | 2593 | return _core_.Image_Copy(*args, **kwargs) |
d55e5bfc RD |
2594 | |
2595 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
2596 | """ |
2597 | Paste(self, Image image, int x, int y) | |
2598 | ||
2599 | Pastes ``image`` into this instance and takes care of the mask colour | |
2600 | and any out of bounds problems. | |
2601 | """ | |
5b5c9bc7 | 2602 | return _core_.Image_Paste(*args, **kwargs) |
d55e5bfc RD |
2603 | |
2604 | def GetData(*args, **kwargs): | |
bb2ef2cc RD |
2605 | """ |
2606 | GetData(self) -> PyObject | |
2607 | ||
2608 | Returns a string containing a copy of the RGB bytes of the image. | |
2609 | """ | |
5b5c9bc7 | 2610 | return _core_.Image_GetData(*args, **kwargs) |
d55e5bfc RD |
2611 | |
2612 | def SetData(*args, **kwargs): | |
bb2ef2cc RD |
2613 | """ |
2614 | SetData(self, buffer data) | |
2615 | ||
2616 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2617 | either a string or a buffer object holding the data and the length of | |
2618 | the data must be width*height*3. | |
2619 | """ | |
5b5c9bc7 | 2620 | return _core_.Image_SetData(*args, **kwargs) |
d55e5bfc RD |
2621 | |
2622 | def GetDataBuffer(*args, **kwargs): | |
bb2ef2cc RD |
2623 | """ |
2624 | GetDataBuffer(self) -> PyObject | |
2625 | ||
2626 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
2627 | image data buffer inside the wx.Image. You need to ensure that you do |
2628 | not use this buffer object after the image has been destroyed. | |
bb2ef2cc | 2629 | """ |
5b5c9bc7 | 2630 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
d55e5bfc RD |
2631 | |
2632 | def SetDataBuffer(*args, **kwargs): | |
bb2ef2cc RD |
2633 | """ |
2634 | SetDataBuffer(self, buffer data) | |
2635 | ||
2636 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
2637 | object. This can save making an extra copy of the data but you must |
2638 | ensure that the buffer object lives longer than the wx.Image does. | |
bb2ef2cc | 2639 | """ |
5b5c9bc7 | 2640 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
d55e5bfc RD |
2641 | |
2642 | def GetAlphaData(*args, **kwargs): | |
bb2ef2cc RD |
2643 | """ |
2644 | GetAlphaData(self) -> PyObject | |
2645 | ||
2646 | Returns a string containing a copy of the alpha bytes of the image. | |
2647 | """ | |
5b5c9bc7 | 2648 | return _core_.Image_GetAlphaData(*args, **kwargs) |
d55e5bfc RD |
2649 | |
2650 | def SetAlphaData(*args, **kwargs): | |
bb2ef2cc RD |
2651 | """ |
2652 | SetAlphaData(self, buffer alpha) | |
2653 | ||
2654 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2655 | a string or a buffer object holding the data and the length of the | |
2656 | data must be width*height. | |
2657 | """ | |
5b5c9bc7 | 2658 | return _core_.Image_SetAlphaData(*args, **kwargs) |
d55e5bfc RD |
2659 | |
2660 | def GetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
2661 | """ |
2662 | GetAlphaBuffer(self) -> PyObject | |
2663 | ||
2664 | Returns a writable Python buffer object that is pointing at the Alpha | |
2665 | data buffer inside the wx.Image. You need to ensure that you do not | |
2666 | use this buffer object after the image has been destroyed. | |
2667 | """ | |
5b5c9bc7 | 2668 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
d55e5bfc RD |
2669 | |
2670 | def SetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
2671 | """ |
2672 | SetAlphaBuffer(self, buffer alpha) | |
2673 | ||
2674 | Sets the internal image alpha pointer to point at a Python buffer | |
2675 | object. This can save making an extra copy of the data but you must | |
2676 | ensure that the buffer object lives as long as the wx.Image does. | |
2677 | """ | |
5b5c9bc7 | 2678 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
d55e5bfc RD |
2679 | |
2680 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
2681 | """ |
2682 | SetMaskColour(self, byte r, byte g, byte b) | |
2683 | ||
2684 | Sets the mask colour for this image (and tells the image to use the | |
2685 | mask). | |
2686 | """ | |
5b5c9bc7 | 2687 | return _core_.Image_SetMaskColour(*args, **kwargs) |
d55e5bfc | 2688 | |
aff4cc5c RD |
2689 | def GetOrFindMaskColour(*args, **kwargs): |
2690 | """ | |
2691 | GetOrFindMaskColour() -> (r,g,b) | |
2692 | ||
2693 | Get the current mask colour or find a suitable colour. | |
2694 | """ | |
5b5c9bc7 | 2695 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) |
aff4cc5c | 2696 | |
d55e5bfc | 2697 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2698 | """ |
2699 | GetMaskRed(self) -> byte | |
2700 | ||
2701 | Gets the red component of the mask colour. | |
2702 | """ | |
5b5c9bc7 | 2703 | return _core_.Image_GetMaskRed(*args, **kwargs) |
d55e5bfc RD |
2704 | |
2705 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
2706 | """ |
2707 | GetMaskGreen(self) -> byte | |
2708 | ||
2709 | Gets the green component of the mask colour. | |
2710 | """ | |
5b5c9bc7 | 2711 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
d55e5bfc RD |
2712 | |
2713 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
2714 | """ |
2715 | GetMaskBlue(self) -> byte | |
2716 | ||
2717 | Gets the blue component of the mask colour. | |
2718 | """ | |
5b5c9bc7 | 2719 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
d55e5bfc RD |
2720 | |
2721 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
2722 | """ |
2723 | SetMask(self, bool mask=True) | |
2724 | ||
2725 | Specifies whether there is a mask or not. The area of the mask is | |
2726 | determined by the current mask colour. | |
2727 | """ | |
5b5c9bc7 | 2728 | return _core_.Image_SetMask(*args, **kwargs) |
d55e5bfc RD |
2729 | |
2730 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
2731 | """ |
2732 | HasMask(self) -> bool | |
2733 | ||
2734 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
2735 | """ | |
5b5c9bc7 | 2736 | return _core_.Image_HasMask(*args, **kwargs) |
d55e5bfc RD |
2737 | |
2738 | def Rotate(*args, **kwargs): | |
2739 | """ | |
5b5c9bc7 RD |
2740 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
2741 | Point offset_after_rotation=None) -> Image | |
7a27cf7c RD |
2742 | |
2743 | Rotates the image about the given point, by ``angle`` radians. Passing | |
2744 | ``True`` to ``interpolating`` results in better image quality, but is | |
2745 | slower. If the image has a mask, then the mask colour is used for the | |
2746 | uncovered pixels in the rotated image background. Otherwise, black | |
2747 | will be used as the fill colour. | |
2748 | ||
2749 | Returns the rotated image, leaving this image intact. | |
d55e5bfc | 2750 | """ |
5b5c9bc7 | 2751 | return _core_.Image_Rotate(*args, **kwargs) |
d55e5bfc RD |
2752 | |
2753 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
2754 | """ |
2755 | Rotate90(self, bool clockwise=True) -> Image | |
2756 | ||
2757 | Returns a copy of the image rotated 90 degrees in the direction | |
2758 | indicated by ``clockwise``. | |
2759 | """ | |
5b5c9bc7 | 2760 | return _core_.Image_Rotate90(*args, **kwargs) |
d55e5bfc RD |
2761 | |
2762 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
2763 | """ |
2764 | Mirror(self, bool horizontally=True) -> Image | |
2765 | ||
2766 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
2767 | indicates the orientation. | |
2768 | """ | |
5b5c9bc7 | 2769 | return _core_.Image_Mirror(*args, **kwargs) |
d55e5bfc RD |
2770 | |
2771 | def Replace(*args, **kwargs): | |
2772 | """ | |
7a27cf7c RD |
2773 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
2774 | ||
2775 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
2776 | ``(r2,g2,b2)``. | |
d55e5bfc | 2777 | """ |
5b5c9bc7 | 2778 | return _core_.Image_Replace(*args, **kwargs) |
d55e5bfc | 2779 | |
32fe5131 RD |
2780 | def ConvertToGreyscale(*args, **kwargs): |
2781 | """ | |
2782 | ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image | |
2783 | ||
2784 | Convert to greyscale image. Uses the luminance component (Y) of the | |
2785 | image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), | |
2786 | defaults to ITU-T BT.601 | |
2787 | """ | |
2788 | return _core_.Image_ConvertToGreyscale(*args, **kwargs) | |
2789 | ||
d55e5bfc | 2790 | def ConvertToMono(*args, **kwargs): |
7a27cf7c RD |
2791 | """ |
2792 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
2793 | ||
2794 | Returns monochromatic version of the image. The returned image has | |
2795 | white colour where the original has ``(r,g,b)`` colour and black | |
2796 | colour everywhere else. | |
2797 | """ | |
5b5c9bc7 | 2798 | return _core_.Image_ConvertToMono(*args, **kwargs) |
d55e5bfc RD |
2799 | |
2800 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
2801 | """ |
2802 | SetOption(self, String name, String value) | |
2803 | ||
2804 | Sets an image handler defined option. For example, when saving as a | |
2805 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
2806 | number between 0 and 100 (0 is terrible, 100 is very good). | |
2807 | """ | |
5b5c9bc7 | 2808 | return _core_.Image_SetOption(*args, **kwargs) |
d55e5bfc RD |
2809 | |
2810 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2811 | """ |
2812 | SetOptionInt(self, String name, int value) | |
2813 | ||
2814 | Sets an image option as an integer. | |
2815 | """ | |
5b5c9bc7 | 2816 | return _core_.Image_SetOptionInt(*args, **kwargs) |
d55e5bfc RD |
2817 | |
2818 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
2819 | """ |
2820 | GetOption(self, String name) -> String | |
2821 | ||
2822 | Gets the value of an image handler option. | |
2823 | """ | |
5b5c9bc7 | 2824 | return _core_.Image_GetOption(*args, **kwargs) |
d55e5bfc RD |
2825 | |
2826 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2827 | """ |
2828 | GetOptionInt(self, String name) -> int | |
2829 | ||
2830 | Gets the value of an image handler option as an integer. If the given | |
2831 | option is not present, the function returns 0. | |
2832 | """ | |
5b5c9bc7 | 2833 | return _core_.Image_GetOptionInt(*args, **kwargs) |
d55e5bfc RD |
2834 | |
2835 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
2836 | """ |
2837 | HasOption(self, String name) -> bool | |
2838 | ||
2839 | Returns true if the given option is present. | |
2840 | """ | |
5b5c9bc7 | 2841 | return _core_.Image_HasOption(*args, **kwargs) |
d55e5bfc RD |
2842 | |
2843 | def CountColours(*args, **kwargs): | |
2844 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" | |
5b5c9bc7 | 2845 | return _core_.Image_CountColours(*args, **kwargs) |
d55e5bfc RD |
2846 | |
2847 | def ComputeHistogram(*args, **kwargs): | |
5b5c9bc7 RD |
2848 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
2849 | return _core_.Image_ComputeHistogram(*args, **kwargs) | |
d55e5bfc RD |
2850 | |
2851 | def AddHandler(*args, **kwargs): | |
5b5c9bc7 RD |
2852 | """AddHandler(ImageHandler handler)""" |
2853 | return _core_.Image_AddHandler(*args, **kwargs) | |
d55e5bfc RD |
2854 | |
2855 | AddHandler = staticmethod(AddHandler) | |
2856 | def InsertHandler(*args, **kwargs): | |
5b5c9bc7 RD |
2857 | """InsertHandler(ImageHandler handler)""" |
2858 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d55e5bfc RD |
2859 | |
2860 | InsertHandler = staticmethod(InsertHandler) | |
2861 | def RemoveHandler(*args, **kwargs): | |
5b5c9bc7 RD |
2862 | """RemoveHandler(String name) -> bool""" |
2863 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d55e5bfc RD |
2864 | |
2865 | RemoveHandler = staticmethod(RemoveHandler) | |
1bd55598 RD |
2866 | def GetHandlers(*args, **kwargs): |
2867 | """GetHandlers() -> PyObject""" | |
2868 | return _core_.Image_GetHandlers(*args, **kwargs) | |
2869 | ||
2870 | GetHandlers = staticmethod(GetHandlers) | |
d55e5bfc | 2871 | def GetImageExtWildcard(*args, **kwargs): |
7a27cf7c RD |
2872 | """ |
2873 | GetImageExtWildcard() -> String | |
2874 | ||
2875 | Iterates all registered wxImageHandler objects, and returns a string | |
2876 | containing file extension masks suitable for passing to file open/save | |
2877 | dialog boxes. | |
2878 | """ | |
5b5c9bc7 | 2879 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
d55e5bfc RD |
2880 | |
2881 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
2882 | def ConvertToBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
2883 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
2884 | return _core_.Image_ConvertToBitmap(*args, **kwargs) | |
d55e5bfc RD |
2885 | |
2886 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 2887 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
5b5c9bc7 | 2888 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
d55e5bfc | 2889 | |
943e8dfd RD |
2890 | def RotateHue(*args, **kwargs): |
2891 | """ | |
2892 | RotateHue(self, double angle) | |
2893 | ||
2894 | Rotates the hue of each pixel of the image. Hue is a double in the | |
2895 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
2896 | """ | |
2897 | return _core_.Image_RotateHue(*args, **kwargs) | |
2898 | ||
2899 | def RGBtoHSV(*args, **kwargs): | |
2900 | """ | |
2901 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
2902 | ||
2903 | Converts a color in RGB color space to HSV color space. | |
2904 | """ | |
2905 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
2906 | ||
2907 | RGBtoHSV = staticmethod(RGBtoHSV) | |
2908 | def HSVtoRGB(*args, **kwargs): | |
2909 | """ | |
2910 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
2911 | ||
2912 | Converts a color in HSV color space to RGB color space. | |
2913 | """ | |
2914 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
2915 | ||
2916 | HSVtoRGB = staticmethod(HSVtoRGB) | |
d55e5bfc | 2917 | def __nonzero__(self): return self.Ok() |
2131d850 | 2918 | _core_.Image_swigregister(Image) |
d55e5bfc RD |
2919 | |
2920 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
2921 | """ |
2922 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
2923 | ||
2924 | Loads an image from a file, using a MIME type string (such as | |
2925 | 'image/jpeg') to specify image type. | |
2926 | """ | |
5b5c9bc7 | 2927 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d55e5bfc RD |
2928 | return val |
2929 | ||
2930 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
2931 | """ |
2932 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2933 | ||
2934 | Loads an image from an input stream, or any readable Python file-like | |
2935 | object. | |
2936 | """ | |
5b5c9bc7 | 2937 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d55e5bfc RD |
2938 | return val |
2939 | ||
2940 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
2941 | """ |
2942 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
2943 | ||
2944 | Loads an image from an input stream, or any readable Python file-like | |
2945 | object, specifying the image format with a MIME type string. | |
2946 | """ | |
5b5c9bc7 | 2947 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d55e5bfc RD |
2948 | return val |
2949 | ||
d6c14a4c | 2950 | def EmptyImage(*args, **kwargs): |
bb2ef2cc | 2951 | """ |
5b5c9bc7 | 2952 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image |
bb2ef2cc RD |
2953 | |
2954 | Construct an empty image of a given size, optionally setting all | |
2955 | pixels to black. | |
2956 | """ | |
5b5c9bc7 | 2957 | val = _core_.new_EmptyImage(*args, **kwargs) |
d55e5bfc RD |
2958 | return val |
2959 | ||
2960 | def ImageFromBitmap(*args, **kwargs): | |
bb2ef2cc | 2961 | """ |
5b5c9bc7 | 2962 | ImageFromBitmap(Bitmap bitmap) -> Image |
bb2ef2cc RD |
2963 | |
2964 | Construct an Image from a `wx.Bitmap`. | |
2965 | """ | |
5b5c9bc7 | 2966 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d55e5bfc RD |
2967 | return val |
2968 | ||
2969 | def ImageFromData(*args, **kwargs): | |
bb2ef2cc | 2970 | """ |
5b5c9bc7 | 2971 | ImageFromData(int width, int height, buffer data) -> Image |
bb2ef2cc RD |
2972 | |
2973 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
2974 | string or a buffer object holding the data and the length of the data | |
2975 | must be width*height*3. | |
2976 | """ | |
5b5c9bc7 | 2977 | val = _core_.new_ImageFromData(*args, **kwargs) |
d55e5bfc RD |
2978 | return val |
2979 | ||
03e46024 | 2980 | def ImageFromDataWithAlpha(*args, **kwargs): |
bb2ef2cc | 2981 | """ |
5b5c9bc7 | 2982 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image |
bb2ef2cc RD |
2983 | |
2984 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
2985 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
2986 | length of the data must be width*height*3 bytes, and the length of the |
2987 | alpha data must be width*height bytes. | |
bb2ef2cc | 2988 | """ |
5b5c9bc7 | 2989 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
03e46024 RD |
2990 | return val |
2991 | ||
5b5c9bc7 | 2992 | def Image_CanRead(*args, **kwargs): |
1bd55598 | 2993 | """ |
7a27cf7c RD |
2994 | Image_CanRead(String filename) -> bool |
2995 | ||
2996 | Returns True if the image handlers can read this file. | |
2997 | """ | |
1bd55598 | 2998 | return _core_.Image_CanRead(*args, **kwargs) |
d55e5bfc | 2999 | |
5b5c9bc7 | 3000 | def Image_GetImageCount(*args, **kwargs): |
1bd55598 | 3001 | """ |
7a27cf7c RD |
3002 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int |
3003 | ||
3004 | If the image file contains more than one image and the image handler | |
3005 | is capable of retrieving these individually, this function will return | |
3006 | the number of available images. | |
3007 | """ | |
1bd55598 | 3008 | return _core_.Image_GetImageCount(*args, **kwargs) |
d55e5bfc | 3009 | |
5b5c9bc7 | 3010 | def Image_CanReadStream(*args, **kwargs): |
1bd55598 | 3011 | """ |
7a27cf7c RD |
3012 | Image_CanReadStream(InputStream stream) -> bool |
3013 | ||
3014 | Returns True if the image handlers can read an image file from the | |
3015 | data currently on the input stream, or a readable Python file-like | |
3016 | object. | |
3017 | """ | |
1bd55598 | 3018 | return _core_.Image_CanReadStream(*args, **kwargs) |
d55e5bfc | 3019 | |
5b5c9bc7 | 3020 | def Image_AddHandler(*args, **kwargs): |
1bd55598 RD |
3021 | """Image_AddHandler(ImageHandler handler)""" |
3022 | return _core_.Image_AddHandler(*args, **kwargs) | |
d55e5bfc | 3023 | |
5b5c9bc7 | 3024 | def Image_InsertHandler(*args, **kwargs): |
1bd55598 RD |
3025 | """Image_InsertHandler(ImageHandler handler)""" |
3026 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d55e5bfc | 3027 | |
5b5c9bc7 | 3028 | def Image_RemoveHandler(*args, **kwargs): |
1bd55598 RD |
3029 | """Image_RemoveHandler(String name) -> bool""" |
3030 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d55e5bfc | 3031 | |
1bd55598 RD |
3032 | def Image_GetHandlers(*args): |
3033 | """Image_GetHandlers() -> PyObject""" | |
3034 | return _core_.Image_GetHandlers(*args) | |
3035 | ||
3036 | def Image_GetImageExtWildcard(*args): | |
3037 | """ | |
7a27cf7c RD |
3038 | Image_GetImageExtWildcard() -> String |
3039 | ||
3040 | Iterates all registered wxImageHandler objects, and returns a string | |
3041 | containing file extension masks suitable for passing to file open/save | |
3042 | dialog boxes. | |
3043 | """ | |
1bd55598 | 3044 | return _core_.Image_GetImageExtWildcard(*args) |
d55e5bfc | 3045 | |
943e8dfd | 3046 | def Image_RGBtoHSV(*args, **kwargs): |
1bd55598 | 3047 | """ |
943e8dfd RD |
3048 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue |
3049 | ||
3050 | Converts a color in RGB color space to HSV color space. | |
3051 | """ | |
1bd55598 | 3052 | return _core_.Image_RGBtoHSV(*args, **kwargs) |
943e8dfd RD |
3053 | |
3054 | def Image_HSVtoRGB(*args, **kwargs): | |
1bd55598 | 3055 | """ |
943e8dfd RD |
3056 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue |
3057 | ||
3058 | Converts a color in HSV color space to RGB color space. | |
3059 | """ | |
1bd55598 | 3060 | return _core_.Image_HSVtoRGB(*args, **kwargs) |
943e8dfd | 3061 | |
fc46b7f3 RD |
3062 | |
3063 | def _ImageFromBuffer(*args, **kwargs): | |
3064 | """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image""" | |
3065 | return _core_._ImageFromBuffer(*args, **kwargs) | |
3066 | def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None): | |
3067 | """ | |
3068 | Creates a `wx.Image` from the data in dataBuffer. The dataBuffer | |
eec1c382 RD |
3069 | parameter must be a Python object that implements the buffer interface, |
3070 | such as a string, array, etc. The dataBuffer object is expected to | |
3071 | contain a series of RGB bytes and be width*height*3 bytes long. A buffer | |
3072 | object can optionally be supplied for the image's alpha channel data, and | |
3073 | it is expected to be width*height bytes long. | |
fc46b7f3 RD |
3074 | |
3075 | The wx.Image will be created with its data and alpha pointers initialized | |
3076 | to the memory address pointed to by the buffer objects, thus saving the | |
3077 | time needed to copy the image data from the buffer object to the wx.Image. | |
3078 | While this has advantages, it also has the shoot-yourself-in-the-foot | |
3079 | risks associated with sharing a C pointer between two objects. | |
3080 | ||
3081 | To help alleviate the risk a reference to the data and alpha buffer | |
3082 | objects are kept with the wx.Image, so that they won't get deleted until | |
3083 | after the wx.Image is deleted. However please be aware that it is not | |
3084 | guaranteed that an object won't move its memory buffer to a new location | |
3085 | when it needs to resize its contents. If that happens then the wx.Image | |
3086 | will end up referring to an invalid memory location and could cause the | |
3087 | application to crash. Therefore care should be taken to not manipulate | |
3088 | the objects used for the data and alpha buffers in a way that would cause | |
3089 | them to change size. | |
3090 | """ | |
fc46b7f3 RD |
3091 | image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer) |
3092 | image._buffer = dataBuffer | |
3093 | image._alpha = alphaBuffer | |
3094 | return image | |
3095 | ||
68e533f8 RD |
3096 | def InitAllImageHandlers(): |
3097 | """ | |
3098 | The former functionality of InitAllImageHanders is now done internal to | |
3099 | the _core_ extension module and so this function has become a simple NOP. | |
3100 | """ | |
3101 | pass | |
d55e5bfc | 3102 | |
5b5c9bc7 RD |
3103 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3104 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
3105 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR | |
3106 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3107 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
3108 | BMP_24BPP = _core_.BMP_24BPP | |
3109 | BMP_8BPP = _core_.BMP_8BPP | |
3110 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3111 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3112 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3113 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3114 | BMP_4BPP = _core_.BMP_4BPP | |
3115 | BMP_1BPP = _core_.BMP_1BPP | |
3116 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
3117 | class BMPHandler(ImageHandler): | |
27fb7603 | 3118 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
1bd55598 RD |
3119 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3120 | __repr__ = _swig_repr | |
3121 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3122 | """ |
3123 | __init__(self) -> BMPHandler | |
3124 | ||
3125 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3126 | """ | |
1bd55598 | 3127 | _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs)) |
2131d850 | 3128 | _core_.BMPHandler_swigregister(BMPHandler) |
5b5c9bc7 | 3129 | NullImage = cvar.NullImage |
68350608 | 3130 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d55e5bfc RD |
3131 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3132 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3133 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3134 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
68350608 RD |
3135 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3136 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d55e5bfc | 3137 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3138 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
68350608 RD |
3139 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3140 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3141 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3142 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
7fbf8399 RD |
3143 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3144 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d55e5bfc | 3145 | |
5b5c9bc7 | 3146 | class ICOHandler(BMPHandler): |
27fb7603 | 3147 | """A `wx.ImageHandler` for \*.ico icon files.""" |
1bd55598 RD |
3148 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3149 | __repr__ = _swig_repr | |
3150 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3151 | """ |
3152 | __init__(self) -> ICOHandler | |
3153 | ||
3154 | A `wx.ImageHandler` for \*.ico icon files. | |
3155 | """ | |
1bd55598 | 3156 | _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs)) |
2131d850 | 3157 | _core_.ICOHandler_swigregister(ICOHandler) |
d55e5bfc | 3158 | |
5b5c9bc7 | 3159 | class CURHandler(ICOHandler): |
27fb7603 | 3160 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
1bd55598 RD |
3161 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3162 | __repr__ = _swig_repr | |
3163 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3164 | """ |
3165 | __init__(self) -> CURHandler | |
3166 | ||
3167 | A `wx.ImageHandler` for \*.cur cursor files. | |
3168 | """ | |
1bd55598 | 3169 | _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs)) |
2131d850 | 3170 | _core_.CURHandler_swigregister(CURHandler) |
d55e5bfc | 3171 | |
5b5c9bc7 | 3172 | class ANIHandler(CURHandler): |
27fb7603 | 3173 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
1bd55598 RD |
3174 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3175 | __repr__ = _swig_repr | |
3176 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3177 | """ |
3178 | __init__(self) -> ANIHandler | |
3179 | ||
3180 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3181 | """ | |
1bd55598 | 3182 | _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs)) |
2131d850 | 3183 | _core_.ANIHandler_swigregister(ANIHandler) |
d55e5bfc | 3184 | |
5b5c9bc7 | 3185 | class PNGHandler(ImageHandler): |
27fb7603 | 3186 | """A `wx.ImageHandler` for PNG image files.""" |
1bd55598 RD |
3187 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3188 | __repr__ = _swig_repr | |
3189 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3190 | """ |
3191 | __init__(self) -> PNGHandler | |
3192 | ||
3193 | A `wx.ImageHandler` for PNG image files. | |
3194 | """ | |
1bd55598 | 3195 | _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs)) |
2131d850 | 3196 | _core_.PNGHandler_swigregister(PNGHandler) |
d55e5bfc | 3197 | |
5b5c9bc7 | 3198 | class GIFHandler(ImageHandler): |
27fb7603 | 3199 | """A `wx.ImageHandler` for GIF image files.""" |
1bd55598 RD |
3200 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3201 | __repr__ = _swig_repr | |
3202 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3203 | """ |
3204 | __init__(self) -> GIFHandler | |
3205 | ||
3206 | A `wx.ImageHandler` for GIF image files. | |
3207 | """ | |
1bd55598 | 3208 | _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs)) |
2131d850 | 3209 | _core_.GIFHandler_swigregister(GIFHandler) |
d55e5bfc | 3210 | |
5b5c9bc7 | 3211 | class PCXHandler(ImageHandler): |
27fb7603 | 3212 | """A `wx.ImageHandler` for PCX imager files.""" |
1bd55598 RD |
3213 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3214 | __repr__ = _swig_repr | |
3215 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3216 | """ |
3217 | __init__(self) -> PCXHandler | |
3218 | ||
3219 | A `wx.ImageHandler` for PCX imager files. | |
3220 | """ | |
1bd55598 | 3221 | _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs)) |
2131d850 | 3222 | _core_.PCXHandler_swigregister(PCXHandler) |
d55e5bfc | 3223 | |
5b5c9bc7 | 3224 | class JPEGHandler(ImageHandler): |
27fb7603 | 3225 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
1bd55598 RD |
3226 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3227 | __repr__ = _swig_repr | |
3228 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3229 | """ |
3230 | __init__(self) -> JPEGHandler | |
3231 | ||
3232 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3233 | """ | |
1bd55598 | 3234 | _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs)) |
2131d850 | 3235 | _core_.JPEGHandler_swigregister(JPEGHandler) |
d55e5bfc | 3236 | |
5b5c9bc7 | 3237 | class PNMHandler(ImageHandler): |
27fb7603 | 3238 | """A `wx.ImageHandler` for PNM image files.""" |
1bd55598 RD |
3239 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3240 | __repr__ = _swig_repr | |
3241 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3242 | """ |
3243 | __init__(self) -> PNMHandler | |
3244 | ||
3245 | A `wx.ImageHandler` for PNM image files. | |
3246 | """ | |
1bd55598 | 3247 | _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs)) |
2131d850 | 3248 | _core_.PNMHandler_swigregister(PNMHandler) |
d55e5bfc | 3249 | |
5b5c9bc7 | 3250 | class XPMHandler(ImageHandler): |
27fb7603 | 3251 | """A `wx.ImageHandler` for XPM image.""" |
1bd55598 RD |
3252 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3253 | __repr__ = _swig_repr | |
3254 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3255 | """ |
3256 | __init__(self) -> XPMHandler | |
3257 | ||
3258 | A `wx.ImageHandler` for XPM image. | |
3259 | """ | |
1bd55598 | 3260 | _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs)) |
2131d850 | 3261 | _core_.XPMHandler_swigregister(XPMHandler) |
d55e5bfc | 3262 | |
5b5c9bc7 | 3263 | class TIFFHandler(ImageHandler): |
27fb7603 | 3264 | """A `wx.ImageHandler` for TIFF image files.""" |
1bd55598 RD |
3265 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3266 | __repr__ = _swig_repr | |
3267 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3268 | """ |
3269 | __init__(self) -> TIFFHandler | |
3270 | ||
3271 | A `wx.ImageHandler` for TIFF image files. | |
3272 | """ | |
1bd55598 | 3273 | _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs)) |
2131d850 | 3274 | _core_.TIFFHandler_swigregister(TIFFHandler) |
d55e5bfc | 3275 | |
5b5c9bc7 RD |
3276 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3277 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3278 | class Quantize(object): | |
c0de73ae | 3279 | """Performs quantization, or colour reduction, on a wxImage.""" |
1bd55598 RD |
3280 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3281 | def __init__(self): raise AttributeError, "No constructor defined" | |
3282 | __repr__ = _swig_repr | |
c0de73ae RD |
3283 | def Quantize(*args, **kwargs): |
3284 | """ | |
5b5c9bc7 | 3285 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
c0de73ae RD |
3286 | |
3287 | Reduce the colours in the source image and put the result into the | |
3288 | destination image, setting the palette in the destination if | |
3289 | needed. Both images may be the same, to overwrite the source image. | |
3290 | """ | |
5b5c9bc7 | 3291 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae RD |
3292 | |
3293 | Quantize = staticmethod(Quantize) | |
2131d850 | 3294 | _core_.Quantize_swigregister(Quantize) |
c0de73ae | 3295 | |
5b5c9bc7 | 3296 | def Quantize_Quantize(*args, **kwargs): |
1bd55598 | 3297 | """ |
5b5c9bc7 | 3298 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
c0de73ae RD |
3299 | |
3300 | Reduce the colours in the source image and put the result into the | |
3301 | destination image, setting the palette in the destination if | |
3302 | needed. Both images may be the same, to overwrite the source image. | |
3303 | """ | |
1bd55598 | 3304 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae | 3305 | |
d55e5bfc RD |
3306 | #--------------------------------------------------------------------------- |
3307 | ||
5b5c9bc7 RD |
3308 | class EvtHandler(Object): |
3309 | """Proxy of C++ EvtHandler class""" | |
1bd55598 RD |
3310 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3311 | __repr__ = _swig_repr | |
3312 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 3313 | """__init__(self) -> EvtHandler""" |
1bd55598 | 3314 | _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs)) |
d55e5bfc | 3315 | def GetNextHandler(*args, **kwargs): |
5b5c9bc7 RD |
3316 | """GetNextHandler(self) -> EvtHandler""" |
3317 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) | |
d55e5bfc RD |
3318 | |
3319 | def GetPreviousHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3320 | """GetPreviousHandler(self) -> EvtHandler""" |
3321 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) | |
d55e5bfc RD |
3322 | |
3323 | def SetNextHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3324 | """SetNextHandler(self, EvtHandler handler)""" |
3325 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) | |
d55e5bfc RD |
3326 | |
3327 | def SetPreviousHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3328 | """SetPreviousHandler(self, EvtHandler handler)""" |
3329 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) | |
d55e5bfc RD |
3330 | |
3331 | def GetEvtHandlerEnabled(*args, **kwargs): | |
3332 | """GetEvtHandlerEnabled(self) -> bool""" | |
5b5c9bc7 | 3333 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
d55e5bfc RD |
3334 | |
3335 | def SetEvtHandlerEnabled(*args, **kwargs): | |
3336 | """SetEvtHandlerEnabled(self, bool enabled)""" | |
5b5c9bc7 | 3337 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
d55e5bfc RD |
3338 | |
3339 | def ProcessEvent(*args, **kwargs): | |
5b5c9bc7 RD |
3340 | """ProcessEvent(self, Event event) -> bool""" |
3341 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) | |
d55e5bfc RD |
3342 | |
3343 | def AddPendingEvent(*args, **kwargs): | |
5b5c9bc7 RD |
3344 | """AddPendingEvent(self, Event event)""" |
3345 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) | |
d55e5bfc RD |
3346 | |
3347 | def ProcessPendingEvents(*args, **kwargs): | |
3348 | """ProcessPendingEvents(self)""" | |
5b5c9bc7 | 3349 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
d55e5bfc RD |
3350 | |
3351 | def Connect(*args, **kwargs): | |
3352 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" | |
5b5c9bc7 | 3353 | return _core_.EvtHandler_Connect(*args, **kwargs) |
d55e5bfc RD |
3354 | |
3355 | def Disconnect(*args, **kwargs): | |
2131d850 | 3356 | """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool""" |
5b5c9bc7 | 3357 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
d55e5bfc RD |
3358 | |
3359 | def _setOORInfo(*args, **kwargs): | |
36ed4f51 | 3360 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
7e08d4ef RD |
3361 | val = _core_.EvtHandler__setOORInfo(*args, **kwargs) |
3362 | args[0].thisown = 0 | |
3363 | return val | |
d55e5bfc RD |
3364 | |
3365 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): | |
3366 | """ | |
3367 | Bind an event to an event handler. | |
3368 | ||
a5ee0656 RD |
3369 | :param event: One of the EVT_* objects that specifies the |
3370 | type of event to bind, | |
d55e5bfc | 3371 | |
a5ee0656 RD |
3372 | :param handler: A callable object to be invoked when the |
3373 | event is delivered to self. Pass None to | |
3374 | disconnect an event handler. | |
d55e5bfc | 3375 | |
a5ee0656 RD |
3376 | :param source: Sometimes the event originates from a |
3377 | different window than self, but you still | |
3378 | want to catch it in self. (For example, a | |
3379 | button event delivered to a frame.) By | |
3380 | passing the source of the event, the event | |
3381 | handling system is able to differentiate | |
3382 | between the same event type from different | |
3383 | controls. | |
d55e5bfc | 3384 | |
a5ee0656 RD |
3385 | :param id: Used to spcify the event source by ID instead |
3386 | of instance. | |
3387 | ||
3388 | :param id2: Used when it is desirable to bind a handler | |
3389 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d55e5bfc RD |
3390 | """ |
3391 | if source is not None: | |
3392 | id = source.GetId() | |
3393 | event.Bind(self, id, id2, handler) | |
3394 | ||
d6c14a4c RD |
3395 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3396 | """ | |
3397 | Disconencts the event handler binding for event from self. | |
3398 | Returns True if successful. | |
3399 | """ | |
3400 | if source is not None: | |
3401 | id = source.GetId() | |
3402 | return event.Unbind(self, id, id2) | |
d55e5bfc | 3403 | |
2131d850 | 3404 | _core_.EvtHandler_swigregister(EvtHandler) |
d55e5bfc RD |
3405 | |
3406 | #--------------------------------------------------------------------------- | |
3407 | ||
3408 | class PyEventBinder(object): | |
3409 | """ | |
3410 | Instances of this class are used to bind specific events to event | |
3411 | handlers. | |
3412 | """ | |
3413 | def __init__(self, evtType, expectedIDs=0): | |
3414 | if expectedIDs not in [0, 1, 2]: | |
3415 | raise ValueError, "Invalid number of expectedIDs" | |
3416 | self.expectedIDs = expectedIDs | |
3417 | ||
3418 | if type(evtType) == list or type(evtType) == tuple: | |
3419 | self.evtType = evtType | |
3420 | else: | |
3421 | self.evtType = [evtType] | |
3422 | ||
3423 | ||
3424 | def Bind(self, target, id1, id2, function): | |
3425 | """Bind this set of event types to target.""" | |
3426 | for et in self.evtType: | |
3427 | target.Connect(id1, id2, et, function) | |
3428 | ||
d6c14a4c RD |
3429 | |
3430 | def Unbind(self, target, id1, id2): | |
3431 | """Remove an event binding.""" | |
3432 | success = 0 | |
3433 | for et in self.evtType: | |
3434 | success += target.Disconnect(id1, id2, et) | |
3435 | return success != 0 | |
3436 | ||
d55e5bfc RD |
3437 | |
3438 | def __call__(self, *args): | |
3439 | """ | |
3440 | For backwards compatibility with the old EVT_* functions. | |
3441 | Should be called with either (window, func), (window, ID, | |
3442 | func) or (window, ID1, ID2, func) parameters depending on the | |
3443 | type of the event. | |
3444 | """ | |
3445 | assert len(args) == 2 + self.expectedIDs | |
3446 | id1 = wx.ID_ANY | |
3447 | id2 = wx.ID_ANY | |
3448 | target = args[0] | |
3449 | if self.expectedIDs == 0: | |
3450 | func = args[1] | |
3451 | elif self.expectedIDs == 1: | |
3452 | id1 = args[1] | |
3453 | func = args[2] | |
3454 | elif self.expectedIDs == 2: | |
3455 | id1 = args[1] | |
3456 | id2 = args[2] | |
3457 | func = args[3] | |
3458 | else: | |
3459 | raise ValueError, "Unexpected number of IDs" | |
3460 | ||
3461 | self.Bind(target, id1, id2, func) | |
3462 | ||
3463 | ||
3464 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3465 | def EVT_COMMAND(win, id, cmd, func): | |
3466 | win.Connect(id, -1, cmd, func) | |
3467 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3468 | win.Connect(id1, id2, cmd, func) | |
3469 | ||
3470 | ||
3471 | #--------------------------------------------------------------------------- | |
3472 | ||
3473 | #--------------------------------------------------------------------------- | |
3474 | ||
5b5c9bc7 RD |
3475 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3476 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
3477 | ||
1bd55598 | 3478 | def NewEventType(*args): |
2131d850 | 3479 | """NewEventType() -> EventType""" |
1bd55598 | 3480 | return _core_.NewEventType(*args) |
5b5c9bc7 RD |
3481 | wxEVT_NULL = _core_.wxEVT_NULL |
3482 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3483 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3484 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3485 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3486 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3487 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3488 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3489 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3490 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3491 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3492 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3493 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3494 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3495 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3496 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3497 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3498 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3499 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3500 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3501 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3502 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3503 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3504 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3505 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3506 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3507 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3508 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3509 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3510 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3511 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3512 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3513 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3514 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3515 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3516 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3517 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3518 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3519 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3520 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3521 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3522 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3523 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3524 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3525 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3526 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3527 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3528 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3529 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3530 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3531 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3532 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3533 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3534 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3535 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3536 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3537 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3538 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3539 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3540 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3541 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3542 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
4f433fef RD |
3543 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
3544 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
5b5c9bc7 RD |
3545 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
3546 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3547 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3548 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3549 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3550 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3551 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3552 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3553 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3554 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3555 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3556 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3557 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3558 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
5b5c9bc7 RD |
3559 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE |
3560 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3561 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3562 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3563 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3564 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3565 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
34e0a3bb | 3566 | wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST |
5b5c9bc7 RD |
3567 | wxEVT_PAINT = _core_.wxEVT_PAINT |
3568 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3569 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3570 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3571 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3572 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3573 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3574 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3575 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3576 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3577 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3578 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3579 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3580 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3581 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3582 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3583 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3584 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3585 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3586 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3587 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3588 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
3589 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE | |
2131d850 RD |
3590 | wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY |
3591 | wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT | |
3592 | wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE | |
5b5c9bc7 RD |
3593 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
3594 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3595 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3596 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3597 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3598 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3599 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d55e5bfc RD |
3600 | # |
3601 | # Create some event binders | |
3602 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3603 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3604 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3605 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3606 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3607 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3608 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3609 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3610 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3611 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3612 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3613 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3614 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
704eda0c | 3615 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) |
d55e5bfc RD |
3616 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) |
3617 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3618 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3619 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3620 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3621 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3622 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3623 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3624 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3625 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
704eda0c | 3626 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d55e5bfc RD |
3627 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3628 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3629 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3630 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3631 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3632 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3633 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3634 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3635 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3636 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3637 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3638 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3639 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3640 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3641 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3642 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
34e0a3bb | 3643 | EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST ) |
d55e5bfc RD |
3644 | |
3645 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3646 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3647 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3648 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3649 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3650 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3651 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3652 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3653 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3654 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3655 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3656 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3657 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3658 | ||
3659 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3660 | wxEVT_LEFT_UP, | |
3661 | wxEVT_MIDDLE_DOWN, | |
3662 | wxEVT_MIDDLE_UP, | |
3663 | wxEVT_RIGHT_DOWN, | |
3664 | wxEVT_RIGHT_UP, | |
3665 | wxEVT_MOTION, | |
3666 | wxEVT_LEFT_DCLICK, | |
3667 | wxEVT_MIDDLE_DCLICK, | |
3668 | wxEVT_RIGHT_DCLICK, | |
3669 | wxEVT_ENTER_WINDOW, | |
3670 | wxEVT_LEAVE_WINDOW, | |
3671 | wxEVT_MOUSEWHEEL | |
3672 | ]) | |
3673 | ||
3674 | ||
3675 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
704eda0c | 3676 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, |
d55e5bfc RD |
3677 | wxEVT_SCROLLWIN_BOTTOM, |
3678 | wxEVT_SCROLLWIN_LINEUP, | |
3679 | wxEVT_SCROLLWIN_LINEDOWN, | |
704eda0c | 3680 | wxEVT_SCROLLWIN_PAGEUP, |
d55e5bfc RD |
3681 | wxEVT_SCROLLWIN_PAGEDOWN, |
3682 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3683 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3684 | ]) | |
3685 | ||
3686 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3687 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3688 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3689 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3690 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3691 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3692 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3693 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3694 | ||
27fb7603 | 3695 | # Scrolling from wx.Slider and wx.ScrollBar |
704eda0c RD |
3696 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3697 | wxEVT_SCROLL_BOTTOM, | |
3698 | wxEVT_SCROLL_LINEUP, | |
3699 | wxEVT_SCROLL_LINEDOWN, | |
3700 | wxEVT_SCROLL_PAGEUP, | |
3701 | wxEVT_SCROLL_PAGEDOWN, | |
3702 | wxEVT_SCROLL_THUMBTRACK, | |
3703 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3704 | wxEVT_SCROLL_CHANGED, |
d55e5bfc RD |
3705 | ]) |
3706 | ||
3707 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3708 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3709 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3710 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3711 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3712 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3713 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3714 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4f433fef RD |
3715 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
3716 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
704eda0c | 3717 | |
27fb7603 | 3718 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
704eda0c RD |
3719 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3720 | wxEVT_SCROLL_BOTTOM, | |
3721 | wxEVT_SCROLL_LINEUP, | |
3722 | wxEVT_SCROLL_LINEDOWN, | |
3723 | wxEVT_SCROLL_PAGEUP, | |
3724 | wxEVT_SCROLL_PAGEDOWN, | |
3725 | wxEVT_SCROLL_THUMBTRACK, | |
d55e5bfc | 3726 | wxEVT_SCROLL_THUMBRELEASE, |
4f433fef | 3727 | wxEVT_SCROLL_CHANGED, |
d55e5bfc RD |
3728 | ], 1) |
3729 | ||
3730 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3731 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3732 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3733 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3734 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3735 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3736 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3737 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4f433fef RD |
3738 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
3739 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d55e5bfc RD |
3740 | |
3741 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) | |
3742 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3743 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3744 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3745 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3746 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3747 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3748 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3749 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3750 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3751 | ||
3752 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3753 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3754 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3755 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3756 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3757 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3758 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3759 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3760 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3761 | ||
3762 | ||
3763 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3764 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3765 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3766 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3767 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3768 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3769 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3770 | ||
3771 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
3772 | ||
3773 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
3774 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
3775 | ||
3776 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
3777 | ||
2131d850 RD |
3778 | EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT ) |
3779 | EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY ) | |
3780 | EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE ) | |
d55e5bfc RD |
3781 | |
3782 | ||
3783 | #--------------------------------------------------------------------------- | |
3784 | ||
5b5c9bc7 | 3785 | class Event(Object): |
27fb7603 RD |
3786 | """ |
3787 | An event is a structure holding information about an event passed to a | |
3788 | callback or member function. wx.Event is an abstract base class for | |
3789 | other event classes | |
3790 | """ | |
1bd55598 RD |
3791 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3792 | def __init__(self): raise AttributeError, "No constructor defined" | |
3793 | __repr__ = _swig_repr | |
3794 | __swig_destroy__ = _core_.delete_Event | |
3795 | __del__ = lambda self : None; | |
d55e5bfc | 3796 | def SetEventType(*args, **kwargs): |
27fb7603 | 3797 | """ |
2131d850 | 3798 | SetEventType(self, EventType typ) |
27fb7603 RD |
3799 | |
3800 | Sets the specific type of the event. | |
3801 | """ | |
5b5c9bc7 | 3802 | return _core_.Event_SetEventType(*args, **kwargs) |
d55e5bfc RD |
3803 | |
3804 | def GetEventType(*args, **kwargs): | |
27fb7603 | 3805 | """ |
2131d850 | 3806 | GetEventType(self) -> EventType |
27fb7603 RD |
3807 | |
3808 | Returns the identifier of the given event type, such as | |
3809 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
3810 | """ | |
5b5c9bc7 | 3811 | return _core_.Event_GetEventType(*args, **kwargs) |
d55e5bfc RD |
3812 | |
3813 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
3814 | """ |
3815 | GetEventObject(self) -> Object | |
3816 | ||
3817 | Returns the object (usually a window) associated with the event, if | |
3818 | any. | |
3819 | """ | |
5b5c9bc7 | 3820 | return _core_.Event_GetEventObject(*args, **kwargs) |
d55e5bfc RD |
3821 | |
3822 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
3823 | """ |
3824 | SetEventObject(self, Object obj) | |
3825 | ||
3826 | Sets the originating object, or in other words, obj is normally the | |
3827 | object that is sending the event. | |
3828 | """ | |
5b5c9bc7 | 3829 | return _core_.Event_SetEventObject(*args, **kwargs) |
d55e5bfc RD |
3830 | |
3831 | def GetTimestamp(*args, **kwargs): | |
3832 | """GetTimestamp(self) -> long""" | |
5b5c9bc7 | 3833 | return _core_.Event_GetTimestamp(*args, **kwargs) |
d55e5bfc RD |
3834 | |
3835 | def SetTimestamp(*args, **kwargs): | |
3836 | """SetTimestamp(self, long ts=0)""" | |
5b5c9bc7 | 3837 | return _core_.Event_SetTimestamp(*args, **kwargs) |
d55e5bfc RD |
3838 | |
3839 | def GetId(*args, **kwargs): | |
27fb7603 RD |
3840 | """ |
3841 | GetId(self) -> int | |
3842 | ||
3843 | Returns the identifier associated with this event, such as a button | |
3844 | command id. | |
3845 | """ | |
5b5c9bc7 | 3846 | return _core_.Event_GetId(*args, **kwargs) |
d55e5bfc RD |
3847 | |
3848 | def SetId(*args, **kwargs): | |
27fb7603 RD |
3849 | """ |
3850 | SetId(self, int Id) | |
3851 | ||
3852 | Set's the ID for the event. This is usually the ID of the window that | |
3853 | is sending the event, but it can also be a command id from a menu | |
3854 | item, etc. | |
3855 | """ | |
5b5c9bc7 | 3856 | return _core_.Event_SetId(*args, **kwargs) |
d55e5bfc RD |
3857 | |
3858 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
3859 | """ |
3860 | IsCommandEvent(self) -> bool | |
3861 | ||
3862 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
3863 | it returns false. Note: Exists only for optimization purposes. | |
3864 | """ | |
5b5c9bc7 | 3865 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
d55e5bfc RD |
3866 | |
3867 | def Skip(*args, **kwargs): | |
51b83b37 RD |
3868 | """ |
3869 | Skip(self, bool skip=True) | |
3870 | ||
3871 | Called by an event handler, it controls whether additional event | |
3872 | handlers bound to this event will be called after the current event | |
3873 | handler returns. Skip(false) (the default setting) will prevent | |
3874 | additional event handlers from being called and control will be | |
3875 | returned to the sender of the event immediately after the current | |
3876 | handler has finished. Skip(True) will cause the event processing | |
3877 | system to continue searching for a handler function for this event. | |
3878 | ||
3879 | """ | |
5b5c9bc7 | 3880 | return _core_.Event_Skip(*args, **kwargs) |
d55e5bfc RD |
3881 | |
3882 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
3883 | """ |
3884 | GetSkipped(self) -> bool | |
3885 | ||
3886 | Returns true if the event handler should be skipped, false otherwise. | |
3887 | :see: `Skip` | |
3888 | """ | |
5b5c9bc7 | 3889 | return _core_.Event_GetSkipped(*args, **kwargs) |
d55e5bfc RD |
3890 | |
3891 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
3892 | """ |
3893 | ShouldPropagate(self) -> bool | |
3894 | ||
3895 | Test if this event should be propagated to the parent window or not, | |
3896 | i.e. if the propagation level is currently greater than 0. | |
3897 | """ | |
5b5c9bc7 | 3898 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
d55e5bfc RD |
3899 | |
3900 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
3901 | """ |
3902 | StopPropagation(self) -> int | |
3903 | ||
3904 | Stop the event from propagating to its parent window. Returns the old | |
3905 | propagation level value which may be later passed to | |
3906 | `ResumePropagation` to allow propagating the event again. | |
3907 | """ | |
5b5c9bc7 | 3908 | return _core_.Event_StopPropagation(*args, **kwargs) |
d55e5bfc RD |
3909 | |
3910 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
3911 | """ |
3912 | ResumePropagation(self, int propagationLevel) | |
3913 | ||
3914 | Resume the event propagation by restoring the propagation level. (For | |
3915 | example, you can use the value returned by an earlier call to | |
3916 | `StopPropagation`.) | |
3917 | ||
3918 | """ | |
5b5c9bc7 | 3919 | return _core_.Event_ResumePropagation(*args, **kwargs) |
d55e5bfc RD |
3920 | |
3921 | def Clone(*args, **kwargs): | |
5b5c9bc7 RD |
3922 | """Clone(self) -> Event""" |
3923 | return _core_.Event_Clone(*args, **kwargs) | |
d55e5bfc | 3924 | |
2131d850 | 3925 | _core_.Event_swigregister(Event) |
d55e5bfc RD |
3926 | |
3927 | #--------------------------------------------------------------------------- | |
3928 | ||
5b5c9bc7 | 3929 | class PropagationDisabler(object): |
27fb7603 RD |
3930 | """ |
3931 | Helper class to temporarily change an event not to propagate. Simply | |
3932 | create an instance of this class and then whe it is destroyed the | |
3933 | propogation of the event will be restored. | |
3934 | """ | |
1bd55598 RD |
3935 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3936 | __repr__ = _swig_repr | |
3937 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3938 | """ |
3939 | __init__(self, Event event) -> PropagationDisabler | |
3940 | ||
3941 | Helper class to temporarily change an event not to propagate. Simply | |
3942 | create an instance of this class and then whe it is destroyed the | |
3943 | propogation of the event will be restored. | |
3944 | """ | |
1bd55598 RD |
3945 | _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs)) |
3946 | __swig_destroy__ = _core_.delete_PropagationDisabler | |
3947 | __del__ = lambda self : None; | |
2131d850 | 3948 | _core_.PropagationDisabler_swigregister(PropagationDisabler) |
d55e5bfc | 3949 | |
5b5c9bc7 | 3950 | class PropagateOnce(object): |
27fb7603 RD |
3951 | """ |
3952 | A helper class that will temporarily lower propagation level of an | |
3953 | event. Simply create an instance of this class and then whe it is | |
3954 | destroyed the propogation of the event will be restored. | |
3955 | """ | |
1bd55598 RD |
3956 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3957 | __repr__ = _swig_repr | |
3958 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3959 | """ |
3960 | __init__(self, Event event) -> PropagateOnce | |
3961 | ||
3962 | A helper class that will temporarily lower propagation level of an | |
3963 | event. Simply create an instance of this class and then whe it is | |
3964 | destroyed the propogation of the event will be restored. | |
3965 | """ | |
1bd55598 RD |
3966 | _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs)) |
3967 | __swig_destroy__ = _core_.delete_PropagateOnce | |
3968 | __del__ = lambda self : None; | |
2131d850 | 3969 | _core_.PropagateOnce_swigregister(PropagateOnce) |
d55e5bfc RD |
3970 | |
3971 | #--------------------------------------------------------------------------- | |
3972 | ||
5b5c9bc7 | 3973 | class CommandEvent(Event): |
27fb7603 RD |
3974 | """ |
3975 | This event class contains information about command events, which | |
3976 | originate from a variety of simple controls, as well as menus and | |
3977 | toolbars. | |
3978 | """ | |
1bd55598 RD |
3979 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3980 | __repr__ = _swig_repr | |
3981 | def __init__(self, *args, **kwargs): | |
27fb7603 | 3982 | """ |
2131d850 | 3983 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent |
27fb7603 RD |
3984 | |
3985 | This event class contains information about command events, which | |
3986 | originate from a variety of simple controls, as well as menus and | |
3987 | toolbars. | |
3988 | """ | |
1bd55598 | 3989 | _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs)) |
d55e5bfc | 3990 | def GetSelection(*args, **kwargs): |
27fb7603 RD |
3991 | """ |
3992 | GetSelection(self) -> int | |
3993 | ||
3994 | Returns item index for a listbox or choice selection event (not valid | |
3995 | for a deselection). | |
3996 | """ | |
5b5c9bc7 | 3997 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
d55e5bfc RD |
3998 | |
3999 | def SetString(*args, **kwargs): | |
5b5c9bc7 RD |
4000 | """SetString(self, String s)""" |
4001 | return _core_.CommandEvent_SetString(*args, **kwargs) | |
d55e5bfc RD |
4002 | |
4003 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4004 | """ |
4005 | GetString(self) -> String | |
4006 | ||
4007 | Returns item string for a listbox or choice selection event (not valid | |
4008 | for a deselection). | |
4009 | """ | |
5b5c9bc7 | 4010 | return _core_.CommandEvent_GetString(*args, **kwargs) |
d55e5bfc RD |
4011 | |
4012 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4013 | """ |
4014 | IsChecked(self) -> bool | |
4015 | ||
4016 | This method can be used with checkbox and menu events: for the | |
4017 | checkboxes, the method returns true for a selection event and false | |
4018 | for a deselection one. For the menu events, this method indicates if | |
4019 | the menu item just has become checked or unchecked (and thus only | |
4020 | makes sense for checkable menu items). | |
4021 | """ | |
5b5c9bc7 | 4022 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
d55e5bfc RD |
4023 | |
4024 | Checked = IsChecked | |
4025 | def IsSelection(*args, **kwargs): | |
27fb7603 RD |
4026 | """ |
4027 | IsSelection(self) -> bool | |
4028 | ||
4029 | For a listbox or similar event, returns true if it is a selection, | |
4030 | false if it is a deselection. | |
4031 | """ | |
5b5c9bc7 | 4032 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
d55e5bfc RD |
4033 | |
4034 | def SetExtraLong(*args, **kwargs): | |
4035 | """SetExtraLong(self, long extraLong)""" | |
5b5c9bc7 | 4036 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
d55e5bfc RD |
4037 | |
4038 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4039 | """ |
4040 | GetExtraLong(self) -> long | |
4041 | ||
5ba5649b RD |
4042 | Returns extra information dependant on the event objects type. If the |
4043 | event comes from a listbox selection, it is a boolean determining | |
4044 | whether the event was a selection (true) or a deselection (false). A | |
4045 | listbox deselection only occurs for multiple-selection boxes, and in | |
4046 | this case the index and string values are indeterminate and the | |
4047 | listbox must be examined by the application. | |
27fb7603 | 4048 | """ |
5b5c9bc7 | 4049 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
d55e5bfc RD |
4050 | |
4051 | def SetInt(*args, **kwargs): | |
4052 | """SetInt(self, int i)""" | |
5b5c9bc7 | 4053 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
d55e5bfc RD |
4054 | |
4055 | def GetInt(*args, **kwargs): | |
27fb7603 | 4056 | """ |
2131d850 | 4057 | GetInt(self) -> int |
27fb7603 | 4058 | |
5ba5649b RD |
4059 | Returns the integer identifier corresponding to a listbox, choice or |
4060 | radiobox selection (only if the event was a selection, not a | |
4061 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4062 | """ |
5b5c9bc7 | 4063 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
d55e5bfc | 4064 | |
1bd55598 RD |
4065 | def GetClientData(*args, **kwargs): |
4066 | """ | |
4067 | GetClientData(self) -> PyObject | |
4068 | ||
4069 | Returns the client data object for a listbox or choice selection event, (if any.) | |
4070 | """ | |
4071 | return _core_.CommandEvent_GetClientData(*args, **kwargs) | |
4072 | ||
4073 | def SetClientData(*args, **kwargs): | |
4074 | """ | |
4075 | SetClientData(self, PyObject clientData) | |
4076 | ||
4077 | Associate the given client data with the item at position n. | |
4078 | """ | |
4079 | return _core_.CommandEvent_SetClientData(*args, **kwargs) | |
4080 | ||
4081 | GetClientObject = GetClientData | |
4082 | SetClientObject = SetClientData | |
4083 | ||
d55e5bfc | 4084 | def Clone(*args, **kwargs): |
5b5c9bc7 RD |
4085 | """Clone(self) -> Event""" |
4086 | return _core_.CommandEvent_Clone(*args, **kwargs) | |
d55e5bfc | 4087 | |
2131d850 | 4088 | _core_.CommandEvent_swigregister(CommandEvent) |
d55e5bfc RD |
4089 | |
4090 | #--------------------------------------------------------------------------- | |
4091 | ||
5b5c9bc7 | 4092 | class NotifyEvent(CommandEvent): |
27fb7603 RD |
4093 | """ |
4094 | An instance of this class (or one of its derived classes) is sent from | |
4095 | a control when the control's state is being changed and the control | |
4096 | allows that change to be prevented from happening. The event handler | |
4097 | can call `Veto` or `Allow` to tell the control what to do. | |
4098 | """ | |
1bd55598 RD |
4099 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4100 | __repr__ = _swig_repr | |
4101 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4102 | """ |
2131d850 | 4103 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent |
27fb7603 RD |
4104 | |
4105 | An instance of this class (or one of its derived classes) is sent from | |
4106 | a control when the control's state is being changed and the control | |
4107 | allows that change to be prevented from happening. The event handler | |
4108 | can call `Veto` or `Allow` to tell the control what to do. | |
4109 | """ | |
1bd55598 | 4110 | _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs)) |
d55e5bfc | 4111 | def Veto(*args, **kwargs): |
27fb7603 RD |
4112 | """ |
4113 | Veto(self) | |
4114 | ||
4115 | Prevents the change announced by this event from happening. | |
4116 | ||
4117 | It is in general a good idea to notify the user about the reasons for | |
4118 | vetoing the change because otherwise the applications behaviour (which | |
4119 | just refuses to do what the user wants) might be quite surprising. | |
4120 | """ | |
5b5c9bc7 | 4121 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
d55e5bfc RD |
4122 | |
4123 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4124 | """ |
4125 | Allow(self) | |
4126 | ||
4127 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4128 | processed. For most events it is not necessary to call this method as | |
4129 | the events are allowed anyhow but some are forbidden by default (this | |
4130 | will be mentioned in the corresponding event description). | |
4131 | """ | |
5b5c9bc7 | 4132 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
d55e5bfc RD |
4133 | |
4134 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4135 | """ |
4136 | IsAllowed(self) -> bool | |
4137 | ||
4138 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4139 | false otherwise (if it was). | |
4140 | """ | |
5b5c9bc7 | 4141 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
d55e5bfc | 4142 | |
2131d850 | 4143 | _core_.NotifyEvent_swigregister(NotifyEvent) |
d55e5bfc RD |
4144 | |
4145 | #--------------------------------------------------------------------------- | |
4146 | ||
5b5c9bc7 | 4147 | class ScrollEvent(CommandEvent): |
27fb7603 RD |
4148 | """ |
4149 | A scroll event holds information about events sent from stand-alone | |
4150 | scrollbars and sliders. Note that scrolled windows do not send | |
4151 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4152 | instead. | |
4153 | """ | |
1bd55598 RD |
4154 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4155 | __repr__ = _swig_repr | |
4156 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 4157 | """ |
2131d850 | 4158 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0, |
5b5c9bc7 | 4159 | int orient=0) -> ScrollEvent |
d55e5bfc | 4160 | """ |
1bd55598 | 4161 | _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs)) |
d55e5bfc | 4162 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4163 | """ |
4164 | GetOrientation(self) -> int | |
4165 | ||
4166 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4167 | the scrollbar. | |
4168 | """ | |
5b5c9bc7 | 4169 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
4170 | |
4171 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4172 | """ |
4173 | GetPosition(self) -> int | |
4174 | ||
4175 | Returns the position of the scrollbar. | |
4176 | """ | |
5b5c9bc7 | 4177 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4178 | |
4179 | def SetOrientation(*args, **kwargs): | |
4180 | """SetOrientation(self, int orient)""" | |
5b5c9bc7 | 4181 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
d55e5bfc RD |
4182 | |
4183 | def SetPosition(*args, **kwargs): | |
4184 | """SetPosition(self, int pos)""" | |
5b5c9bc7 | 4185 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
d55e5bfc | 4186 | |
2131d850 | 4187 | _core_.ScrollEvent_swigregister(ScrollEvent) |
d55e5bfc RD |
4188 | |
4189 | #--------------------------------------------------------------------------- | |
4190 | ||
5b5c9bc7 | 4191 | class ScrollWinEvent(Event): |
27fb7603 RD |
4192 | """ |
4193 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4194 | scrolling windows. | |
4195 | """ | |
1bd55598 RD |
4196 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4197 | __repr__ = _swig_repr | |
4198 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4199 | """ |
2131d850 | 4200 | __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent |
27fb7603 RD |
4201 | |
4202 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4203 | scrolling windows. | |
4204 | """ | |
1bd55598 | 4205 | _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs)) |
d55e5bfc | 4206 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4207 | """ |
4208 | GetOrientation(self) -> int | |
4209 | ||
4210 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4211 | the scrollbar. | |
4212 | """ | |
5b5c9bc7 | 4213 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
4214 | |
4215 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4216 | """ |
4217 | GetPosition(self) -> int | |
4218 | ||
4219 | Returns the position of the scrollbar for the thumb track and release | |
4220 | events. Note that this field can't be used for the other events, you | |
4221 | need to query the window itself for the current position in that case. | |
4222 | """ | |
5b5c9bc7 | 4223 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4224 | |
4225 | def SetOrientation(*args, **kwargs): | |
4226 | """SetOrientation(self, int orient)""" | |
5b5c9bc7 | 4227 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
d55e5bfc RD |
4228 | |
4229 | def SetPosition(*args, **kwargs): | |
4230 | """SetPosition(self, int pos)""" | |
5b5c9bc7 | 4231 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
d55e5bfc | 4232 | |
2131d850 | 4233 | _core_.ScrollWinEvent_swigregister(ScrollWinEvent) |
d55e5bfc RD |
4234 | |
4235 | #--------------------------------------------------------------------------- | |
4236 | ||
5b5c9bc7 RD |
4237 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4238 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4239 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4240 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4241 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
4242 | class MouseEvent(Event): | |
27fb7603 RD |
4243 | """ |
4244 | This event class contains information about the events generated by | |
4245 | the mouse: they include mouse buttons press and release events and | |
4246 | mouse move events. | |
4247 | ||
4248 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4249 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4250 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4251 | a middle button so a portable application should avoid relying on the | |
4252 | events from it. | |
4253 | ||
4254 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4255 | the former returns true when the event corresponds to the left mouse | |
4256 | button click while the latter returns true if the left mouse button is | |
4257 | currently being pressed. For example, when the user is dragging the | |
4258 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4259 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4260 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4261 | underlying GUI behaviour is (which is platform-dependent). The same | |
4262 | applies, of course, to other mouse buttons as well. | |
4263 | """ | |
1bd55598 RD |
4264 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4265 | __repr__ = _swig_repr | |
4266 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4267 | """ |
2131d850 | 4268 | __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent |
27fb7603 RD |
4269 | |
4270 | Constructs a wx.MouseEvent. Valid event types are: | |
4271 | ||
4272 | * wxEVT_ENTER_WINDOW | |
4273 | * wxEVT_LEAVE_WINDOW | |
4274 | * wxEVT_LEFT_DOWN | |
4275 | * wxEVT_LEFT_UP | |
4276 | * wxEVT_LEFT_DCLICK | |
4277 | * wxEVT_MIDDLE_DOWN | |
4278 | * wxEVT_MIDDLE_UP | |
4279 | * wxEVT_MIDDLE_DCLICK | |
4280 | * wxEVT_RIGHT_DOWN | |
4281 | * wxEVT_RIGHT_UP | |
4282 | * wxEVT_RIGHT_DCLICK | |
4283 | * wxEVT_MOTION | |
4284 | * wxEVT_MOUSEWHEEL | |
4285 | """ | |
1bd55598 | 4286 | _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs)) |
d55e5bfc | 4287 | def IsButton(*args, **kwargs): |
27fb7603 RD |
4288 | """ |
4289 | IsButton(self) -> bool | |
4290 | ||
4291 | Returns true if the event was a mouse button event (not necessarily a | |
4292 | button down event - that may be tested using `ButtonDown`). | |
4293 | """ | |
5b5c9bc7 | 4294 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
d55e5bfc RD |
4295 | |
4296 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4297 | """ |
4298 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4299 | ||
5ba5649b RD |
4300 | If the argument is omitted, this returns true if the event was any |
4301 | mouse button down event. Otherwise the argument specifies which | |
4302 | button-down event shold be checked for (see `Button` for the possible | |
4303 | values). | |
27fb7603 | 4304 | """ |
5b5c9bc7 | 4305 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
d55e5bfc RD |
4306 | |
4307 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4308 | """ |
4309 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4310 | ||
4311 | If the argument is omitted, this returns true if the event was any | |
4312 | mouse double click event. Otherwise the argument specifies which | |
4313 | double click event to check for (see `Button` for the possible | |
4314 | values). | |
4315 | """ | |
5b5c9bc7 | 4316 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
d55e5bfc RD |
4317 | |
4318 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4319 | """ |
4320 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4321 | ||
4322 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4323 | mouse button up event. Otherwise the argument specifies which button |
4324 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4325 | """ |
5b5c9bc7 | 4326 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
d55e5bfc RD |
4327 | |
4328 | def Button(*args, **kwargs): | |
27fb7603 RD |
4329 | """ |
4330 | Button(self, int button) -> bool | |
4331 | ||
4332 | Returns true if the identified mouse button is changing state. Valid | |
4333 | values of button are: | |
4334 | ||
4335 | ==================== ===================================== | |
4336 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4337 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4338 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4339 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4340 | ==================== ===================================== | |
4341 | ||
4342 | """ | |
5b5c9bc7 | 4343 | return _core_.MouseEvent_Button(*args, **kwargs) |
d55e5bfc RD |
4344 | |
4345 | def ButtonIsDown(*args, **kwargs): | |
4346 | """ButtonIsDown(self, int but) -> bool""" | |
5b5c9bc7 | 4347 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
d55e5bfc RD |
4348 | |
4349 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4350 | """ |
4351 | GetButton(self) -> int | |
4352 | ||
4353 | Returns the mouse button which generated this event or | |
4354 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4355 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4356 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4357 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4358 | right buttons respectively. | |
4359 | """ | |
5b5c9bc7 | 4360 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
d55e5bfc RD |
4361 | |
4362 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4363 | """ |
4364 | ControlDown(self) -> bool | |
4365 | ||
4366 | Returns true if the control key was down at the time of the event. | |
4367 | """ | |
5b5c9bc7 | 4368 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
d55e5bfc RD |
4369 | |
4370 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4371 | """ |
4372 | MetaDown(self) -> bool | |
4373 | ||
4374 | Returns true if the Meta key was down at the time of the event. | |
4375 | """ | |
5b5c9bc7 | 4376 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
d55e5bfc RD |
4377 | |
4378 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4379 | """ |
4380 | AltDown(self) -> bool | |
4381 | ||
4382 | Returns true if the Alt key was down at the time of the event. | |
4383 | """ | |
5b5c9bc7 | 4384 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
d55e5bfc RD |
4385 | |
4386 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4387 | """ |
4388 | ShiftDown(self) -> bool | |
4389 | ||
4390 | Returns true if the Shift key was down at the time of the event. | |
4391 | """ | |
5b5c9bc7 | 4392 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
d55e5bfc | 4393 | |
412d302d RD |
4394 | def CmdDown(*args, **kwargs): |
4395 | """ | |
4396 | CmdDown(self) -> bool | |
4397 | ||
4398 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4399 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4400 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4401 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4402 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4403 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4404 | and Macs this is the same as `MetaDown`. | |
4405 | """ | |
5b5c9bc7 | 4406 | return _core_.MouseEvent_CmdDown(*args, **kwargs) |
412d302d | 4407 | |
d55e5bfc | 4408 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4409 | """ |
4410 | LeftDown(self) -> bool | |
4411 | ||
4412 | Returns true if the left mouse button state changed to down. | |
4413 | """ | |
5b5c9bc7 | 4414 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
d55e5bfc RD |
4415 | |
4416 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4417 | """ |
4418 | MiddleDown(self) -> bool | |
4419 | ||
4420 | Returns true if the middle mouse button state changed to down. | |
4421 | """ | |
5b5c9bc7 | 4422 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
d55e5bfc RD |
4423 | |
4424 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4425 | """ |
4426 | RightDown(self) -> bool | |
4427 | ||
4428 | Returns true if the right mouse button state changed to down. | |
4429 | """ | |
5b5c9bc7 | 4430 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
d55e5bfc RD |
4431 | |
4432 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4433 | """ |
4434 | LeftUp(self) -> bool | |
4435 | ||
4436 | Returns true if the left mouse button state changed to up. | |
4437 | """ | |
5b5c9bc7 | 4438 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
d55e5bfc RD |
4439 | |
4440 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4441 | """ |
4442 | MiddleUp(self) -> bool | |
4443 | ||
4444 | Returns true if the middle mouse button state changed to up. | |
4445 | """ | |
5b5c9bc7 | 4446 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
d55e5bfc RD |
4447 | |
4448 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4449 | """ |
4450 | RightUp(self) -> bool | |
4451 | ||
4452 | Returns true if the right mouse button state changed to up. | |
4453 | """ | |
5b5c9bc7 | 4454 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
d55e5bfc RD |
4455 | |
4456 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4457 | """ |
4458 | LeftDClick(self) -> bool | |
4459 | ||
4460 | Returns true if the event was a left button double click. | |
4461 | """ | |
5b5c9bc7 | 4462 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
d55e5bfc RD |
4463 | |
4464 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4465 | """ |
4466 | MiddleDClick(self) -> bool | |
4467 | ||
4468 | Returns true if the event was a middle button double click. | |
4469 | """ | |
5b5c9bc7 | 4470 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
d55e5bfc RD |
4471 | |
4472 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4473 | """ |
4474 | RightDClick(self) -> bool | |
4475 | ||
4476 | Returns true if the event was a right button double click. | |
4477 | """ | |
5b5c9bc7 | 4478 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
d55e5bfc RD |
4479 | |
4480 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4481 | """ |
4482 | LeftIsDown(self) -> bool | |
4483 | ||
4484 | Returns true if the left mouse button is currently down, independent | |
4485 | of the current event type. | |
4486 | ||
4487 | Please notice that it is not the same as LeftDown which returns true | |
4488 | if the left mouse button was just pressed. Rather, it describes the | |
4489 | state of the mouse button before the event happened. | |
4490 | ||
4491 | This event is usually used in the mouse event handlers which process | |
4492 | "move mouse" messages to determine whether the user is (still) | |
4493 | dragging the mouse. | |
4494 | """ | |
5b5c9bc7 | 4495 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
d55e5bfc RD |
4496 | |
4497 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4498 | """ |
4499 | MiddleIsDown(self) -> bool | |
4500 | ||
4501 | Returns true if the middle mouse button is currently down, independent | |
4502 | of the current event type. | |
4503 | """ | |
5b5c9bc7 | 4504 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
d55e5bfc RD |
4505 | |
4506 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4507 | """ |
4508 | RightIsDown(self) -> bool | |
4509 | ||
4510 | Returns true if the right mouse button is currently down, independent | |
4511 | of the current event type. | |
4512 | """ | |
5b5c9bc7 | 4513 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
d55e5bfc RD |
4514 | |
4515 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4516 | """ |
4517 | Dragging(self) -> bool | |
4518 | ||
4519 | Returns true if this was a dragging event (motion while a button is | |
4520 | depressed). | |
4521 | """ | |
5b5c9bc7 | 4522 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
d55e5bfc RD |
4523 | |
4524 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4525 | """ |
4526 | Moving(self) -> bool | |
4527 | ||
4528 | Returns true if this was a motion event and no mouse buttons were | |
4529 | pressed. If any mouse button is held pressed, then this method returns | |
4530 | false and Dragging returns true. | |
4531 | """ | |
5b5c9bc7 | 4532 | return _core_.MouseEvent_Moving(*args, **kwargs) |
d55e5bfc RD |
4533 | |
4534 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4535 | """ |
4536 | Entering(self) -> bool | |
4537 | ||
4538 | Returns true if the mouse was entering the window. | |
4539 | """ | |
5b5c9bc7 | 4540 | return _core_.MouseEvent_Entering(*args, **kwargs) |
d55e5bfc RD |
4541 | |
4542 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4543 | """ |
4544 | Leaving(self) -> bool | |
4545 | ||
4546 | Returns true if the mouse was leaving the window. | |
4547 | """ | |
5b5c9bc7 | 4548 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
d55e5bfc RD |
4549 | |
4550 | def GetPosition(*args, **kwargs): | |
4551 | """ | |
5b5c9bc7 | 4552 | GetPosition(self) -> Point |
d55e5bfc | 4553 | |
27fb7603 RD |
4554 | Returns the pixel position of the mouse in window coordinates when the |
4555 | event happened. | |
d55e5bfc | 4556 | """ |
5b5c9bc7 | 4557 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4558 | |
4559 | def GetPositionTuple(*args, **kwargs): | |
4560 | """ | |
4561 | GetPositionTuple() -> (x,y) | |
4562 | ||
27fb7603 RD |
4563 | Returns the pixel position of the mouse in window coordinates when the |
4564 | event happened. | |
d55e5bfc | 4565 | """ |
5b5c9bc7 | 4566 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
d55e5bfc RD |
4567 | |
4568 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4569 | """ |
4570 | GetLogicalPosition(self, DC dc) -> Point | |
4571 | ||
4572 | Returns the logical mouse position in pixels (i.e. translated | |
4573 | according to the translation set for the DC, which usually indicates | |
4574 | that the window has been scrolled). | |
4575 | """ | |
5b5c9bc7 | 4576 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
d55e5bfc RD |
4577 | |
4578 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4579 | """ |
4580 | GetX(self) -> int | |
4581 | ||
4582 | Returns X coordinate of the physical mouse event position. | |
4583 | """ | |
5b5c9bc7 | 4584 | return _core_.MouseEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
4585 | |
4586 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4587 | """ |
4588 | GetY(self) -> int | |
4589 | ||
4590 | Returns Y coordinate of the physical mouse event position. | |
4591 | """ | |
5b5c9bc7 | 4592 | return _core_.MouseEvent_GetY(*args, **kwargs) |
d55e5bfc RD |
4593 | |
4594 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4595 | """ |
4596 | GetWheelRotation(self) -> int | |
4597 | ||
4598 | Get wheel rotation, positive or negative indicates direction of | |
4599 | rotation. Current devices all send an event when rotation is equal to | |
4600 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4601 | created in the future. Because of this you shouldn't assume that one | |
4602 | event is equal to 1 line or whatever, but you should be able to either | |
4603 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4604 | have been accumulated before scrolling. | |
4605 | """ | |
5b5c9bc7 | 4606 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
d55e5bfc RD |
4607 | |
4608 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4609 | """ |
4610 | GetWheelDelta(self) -> int | |
4611 | ||
4612 | Get wheel delta, normally 120. This is the threshold for action to be | |
4613 | taken, and one such action (for example, scrolling one increment) | |
4614 | should occur for each delta. | |
4615 | """ | |
5b5c9bc7 | 4616 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
d55e5bfc RD |
4617 | |
4618 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4619 | """ |
4620 | GetLinesPerAction(self) -> int | |
4621 | ||
4622 | Returns the configured number of lines (or whatever) to be scrolled | |
4623 | per wheel action. Defaults to three. | |
4624 | """ | |
5b5c9bc7 | 4625 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
d55e5bfc RD |
4626 | |
4627 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4628 | """ |
4629 | IsPageScroll(self) -> bool | |
4630 | ||
4631 | Returns true if the system has been setup to do page scrolling with | |
4632 | the mouse wheel instead of line scrolling. | |
4633 | """ | |
5b5c9bc7 RD |
4634 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4635 | ||
4636 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4637 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4638 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4639 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4640 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4641 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4642 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4643 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4644 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4645 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4646 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4647 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
2131d850 | 4648 | _core_.MouseEvent_swigregister(MouseEvent) |
d55e5bfc RD |
4649 | |
4650 | #--------------------------------------------------------------------------- | |
4651 | ||
5b5c9bc7 | 4652 | class SetCursorEvent(Event): |
5ba5649b RD |
4653 | """ |
4654 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4655 | as a result of mouse motion. This event gives the application the | |
4656 | chance to perform specific mouse cursor processing based on the | |
4657 | current position of the mouse within the window. Use the `SetCursor` | |
4658 | method to specify the cursor you want to be displayed. | |
4659 | """ | |
1bd55598 RD |
4660 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4661 | __repr__ = _swig_repr | |
4662 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4663 | """ |
4664 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4665 | ||
4666 | Construct a new `wx.SetCursorEvent`. | |
4667 | """ | |
1bd55598 | 4668 | _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs)) |
d55e5bfc | 4669 | def GetX(*args, **kwargs): |
5ba5649b RD |
4670 | """ |
4671 | GetX(self) -> int | |
4672 | ||
4673 | Returns the X coordinate of the mouse in client coordinates. | |
4674 | """ | |
5b5c9bc7 | 4675 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
4676 | |
4677 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4678 | """ |
4679 | GetY(self) -> int | |
4680 | ||
4681 | Returns the Y coordinate of the mouse in client coordinates. | |
4682 | """ | |
5b5c9bc7 | 4683 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
d55e5bfc RD |
4684 | |
4685 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4686 | """ |
4687 | SetCursor(self, Cursor cursor) | |
4688 | ||
4689 | Sets the cursor associated with this event. | |
4690 | """ | |
5b5c9bc7 | 4691 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
d55e5bfc RD |
4692 | |
4693 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4694 | """ |
4695 | GetCursor(self) -> Cursor | |
4696 | ||
4697 | Returns a reference to the cursor specified by this event. | |
4698 | """ | |
5b5c9bc7 | 4699 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
d55e5bfc RD |
4700 | |
4701 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
4702 | """ |
4703 | HasCursor(self) -> bool | |
4704 | ||
4705 | Returns true if the cursor specified by this event is a valid cursor. | |
4706 | """ | |
5b5c9bc7 | 4707 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
d55e5bfc | 4708 | |
2131d850 | 4709 | _core_.SetCursorEvent_swigregister(SetCursorEvent) |
d55e5bfc RD |
4710 | |
4711 | #--------------------------------------------------------------------------- | |
4712 | ||
5b5c9bc7 | 4713 | class KeyEvent(Event): |
5ba5649b RD |
4714 | """ |
4715 | This event class contains information about keypress and character | |
4716 | events. These events are only sent to the widget that currently has | |
4717 | the keyboard focus. | |
4718 | ||
4719 | Notice that there are three different kinds of keyboard events in | |
4720 | wxWidgets: key down and up events and char events. The difference | |
4721 | between the first two is clear - the first corresponds to a key press | |
4722 | and the second to a key release - otherwise they are identical. Just | |
4723 | note that if the key is maintained in a pressed state you will | |
4724 | typically get a lot of (automatically generated) down events but only | |
4725 | one up so it is wrong to assume that there is one up event | |
4726 | corresponding to each down one. | |
4727 | ||
4728 | Both key events provide untranslated key codes while the char event | |
4729 | carries the translated one. The untranslated code for alphanumeric | |
4730 | keys is always an upper case value. For the other keys it is one of | |
4731 | WXK_XXX values from the keycodes table. The translated key is, in | |
4732 | general, the character the user expects to appear as the result of the | |
4733 | key combination when typing the text into a text entry zone, for | |
4734 | example. | |
4735 | ||
4736 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
4737 | and the standard US keyboard): when the 'A' key is pressed, the key | |
4738 | down event key code is equal to ASCII A == 65. But the char event key | |
4739 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
4740 | 'A' keys simultaneously , the key code in key down event will still be | |
4741 | just 'A' while the char event key code parameter will now be 'A' as | |
4742 | well. | |
4743 | ||
4744 | Although in this simple case it is clear that the correct key code | |
4745 | could be found in the key down event handler by checking the value | |
4746 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
4747 | as for non alphanumeric keys or non-US keyboard layouts the | |
4748 | translation is keyboard-layout dependent and can only be done properly | |
4749 | by the system itself. | |
4750 | ||
4751 | Another kind of translation is done when the control key is pressed: | |
4752 | for example, for CTRL-A key press the key down event still carries the | |
4753 | same key code 'A' as usual but the char event will have key code of 1, | |
4754 | the ASCII value of this key combination. | |
4755 | ||
4756 | You may discover how the other keys on your system behave | |
4757 | interactively by running the KeyEvents sample in the wxPython demo and | |
4758 | pressing some keys while the blue box at the top has the keyboard | |
4759 | focus. | |
4760 | ||
4761 | **Note**: If a key down event is caught and the event handler does not | |
4762 | call event.Skip() then the coresponding char event will not | |
4763 | happen. This is by design and enables the programs that handle both | |
4764 | types of events to be a bit simpler. | |
4765 | ||
4766 | **Note for Windows programmers**: The key and char events in wxWidgets | |
4767 | are similar to but slightly different from Windows WM_KEYDOWN and | |
4768 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
4769 | event in wxWidgets (unless it is used as an accelerator). | |
4770 | ||
4771 | **Tip**: be sure to call event.Skip() for events that you don't | |
4772 | process in key event function, otherwise menu shortcuts may cease to | |
4773 | work under Windows. | |
4774 | ||
4775 | """ | |
1bd55598 RD |
4776 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4777 | __repr__ = _swig_repr | |
4778 | def __init__(self, *args, **kwargs): | |
5ba5649b | 4779 | """ |
2131d850 | 4780 | __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent |
5ba5649b RD |
4781 | |
4782 | Construct a new `wx.KeyEvent`. Valid event types are: | |
4783 | * | |
4784 | """ | |
1bd55598 | 4785 | _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs)) |
b1fcee84 RD |
4786 | def GetModifiers(*args, **kwargs): |
4787 | """ | |
4788 | GetModifiers(self) -> int | |
4789 | ||
4790 | Returns a bitmask of the current modifier settings. Can be used to | |
4791 | check if the key event has exactly the given modifiers without having | |
4792 | to explicitly check that the other modifiers are not down. For | |
4793 | example:: | |
4794 | ||
4795 | if event.GetModifers() == wx.MOD_CONTROL: | |
4796 | DoSomething() | |
4797 | ||
4798 | """ | |
4799 | return _core_.KeyEvent_GetModifiers(*args, **kwargs) | |
4800 | ||
d55e5bfc | 4801 | def ControlDown(*args, **kwargs): |
5ba5649b RD |
4802 | """ |
4803 | ControlDown(self) -> bool | |
4804 | ||
4805 | Returns ``True`` if the Control key was down at the time of the event. | |
4806 | """ | |
5b5c9bc7 | 4807 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
d55e5bfc RD |
4808 | |
4809 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
4810 | """ |
4811 | MetaDown(self) -> bool | |
4812 | ||
4813 | Returns ``True`` if the Meta key was down at the time of the event. | |
4814 | """ | |
5b5c9bc7 | 4815 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
d55e5bfc RD |
4816 | |
4817 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
4818 | """ |
4819 | AltDown(self) -> bool | |
4820 | ||
4821 | Returns ``True`` if the Alt key was down at the time of the event. | |
4822 | """ | |
5b5c9bc7 | 4823 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
d55e5bfc RD |
4824 | |
4825 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
4826 | """ |
4827 | ShiftDown(self) -> bool | |
4828 | ||
4829 | Returns ``True`` if the Shift key was down at the time of the event. | |
4830 | """ | |
5b5c9bc7 | 4831 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
d55e5bfc | 4832 | |
412d302d RD |
4833 | def CmdDown(*args, **kwargs): |
4834 | """ | |
4835 | CmdDown(self) -> bool | |
4836 | ||
4837 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4838 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4839 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
4840 | because Cmd key is used for the same thing under Mac as Ctrl |
4841 | elsewhere. The Ctrl still exists, it's just not used for this | |
4842 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
4843 | and Macs this is the same as `MetaDown`. | |
4844 | """ | |
5b5c9bc7 | 4845 | return _core_.KeyEvent_CmdDown(*args, **kwargs) |
412d302d | 4846 | |
d55e5bfc | 4847 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
4848 | """ |
4849 | HasModifiers(self) -> bool | |
4850 | ||
4851 | Returns true if either CTRL or ALT keys was down at the time of the | |
4852 | key event. Note that this function does not take into account neither | |
4853 | SHIFT nor META key states (the reason for ignoring the latter is that | |
4854 | it is common for NUMLOCK key to be configured as META under X but the | |
4855 | key presses even while NUMLOCK is on should be still processed | |
4856 | normally). | |
4857 | """ | |
5b5c9bc7 | 4858 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
d55e5bfc RD |
4859 | |
4860 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
4861 | """ |
4862 | GetKeyCode(self) -> int | |
4863 | ||
4864 | Returns the virtual key code. ASCII events return normal ASCII values, | |
4865 | while non-ASCII events return values such as WXK_LEFT for the left | |
4866 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
4867 | codes. | |
4868 | ||
4869 | Note that in Unicode build, the returned value is meaningful only if | |
4870 | the user entered a character that can be represented in current | |
4871 | locale's default charset. You can obtain the corresponding Unicode | |
4872 | character using `GetUnicodeKey`. | |
4873 | """ | |
5b5c9bc7 | 4874 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
d55e5bfc RD |
4875 | |
4876 | KeyCode = GetKeyCode | |
bb4524c4 | 4877 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
4878 | """ |
4879 | GetUnicodeKey(self) -> int | |
4880 | ||
4881 | Returns the Unicode character corresponding to this key event. This | |
4882 | function is only meaningfule in a Unicode build of wxPython. | |
4883 | """ | |
5b5c9bc7 | 4884 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
d55e5bfc | 4885 | |
bb4524c4 | 4886 | GetUniChar = GetUnicodeKey |
b850e7f3 RD |
4887 | def SetUnicodeKey(*args, **kwargs): |
4888 | """ | |
4889 | SetUnicodeKey(self, int uniChar) | |
4890 | ||
4891 | Set the Unicode value of the key event, but only if this is a Unicode | |
4892 | build of wxPython. | |
4893 | """ | |
4894 | return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs) | |
4895 | ||
d55e5bfc | 4896 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
4897 | """ |
4898 | GetRawKeyCode(self) -> unsigned int | |
4899 | ||
4900 | Returns the raw key code for this event. This is a platform-dependent | |
4901 | scan code which should only be used in advanced | |
4902 | applications. Currently the raw key codes are not supported by all | |
4903 | ports. | |
4904 | """ | |
5b5c9bc7 | 4905 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
d55e5bfc RD |
4906 | |
4907 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
4908 | """ |
4909 | GetRawKeyFlags(self) -> unsigned int | |
4910 | ||
4911 | Returns the low level key flags for this event. The flags are | |
4912 | platform-dependent and should only be used in advanced applications. | |
4913 | Currently the raw key flags are not supported by all ports. | |
4914 | """ | |
5b5c9bc7 | 4915 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
d55e5bfc RD |
4916 | |
4917 | def GetPosition(*args, **kwargs): | |
4918 | """ | |
5b5c9bc7 | 4919 | GetPosition(self) -> Point |
d55e5bfc | 4920 | |
5ba5649b | 4921 | Find the position of the event, if applicable. |
d55e5bfc | 4922 | """ |
5b5c9bc7 | 4923 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4924 | |
4925 | def GetPositionTuple(*args, **kwargs): | |
4926 | """ | |
4927 | GetPositionTuple() -> (x,y) | |
4928 | ||
5ba5649b | 4929 | Find the position of the event, if applicable. |
d55e5bfc | 4930 | """ |
5b5c9bc7 | 4931 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
d55e5bfc RD |
4932 | |
4933 | def GetX(*args, **kwargs): | |
5ba5649b RD |
4934 | """ |
4935 | GetX(self) -> int | |
4936 | ||
4937 | Returns the X position (in client coordinates) of the event, if | |
4938 | applicable. | |
4939 | """ | |
5b5c9bc7 | 4940 | return _core_.KeyEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
4941 | |
4942 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4943 | """ |
4944 | GetY(self) -> int | |
4945 | ||
4946 | Returns the Y position (in client coordinates) of the event, if | |
4947 | applicable. | |
4948 | """ | |
5b5c9bc7 RD |
4949 | return _core_.KeyEvent_GetY(*args, **kwargs) |
4950 | ||
4951 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
4952 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
4953 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
4954 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
4955 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
4956 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
4957 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
4958 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
4959 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
4960 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
2131d850 | 4961 | _core_.KeyEvent_swigregister(KeyEvent) |
d55e5bfc RD |
4962 | |
4963 | #--------------------------------------------------------------------------- | |
4964 | ||
5b5c9bc7 | 4965 | class SizeEvent(Event): |
5ba5649b RD |
4966 | """ |
4967 | A size event holds information about size change events. The EVT_SIZE | |
4968 | handler function will be called when the window it is bound to has | |
4969 | been resized. | |
4970 | ||
4971 | Note that the size passed is of the whole window: call | |
4972 | `wx.Window.GetClientSize` for the area which may be used by the | |
4973 | application. | |
4974 | ||
4975 | When a window is resized, usually only a small part of the window is | |
4976 | damaged and and that area is all that is in the update region for the | |
4977 | next paint event. However, if your drawing depends on the size of the | |
4978 | window, you may need to clear the DC explicitly and repaint the whole | |
4979 | window. In which case, you may need to call `wx.Window.Refresh` to | |
4980 | invalidate the entire window. | |
4981 | ||
4982 | """ | |
1bd55598 RD |
4983 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4984 | __repr__ = _swig_repr | |
4985 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4986 | """ |
4987 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
4988 | ||
4989 | Construct a new ``wx.SizeEvent``. | |
4990 | """ | |
1bd55598 | 4991 | _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs)) |
d55e5bfc | 4992 | def GetSize(*args, **kwargs): |
5ba5649b RD |
4993 | """ |
4994 | GetSize(self) -> Size | |
4995 | ||
4996 | Returns the entire size of the window generating the size change | |
4997 | event. | |
4998 | """ | |
5b5c9bc7 | 4999 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
d55e5bfc RD |
5000 | |
5001 | def GetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5002 | """GetRect(self) -> Rect""" |
5003 | return _core_.SizeEvent_GetRect(*args, **kwargs) | |
d55e5bfc RD |
5004 | |
5005 | def SetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5006 | """SetRect(self, Rect rect)""" |
5007 | return _core_.SizeEvent_SetRect(*args, **kwargs) | |
d55e5bfc RD |
5008 | |
5009 | def SetSize(*args, **kwargs): | |
5b5c9bc7 RD |
5010 | """SetSize(self, Size size)""" |
5011 | return _core_.SizeEvent_SetSize(*args, **kwargs) | |
d55e5bfc | 5012 | |
5b5c9bc7 RD |
5013 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
5014 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
2131d850 | 5015 | _core_.SizeEvent_swigregister(SizeEvent) |
d55e5bfc RD |
5016 | |
5017 | #--------------------------------------------------------------------------- | |
5018 | ||
5b5c9bc7 | 5019 | class MoveEvent(Event): |
5ba5649b RD |
5020 | """ |
5021 | This event object is sent for EVT_MOVE event bindings when a window is | |
5022 | moved to a new position. | |
5023 | """ | |
1bd55598 RD |
5024 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5025 | __repr__ = _swig_repr | |
5026 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5027 | """ |
5028 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5029 | ||
5030 | Constructor. | |
5031 | """ | |
1bd55598 | 5032 | _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs)) |
d55e5bfc | 5033 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5034 | """ |
5035 | GetPosition(self) -> Point | |
5036 | ||
5037 | Returns the position of the window generating the move change event. | |
5038 | """ | |
5b5c9bc7 | 5039 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
5040 | |
5041 | def GetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5042 | """GetRect(self) -> Rect""" |
5043 | return _core_.MoveEvent_GetRect(*args, **kwargs) | |
d55e5bfc RD |
5044 | |
5045 | def SetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5046 | """SetRect(self, Rect rect)""" |
5047 | return _core_.MoveEvent_SetRect(*args, **kwargs) | |
d55e5bfc RD |
5048 | |
5049 | def SetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
5050 | """SetPosition(self, Point pos)""" |
5051 | return _core_.MoveEvent_SetPosition(*args, **kwargs) | |
d55e5bfc | 5052 | |
fef4c27a RD |
5053 | m_pos = property(GetPosition, SetPosition) |
5054 | m_rect = property(GetRect, SetRect) | |
5055 | ||
2131d850 | 5056 | _core_.MoveEvent_swigregister(MoveEvent) |
d55e5bfc RD |
5057 | |
5058 | #--------------------------------------------------------------------------- | |
5059 | ||
5b5c9bc7 | 5060 | class PaintEvent(Event): |
5ba5649b RD |
5061 | """ |
5062 | A paint event is sent when a window's contents needs to be repainted. | |
5063 | Note that in an EVT_PAINT handler the application must *always* create | |
5064 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5065 | Windows assumes that the window has not been painted yet and will send | |
5066 | the event again, causing endless refreshes. | |
5067 | ||
5068 | You can optimize painting by retrieving the rectangles that have been | |
5069 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5070 | and only repainting these rectangles. The rectangles are in terms of | |
5071 | the client area, and are unscrolled, so you will need to do some | |
5072 | calculations using the current view position to obtain logical, | |
5073 | scrolled units. | |
5074 | ||
5075 | """ | |
1bd55598 RD |
5076 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5077 | __repr__ = _swig_repr | |
5078 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 5079 | """__init__(self, int Id=0) -> PaintEvent""" |
1bd55598 | 5080 | _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs)) |
2131d850 | 5081 | _core_.PaintEvent_swigregister(PaintEvent) |
d55e5bfc | 5082 | |
5b5c9bc7 RD |
5083 | class NcPaintEvent(Event): |
5084 | """Proxy of C++ NcPaintEvent class""" | |
1bd55598 RD |
5085 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5086 | __repr__ = _swig_repr | |
5087 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 5088 | """__init__(self, int winid=0) -> NcPaintEvent""" |
1bd55598 | 5089 | _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs)) |
2131d850 | 5090 | _core_.NcPaintEvent_swigregister(NcPaintEvent) |
d55e5bfc RD |
5091 | |
5092 | #--------------------------------------------------------------------------- | |
5093 | ||
5b5c9bc7 | 5094 | class EraseEvent(Event): |
5ba5649b RD |
5095 | """ |
5096 | An erase event is sent whenever the background of a window needs to be | |
5097 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5098 | binder. On some platforms, such as GTK+, this event is simulated | |
5099 | (simply generated just before the paint event) and may cause flicker. | |
5100 | ||
5101 | To paint a custom background use the `GetDC` method and use the returned | |
5102 | device context if it is not ``None``, otherwise create a temporary | |
5103 | `wx.ClientDC` and draw on that. | |
5104 | ||
5105 | """ | |
1bd55598 RD |
5106 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5107 | __repr__ = _swig_repr | |
5108 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5109 | """ |
5110 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5111 | ||
5112 | Constructor | |
5113 | """ | |
1bd55598 | 5114 | _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs)) |
d55e5bfc | 5115 | def GetDC(*args, **kwargs): |
5ba5649b RD |
5116 | """ |
5117 | GetDC(self) -> DC | |
5118 | ||
5119 | Returns the device context the event handler should draw upon. If | |
5120 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5121 | that instead. | |
5122 | """ | |
5b5c9bc7 | 5123 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
d55e5bfc | 5124 | |
2131d850 | 5125 | _core_.EraseEvent_swigregister(EraseEvent) |
d55e5bfc RD |
5126 | |
5127 | #--------------------------------------------------------------------------- | |
5128 | ||
5b5c9bc7 | 5129 | class FocusEvent(Event): |
5ba5649b RD |
5130 | """ |
5131 | A focus event is sent when a window's focus changes. The window losing | |
5132 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5133 | gets an EVT_SET_FOCUS event. | |
5134 | ||
5135 | Notice that the set focus event happens both when the user gives focus | |
5136 | to the window (whether using the mouse or keyboard) and when it is | |
5137 | done from the program itself using `wx.Window.SetFocus`. | |
5138 | ||
5139 | """ | |
1bd55598 RD |
5140 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5141 | __repr__ = _swig_repr | |
5142 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5143 | """ |
2131d850 | 5144 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent |
5ba5649b RD |
5145 | |
5146 | Constructor | |
5147 | """ | |
1bd55598 | 5148 | _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs)) |
d55e5bfc | 5149 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5150 | """ |
5151 | GetWindow(self) -> Window | |
5152 | ||
5153 | Returns the other window associated with this event, that is the | |
5154 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5155 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5156 | ||
5157 | Warning: the window returned may be None! | |
5158 | """ | |
5b5c9bc7 | 5159 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
5160 | |
5161 | def SetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
5162 | """SetWindow(self, Window win)""" |
5163 | return _core_.FocusEvent_SetWindow(*args, **kwargs) | |
d55e5bfc | 5164 | |
2131d850 | 5165 | _core_.FocusEvent_swigregister(FocusEvent) |
d55e5bfc RD |
5166 | |
5167 | #--------------------------------------------------------------------------- | |
5168 | ||
5b5c9bc7 | 5169 | class ChildFocusEvent(CommandEvent): |
5ba5649b RD |
5170 | """ |
5171 | wx.ChildFocusEvent notifies the parent that a child has received the | |
5172 | focus. Unlike `wx.FocusEvent` it is propagated up the window | |
5173 | heirarchy. | |
5174 | """ | |
1bd55598 RD |
5175 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5176 | __repr__ = _swig_repr | |
5177 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5178 | """ |
5179 | __init__(self, Window win=None) -> ChildFocusEvent | |
5180 | ||
5181 | Constructor | |
5182 | """ | |
1bd55598 | 5183 | _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs)) |
d55e5bfc | 5184 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5185 | """ |
5186 | GetWindow(self) -> Window | |
5187 | ||
5188 | The window which has just received the focus. | |
5189 | """ | |
5b5c9bc7 | 5190 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
d55e5bfc | 5191 | |
2131d850 | 5192 | _core_.ChildFocusEvent_swigregister(ChildFocusEvent) |
d55e5bfc RD |
5193 | |
5194 | #--------------------------------------------------------------------------- | |
5195 | ||
5b5c9bc7 | 5196 | class ActivateEvent(Event): |
5ba5649b RD |
5197 | """ |
5198 | An activate event is sent when a top-level window or the entire | |
5199 | application is being activated or deactivated. | |
5200 | ||
5201 | A top-level window (a dialog or frame) receives an activate event when | |
5202 | is being activated or deactivated. This is indicated visually by the | |
5203 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5204 | An application is activated or deactivated when one of its frames | |
5205 | becomes activated, or a frame becomes inactivate resulting in all | |
5206 | application frames being inactive. | |
5207 | ||
5208 | Please note that usually you should call event.Skip() in your handlers | |
5209 | for these events so the default handlers will still be called, as not | |
5210 | doing so can result in strange effects. | |
5211 | ||
5212 | """ | |
1bd55598 RD |
5213 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5214 | __repr__ = _swig_repr | |
5215 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5216 | """ |
2131d850 | 5217 | __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent |
5ba5649b RD |
5218 | |
5219 | Constructor | |
5220 | """ | |
1bd55598 | 5221 | _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs)) |
d55e5bfc | 5222 | def GetActive(*args, **kwargs): |
5ba5649b RD |
5223 | """ |
5224 | GetActive(self) -> bool | |
5225 | ||
5226 | Returns true if the application or window is being activated, false | |
5227 | otherwise. | |
5228 | """ | |
5b5c9bc7 | 5229 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
d55e5bfc | 5230 | |
2131d850 | 5231 | _core_.ActivateEvent_swigregister(ActivateEvent) |
d55e5bfc RD |
5232 | |
5233 | #--------------------------------------------------------------------------- | |
5234 | ||
5b5c9bc7 | 5235 | class InitDialogEvent(Event): |
5ba5649b RD |
5236 | """ |
5237 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5238 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5239 | event can transfer data to the window, or anything else that should be | |
5240 | done before the user begins editing the form. The default handler | |
5241 | calls `wx.Window.TransferDataToWindow`. | |
5242 | """ | |
1bd55598 RD |
5243 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5244 | __repr__ = _swig_repr | |
5245 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5246 | """ |
5247 | __init__(self, int Id=0) -> InitDialogEvent | |
5248 | ||
5249 | Constructor | |
5250 | """ | |
1bd55598 | 5251 | _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs)) |
2131d850 | 5252 | _core_.InitDialogEvent_swigregister(InitDialogEvent) |
d55e5bfc RD |
5253 | |
5254 | #--------------------------------------------------------------------------- | |
5255 | ||
5b5c9bc7 | 5256 | class MenuEvent(Event): |
5ba5649b RD |
5257 | """ |
5258 | This class is used for a variety of menu-related events. Note that | |
5259 | these do not include menu command events, which are handled by sending | |
5260 | `wx.CommandEvent` objects. | |
5261 | ||
5262 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5263 | text in the first field of the status bar. | |
5264 | """ | |
1bd55598 RD |
5265 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5266 | __repr__ = _swig_repr | |
5267 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5268 | """ |
2131d850 | 5269 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent |
5ba5649b RD |
5270 | |
5271 | Constructor | |
5272 | """ | |
1bd55598 | 5273 | _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs)) |
d55e5bfc | 5274 | def GetMenuId(*args, **kwargs): |
5ba5649b RD |
5275 | """ |
5276 | GetMenuId(self) -> int | |
5277 | ||
5278 | Returns the menu identifier associated with the event. This method | |
5279 | should be only used with the HIGHLIGHT events. | |
5280 | """ | |
5b5c9bc7 | 5281 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
d55e5bfc RD |
5282 | |
5283 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5284 | """ |
5285 | IsPopup(self) -> bool | |
5286 | ||
5287 | Returns ``True`` if the menu which is being opened or closed is a | |
5288 | popup menu, ``False`` if it is a normal one. This method should only | |
5289 | be used with the OPEN and CLOSE events. | |
5290 | """ | |
5b5c9bc7 | 5291 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
d55e5bfc RD |
5292 | |
5293 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5294 | """ |
5295 | GetMenu(self) -> Menu | |
5296 | ||
5297 | Returns the menu which is being opened or closed. This method should | |
5298 | only be used with the OPEN and CLOSE events. | |
5299 | """ | |
5b5c9bc7 | 5300 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
d55e5bfc | 5301 | |
2131d850 | 5302 | _core_.MenuEvent_swigregister(MenuEvent) |
d55e5bfc RD |
5303 | |
5304 | #--------------------------------------------------------------------------- | |
5305 | ||
5b5c9bc7 | 5306 | class CloseEvent(Event): |
5ba5649b RD |
5307 | """ |
5308 | This event class contains information about window and session close | |
5309 | events. | |
5310 | ||
5311 | The handler function for EVT_CLOSE is called when the user has tried | |
5312 | to close a a frame or dialog box using the window manager controls or | |
5313 | the system menu. It can also be invoked by the application itself | |
5314 | programmatically, for example by calling the `wx.Window.Close` | |
5315 | function. | |
5316 | ||
5317 | You should check whether the application is forcing the deletion of | |
5318 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5319 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5320 | it is up to you whether you respond by destroying the window or not. | |
5321 | For example you may wish to display a message dialog prompting to save | |
5322 | files or to cancel the close. | |
5323 | ||
5324 | If you don't destroy the window, you should call `Veto` to let the | |
5325 | calling code know that you did not destroy the window. This allows the | |
5326 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5327 | on whether the close instruction was honored or not. | |
5328 | """ | |
1bd55598 RD |
5329 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5330 | __repr__ = _swig_repr | |
5331 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5332 | """ |
2131d850 | 5333 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent |
5ba5649b RD |
5334 | |
5335 | Constructor. | |
5336 | """ | |
1bd55598 | 5337 | _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs)) |
d55e5bfc | 5338 | def SetLoggingOff(*args, **kwargs): |
5ba5649b RD |
5339 | """ |
5340 | SetLoggingOff(self, bool logOff) | |
5341 | ||
5342 | Sets the 'logging off' flag. | |
5343 | """ | |
5b5c9bc7 | 5344 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
d55e5bfc RD |
5345 | |
5346 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5347 | """ |
5348 | GetLoggingOff(self) -> bool | |
5349 | ||
034e3677 RD |
5350 | Returns ``True`` if the user is logging off or ``False`` if the |
5351 | system is shutting down. This method can only be called for end | |
5352 | session and query end session events, it doesn't make sense for close | |
5353 | window event. | |
5ba5649b | 5354 | """ |
5b5c9bc7 | 5355 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
d55e5bfc RD |
5356 | |
5357 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5358 | """ |
5359 | Veto(self, bool veto=True) | |
5360 | ||
5361 | Call this from your event handler to veto a system shutdown or to | |
5362 | signal to the calling application that a window close did not happen. | |
5363 | ||
5364 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5365 | """ | |
5b5c9bc7 | 5366 | return _core_.CloseEvent_Veto(*args, **kwargs) |
d55e5bfc | 5367 | |
5ba5649b RD |
5368 | def GetVeto(*args, **kwargs): |
5369 | """GetVeto(self) -> bool""" | |
5370 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5371 | ||
d55e5bfc | 5372 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5373 | """ |
5374 | SetCanVeto(self, bool canVeto) | |
5375 | ||
5376 | Sets the 'can veto' flag. | |
5377 | """ | |
5b5c9bc7 | 5378 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
d55e5bfc RD |
5379 | |
5380 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5381 | """ |
5382 | CanVeto(self) -> bool | |
d55e5bfc | 5383 | |
5ba5649b RD |
5384 | Returns true if you can veto a system shutdown or a window close |
5385 | event. Vetoing a window close event is not possible if the calling | |
5386 | code wishes to force the application to exit, and so this function | |
5387 | must be called to check this. | |
5388 | """ | |
5389 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
d55e5bfc | 5390 | |
2131d850 | 5391 | _core_.CloseEvent_swigregister(CloseEvent) |
d55e5bfc RD |
5392 | |
5393 | #--------------------------------------------------------------------------- | |
5394 | ||
5b5c9bc7 | 5395 | class ShowEvent(Event): |
5ba5649b | 5396 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
1bd55598 RD |
5397 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5398 | __repr__ = _swig_repr | |
5399 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5400 | """ |
5401 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5402 | ||
5403 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5404 | """ | |
1bd55598 | 5405 | _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs)) |
d55e5bfc RD |
5406 | def SetShow(*args, **kwargs): |
5407 | """SetShow(self, bool show)""" | |
5b5c9bc7 | 5408 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
d55e5bfc RD |
5409 | |
5410 | def GetShow(*args, **kwargs): | |
5411 | """GetShow(self) -> bool""" | |
5b5c9bc7 | 5412 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
d55e5bfc | 5413 | |
2131d850 | 5414 | _core_.ShowEvent_swigregister(ShowEvent) |
d55e5bfc RD |
5415 | |
5416 | #--------------------------------------------------------------------------- | |
5417 | ||
5b5c9bc7 | 5418 | class IconizeEvent(Event): |
5ba5649b RD |
5419 | """ |
5420 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5421 | restored. | |
5422 | """ | |
1bd55598 RD |
5423 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5424 | __repr__ = _swig_repr | |
5425 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5426 | """ |
5427 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5428 | ||
5429 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5430 | restored. | |
5431 | """ | |
1bd55598 | 5432 | _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs)) |
d55e5bfc | 5433 | def Iconized(*args, **kwargs): |
5ba5649b RD |
5434 | """ |
5435 | Iconized(self) -> bool | |
5436 | ||
5437 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5438 | been restored. | |
5439 | """ | |
5b5c9bc7 | 5440 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
d55e5bfc | 5441 | |
2131d850 | 5442 | _core_.IconizeEvent_swigregister(IconizeEvent) |
d55e5bfc RD |
5443 | |
5444 | #--------------------------------------------------------------------------- | |
5445 | ||
5b5c9bc7 | 5446 | class MaximizeEvent(Event): |
5ba5649b | 5447 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
1bd55598 RD |
5448 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5449 | __repr__ = _swig_repr | |
5450 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5451 | """ |
5452 | __init__(self, int id=0) -> MaximizeEvent | |
5453 | ||
5454 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5455 | """ | |
1bd55598 | 5456 | _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs)) |
2131d850 | 5457 | _core_.MaximizeEvent_swigregister(MaximizeEvent) |
d55e5bfc RD |
5458 | |
5459 | #--------------------------------------------------------------------------- | |
5460 | ||
5b5c9bc7 | 5461 | class DropFilesEvent(Event): |
5ba5649b RD |
5462 | """ |
5463 | This class is used for drop files events, that is, when files have | |
5464 | been dropped onto the window. This functionality is only available | |
5465 | under Windows. The window must have previously been enabled for | |
5466 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5467 | ||
5468 | Important note: this is a separate implementation to the more general | |
5469 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5470 | implementation uses the older, Windows message-based approach of | |
5471 | dropping files. | |
5472 | ||
5473 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5474 | events. | |
5475 | ||
5476 | """ | |
1bd55598 RD |
5477 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5478 | def __init__(self): raise AttributeError, "No constructor defined" | |
5479 | __repr__ = _swig_repr | |
d55e5bfc | 5480 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5481 | """ |
5482 | GetPosition(self) -> Point | |
5483 | ||
5484 | Returns the position at which the files were dropped. | |
5485 | """ | |
5b5c9bc7 | 5486 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
5487 | |
5488 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5489 | """ |
5490 | GetNumberOfFiles(self) -> int | |
5491 | ||
5492 | Returns the number of files dropped. | |
5493 | """ | |
5b5c9bc7 | 5494 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
d55e5bfc RD |
5495 | |
5496 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5497 | """ |
5498 | GetFiles(self) -> PyObject | |
5499 | ||
5500 | Returns a list of the filenames that were dropped. | |
5501 | """ | |
5b5c9bc7 | 5502 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
d55e5bfc | 5503 | |
2131d850 | 5504 | _core_.DropFilesEvent_swigregister(DropFilesEvent) |
d55e5bfc RD |
5505 | |
5506 | #--------------------------------------------------------------------------- | |
5507 | ||
5b5c9bc7 RD |
5508 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
5509 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
5510 | class UpdateUIEvent(CommandEvent): | |
5ba5649b RD |
5511 | """ |
5512 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5513 | wxWidgets to give an application the chance to update various user | |
5514 | interface elements. | |
5515 | ||
5516 | Without update UI events, an application has to work hard to | |
5517 | check/uncheck, enable/disable, and set the text for elements such as | |
5518 | menu items and toolbar buttons. The code for doing this has to be | |
5519 | mixed up with the code that is invoked when an action is invoked for a | |
5520 | menu item or button. | |
5521 | ||
5522 | With update UI events, you define an event handler to look at the | |
5523 | state of the application and change UI elements accordingly. wxWidgets | |
5524 | will call your handler functions in idle time, so you don't have to | |
5525 | worry where to call this code. In addition to being a clearer and more | |
5526 | declarative method, it also means you don't have to worry whether | |
5527 | you're updating a toolbar or menubar identifier. The same handler can | |
5528 | update a menu item and toolbar button, if the ID values are the same. | |
5529 | ||
5530 | Instead of directly manipulating the menu or button, you call | |
5531 | functions in the event object, such as `Check`. wxWidgets will | |
5532 | determine whether such a call has been made, and which UI element to | |
5533 | update. | |
5534 | ||
5535 | These events will work for popup menus as well as menubars. Just | |
5536 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5537 | any UI events for the window that owns the menu. | |
5538 | ||
5539 | If you find that the overhead of UI update processing is affecting | |
5540 | your application, you can do one or both of the following: | |
5541 | ||
5542 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5543 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5544 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5545 | receive update events. No other windows will receive update | |
5546 | events. | |
5547 | ||
5548 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5549 | value to set the delay between updates. You may need to call | |
5550 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5551 | a dialog is about to be shown, in case the user sees a slight | |
5552 | delay before windows are updated. | |
5553 | ||
5554 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5555 | handler for a window does not affect this because the events are sent | |
5556 | from an internal idle handler. | |
5557 | ||
5558 | wxWidgets tries to optimize update events on some platforms. On | |
5559 | Windows and GTK+, events for menubar items are only sent when the menu | |
5560 | is about to be shown, and not in idle time. | |
5561 | ||
5562 | """ | |
1bd55598 RD |
5563 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5564 | __repr__ = _swig_repr | |
5565 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5566 | """ |
5567 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5568 | ||
5569 | Constructor | |
5570 | """ | |
1bd55598 | 5571 | _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs)) |
d55e5bfc | 5572 | def GetChecked(*args, **kwargs): |
5ba5649b RD |
5573 | """ |
5574 | GetChecked(self) -> bool | |
5575 | ||
5576 | Returns ``True`` if the UI element should be checked. | |
5577 | """ | |
5b5c9bc7 | 5578 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
d55e5bfc RD |
5579 | |
5580 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
5581 | """ |
5582 | GetEnabled(self) -> bool | |
5583 | ||
5584 | Returns ``True`` if the UI element should be enabled. | |
5585 | """ | |
5b5c9bc7 | 5586 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
d55e5bfc | 5587 | |
b1fcee84 RD |
5588 | def GetShown(*args, **kwargs): |
5589 | """ | |
5590 | GetShown(self) -> bool | |
5591 | ||
5592 | Returns ``True`` if the UI element should be shown. | |
5593 | """ | |
5594 | return _core_.UpdateUIEvent_GetShown(*args, **kwargs) | |
5595 | ||
d55e5bfc | 5596 | def GetText(*args, **kwargs): |
5ba5649b RD |
5597 | """ |
5598 | GetText(self) -> String | |
5599 | ||
5600 | Returns the text that should be set for the UI element. | |
5601 | """ | |
5b5c9bc7 | 5602 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
d55e5bfc RD |
5603 | |
5604 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
5605 | """ |
5606 | GetSetText(self) -> bool | |
5607 | ||
5608 | Returns ``True`` if the application has called `SetText`. For | |
5609 | wxWidgets internal use only. | |
5610 | """ | |
5b5c9bc7 | 5611 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
d55e5bfc RD |
5612 | |
5613 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
5614 | """ |
5615 | GetSetChecked(self) -> bool | |
5616 | ||
5617 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
5618 | internal use only. | |
5619 | """ | |
5b5c9bc7 | 5620 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
d55e5bfc RD |
5621 | |
5622 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
5623 | """ |
5624 | GetSetEnabled(self) -> bool | |
5625 | ||
5626 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
5627 | internal use only. | |
5628 | """ | |
5b5c9bc7 | 5629 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
d55e5bfc | 5630 | |
b1fcee84 RD |
5631 | def GetSetShown(*args, **kwargs): |
5632 | """ | |
5633 | GetSetShown(self) -> bool | |
5634 | ||
5635 | Returns ``True`` if the application has called `Show`. For wxWidgets | |
5636 | internal use only. | |
5637 | """ | |
5638 | return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs) | |
5639 | ||
d55e5bfc | 5640 | def Check(*args, **kwargs): |
5ba5649b RD |
5641 | """ |
5642 | Check(self, bool check) | |
5643 | ||
5644 | Check or uncheck the UI element. | |
5645 | """ | |
5b5c9bc7 | 5646 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
d55e5bfc RD |
5647 | |
5648 | def Enable(*args, **kwargs): | |
5ba5649b RD |
5649 | """ |
5650 | Enable(self, bool enable) | |
5651 | ||
5652 | Enable or disable the UI element. | |
5653 | """ | |
5b5c9bc7 | 5654 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
d55e5bfc | 5655 | |
b1fcee84 RD |
5656 | def Show(*args, **kwargs): |
5657 | """ | |
5658 | Show(self, bool show) | |
5659 | ||
5660 | Show or hide the UI element. | |
5661 | """ | |
5662 | return _core_.UpdateUIEvent_Show(*args, **kwargs) | |
5663 | ||
d55e5bfc | 5664 | def SetText(*args, **kwargs): |
5ba5649b RD |
5665 | """ |
5666 | SetText(self, String text) | |
5667 | ||
5668 | Sets the text for this UI element. | |
5669 | """ | |
5b5c9bc7 | 5670 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
d55e5bfc RD |
5671 | |
5672 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5673 | """ |
5674 | SetUpdateInterval(long updateInterval) | |
5675 | ||
5676 | Sets the interval between updates in milliseconds. Set to -1 to | |
5677 | disable updates, or to 0 to update as frequently as possible. The | |
5678 | default is 0. | |
5679 | ||
5680 | Use this to reduce the overhead of UI update events if your | |
5681 | application has a lot of windows. If you set the value to -1 or | |
5682 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5683 | at appropriate points in your application, such as when a dialog is | |
5684 | about to be shown. | |
5685 | """ | |
5b5c9bc7 | 5686 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d55e5bfc RD |
5687 | |
5688 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
5689 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5690 | """ |
5691 | GetUpdateInterval() -> long | |
5692 | ||
5693 | Returns the current interval between updates in milliseconds. -1 | |
5694 | disables updates, 0 updates as frequently as possible. | |
5695 | """ | |
5b5c9bc7 | 5696 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
d55e5bfc RD |
5697 | |
5698 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
5699 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
5700 | """ |
5701 | CanUpdate(Window win) -> bool | |
5702 | ||
5703 | Returns ``True`` if it is appropriate to update (send UI update events | |
5704 | to) this window. | |
5705 | ||
5706 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5707 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5708 | events were last sent in idle time, and the update interval, to | |
5709 | determine whether events should be sent to this window now. By default | |
5710 | this will always return true because the update mode is initially | |
5711 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5712 | events will be sent as often as possible. You can reduce the frequency | |
5713 | that events are sent by changing the mode and/or setting an update | |
5714 | interval. | |
5715 | ||
5716 | """ | |
5b5c9bc7 | 5717 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d55e5bfc RD |
5718 | |
5719 | CanUpdate = staticmethod(CanUpdate) | |
5720 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
5721 | """ |
5722 | ResetUpdateTime() | |
5723 | ||
5724 | Used internally to reset the last-updated time to the current time. It | |
5725 | is assumed that update events are normally sent in idle time, so this | |
5726 | is called at the end of idle processing. | |
5727 | """ | |
5b5c9bc7 | 5728 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
d55e5bfc RD |
5729 | |
5730 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
5731 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
5732 | """ |
5733 | SetMode(int mode) | |
5734 | ||
5735 | Specify how wxWidgets will send update events: to all windows, or only | |
5736 | to those which specify that they will process the events. | |
5737 | ||
5738 | The mode may be one of the following values: | |
5739 | ||
5740 | ============================= ========================================== | |
5741 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5742 | is the default setting. | |
5743 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5744 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5745 | style set. | |
5746 | ============================= ========================================== | |
5747 | ||
5748 | """ | |
5b5c9bc7 | 5749 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d55e5bfc RD |
5750 | |
5751 | SetMode = staticmethod(SetMode) | |
5752 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
5753 | """ |
5754 | GetMode() -> int | |
5755 | ||
5756 | Returns a value specifying how wxWidgets will send update events: to | |
5757 | all windows, or only to those which specify that they will process the | |
5758 | events. | |
5759 | """ | |
5b5c9bc7 | 5760 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
d55e5bfc RD |
5761 | |
5762 | GetMode = staticmethod(GetMode) | |
2131d850 | 5763 | _core_.UpdateUIEvent_swigregister(UpdateUIEvent) |
d55e5bfc | 5764 | |
5b5c9bc7 | 5765 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
1bd55598 | 5766 | """ |
5ba5649b RD |
5767 | UpdateUIEvent_SetUpdateInterval(long updateInterval) |
5768 | ||
5769 | Sets the interval between updates in milliseconds. Set to -1 to | |
5770 | disable updates, or to 0 to update as frequently as possible. The | |
5771 | default is 0. | |
5772 | ||
5773 | Use this to reduce the overhead of UI update events if your | |
5774 | application has a lot of windows. If you set the value to -1 or | |
5775 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5776 | at appropriate points in your application, such as when a dialog is | |
5777 | about to be shown. | |
5778 | """ | |
1bd55598 | 5779 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d55e5bfc | 5780 | |
1bd55598 RD |
5781 | def UpdateUIEvent_GetUpdateInterval(*args): |
5782 | """ | |
5ba5649b RD |
5783 | UpdateUIEvent_GetUpdateInterval() -> long |
5784 | ||
5785 | Returns the current interval between updates in milliseconds. -1 | |
5786 | disables updates, 0 updates as frequently as possible. | |
5787 | """ | |
1bd55598 | 5788 | return _core_.UpdateUIEvent_GetUpdateInterval(*args) |
d55e5bfc | 5789 | |
5b5c9bc7 | 5790 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
1bd55598 | 5791 | """ |
5ba5649b RD |
5792 | UpdateUIEvent_CanUpdate(Window win) -> bool |
5793 | ||
5794 | Returns ``True`` if it is appropriate to update (send UI update events | |
5795 | to) this window. | |
5796 | ||
5797 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5798 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5799 | events were last sent in idle time, and the update interval, to | |
5800 | determine whether events should be sent to this window now. By default | |
5801 | this will always return true because the update mode is initially | |
5802 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5803 | events will be sent as often as possible. You can reduce the frequency | |
5804 | that events are sent by changing the mode and/or setting an update | |
5805 | interval. | |
5806 | ||
5807 | """ | |
1bd55598 | 5808 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d55e5bfc | 5809 | |
1bd55598 RD |
5810 | def UpdateUIEvent_ResetUpdateTime(*args): |
5811 | """ | |
5ba5649b RD |
5812 | UpdateUIEvent_ResetUpdateTime() |
5813 | ||
5814 | Used internally to reset the last-updated time to the current time. It | |
5815 | is assumed that update events are normally sent in idle time, so this | |
5816 | is called at the end of idle processing. | |
5817 | """ | |
1bd55598 | 5818 | return _core_.UpdateUIEvent_ResetUpdateTime(*args) |
d55e5bfc | 5819 | |
5b5c9bc7 | 5820 | def UpdateUIEvent_SetMode(*args, **kwargs): |
1bd55598 | 5821 | """ |
5ba5649b RD |
5822 | UpdateUIEvent_SetMode(int mode) |
5823 | ||
5824 | Specify how wxWidgets will send update events: to all windows, or only | |
5825 | to those which specify that they will process the events. | |
5826 | ||
5827 | The mode may be one of the following values: | |
5828 | ||
5829 | ============================= ========================================== | |
5830 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5831 | is the default setting. | |
5832 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5833 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5834 | style set. | |
5835 | ============================= ========================================== | |
5836 | ||
5837 | """ | |
1bd55598 | 5838 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d55e5bfc | 5839 | |
1bd55598 RD |
5840 | def UpdateUIEvent_GetMode(*args): |
5841 | """ | |
5ba5649b RD |
5842 | UpdateUIEvent_GetMode() -> int |
5843 | ||
5844 | Returns a value specifying how wxWidgets will send update events: to | |
5845 | all windows, or only to those which specify that they will process the | |
5846 | events. | |
5847 | """ | |
1bd55598 | 5848 | return _core_.UpdateUIEvent_GetMode(*args) |
d55e5bfc RD |
5849 | |
5850 | #--------------------------------------------------------------------------- | |
5851 | ||
5b5c9bc7 | 5852 | class SysColourChangedEvent(Event): |
5ba5649b RD |
5853 | """ |
5854 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
5855 | when the user changes the colour settings using the control | |
5856 | panel. This is only applicable under Windows. | |
5857 | ||
5858 | The default event handler for this event propagates the event to child | |
5859 | windows, since Windows only sends the events to top-level windows. If | |
5860 | intercepting this event for a top-level window, remember to call | |
5861 | `Skip` so the the base class handler will still be executed, or to | |
5862 | pass the event on to the window's children explicitly. | |
5863 | ||
5864 | """ | |
1bd55598 RD |
5865 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5866 | __repr__ = _swig_repr | |
5867 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5868 | """ |
5869 | __init__(self) -> SysColourChangedEvent | |
5870 | ||
5871 | Constructor | |
5872 | """ | |
1bd55598 | 5873 | _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs)) |
2131d850 | 5874 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent) |
d55e5bfc RD |
5875 | |
5876 | #--------------------------------------------------------------------------- | |
5877 | ||
5b5c9bc7 | 5878 | class MouseCaptureChangedEvent(Event): |
5ba5649b RD |
5879 | """ |
5880 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
5881 | a window that loses its mouse capture. This is called even if | |
5882 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
5883 | this event allows an application to cater for unexpected capture | |
5884 | releases which might otherwise confuse mouse handling code. | |
5885 | ||
5886 | This event is implemented under Windows only. | |
5887 | """ | |
1bd55598 RD |
5888 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5889 | __repr__ = _swig_repr | |
5890 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5891 | """ |
5892 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
5893 | ||
5894 | Constructor | |
5895 | """ | |
1bd55598 | 5896 | _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs)) |
d55e5bfc | 5897 | def GetCapturedWindow(*args, **kwargs): |
5ba5649b RD |
5898 | """ |
5899 | GetCapturedWindow(self) -> Window | |
5900 | ||
5901 | Returns the window that gained the capture, or ``None`` if it was a | |
5902 | non-wxWidgets window. | |
5903 | """ | |
5b5c9bc7 | 5904 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
d55e5bfc | 5905 | |
2131d850 | 5906 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent) |
d55e5bfc RD |
5907 | |
5908 | #--------------------------------------------------------------------------- | |
5909 | ||
34e0a3bb RD |
5910 | class MouseCaptureLostEvent(Event): |
5911 | """ | |
5912 | A mouse capture lost event is sent to a window that obtained mouse | |
5913 | capture, which was subsequently loss due to "external" event, for | |
5914 | example when a dialog box is shown or if another application captures | |
5915 | the mouse. | |
5916 | ||
5917 | If this happens, this event is sent to all windows that are on the | |
5918 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
5919 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
5920 | if the capture changes because of a call to CaptureMouse or | |
5921 | ReleaseMouse. | |
5922 | ||
5923 | This event is currently emitted under Windows only. | |
5924 | ||
5925 | """ | |
5926 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
5927 | __repr__ = _swig_repr | |
5928 | def __init__(self, *args, **kwargs): | |
5929 | """ | |
5930 | __init__(self, int winid=0) -> MouseCaptureLostEvent | |
5931 | ||
5932 | A mouse capture lost event is sent to a window that obtained mouse | |
5933 | capture, which was subsequently loss due to "external" event, for | |
5934 | example when a dialog box is shown or if another application captures | |
5935 | the mouse. | |
5936 | ||
5937 | If this happens, this event is sent to all windows that are on the | |
5938 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
5939 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
5940 | if the capture changes because of a call to CaptureMouse or | |
5941 | ReleaseMouse. | |
5942 | ||
5943 | This event is currently emitted under Windows only. | |
5944 | ||
5945 | """ | |
5946 | _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs)) | |
5947 | _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent) | |
5948 | ||
5949 | #--------------------------------------------------------------------------- | |
5950 | ||
5b5c9bc7 | 5951 | class DisplayChangedEvent(Event): |
5ba5649b RD |
5952 | """ |
5953 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
5954 | resolution has changed. | |
5955 | ||
5956 | This event is implemented under Windows only. | |
5957 | """ | |
1bd55598 RD |
5958 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5959 | __repr__ = _swig_repr | |
5960 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 5961 | """__init__(self) -> DisplayChangedEvent""" |
1bd55598 | 5962 | _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs)) |
2131d850 | 5963 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent) |
d55e5bfc RD |
5964 | |
5965 | #--------------------------------------------------------------------------- | |
5966 | ||
5b5c9bc7 | 5967 | class PaletteChangedEvent(Event): |
5ba5649b RD |
5968 | """ |
5969 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
5970 | changed, thereby giving each window a chance to redo their own to | |
5971 | match. | |
5972 | ||
5973 | This event is implemented under Windows only. | |
5974 | """ | |
1bd55598 RD |
5975 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5976 | __repr__ = _swig_repr | |
5977 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5978 | """ |
5979 | __init__(self, int id=0) -> PaletteChangedEvent | |
5980 | ||
5981 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
5982 | changed, thereby giving each window a chance to redo their own to | |
5983 | match. | |
5984 | ||
5985 | This event is implemented under Windows only. | |
5986 | """ | |
1bd55598 | 5987 | _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs)) |
d55e5bfc | 5988 | def SetChangedWindow(*args, **kwargs): |
5b5c9bc7 RD |
5989 | """SetChangedWindow(self, Window win)""" |
5990 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) | |
d55e5bfc RD |
5991 | |
5992 | def GetChangedWindow(*args, **kwargs): | |
5b5c9bc7 RD |
5993 | """GetChangedWindow(self) -> Window""" |
5994 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) | |
d55e5bfc | 5995 | |
2131d850 | 5996 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent) |
d55e5bfc RD |
5997 | |
5998 | #--------------------------------------------------------------------------- | |
5999 | ||
5b5c9bc7 | 6000 | class QueryNewPaletteEvent(Event): |
5ba5649b RD |
6001 | """ |
6002 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6003 | focus and should re-do its palette. | |
6004 | ||
6005 | This event is implemented under Windows only. | |
6006 | """ | |
1bd55598 RD |
6007 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6008 | __repr__ = _swig_repr | |
6009 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6010 | """ |
6011 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6012 | ||
6013 | Constructor. | |
6014 | """ | |
1bd55598 | 6015 | _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs)) |
d55e5bfc | 6016 | def SetPaletteRealized(*args, **kwargs): |
5ba5649b RD |
6017 | """ |
6018 | SetPaletteRealized(self, bool realized) | |
6019 | ||
6020 | App should set this if it changes the palette. | |
6021 | """ | |
5b5c9bc7 | 6022 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
d55e5bfc RD |
6023 | |
6024 | def GetPaletteRealized(*args, **kwargs): | |
6025 | """GetPaletteRealized(self) -> bool""" | |
5b5c9bc7 | 6026 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
d55e5bfc | 6027 | |
2131d850 | 6028 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent) |
d55e5bfc RD |
6029 | |
6030 | #--------------------------------------------------------------------------- | |
6031 | ||
5b5c9bc7 | 6032 | class NavigationKeyEvent(Event): |
5ba5649b RD |
6033 | """ |
6034 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6035 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6036 | catch navigation events in applications as there are already | |
6037 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6038 | it useful to send navigation events in certain situations to change | |
6039 | the focus in certain ways, although it's probably easier to just call | |
6040 | `wx.Window.Navigate`. | |
6041 | """ | |
1bd55598 RD |
6042 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6043 | __repr__ = _swig_repr | |
6044 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 6045 | """__init__(self) -> NavigationKeyEvent""" |
1bd55598 | 6046 | _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs)) |
d55e5bfc | 6047 | def GetDirection(*args, **kwargs): |
5ba5649b RD |
6048 | """ |
6049 | GetDirection(self) -> bool | |
6050 | ||
6051 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6052 | """ | |
5b5c9bc7 | 6053 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
d55e5bfc RD |
6054 | |
6055 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6056 | """ |
6057 | SetDirection(self, bool forward) | |
6058 | ||
6059 | Specify the direction that the navigation should take. Usually the | |
6060 | difference between using Tab and Shift-Tab. | |
6061 | """ | |
5b5c9bc7 | 6062 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
d55e5bfc RD |
6063 | |
6064 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6065 | """ |
6066 | IsWindowChange(self) -> bool | |
6067 | ||
6068 | Returns ``True`` if window change is allowed. | |
6069 | """ | |
5b5c9bc7 | 6070 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
d55e5bfc RD |
6071 | |
6072 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6073 | """ |
6074 | SetWindowChange(self, bool ischange) | |
6075 | ||
6076 | Specify if the navigation should be able to change parent windows. | |
6077 | For example, changing notebook pages, etc. This is usually implemented | |
6078 | by using Control-Tab. | |
6079 | """ | |
5b5c9bc7 | 6080 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
d55e5bfc | 6081 | |
68350608 | 6082 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6083 | """ |
6084 | IsFromTab(self) -> bool | |
6085 | ||
6086 | Returns ``True`` if the navigation event is originated from the Tab | |
6087 | key. | |
6088 | """ | |
5b5c9bc7 | 6089 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
68350608 RD |
6090 | |
6091 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6092 | """ |
6093 | SetFromTab(self, bool bIs) | |
6094 | ||
6095 | Set to true under MSW if the event was generated using the tab key. | |
6096 | This is required for proper navogation over radio buttons. | |
6097 | """ | |
5b5c9bc7 | 6098 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
68350608 | 6099 | |
908b74cd | 6100 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6101 | """ |
6102 | SetFlags(self, long flags) | |
6103 | ||
6104 | Set the navigation flags to a combination of the following: | |
6105 | ||
6106 | * wx.NavigationKeyEvent.IsBackward | |
6107 | * wx.NavigationKeyEvent.IsForward | |
6108 | * wx.NavigationKeyEvent.WinChange | |
6109 | * wx.NavigationKeyEvent.FromTab | |
6110 | ||
6111 | """ | |
5b5c9bc7 | 6112 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
908b74cd | 6113 | |
d55e5bfc | 6114 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6115 | """ |
6116 | GetCurrentFocus(self) -> Window | |
6117 | ||
6118 | Returns the child window which currenty has the focus. May be | |
6119 | ``None``. | |
6120 | """ | |
5b5c9bc7 | 6121 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
d55e5bfc RD |
6122 | |
6123 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6124 | """ |
6125 | SetCurrentFocus(self, Window win) | |
6126 | ||
6127 | Set the window that has the focus. | |
6128 | """ | |
5b5c9bc7 | 6129 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
d55e5bfc | 6130 | |
5b5c9bc7 RD |
6131 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
6132 | IsForward = _core_.NavigationKeyEvent_IsForward | |
6133 | WinChange = _core_.NavigationKeyEvent_WinChange | |
6134 | FromTab = _core_.NavigationKeyEvent_FromTab | |
2131d850 | 6135 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent) |
d55e5bfc RD |
6136 | |
6137 | #--------------------------------------------------------------------------- | |
6138 | ||
5b5c9bc7 | 6139 | class WindowCreateEvent(CommandEvent): |
5ba5649b RD |
6140 | """ |
6141 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6142 | underlying GUI object) exists. | |
6143 | """ | |
1bd55598 RD |
6144 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6145 | __repr__ = _swig_repr | |
6146 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6147 | """ |
6148 | __init__(self, Window win=None) -> WindowCreateEvent | |
6149 | ||
6150 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6151 | underlying GUI object) exists. | |
6152 | """ | |
1bd55598 | 6153 | _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs)) |
d55e5bfc | 6154 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6155 | """ |
6156 | GetWindow(self) -> Window | |
6157 | ||
6158 | Returns the window that this event refers to. | |
6159 | """ | |
5b5c9bc7 | 6160 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
d55e5bfc | 6161 | |
2131d850 | 6162 | _core_.WindowCreateEvent_swigregister(WindowCreateEvent) |
d55e5bfc | 6163 | |
5b5c9bc7 | 6164 | class WindowDestroyEvent(CommandEvent): |
5ba5649b | 6165 | """ |
943e8dfd RD |
6166 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6167 | when the GUI window is destroyed. | |
6168 | ||
6169 | When a class derived from `wx.Window` is destroyed its destructor will | |
6170 | have already run by the time this event is sent. Therefore this event | |
6171 | will not usually be received at all by the window itself. Since it is | |
6172 | received after the destructor has run, an object should not try to | |
6173 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6174 | notification of the destruction of another window. | |
5ba5649b | 6175 | """ |
1bd55598 RD |
6176 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6177 | __repr__ = _swig_repr | |
6178 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6179 | """ |
6180 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6181 | ||
943e8dfd RD |
6182 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6183 | when the GUI window is destroyed. | |
6184 | ||
6185 | When a class derived from `wx.Window` is destroyed its destructor will | |
6186 | have already run by the time this event is sent. Therefore this event | |
6187 | will not usually be received at all by the window itself. Since it is | |
6188 | received after the destructor has run, an object should not try to | |
6189 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6190 | notification of the destruction of another window. | |
5ba5649b | 6191 | """ |
1bd55598 | 6192 | _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs)) |
d55e5bfc | 6193 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6194 | """ |
6195 | GetWindow(self) -> Window | |
6196 | ||
6197 | Returns the window that this event refers to. | |
6198 | """ | |
5b5c9bc7 | 6199 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
d55e5bfc | 6200 | |
2131d850 | 6201 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent) |
d55e5bfc RD |
6202 | |
6203 | #--------------------------------------------------------------------------- | |
6204 | ||
5b5c9bc7 | 6205 | class ContextMenuEvent(CommandEvent): |
5ba5649b RD |
6206 | """ |
6207 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6208 | give the application a chance to show a context (popup) menu. | |
6209 | """ | |
1bd55598 RD |
6210 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6211 | __repr__ = _swig_repr | |
6212 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6213 | """ |
2131d850 | 6214 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent |
5ba5649b RD |
6215 | |
6216 | Constructor. | |
6217 | """ | |
1bd55598 | 6218 | _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs)) |
d55e5bfc | 6219 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
6220 | """ |
6221 | GetPosition(self) -> Point | |
6222 | ||
6223 | Returns the position (in screen coordinants) at which the menu should | |
6224 | be shown. | |
6225 | """ | |
5b5c9bc7 | 6226 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
6227 | |
6228 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6229 | """ |
6230 | SetPosition(self, Point pos) | |
6231 | ||
6232 | Sets the position at which the menu should be shown. | |
6233 | """ | |
5b5c9bc7 | 6234 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
d55e5bfc | 6235 | |
2131d850 | 6236 | _core_.ContextMenuEvent_swigregister(ContextMenuEvent) |
d55e5bfc RD |
6237 | |
6238 | #--------------------------------------------------------------------------- | |
6239 | ||
5b5c9bc7 RD |
6240 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6241 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
6242 | class IdleEvent(Event): | |
5ba5649b RD |
6243 | """ |
6244 | This class is used for EVT_IDLE events, which are generated and sent | |
6245 | when the application *becomes* idle. In other words, the when the | |
6246 | event queue becomes empty then idle events are sent to all windows (by | |
6247 | default) and as long as none of them call `RequestMore` then there are | |
6248 | no more idle events until after the system event queue has some normal | |
6249 | events and then becomes empty again. | |
6250 | ||
6251 | By default, idle events are sent to all windows. If this is causing a | |
6252 | significant overhead in your application, you can call | |
6253 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6254 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6255 | which should receive idle events. Then idle events will only be sent | |
6256 | to those windows and not to any others. | |
6257 | """ | |
1bd55598 RD |
6258 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6259 | __repr__ = _swig_repr | |
6260 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6261 | """ |
6262 | __init__(self) -> IdleEvent | |
6263 | ||
6264 | Constructor | |
6265 | """ | |
1bd55598 | 6266 | _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs)) |
d55e5bfc | 6267 | def RequestMore(*args, **kwargs): |
5ba5649b RD |
6268 | """ |
6269 | RequestMore(self, bool needMore=True) | |
6270 | ||
6271 | Tells wxWidgets that more processing is required. This function can be | |
6272 | called by an EVT_IDLE handler for a window to indicate that the | |
6273 | application should forward the EVT_IDLE event once more to the | |
6274 | application windows. If no window calls this function during its | |
6275 | EVT_IDLE handler, then the application will remain in a passive event | |
6276 | loop until a new event is posted to the application by the windowing | |
6277 | system. | |
6278 | """ | |
5b5c9bc7 | 6279 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
d55e5bfc RD |
6280 | |
6281 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6282 | """ |
6283 | MoreRequested(self) -> bool | |
6284 | ||
6285 | Returns ``True`` if the OnIdle function processing this event | |
6286 | requested more processing time. | |
6287 | """ | |
5b5c9bc7 | 6288 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
d55e5bfc RD |
6289 | |
6290 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6291 | """ |
6292 | SetMode(int mode) | |
6293 | ||
6294 | Static method for specifying how wxWidgets will send idle events: to | |
6295 | all windows, or only to those which specify that they will process the | |
6296 | events. | |
6297 | ||
6298 | The mode can be one of the following values: | |
6299 | ||
6300 | ========================= ======================================== | |
6301 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6302 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6303 | the wx.WS_EX_PROCESS_IDLE extra style | |
6304 | flag set. | |
6305 | ========================= ======================================== | |
6306 | ||
6307 | """ | |
5b5c9bc7 | 6308 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d55e5bfc RD |
6309 | |
6310 | SetMode = staticmethod(SetMode) | |
6311 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6312 | """ |
6313 | GetMode() -> int | |
6314 | ||
6315 | Static method returning a value specifying how wxWidgets will send | |
6316 | idle events: to all windows, or only to those which specify that they | |
6317 | will process the events. | |
6318 | """ | |
5b5c9bc7 | 6319 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
d55e5bfc RD |
6320 | |
6321 | GetMode = staticmethod(GetMode) | |
6322 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6323 | """ |
6324 | CanSend(Window win) -> bool | |
6325 | ||
6326 | Returns ``True`` if it is appropriate to send idle events to this | |
6327 | window. | |
6328 | ||
6329 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6330 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6331 | events should be sent to this window now. By default this will always | |
6332 | return ``True`` because the update mode is initially | |
6333 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6334 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6335 | """ | |
5b5c9bc7 | 6336 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d55e5bfc RD |
6337 | |
6338 | CanSend = staticmethod(CanSend) | |
2131d850 | 6339 | _core_.IdleEvent_swigregister(IdleEvent) |
d55e5bfc | 6340 | |
5b5c9bc7 | 6341 | def IdleEvent_SetMode(*args, **kwargs): |
1bd55598 | 6342 | """ |
5ba5649b RD |
6343 | IdleEvent_SetMode(int mode) |
6344 | ||
6345 | Static method for specifying how wxWidgets will send idle events: to | |
6346 | all windows, or only to those which specify that they will process the | |
6347 | events. | |
6348 | ||
6349 | The mode can be one of the following values: | |
6350 | ||
6351 | ========================= ======================================== | |
6352 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6353 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6354 | the wx.WS_EX_PROCESS_IDLE extra style | |
6355 | flag set. | |
6356 | ========================= ======================================== | |
6357 | ||
6358 | """ | |
1bd55598 | 6359 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d55e5bfc | 6360 | |
1bd55598 RD |
6361 | def IdleEvent_GetMode(*args): |
6362 | """ | |
5ba5649b RD |
6363 | IdleEvent_GetMode() -> int |
6364 | ||
6365 | Static method returning a value specifying how wxWidgets will send | |
6366 | idle events: to all windows, or only to those which specify that they | |
6367 | will process the events. | |
6368 | """ | |
1bd55598 | 6369 | return _core_.IdleEvent_GetMode(*args) |
d55e5bfc | 6370 | |
5b5c9bc7 | 6371 | def IdleEvent_CanSend(*args, **kwargs): |
1bd55598 | 6372 | """ |
5ba5649b RD |
6373 | IdleEvent_CanSend(Window win) -> bool |
6374 | ||
6375 | Returns ``True`` if it is appropriate to send idle events to this | |
6376 | window. | |
6377 | ||
6378 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6379 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6380 | events should be sent to this window now. By default this will always | |
6381 | return ``True`` because the update mode is initially | |
6382 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6383 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6384 | """ | |
1bd55598 | 6385 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d55e5bfc RD |
6386 | |
6387 | #--------------------------------------------------------------------------- | |
6388 | ||
2131d850 RD |
6389 | class ClipboardTextEvent(CommandEvent): |
6390 | """ | |
6391 | A Clipboard Text event is sent when a window intercepts a text | |
6392 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6393 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6394 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6395 | generated automatically for a Rich Edit text control. | |
6396 | """ | |
6397 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6398 | __repr__ = _swig_repr | |
6399 | def __init__(self, *args, **kwargs): | |
6400 | """ | |
6401 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent | |
6402 | ||
6403 | A Clipboard Text event is sent when a window intercepts a text | |
6404 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6405 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6406 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6407 | generated automatically for a Rich Edit text control. | |
6408 | """ | |
6409 | _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs)) | |
6410 | _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent) | |
6411 | ||
6412 | #--------------------------------------------------------------------------- | |
6413 | ||
5b5c9bc7 | 6414 | class PyEvent(Event): |
5ba5649b RD |
6415 | """ |
6416 | wx.PyEvent can be used as a base class for implementing custom event | |
6417 | types in Python. You should derived from this class instead of | |
6418 | `wx.Event` because this class is Python-aware and is able to transport | |
6419 | its Python bits safely through the wxWidgets event system and have | |
6420 | them still be there when the event handler is invoked. | |
6421 | ||
6422 | :see: `wx.PyCommandEvent` | |
6423 | ||
6424 | """ | |
1bd55598 RD |
6425 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6426 | __repr__ = _swig_repr | |
6427 | def __init__(self, *args, **kwargs): | |
2131d850 | 6428 | """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent""" |
1bd55598 | 6429 | _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs)) |
5ba5649b | 6430 | self._SetSelf(self) |
d55e5bfc | 6431 | |
1bd55598 RD |
6432 | __swig_destroy__ = _core_.delete_PyEvent |
6433 | __del__ = lambda self : None; | |
5ba5649b RD |
6434 | def _SetSelf(*args, **kwargs): |
6435 | """_SetSelf(self, PyObject self)""" | |
6436 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
d55e5bfc | 6437 | |
5ba5649b RD |
6438 | def _GetSelf(*args, **kwargs): |
6439 | """_GetSelf(self) -> PyObject""" | |
6440 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
d55e5bfc | 6441 | |
2131d850 | 6442 | _core_.PyEvent_swigregister(PyEvent) |
d55e5bfc | 6443 | |
5b5c9bc7 | 6444 | class PyCommandEvent(CommandEvent): |
5ba5649b RD |
6445 | """ |
6446 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6447 | event types in Python, where the event shoudl travel up to parent | |
6448 | windows looking for a handler. You should derived from this class | |
6449 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6450 | able to transport its Python bits safely through the wxWidgets event | |
6451 | system and have them still be there when the event handler is invoked. | |
6452 | ||
6453 | :see: `wx.PyEvent` | |
6454 | ||
6455 | """ | |
1bd55598 RD |
6456 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6457 | __repr__ = _swig_repr | |
6458 | def __init__(self, *args, **kwargs): | |
2131d850 | 6459 | """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
1bd55598 | 6460 | _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs)) |
5ba5649b | 6461 | self._SetSelf(self) |
d55e5bfc | 6462 | |
1bd55598 RD |
6463 | __swig_destroy__ = _core_.delete_PyCommandEvent |
6464 | __del__ = lambda self : None; | |
5ba5649b RD |
6465 | def _SetSelf(*args, **kwargs): |
6466 | """_SetSelf(self, PyObject self)""" | |
6467 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
d55e5bfc | 6468 | |
5ba5649b RD |
6469 | def _GetSelf(*args, **kwargs): |
6470 | """_GetSelf(self) -> PyObject""" | |
6471 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
d55e5bfc | 6472 | |
2131d850 | 6473 | _core_.PyCommandEvent_swigregister(PyCommandEvent) |
d55e5bfc | 6474 | |
5b5c9bc7 | 6475 | class DateEvent(CommandEvent): |
5ba5649b RD |
6476 | """ |
6477 | This event class holds information about a date change event and is | |
6478 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6479 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6480 | EVT_DATE_CHANGED. | |
6481 | """ | |
1bd55598 RD |
6482 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6483 | __repr__ = _swig_repr | |
6484 | def __init__(self, *args, **kwargs): | |
2131d850 | 6485 | """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent""" |
1bd55598 | 6486 | _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs)) |
53aa7709 | 6487 | def GetDate(*args, **kwargs): |
5ba5649b RD |
6488 | """ |
6489 | GetDate(self) -> DateTime | |
6490 | ||
6491 | Returns the date. | |
6492 | """ | |
5b5c9bc7 | 6493 | return _core_.DateEvent_GetDate(*args, **kwargs) |
53aa7709 RD |
6494 | |
6495 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6496 | """ |
6497 | SetDate(self, DateTime date) | |
6498 | ||
6499 | Sets the date carried by the event, normally only used by the library | |
6500 | internally. | |
6501 | """ | |
5b5c9bc7 | 6502 | return _core_.DateEvent_SetDate(*args, **kwargs) |
53aa7709 | 6503 | |
2131d850 | 6504 | _core_.DateEvent_swigregister(DateEvent) |
53aa7709 | 6505 | |
5b5c9bc7 | 6506 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED |
53aa7709 RD |
6507 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) |
6508 | ||
d55e5bfc RD |
6509 | #--------------------------------------------------------------------------- |
6510 | ||
5b5c9bc7 RD |
6511 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
6512 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6513 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6514 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6515 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6516 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
6517 | class PyApp(EvtHandler): | |
d6c14a4c RD |
6518 | """ |
6519 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6520 | `wx.App` class (or some other derived class) instead. | |
6521 | """ | |
1bd55598 RD |
6522 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6523 | __repr__ = _swig_repr | |
6524 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 6525 | """ |
5b5c9bc7 | 6526 | __init__(self) -> PyApp |
d55e5bfc RD |
6527 | |
6528 | Create a new application object, starting the bootstrap process. | |
6529 | """ | |
1bd55598 | 6530 | _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs)) |
7993762b RD |
6531 | self._setCallbackInfo(self, PyApp, False) |
6532 | self._setOORInfo(self, False) | |
d55e5bfc | 6533 | |
1bd55598 RD |
6534 | __swig_destroy__ = _core_.delete_PyApp |
6535 | __del__ = lambda self : None; | |
d55e5bfc | 6536 | def _setCallbackInfo(*args, **kwargs): |
7993762b | 6537 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
5b5c9bc7 | 6538 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
6539 | |
6540 | def GetAppName(*args, **kwargs): | |
6541 | """ | |
5b5c9bc7 | 6542 | GetAppName(self) -> String |
d55e5bfc RD |
6543 | |
6544 | Get the application name. | |
6545 | """ | |
5b5c9bc7 | 6546 | return _core_.PyApp_GetAppName(*args, **kwargs) |
d55e5bfc RD |
6547 | |
6548 | def SetAppName(*args, **kwargs): | |
6549 | """ | |
5b5c9bc7 | 6550 | SetAppName(self, String name) |
d55e5bfc | 6551 | |
d6c14a4c RD |
6552 | Set the application name. This value may be used automatically by |
6553 | `wx.Config` and such. | |
d55e5bfc | 6554 | """ |
5b5c9bc7 | 6555 | return _core_.PyApp_SetAppName(*args, **kwargs) |
d55e5bfc RD |
6556 | |
6557 | def GetClassName(*args, **kwargs): | |
6558 | """ | |
5b5c9bc7 | 6559 | GetClassName(self) -> String |
d55e5bfc RD |
6560 | |
6561 | Get the application's class name. | |
6562 | """ | |
5b5c9bc7 | 6563 | return _core_.PyApp_GetClassName(*args, **kwargs) |
d55e5bfc RD |
6564 | |
6565 | def SetClassName(*args, **kwargs): | |
6566 | """ | |
5b5c9bc7 | 6567 | SetClassName(self, String name) |
d55e5bfc | 6568 | |
d6c14a4c RD |
6569 | Set the application's class name. This value may be used for |
6570 | X-resources if applicable for the platform | |
d55e5bfc | 6571 | """ |
5b5c9bc7 | 6572 | return _core_.PyApp_SetClassName(*args, **kwargs) |
d55e5bfc RD |
6573 | |
6574 | def GetVendorName(*args, **kwargs): | |
6575 | """ | |
5b5c9bc7 | 6576 | GetVendorName(self) -> String |
d55e5bfc RD |
6577 | |
6578 | Get the application's vendor name. | |
6579 | """ | |
5b5c9bc7 | 6580 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
d55e5bfc RD |
6581 | |
6582 | def SetVendorName(*args, **kwargs): | |
6583 | """ | |
5b5c9bc7 | 6584 | SetVendorName(self, String name) |
d55e5bfc | 6585 | |
d6c14a4c RD |
6586 | Set the application's vendor name. This value may be used |
6587 | automatically by `wx.Config` and such. | |
d55e5bfc | 6588 | """ |
5b5c9bc7 | 6589 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
d55e5bfc RD |
6590 | |
6591 | def GetTraits(*args, **kwargs): | |
6592 | """ | |
6593 | GetTraits(self) -> wxAppTraits | |
6594 | ||
d6c14a4c RD |
6595 | Return (and create if necessary) the app traits object to which we |
6596 | delegate for everything which either should be configurable by the | |
6597 | user (then he can change the default behaviour simply by overriding | |
6598 | CreateTraits() and returning his own traits object) or which is | |
6599 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
6600 | differences behind the common facade. | |
6601 | ||
6602 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
d55e5bfc | 6603 | """ |
5b5c9bc7 | 6604 | return _core_.PyApp_GetTraits(*args, **kwargs) |
d55e5bfc RD |
6605 | |
6606 | def ProcessPendingEvents(*args, **kwargs): | |
6607 | """ | |
6608 | ProcessPendingEvents(self) | |
6609 | ||
d6c14a4c RD |
6610 | Process all events in the Pending Events list -- it is necessary to |
6611 | call this function to process posted events. This normally happens | |
6612 | during each event loop iteration. | |
d55e5bfc | 6613 | """ |
5b5c9bc7 | 6614 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
d55e5bfc RD |
6615 | |
6616 | def Yield(*args, **kwargs): | |
6617 | """ | |
6618 | Yield(self, bool onlyIfNeeded=False) -> bool | |
6619 | ||
d6c14a4c RD |
6620 | Process all currently pending events right now, instead of waiting |
6621 | until return to the event loop. It is an error to call ``Yield`` | |
6622 | recursively unless the value of ``onlyIfNeeded`` is True. | |
d55e5bfc | 6623 | |
d6c14a4c | 6624 | :warning: This function is dangerous as it can lead to unexpected |
15817c7e RD |
6625 | reentrancies (i.e. when called from an event handler it may |
6626 | result in calling the same event handler again), use with | |
6627 | extreme care or, better, don't use at all! | |
d55e5bfc | 6628 | |
d6c14a4c | 6629 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
15817c7e | 6630 | |
d55e5bfc | 6631 | """ |
5b5c9bc7 | 6632 | return _core_.PyApp_Yield(*args, **kwargs) |
d55e5bfc RD |
6633 | |
6634 | def WakeUpIdle(*args, **kwargs): | |
6635 | """ | |
6636 | WakeUpIdle(self) | |
6637 | ||
d6c14a4c RD |
6638 | Make sure that idle events are sent again. |
6639 | :see: `wx.WakeUpIdle` | |
d55e5bfc | 6640 | """ |
5b5c9bc7 | 6641 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
d55e5bfc | 6642 | |
84f85550 RD |
6643 | def IsMainLoopRunning(*args, **kwargs): |
6644 | """ | |
6645 | IsMainLoopRunning() -> bool | |
6646 | ||
6647 | Returns True if we're running the main loop, i.e. if the events can | |
6648 | currently be dispatched. | |
6649 | """ | |
5b5c9bc7 | 6650 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) |
84f85550 RD |
6651 | |
6652 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
d55e5bfc RD |
6653 | def MainLoop(*args, **kwargs): |
6654 | """ | |
6655 | MainLoop(self) -> int | |
6656 | ||
d6c14a4c RD |
6657 | Execute the main GUI loop, the function doesn't normally return until |
6658 | all top level windows have been closed and destroyed. | |
d55e5bfc | 6659 | """ |
5b5c9bc7 | 6660 | return _core_.PyApp_MainLoop(*args, **kwargs) |
d55e5bfc RD |
6661 | |
6662 | def Exit(*args, **kwargs): | |
6663 | """ | |
6664 | Exit(self) | |
6665 | ||
6666 | Exit the main loop thus terminating the application. | |
d6c14a4c | 6667 | :see: `wx.Exit` |
d55e5bfc | 6668 | """ |
5b5c9bc7 | 6669 | return _core_.PyApp_Exit(*args, **kwargs) |
d55e5bfc RD |
6670 | |
6671 | def ExitMainLoop(*args, **kwargs): | |
6672 | """ | |
6673 | ExitMainLoop(self) | |
6674 | ||
d6c14a4c RD |
6675 | Exit the main GUI loop during the next iteration of the main |
6676 | loop, (i.e. it does not stop the program immediately!) | |
d55e5bfc | 6677 | """ |
5b5c9bc7 | 6678 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
d55e5bfc RD |
6679 | |
6680 | def Pending(*args, **kwargs): | |
6681 | """ | |
6682 | Pending(self) -> bool | |
6683 | ||
6684 | Returns True if there are unprocessed events in the event queue. | |
6685 | """ | |
5b5c9bc7 | 6686 | return _core_.PyApp_Pending(*args, **kwargs) |
d55e5bfc RD |
6687 | |
6688 | def Dispatch(*args, **kwargs): | |
6689 | """ | |
6690 | Dispatch(self) -> bool | |
6691 | ||
6692 | Process the first event in the event queue (blocks until an event | |
6693 | appears if there are none currently) | |
6694 | """ | |
5b5c9bc7 | 6695 | return _core_.PyApp_Dispatch(*args, **kwargs) |
d55e5bfc RD |
6696 | |
6697 | def ProcessIdle(*args, **kwargs): | |
6698 | """ | |
6699 | ProcessIdle(self) -> bool | |
6700 | ||
d6c14a4c RD |
6701 | Called from the MainLoop when the application becomes idle (there are |
6702 | no pending events) and sends a `wx.IdleEvent` to all interested | |
6703 | parties. Returns True if more idle events are needed, False if not. | |
d55e5bfc | 6704 | """ |
5b5c9bc7 | 6705 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
d55e5bfc RD |
6706 | |
6707 | def SendIdleEvents(*args, **kwargs): | |
6708 | """ | |
5b5c9bc7 | 6709 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
d55e5bfc | 6710 | |
d6c14a4c RD |
6711 | Send idle event to window and all subwindows. Returns True if more |
6712 | idle time is requested. | |
d55e5bfc | 6713 | """ |
5b5c9bc7 | 6714 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
d55e5bfc RD |
6715 | |
6716 | def IsActive(*args, **kwargs): | |
6717 | """ | |
6718 | IsActive(self) -> bool | |
6719 | ||
6720 | Return True if our app has focus. | |
6721 | """ | |
5b5c9bc7 | 6722 | return _core_.PyApp_IsActive(*args, **kwargs) |
d55e5bfc RD |
6723 | |
6724 | def SetTopWindow(*args, **kwargs): | |
6725 | """ | |
5b5c9bc7 | 6726 | SetTopWindow(self, Window win) |
d55e5bfc | 6727 | |
d6c14a4c | 6728 | Set the *main* top level window |
d55e5bfc | 6729 | """ |
5b5c9bc7 | 6730 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
d55e5bfc RD |
6731 | |
6732 | def GetTopWindow(*args, **kwargs): | |
6733 | """ | |
5b5c9bc7 | 6734 | GetTopWindow(self) -> Window |
d55e5bfc | 6735 | |
d6c14a4c RD |
6736 | Return the *main* top level window (if it hadn't been set previously |
6737 | with SetTopWindow(), will return just some top level window and, if | |
6738 | there not any, will return None) | |
d55e5bfc | 6739 | """ |
5b5c9bc7 | 6740 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
d55e5bfc RD |
6741 | |
6742 | def SetExitOnFrameDelete(*args, **kwargs): | |
6743 | """ | |
6744 | SetExitOnFrameDelete(self, bool flag) | |
6745 | ||
d6c14a4c RD |
6746 | Control the exit behaviour: by default, the program will exit the main |
6747 | loop (and so, usually, terminate) when the last top-level program | |
6748 | window is deleted. Beware that if you disable this behaviour (with | |
6749 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
6750 | explicitly from somewhere. | |
d55e5bfc | 6751 | """ |
5b5c9bc7 | 6752 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
d55e5bfc RD |
6753 | |
6754 | def GetExitOnFrameDelete(*args, **kwargs): | |
6755 | """ | |
6756 | GetExitOnFrameDelete(self) -> bool | |
6757 | ||
6758 | Get the current exit behaviour setting. | |
6759 | """ | |
5b5c9bc7 | 6760 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
d55e5bfc RD |
6761 | |
6762 | def SetUseBestVisual(*args, **kwargs): | |
6763 | """ | |
6764 | SetUseBestVisual(self, bool flag) | |
6765 | ||
d6c14a4c RD |
6766 | Set whether the app should try to use the best available visual on |
6767 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
d55e5bfc | 6768 | """ |
5b5c9bc7 | 6769 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
d55e5bfc RD |
6770 | |
6771 | def GetUseBestVisual(*args, **kwargs): | |
6772 | """ | |
6773 | GetUseBestVisual(self) -> bool | |
6774 | ||
6775 | Get current UseBestVisual setting. | |
6776 | """ | |
5b5c9bc7 | 6777 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
d55e5bfc RD |
6778 | |
6779 | def SetPrintMode(*args, **kwargs): | |
6780 | """SetPrintMode(self, int mode)""" | |
5b5c9bc7 | 6781 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
d55e5bfc RD |
6782 | |
6783 | def GetPrintMode(*args, **kwargs): | |
6784 | """GetPrintMode(self) -> int""" | |
5b5c9bc7 | 6785 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
d55e5bfc RD |
6786 | |
6787 | def SetAssertMode(*args, **kwargs): | |
6788 | """ | |
6789 | SetAssertMode(self, int mode) | |
6790 | ||
15817c7e | 6791 | Set the OnAssert behaviour for debug and hybrid builds. |
d55e5bfc | 6792 | """ |
5b5c9bc7 | 6793 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
d55e5bfc RD |
6794 | |
6795 | def GetAssertMode(*args, **kwargs): | |
6796 | """ | |
6797 | GetAssertMode(self) -> int | |
6798 | ||
6799 | Get the current OnAssert behaviour setting. | |
6800 | """ | |
5b5c9bc7 | 6801 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
d55e5bfc RD |
6802 | |
6803 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): | |
d6c14a4c | 6804 | """GetMacSupportPCMenuShortcuts() -> bool""" |
5b5c9bc7 | 6805 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
d55e5bfc RD |
6806 | |
6807 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
6808 | def GetMacAboutMenuItemId(*args, **kwargs): | |
d6c14a4c | 6809 | """GetMacAboutMenuItemId() -> long""" |
5b5c9bc7 | 6810 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
d55e5bfc RD |
6811 | |
6812 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
6813 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
d6c14a4c | 6814 | """GetMacPreferencesMenuItemId() -> long""" |
5b5c9bc7 | 6815 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
d55e5bfc RD |
6816 | |
6817 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
6818 | def GetMacExitMenuItemId(*args, **kwargs): | |
d6c14a4c | 6819 | """GetMacExitMenuItemId() -> long""" |
5b5c9bc7 | 6820 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
d55e5bfc RD |
6821 | |
6822 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
6823 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
5b5c9bc7 RD |
6824 | """GetMacHelpMenuTitleName() -> String""" |
6825 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc RD |
6826 | |
6827 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
6828 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
d6c14a4c | 6829 | """SetMacSupportPCMenuShortcuts(bool val)""" |
5b5c9bc7 | 6830 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
d55e5bfc RD |
6831 | |
6832 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
6833 | def SetMacAboutMenuItemId(*args, **kwargs): | |
d6c14a4c | 6834 | """SetMacAboutMenuItemId(long val)""" |
5b5c9bc7 | 6835 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
d55e5bfc RD |
6836 | |
6837 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
6838 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
d6c14a4c | 6839 | """SetMacPreferencesMenuItemId(long val)""" |
5b5c9bc7 | 6840 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
d55e5bfc RD |
6841 | |
6842 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
6843 | def SetMacExitMenuItemId(*args, **kwargs): | |
d6c14a4c | 6844 | """SetMacExitMenuItemId(long val)""" |
5b5c9bc7 | 6845 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
d55e5bfc RD |
6846 | |
6847 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
6848 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
5b5c9bc7 RD |
6849 | """SetMacHelpMenuTitleName(String val)""" |
6850 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc RD |
6851 | |
6852 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
6853 | def _BootstrapApp(*args, **kwargs): | |
6854 | """ | |
6855 | _BootstrapApp(self) | |
6856 | ||
6857 | For internal use only | |
6858 | """ | |
5b5c9bc7 | 6859 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
d55e5bfc RD |
6860 | |
6861 | def GetComCtl32Version(*args, **kwargs): | |
6862 | """ | |
d6c14a4c | 6863 | GetComCtl32Version() -> int |
d55e5bfc | 6864 | |
d6c14a4c RD |
6865 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
6866 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc | 6867 | """ |
5b5c9bc7 | 6868 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
d55e5bfc RD |
6869 | |
6870 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
fc46b7f3 RD |
6871 | def DisplayAvailable(*args, **kwargs): |
6872 | """ | |
6873 | DisplayAvailable() -> bool | |
6874 | ||
6875 | Tests if it is possible to create a GUI in the current environment. | |
6876 | This will mean different things on the different platforms. | |
6877 | ||
6878 | * On X Windows systems this function will return ``False`` if it is | |
6879 | not able to open a connection to the X display, which can happen | |
6880 | if $DISPLAY is not set, or is not set correctly. | |
6881 | ||
6882 | * On Mac OS X a ``False`` return value will mean that wx is not | |
6883 | able to access the window manager, which can happen if logged in | |
6884 | remotely or if running from the normal version of python instead | |
6885 | of the framework version, (i.e., pythonw.) | |
6886 | ||
6887 | * On MS Windows... | |
6888 | ||
6889 | """ | |
6890 | return _core_.PyApp_DisplayAvailable(*args, **kwargs) | |
6891 | ||
6892 | DisplayAvailable = staticmethod(DisplayAvailable) | |
2131d850 | 6893 | _core_.PyApp_swigregister(PyApp) |
d55e5bfc | 6894 | |
1bd55598 RD |
6895 | def PyApp_IsMainLoopRunning(*args): |
6896 | """ | |
5b5c9bc7 | 6897 | PyApp_IsMainLoopRunning() -> bool |
84f85550 RD |
6898 | |
6899 | Returns True if we're running the main loop, i.e. if the events can | |
6900 | currently be dispatched. | |
6901 | """ | |
1bd55598 | 6902 | return _core_.PyApp_IsMainLoopRunning(*args) |
84f85550 | 6903 | |
1bd55598 RD |
6904 | def PyApp_GetMacSupportPCMenuShortcuts(*args): |
6905 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
6906 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args) | |
d55e5bfc | 6907 | |
1bd55598 RD |
6908 | def PyApp_GetMacAboutMenuItemId(*args): |
6909 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
6910 | return _core_.PyApp_GetMacAboutMenuItemId(*args) | |
d55e5bfc | 6911 | |
1bd55598 RD |
6912 | def PyApp_GetMacPreferencesMenuItemId(*args): |
6913 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
6914 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args) | |
d55e5bfc | 6915 | |
1bd55598 RD |
6916 | def PyApp_GetMacExitMenuItemId(*args): |
6917 | """PyApp_GetMacExitMenuItemId() -> long""" | |
6918 | return _core_.PyApp_GetMacExitMenuItemId(*args) | |
d55e5bfc | 6919 | |
1bd55598 RD |
6920 | def PyApp_GetMacHelpMenuTitleName(*args): |
6921 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
6922 | return _core_.PyApp_GetMacHelpMenuTitleName(*args) | |
d55e5bfc | 6923 | |
5b5c9bc7 | 6924 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
1bd55598 RD |
6925 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" |
6926 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d55e5bfc | 6927 | |
5b5c9bc7 | 6928 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
1bd55598 RD |
6929 | """PyApp_SetMacAboutMenuItemId(long val)""" |
6930 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
d55e5bfc | 6931 | |
5b5c9bc7 | 6932 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
1bd55598 RD |
6933 | """PyApp_SetMacPreferencesMenuItemId(long val)""" |
6934 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
d55e5bfc | 6935 | |
5b5c9bc7 | 6936 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
1bd55598 RD |
6937 | """PyApp_SetMacExitMenuItemId(long val)""" |
6938 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
d55e5bfc | 6939 | |
5b5c9bc7 | 6940 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
1bd55598 RD |
6941 | """PyApp_SetMacHelpMenuTitleName(String val)""" |
6942 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc | 6943 | |
1bd55598 RD |
6944 | def PyApp_GetComCtl32Version(*args): |
6945 | """ | |
5b5c9bc7 | 6946 | PyApp_GetComCtl32Version() -> int |
d55e5bfc | 6947 | |
d6c14a4c RD |
6948 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
6949 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc | 6950 | """ |
1bd55598 | 6951 | return _core_.PyApp_GetComCtl32Version(*args) |
d55e5bfc | 6952 | |
fc46b7f3 RD |
6953 | def PyApp_DisplayAvailable(*args): |
6954 | """ | |
6955 | PyApp_DisplayAvailable() -> bool | |
6956 | ||
6957 | Tests if it is possible to create a GUI in the current environment. | |
6958 | This will mean different things on the different platforms. | |
6959 | ||
6960 | * On X Windows systems this function will return ``False`` if it is | |
6961 | not able to open a connection to the X display, which can happen | |
6962 | if $DISPLAY is not set, or is not set correctly. | |
6963 | ||
6964 | * On Mac OS X a ``False`` return value will mean that wx is not | |
6965 | able to access the window manager, which can happen if logged in | |
6966 | remotely or if running from the normal version of python instead | |
6967 | of the framework version, (i.e., pythonw.) | |
6968 | ||
6969 | * On MS Windows... | |
6970 | ||
6971 | """ | |
6972 | return _core_.PyApp_DisplayAvailable(*args) | |
6973 | ||
d55e5bfc RD |
6974 | #--------------------------------------------------------------------------- |
6975 | ||
6976 | ||
1bd55598 RD |
6977 | def Exit(*args): |
6978 | """ | |
5b5c9bc7 | 6979 | Exit() |
d55e5bfc RD |
6980 | |
6981 | Force an exit of the application. Convenience for wx.GetApp().Exit() | |
6982 | """ | |
1bd55598 | 6983 | return _core_.Exit(*args) |
d55e5bfc | 6984 | |
1bd55598 RD |
6985 | def Yield(*args): |
6986 | """ | |
5b5c9bc7 | 6987 | Yield() -> bool |
d55e5bfc RD |
6988 | |
6989 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() | |
6990 | """ | |
1bd55598 | 6991 | return _core_.Yield(*args) |
d55e5bfc | 6992 | |
1bd55598 RD |
6993 | def YieldIfNeeded(*args): |
6994 | """ | |
5b5c9bc7 | 6995 | YieldIfNeeded() -> bool |
d55e5bfc RD |
6996 | |
6997 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) | |
6998 | """ | |
1bd55598 | 6999 | return _core_.YieldIfNeeded(*args) |
d55e5bfc | 7000 | |
5b5c9bc7 | 7001 | def SafeYield(*args, **kwargs): |
1bd55598 | 7002 | """ |
5b5c9bc7 | 7003 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool |
d55e5bfc | 7004 | |
d6c14a4c RD |
7005 | This function is similar to `wx.Yield`, except that it disables the |
7006 | user input to all program windows before calling `wx.Yield` and | |
7007 | re-enables it again afterwards. If ``win`` is not None, this window | |
7008 | will remain enabled, allowing the implementation of some limited user | |
7009 | interaction. | |
d55e5bfc | 7010 | |
d6c14a4c | 7011 | :Returns: the result of the call to `wx.Yield`. |
d55e5bfc | 7012 | """ |
1bd55598 | 7013 | return _core_.SafeYield(*args, **kwargs) |
d55e5bfc | 7014 | |
1bd55598 RD |
7015 | def WakeUpIdle(*args): |
7016 | """ | |
5b5c9bc7 | 7017 | WakeUpIdle() |
d55e5bfc | 7018 | |
d6c14a4c RD |
7019 | Cause the message queue to become empty again, so idle events will be |
7020 | sent. | |
d55e5bfc | 7021 | """ |
1bd55598 | 7022 | return _core_.WakeUpIdle(*args) |
d55e5bfc | 7023 | |
5b5c9bc7 | 7024 | def PostEvent(*args, **kwargs): |
1bd55598 | 7025 | """ |
5b5c9bc7 | 7026 | PostEvent(EvtHandler dest, Event event) |
d55e5bfc | 7027 | |
d6c14a4c RD |
7028 | Send an event to a window or other wx.EvtHandler to be processed |
7029 | later. | |
d55e5bfc | 7030 | """ |
1bd55598 | 7031 | return _core_.PostEvent(*args, **kwargs) |
d55e5bfc | 7032 | |
1bd55598 RD |
7033 | def App_CleanUp(*args): |
7034 | """ | |
5b5c9bc7 | 7035 | App_CleanUp() |
d55e5bfc | 7036 | |
15817c7e | 7037 | For internal use only, it is used to cleanup after wxWidgets when |
d6c14a4c | 7038 | Python shuts down. |
d55e5bfc | 7039 | """ |
1bd55598 | 7040 | return _core_.App_CleanUp(*args) |
d55e5bfc | 7041 | |
1bd55598 RD |
7042 | def GetApp(*args): |
7043 | """ | |
5b5c9bc7 | 7044 | GetApp() -> PyApp |
d55e5bfc RD |
7045 | |
7046 | Return a reference to the current wx.App object. | |
7047 | """ | |
1bd55598 | 7048 | return _core_.GetApp(*args) |
5cbf236d | 7049 | |
5b5c9bc7 | 7050 | def SetDefaultPyEncoding(*args, **kwargs): |
1bd55598 | 7051 | """ |
5cbf236d RD |
7052 | SetDefaultPyEncoding(string encoding) |
7053 | ||
7054 | Sets the encoding that wxPython will use when it needs to convert a | |
7055 | Python string or unicode object to or from a wxString. | |
62d32a5f RD |
7056 | |
7057 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7058 | but please be aware that the default encoding within the same locale | |
7059 | may be slightly different on different platforms. For example, please | |
7060 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7061 | between the common latin/roman encodings. | |
5cbf236d | 7062 | """ |
1bd55598 | 7063 | return _core_.SetDefaultPyEncoding(*args, **kwargs) |
5cbf236d | 7064 | |
1bd55598 RD |
7065 | def GetDefaultPyEncoding(*args): |
7066 | """ | |
5cbf236d RD |
7067 | GetDefaultPyEncoding() -> string |
7068 | ||
7069 | Gets the current encoding that wxPython will use when it needs to | |
7070 | convert a Python string or unicode object to or from a wxString. | |
7071 | """ | |
1bd55598 | 7072 | return _core_.GetDefaultPyEncoding(*args) |
d55e5bfc RD |
7073 | #---------------------------------------------------------------------- |
7074 | ||
7075 | class PyOnDemandOutputWindow: | |
7076 | """ | |
7077 | A class that can be used for redirecting Python's stdout and | |
7078 | stderr streams. It will do nothing until something is wrriten to | |
7079 | the stream at which point it will create a Frame with a text area | |
7080 | and write the text there. | |
7081 | """ | |
7082 | def __init__(self, title = "wxPython: stdout/stderr"): | |
7083 | self.frame = None | |
7084 | self.title = title | |
412d302d RD |
7085 | self.pos = wx.DefaultPosition |
7086 | self.size = (450, 300) | |
d55e5bfc RD |
7087 | self.parent = None |
7088 | ||
7089 | def SetParent(self, parent): | |
7090 | """Set the window to be used as the popup Frame's parent.""" | |
7091 | self.parent = parent | |
7092 | ||
7093 | ||
7094 | def CreateOutputWindow(self, st): | |
412d302d RD |
7095 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7096 | style=wx.DEFAULT_FRAME_STYLE) | |
d55e5bfc | 7097 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7098 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d55e5bfc | 7099 | self.text.AppendText(st) |
d55e5bfc | 7100 | self.frame.Show(True) |
2131d850 | 7101 | self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
d55e5bfc RD |
7102 | |
7103 | ||
7104 | def OnCloseWindow(self, event): | |
7105 | if self.frame is not None: | |
7106 | self.frame.Destroy() | |
7107 | self.frame = None | |
7108 | self.text = None | |
7109 | ||
7110 | ||
7111 | # These methods provide the file-like output behaviour. | |
7112 | def write(self, text): | |
7113 | """ | |
7114 | Create the output window if needed and write the string to it. | |
7115 | If not called in the context of the gui thread then uses | |
7116 | CallAfter to do the work there. | |
7117 | """ | |
7118 | if self.frame is None: | |
7119 | if not wx.Thread_IsMain(): | |
7120 | wx.CallAfter(self.CreateOutputWindow, text) | |
7121 | else: | |
7122 | self.CreateOutputWindow(text) | |
7123 | else: | |
7124 | if not wx.Thread_IsMain(): | |
7125 | wx.CallAfter(self.text.AppendText, text) | |
7126 | else: | |
7127 | self.text.AppendText(text) | |
7128 | ||
7129 | ||
7130 | def close(self): | |
7131 | if self.frame is not None: | |
7132 | wx.CallAfter(self.frame.Close) | |
7133 | ||
7134 | ||
bb4524c4 RD |
7135 | def flush(self): |
7136 | pass | |
7137 | ||
7138 | ||
d55e5bfc RD |
7139 | |
7140 | #---------------------------------------------------------------------- | |
7141 | ||
7142 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
fc46b7f3 | 7143 | |
d55e5bfc RD |
7144 | class App(wx.PyApp): |
7145 | """ | |
d6c14a4c RD |
7146 | The ``wx.App`` class represents the application and is used to: |
7147 | ||
7148 | * bootstrap the wxPython system and initialize the underlying | |
7149 | gui toolkit | |
7150 | * set and get application-wide properties | |
7151 | * implement the windowing system main message or event loop, | |
7152 | and to dispatch events to window instances | |
7153 | * etc. | |
7154 | ||
7155 | Every application must have a ``wx.App`` instance, and all | |
7156 | creation of UI objects should be delayed until after the | |
7157 | ``wx.App`` object has been created in order to ensure that the gui | |
7158 | platform and wxWidgets have been fully initialized. | |
7159 | ||
7160 | Normally you would derive from this class and implement an | |
7161 | ``OnInit`` method that creates a frame and then calls | |
7162 | ``self.SetTopWindow(frame)``. | |
7163 | ||
7164 | :see: `wx.PySimpleApp` for a simpler app class that can be used | |
15817c7e | 7165 | directly. |
d55e5bfc | 7166 | """ |
d6c14a4c | 7167 | |
d55e5bfc RD |
7168 | outputWindowClass = PyOnDemandOutputWindow |
7169 | ||
d6c14a4c RD |
7170 | def __init__(self, redirect=_defRedirect, filename=None, |
7171 | useBestVisual=False, clearSigInt=True): | |
7172 | """ | |
7173 | Construct a ``wx.App`` object. | |
7174 | ||
7175 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be | |
7176 | redirected? Defaults to True on Windows and Mac, False | |
7177 | otherwise. If `filename` is None then output will be | |
7178 | redirected to a window that pops up as needed. (You can | |
7179 | control what kind of window is created for the output by | |
7180 | resetting the class variable ``outputWindowClass`` to a | |
7181 | class of your choosing.) | |
7182 | ||
7183 | :param filename: The name of a file to redirect output to, if | |
7184 | redirect is True. | |
7185 | ||
7186 | :param useBestVisual: Should the app try to use the best | |
7187 | available visual provided by the system (only relevant on | |
7188 | systems that have more than one visual.) This parameter | |
7189 | must be used instead of calling `SetUseBestVisual` later | |
7190 | on because it must be set before the underlying GUI | |
7191 | toolkit is initialized. | |
7192 | ||
7193 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7194 | app to terminate upon a Ctrl-C in the console like other | |
7195 | GUI apps will. | |
7196 | ||
7197 | :note: You should override OnInit to do applicaition | |
7198 | initialization to ensure that the system, toolkit and | |
7199 | wxWidgets are fully initialized. | |
7200 | """ | |
fc46b7f3 | 7201 | |
d55e5bfc RD |
7202 | wx.PyApp.__init__(self) |
7203 | ||
fc46b7f3 RD |
7204 | # make sure we can create a GUI |
7205 | if not self.DisplayAvailable(): | |
7206 | ||
7207 | if wx.Platform == "__WXMAC__": | |
7208 | msg = """This program needs access to the screen. | |
7209 | Please run with 'pythonw', not 'python', and only when you are logged | |
7210 | in on the main display of your Mac.""" | |
7211 | ||
7212 | elif wx.Platform == "__WXGTK__": | |
7213 | msg ="Unable to access the X Display, is $DISPLAY set properly?" | |
d55e5bfc | 7214 | |
fc46b7f3 RD |
7215 | else: |
7216 | msg = "Unable to create GUI" | |
7217 | # TODO: more description is needed for wxMSW... | |
7218 | ||
7219 | raise SystemExit(msg) | |
7220 | ||
d55e5bfc RD |
7221 | # This has to be done before OnInit |
7222 | self.SetUseBestVisual(useBestVisual) | |
7223 | ||
7224 | # Set the default handler for SIGINT. This fixes a problem | |
7225 | # where if Ctrl-C is pressed in the console that started this | |
7226 | # app then it will not appear to do anything, (not even send | |
7227 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7228 | # setting the default handler then the app will exit, as | |
7229 | # expected (depending on platform.) | |
d6c14a4c RD |
7230 | if clearSigInt: |
7231 | try: | |
7232 | import signal | |
7233 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7234 | except: | |
7235 | pass | |
d55e5bfc RD |
7236 | |
7237 | # Save and redirect the stdio to a window? | |
7238 | self.stdioWin = None | |
7239 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7240 | if redirect: | |
7241 | self.RedirectStdio(filename) | |
7242 | ||
8fb0e70a RD |
7243 | # Use Python's install prefix as the default |
7244 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7245 | ||
d55e5bfc RD |
7246 | # This finishes the initialization of wxWindows and then calls |
7247 | # the OnInit that should be present in the derived class | |
7248 | self._BootstrapApp() | |
7249 | ||
7250 | ||
2131d850 RD |
7251 | def OnPreInit(self): |
7252 | """ | |
7253 | Things that must be done after _BootstrapApp has done its | |
7254 | thing, but would be nice if they were already done by the time | |
7255 | that OnInit is called. | |
7256 | """ | |
7257 | wx.StockGDI._initStockObjects() | |
7258 | ||
7259 | ||
66af7a75 RD |
7260 | def __del__(self, destroy=wx.PyApp.__del__): |
7261 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7262 | destroy(self) | |
d55e5bfc | 7263 | |
7993762b RD |
7264 | def Destroy(self): |
7265 | wx.PyApp.Destroy(self) | |
7266 | self.thisown = 0 | |
d55e5bfc RD |
7267 | |
7268 | def SetTopWindow(self, frame): | |
7269 | """Set the \"main\" top level window""" | |
7270 | if self.stdioWin: | |
7271 | self.stdioWin.SetParent(frame) | |
7272 | wx.PyApp.SetTopWindow(self, frame) | |
7273 | ||
7274 | ||
7275 | def MainLoop(self): | |
7276 | """Execute the main GUI event loop""" | |
7277 | wx.PyApp.MainLoop(self) | |
7278 | self.RestoreStdio() | |
7279 | ||
7280 | ||
7281 | def RedirectStdio(self, filename=None): | |
7282 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" | |
7283 | if filename: | |
7284 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7285 | else: | |
7286 | self.stdioWin = self.outputWindowClass() | |
7287 | _sys.stdout = _sys.stderr = self.stdioWin | |
7288 | ||
7289 | ||
7290 | def RestoreStdio(self): | |
66af7a75 RD |
7291 | try: |
7292 | _sys.stdout, _sys.stderr = self.saveStdio | |
7293 | except: | |
7294 | pass | |
d55e5bfc RD |
7295 | |
7296 | ||
412d302d RD |
7297 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7298 | """ | |
7299 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7300 | the stdio has been redirected. This should be called before |
7301 | any output would cause the output window to be created. | |
412d302d RD |
7302 | """ |
7303 | if self.stdioWin: | |
7304 | if title is not None: | |
7305 | self.stdioWin.title = title | |
7306 | if pos is not None: | |
7307 | self.stdioWin.pos = pos | |
7308 | if size is not None: | |
7309 | self.stdioWin.size = size | |
7310 | ||
7311 | ||
7312 | ||
d55e5bfc | 7313 | |
d6c14a4c | 7314 | # change from wx.PyApp_XX to wx.App_XX |
d55e5bfc RD |
7315 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7316 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7317 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7318 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7319 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7320 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7321 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7322 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7323 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7324 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7325 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
7326 | ||
7327 | #---------------------------------------------------------------------------- | |
7328 | ||
7329 | class PySimpleApp(wx.App): | |
7330 | """ | |
7331 | A simple application class. You can just create one of these and | |
7332 | then then make your top level windows later, and not have to worry | |
d6c14a4c | 7333 | about OnInit. For example:: |
d55e5bfc | 7334 | |
d6c14a4c RD |
7335 | app = wx.PySimpleApp() |
7336 | frame = wx.Frame(None, title='Hello World') | |
7337 | frame.Show() | |
7338 | app.MainLoop() | |
7339 | ||
7340 | :see: `wx.App` | |
7341 | """ | |
7342 | ||
7343 | def __init__(self, redirect=False, filename=None, | |
7344 | useBestVisual=False, clearSigInt=True): | |
7345 | """ | |
7346 | :see: `wx.App.__init__` | |
7347 | """ | |
7348 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) | |
d55e5bfc RD |
7349 | |
7350 | def OnInit(self): | |
d55e5bfc RD |
7351 | return True |
7352 | ||
7353 | ||
d6c14a4c | 7354 | |
d55e5bfc RD |
7355 | # Is anybody using this one? |
7356 | class PyWidgetTester(wx.App): | |
7357 | def __init__(self, size = (250, 100)): | |
7358 | self.size = size | |
7359 | wx.App.__init__(self, 0) | |
7360 | ||
7361 | def OnInit(self): | |
7362 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) | |
7363 | self.SetTopWindow(self.frame) | |
7364 | return True | |
7365 | ||
d6c14a4c RD |
7366 | def SetWidget(self, widgetClass, *args, **kwargs): |
7367 | w = widgetClass(self.frame, *args, **kwargs) | |
d55e5bfc RD |
7368 | self.frame.Show(True) |
7369 | ||
7370 | #---------------------------------------------------------------------------- | |
7371 | # DO NOT hold any other references to this object. This is how we | |
d6c14a4c | 7372 | # know when to cleanup system resources that wxWidgets is holding. When |
d55e5bfc | 7373 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
d6c14a4c | 7374 | # goes to zero and it calls the wx.App_CleanUp function. |
d55e5bfc RD |
7375 | |
7376 | class __wxPyCleanup: | |
7377 | def __init__(self): | |
7378 | self.cleanup = _core_.App_CleanUp | |
7379 | def __del__(self): | |
7380 | self.cleanup() | |
7381 | ||
7382 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7383 | ||
7384 | ## # another possible solution, but it gets called too early... | |
d6c14a4c RD |
7385 | ## import atexit |
7386 | ## atexit.register(_core_.wxApp_CleanUp) | |
d55e5bfc RD |
7387 | |
7388 | ||
7389 | #---------------------------------------------------------------------------- | |
7390 | ||
7391 | #--------------------------------------------------------------------------- | |
7392 | ||
5b5c9bc7 RD |
7393 | class EventLoop(object): |
7394 | """Proxy of C++ EventLoop class""" | |
1bd55598 RD |
7395 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7396 | __repr__ = _swig_repr | |
7397 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 7398 | """__init__(self) -> EventLoop""" |
1bd55598 RD |
7399 | _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs)) |
7400 | __swig_destroy__ = _core_.delete_EventLoop | |
7401 | __del__ = lambda self : None; | |
b411df4a RD |
7402 | def Run(*args, **kwargs): |
7403 | """Run(self) -> int""" | |
5b5c9bc7 | 7404 | return _core_.EventLoop_Run(*args, **kwargs) |
b411df4a RD |
7405 | |
7406 | def Exit(*args, **kwargs): | |
7407 | """Exit(self, int rc=0)""" | |
5b5c9bc7 | 7408 | return _core_.EventLoop_Exit(*args, **kwargs) |
b411df4a RD |
7409 | |
7410 | def Pending(*args, **kwargs): | |
7411 | """Pending(self) -> bool""" | |
5b5c9bc7 | 7412 | return _core_.EventLoop_Pending(*args, **kwargs) |
b411df4a RD |
7413 | |
7414 | def Dispatch(*args, **kwargs): | |
7415 | """Dispatch(self) -> bool""" | |
5b5c9bc7 | 7416 | return _core_.EventLoop_Dispatch(*args, **kwargs) |
b411df4a RD |
7417 | |
7418 | def IsRunning(*args, **kwargs): | |
7419 | """IsRunning(self) -> bool""" | |
5b5c9bc7 | 7420 | return _core_.EventLoop_IsRunning(*args, **kwargs) |
b411df4a RD |
7421 | |
7422 | def GetActive(*args, **kwargs): | |
5b5c9bc7 RD |
7423 | """GetActive() -> EventLoop""" |
7424 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
b411df4a RD |
7425 | |
7426 | GetActive = staticmethod(GetActive) | |
7427 | def SetActive(*args, **kwargs): | |
5b5c9bc7 RD |
7428 | """SetActive(EventLoop loop)""" |
7429 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
b411df4a RD |
7430 | |
7431 | SetActive = staticmethod(SetActive) | |
2131d850 | 7432 | _core_.EventLoop_swigregister(EventLoop) |
b411df4a | 7433 | |
1bd55598 RD |
7434 | def EventLoop_GetActive(*args): |
7435 | """EventLoop_GetActive() -> EventLoop""" | |
7436 | return _core_.EventLoop_GetActive(*args) | |
b411df4a | 7437 | |
5b5c9bc7 | 7438 | def EventLoop_SetActive(*args, **kwargs): |
1bd55598 RD |
7439 | """EventLoop_SetActive(EventLoop loop)""" |
7440 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
b411df4a | 7441 | |
32fe5131 RD |
7442 | class EventLoopActivator(object): |
7443 | """Proxy of C++ EventLoopActivator class""" | |
1bd55598 RD |
7444 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7445 | __repr__ = _swig_repr | |
7446 | def __init__(self, *args, **kwargs): | |
32fe5131 | 7447 | """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" |
1bd55598 RD |
7448 | _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs)) |
7449 | __swig_destroy__ = _core_.delete_EventLoopActivator | |
7450 | __del__ = lambda self : None; | |
2131d850 | 7451 | _core_.EventLoopActivator_swigregister(EventLoopActivator) |
32fe5131 | 7452 | |
b411df4a RD |
7453 | #--------------------------------------------------------------------------- |
7454 | ||
eec1c382 RD |
7455 | ACCEL_ALT = _core_.ACCEL_ALT |
7456 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
7457 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
7458 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
7459 | ACCEL_CMD = _core_.ACCEL_CMD | |
5b5c9bc7 | 7460 | class AcceleratorEntry(object): |
d6c14a4c RD |
7461 | """ |
7462 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7463 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7464 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
15817c7e | 7465 | as well. See `__init__` for of the tuple values. |
d6c14a4c RD |
7466 | |
7467 | :see: `wx.AcceleratorTable` | |
7468 | """ | |
1bd55598 RD |
7469 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7470 | __repr__ = _swig_repr | |
7471 | def __init__(self, *args, **kwargs): | |
d6c14a4c | 7472 | """ |
5b5c9bc7 | 7473 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry |
d6c14a4c RD |
7474 | |
7475 | Construct a wx.AcceleratorEntry. | |
d6c14a4c | 7476 | """ |
1bd55598 RD |
7477 | _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs)) |
7478 | __swig_destroy__ = _core_.delete_AcceleratorEntry | |
7479 | __del__ = lambda self : None; | |
d55e5bfc | 7480 | def Set(*args, **kwargs): |
d6c14a4c RD |
7481 | """ |
7482 | Set(self, int flags, int keyCode, int cmd) | |
d55e5bfc | 7483 | |
d6c14a4c RD |
7484 | (Re)set the attributes of a wx.AcceleratorEntry. |
7485 | :see `__init__` | |
7486 | """ | |
5b5c9bc7 | 7487 | return _core_.AcceleratorEntry_Set(*args, **kwargs) |
d55e5bfc RD |
7488 | |
7489 | def GetFlags(*args, **kwargs): | |
d6c14a4c RD |
7490 | """ |
7491 | GetFlags(self) -> int | |
7492 | ||
7493 | Get the AcceleratorEntry's flags. | |
7494 | """ | |
5b5c9bc7 | 7495 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
d55e5bfc RD |
7496 | |
7497 | def GetKeyCode(*args, **kwargs): | |
d6c14a4c RD |
7498 | """ |
7499 | GetKeyCode(self) -> int | |
7500 | ||
7501 | Get the AcceleratorEntry's keycode. | |
7502 | """ | |
5b5c9bc7 | 7503 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
d55e5bfc RD |
7504 | |
7505 | def GetCommand(*args, **kwargs): | |
d6c14a4c RD |
7506 | """ |
7507 | GetCommand(self) -> int | |
7508 | ||
7509 | Get the AcceleratorEntry's command ID. | |
7510 | """ | |
5b5c9bc7 | 7511 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
d55e5bfc | 7512 | |
2131d850 | 7513 | _core_.AcceleratorEntry_swigregister(AcceleratorEntry) |
d55e5bfc | 7514 | |
5b5c9bc7 | 7515 | class AcceleratorTable(Object): |
d6c14a4c RD |
7516 | """ |
7517 | An accelerator table allows the application to specify a table of | |
7518 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7519 | button commands are supported; on GTK, only menu commands are | |
7520 | supported. | |
d6c14a4c | 7521 | """ |
1bd55598 RD |
7522 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7523 | __repr__ = _swig_repr | |
7524 | def __init__(self, *args, **kwargs): | |
d55e5bfc RD |
7525 | """ |
7526 | __init__(entries) -> AcceleratorTable | |
7527 | ||
d6c14a4c RD |
7528 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7529 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7530 | ||
7531 | :see: `wx.AcceleratorEntry` | |
d55e5bfc | 7532 | """ |
1bd55598 RD |
7533 | _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs)) |
7534 | __swig_destroy__ = _core_.delete_AcceleratorTable | |
7535 | __del__ = lambda self : None; | |
d55e5bfc RD |
7536 | def Ok(*args, **kwargs): |
7537 | """Ok(self) -> bool""" | |
5b5c9bc7 | 7538 | return _core_.AcceleratorTable_Ok(*args, **kwargs) |
d55e5bfc | 7539 | |
2131d850 | 7540 | _core_.AcceleratorTable_swigregister(AcceleratorTable) |
d55e5bfc RD |
7541 | |
7542 | ||
5b5c9bc7 | 7543 | def GetAccelFromString(*args, **kwargs): |
1bd55598 RD |
7544 | """GetAccelFromString(String label) -> AcceleratorEntry""" |
7545 | return _core_.GetAccelFromString(*args, **kwargs) | |
d55e5bfc RD |
7546 | #--------------------------------------------------------------------------- |
7547 | ||
5b5c9bc7 | 7548 | class VisualAttributes(object): |
d55e5bfc | 7549 | """struct containing all the visual attributes of a control""" |
1bd55598 RD |
7550 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7551 | __repr__ = _swig_repr | |
7552 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 7553 | """ |
5b5c9bc7 | 7554 | __init__(self) -> VisualAttributes |
d55e5bfc RD |
7555 | |
7556 | struct containing all the visual attributes of a control | |
7557 | """ | |
1bd55598 RD |
7558 | _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs)) |
7559 | __swig_destroy__ = _core_.delete_VisualAttributes | |
7560 | __del__ = lambda self : None; | |
5b5c9bc7 RD |
7561 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) |
7562 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
7563 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
2131d850 | 7564 | _core_.VisualAttributes_swigregister(VisualAttributes) |
5b5c9bc7 | 7565 | NullAcceleratorTable = cvar.NullAcceleratorTable |
d55e5bfc RD |
7566 | PanelNameStr = cvar.PanelNameStr |
7567 | ||
5b5c9bc7 RD |
7568 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
7569 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
7570 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
7571 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
7572 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
7573 | class Window(EvtHandler): | |
d55e5bfc RD |
7574 | """ |
7575 | wx.Window is the base class for all windows and represents any visible | |
7576 | object on the screen. All controls, top level windows and so on are | |
7577 | wx.Windows. Sizers and device contexts are not however, as they don't | |
7578 | appear on screen themselves. | |
7579 | ||
7580 | """ | |
1bd55598 RD |
7581 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7582 | __repr__ = _swig_repr | |
7583 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 7584 | """ |
5b5c9bc7 RD |
7585 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
7586 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window | |
d55e5bfc RD |
7587 | |
7588 | Construct and show a generic Window. | |
7589 | """ | |
1bd55598 | 7590 | _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs)) |
d55e5bfc RD |
7591 | self._setOORInfo(self) |
7592 | ||
7593 | def Create(*args, **kwargs): | |
7594 | """ | |
5b5c9bc7 RD |
7595 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
7596 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool | |
d55e5bfc RD |
7597 | |
7598 | Create the GUI part of the Window for 2-phase creation mode. | |
7599 | """ | |
5b5c9bc7 | 7600 | return _core_.Window_Create(*args, **kwargs) |
d55e5bfc RD |
7601 | |
7602 | def Close(*args, **kwargs): | |
7603 | """ | |
7604 | Close(self, bool force=False) -> bool | |
7605 | ||
7606 | This function simply generates a EVT_CLOSE event whose handler usually | |
7607 | tries to close the window. It doesn't close the window itself, | |
7608 | however. If force is False (the default) then the window's close | |
7609 | handler will be allowed to veto the destruction of the window. | |
d55e5bfc | 7610 | """ |
5b5c9bc7 | 7611 | return _core_.Window_Close(*args, **kwargs) |
d55e5bfc RD |
7612 | |
7613 | def Destroy(*args, **kwargs): | |
7614 | """ | |
7615 | Destroy(self) -> bool | |
7616 | ||
7617 | Destroys the window safely. Frames and dialogs are not destroyed | |
7618 | immediately when this function is called -- they are added to a list | |
7619 | of windows to be deleted on idle time, when all the window's events | |
7620 | have been processed. This prevents problems with events being sent to | |
7621 | non-existent windows. | |
7622 | ||
7623 | Returns True if the window has either been successfully deleted, or it | |
7624 | has been added to the list of windows pending real deletion. | |
7625 | """ | |
7e08d4ef RD |
7626 | val = _core_.Window_Destroy(*args, **kwargs) |
7627 | args[0].thisown = 0 | |
7628 | return val | |
d55e5bfc RD |
7629 | |
7630 | def DestroyChildren(*args, **kwargs): | |
7631 | """ | |
7632 | DestroyChildren(self) -> bool | |
7633 | ||
15817c7e RD |
7634 | Destroys all children of a window. Called automatically by the |
7635 | destructor. | |
d55e5bfc | 7636 | """ |
5b5c9bc7 | 7637 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d55e5bfc RD |
7638 | |
7639 | def IsBeingDeleted(*args, **kwargs): | |
7640 | """ | |
7641 | IsBeingDeleted(self) -> bool | |
7642 | ||
7643 | Is the window in the process of being deleted? | |
7644 | """ | |
5b5c9bc7 | 7645 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d55e5bfc | 7646 | |
d55e5bfc RD |
7647 | def SetLabel(*args, **kwargs): |
7648 | """ | |
5b5c9bc7 | 7649 | SetLabel(self, String label) |
d55e5bfc RD |
7650 | |
7651 | Set the text which the window shows in its label if applicable. | |
7652 | """ | |
5b5c9bc7 | 7653 | return _core_.Window_SetLabel(*args, **kwargs) |
d55e5bfc RD |
7654 | |
7655 | def GetLabel(*args, **kwargs): | |
7656 | """ | |
5b5c9bc7 | 7657 | GetLabel(self) -> String |
d55e5bfc | 7658 | |
15817c7e RD |
7659 | Generic way of getting a label from any window, for identification |
7660 | purposes. The interpretation of this function differs from class to | |
7661 | class. For frames and dialogs, the value returned is the title. For | |
7662 | buttons or static text controls, it is the button text. This function | |
7663 | can be useful for meta-programs such as testing tools or special-needs | |
7664 | access programs)which need to identify windows by name. | |
d55e5bfc | 7665 | """ |
5b5c9bc7 | 7666 | return _core_.Window_GetLabel(*args, **kwargs) |
d55e5bfc RD |
7667 | |
7668 | def SetName(*args, **kwargs): | |
7669 | """ | |
5b5c9bc7 | 7670 | SetName(self, String name) |
d55e5bfc | 7671 | |
15817c7e RD |
7672 | Sets the window's name. The window name is used for ressource setting |
7673 | in X, it is not the same as the window title/label | |
d55e5bfc | 7674 | """ |
5b5c9bc7 | 7675 | return _core_.Window_SetName(*args, **kwargs) |
d55e5bfc RD |
7676 | |
7677 | def GetName(*args, **kwargs): | |
7678 | """ | |
5b5c9bc7 | 7679 | GetName(self) -> String |
d55e5bfc | 7680 | |
15817c7e RD |
7681 | Returns the windows name. This name is not guaranteed to be unique; |
7682 | it is up to the programmer to supply an appropriate name in the window | |
7683 | constructor or via wx.Window.SetName. | |
d55e5bfc | 7684 | """ |
5b5c9bc7 | 7685 | return _core_.Window_GetName(*args, **kwargs) |
d55e5bfc RD |
7686 | |
7687 | def SetWindowVariant(*args, **kwargs): | |
7688 | """ | |
7689 | SetWindowVariant(self, int variant) | |
7690 | ||
15817c7e RD |
7691 | Sets the variant of the window/font size to use for this window, if |
7692 | the platform supports variants, for example, wxMac. | |
d55e5bfc | 7693 | """ |
5b5c9bc7 | 7694 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
d55e5bfc RD |
7695 | |
7696 | def GetWindowVariant(*args, **kwargs): | |
7697 | """GetWindowVariant(self) -> int""" | |
5b5c9bc7 | 7698 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
d55e5bfc RD |
7699 | |
7700 | def SetId(*args, **kwargs): | |
7701 | """ | |
7702 | SetId(self, int winid) | |
7703 | ||
7704 | Sets the identifier of the window. Each window has an integer | |
7705 | identifier. If the application has not provided one, an identifier | |
7706 | will be generated. Normally, the identifier should be provided on | |
7707 | creation and should not be modified subsequently. | |
7708 | """ | |
5b5c9bc7 | 7709 | return _core_.Window_SetId(*args, **kwargs) |
d55e5bfc RD |
7710 | |
7711 | def GetId(*args, **kwargs): | |
7712 | """ | |
7713 | GetId(self) -> int | |
7714 | ||
7715 | Returns the identifier of the window. Each window has an integer | |
7716 | identifier. If the application has not provided one (or the default Id | |
7717 | -1 is used) then an unique identifier with a negative value will be | |
7718 | generated. | |
7719 | """ | |
5b5c9bc7 | 7720 | return _core_.Window_GetId(*args, **kwargs) |
d55e5bfc RD |
7721 | |
7722 | def NewControlId(*args, **kwargs): | |
7723 | """ | |
d6c14a4c | 7724 | NewControlId() -> int |
d55e5bfc RD |
7725 | |
7726 | Generate a control id for the controls which were not given one. | |
7727 | """ | |
5b5c9bc7 | 7728 | return _core_.Window_NewControlId(*args, **kwargs) |
d55e5bfc RD |
7729 | |
7730 | NewControlId = staticmethod(NewControlId) | |
7731 | def NextControlId(*args, **kwargs): | |
7732 | """ | |
d6c14a4c | 7733 | NextControlId(int winid) -> int |
d55e5bfc RD |
7734 | |
7735 | Get the id of the control following the one with the given | |
15817c7e | 7736 | autogenerated) id |
d55e5bfc | 7737 | """ |
5b5c9bc7 | 7738 | return _core_.Window_NextControlId(*args, **kwargs) |
d55e5bfc RD |
7739 | |
7740 | NextControlId = staticmethod(NextControlId) | |
7741 | def PrevControlId(*args, **kwargs): | |
7742 | """ | |
d6c14a4c | 7743 | PrevControlId(int winid) -> int |
d55e5bfc RD |
7744 | |
7745 | Get the id of the control preceding the one with the given | |
15817c7e | 7746 | autogenerated) id |
d55e5bfc | 7747 | """ |
5b5c9bc7 | 7748 | return _core_.Window_PrevControlId(*args, **kwargs) |
d55e5bfc RD |
7749 | |
7750 | PrevControlId = staticmethod(PrevControlId) | |
7751 | def SetSize(*args, **kwargs): | |
7752 | """ | |
5b5c9bc7 | 7753 | SetSize(self, Size size) |
d55e5bfc RD |
7754 | |
7755 | Sets the size of the window in pixels. | |
7756 | """ | |
5b5c9bc7 | 7757 | return _core_.Window_SetSize(*args, **kwargs) |
d55e5bfc RD |
7758 | |
7759 | def SetDimensions(*args, **kwargs): | |
7760 | """ | |
5b5c9bc7 | 7761 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
d55e5bfc RD |
7762 | |
7763 | Sets the position and size of the window in pixels. The sizeFlags | |
7764 | parameter indicates the interpretation of the other params if they are | |
62d32a5f RD |
7765 | equal to -1. |
7766 | ||
7767 | ======================== ====================================== | |
7768 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
7769 | default should be used. | |
7770 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
7771 | -1 values are supplied. | |
7772 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
7773 | interpreted as real dimensions, not | |
7774 | default values. | |
7775 | ======================== ====================================== | |
7776 | ||
d55e5bfc | 7777 | """ |
5b5c9bc7 | 7778 | return _core_.Window_SetDimensions(*args, **kwargs) |
d55e5bfc RD |
7779 | |
7780 | def SetRect(*args, **kwargs): | |
7781 | """ | |
5b5c9bc7 | 7782 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
d55e5bfc RD |
7783 | |
7784 | Sets the position and size of the window in pixels using a wx.Rect. | |
7785 | """ | |
5b5c9bc7 | 7786 | return _core_.Window_SetRect(*args, **kwargs) |
d55e5bfc RD |
7787 | |
7788 | def SetSizeWH(*args, **kwargs): | |
7789 | """ | |
7790 | SetSizeWH(self, int width, int height) | |
7791 | ||
7792 | Sets the size of the window in pixels. | |
7793 | """ | |
5b5c9bc7 | 7794 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d55e5bfc RD |
7795 | |
7796 | def Move(*args, **kwargs): | |
7797 | """ | |
5b5c9bc7 | 7798 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
d55e5bfc RD |
7799 | |
7800 | Moves the window to the given position. | |
7801 | """ | |
5b5c9bc7 | 7802 | return _core_.Window_Move(*args, **kwargs) |
d55e5bfc RD |
7803 | |
7804 | SetPosition = Move | |
7805 | def MoveXY(*args, **kwargs): | |
7806 | """ | |
5b5c9bc7 | 7807 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
d55e5bfc RD |
7808 | |
7809 | Moves the window to the given position. | |
7810 | """ | |
5b5c9bc7 | 7811 | return _core_.Window_MoveXY(*args, **kwargs) |
d55e5bfc | 7812 | |
f8167d6e RD |
7813 | def SetBestFittingSize(*args, **kwargs): |
7814 | """ | |
5b5c9bc7 | 7815 | SetBestFittingSize(self, Size size=DefaultSize) |
f8167d6e RD |
7816 | |
7817 | A 'Smart' SetSize that will fill in default size components with the | |
7818 | window's *best size* values. Also set's the minsize for use with sizers. | |
7819 | """ | |
5b5c9bc7 | 7820 | return _core_.Window_SetBestFittingSize(*args, **kwargs) |
f8167d6e | 7821 | |
d55e5bfc RD |
7822 | def Raise(*args, **kwargs): |
7823 | """ | |
7824 | Raise(self) | |
7825 | ||
943e8dfd RD |
7826 | Raises the window to the top of the window hierarchy. In current |
7827 | version of wxWidgets this works both for manage and child windows. | |
d55e5bfc | 7828 | """ |
5b5c9bc7 | 7829 | return _core_.Window_Raise(*args, **kwargs) |
d55e5bfc RD |
7830 | |
7831 | def Lower(*args, **kwargs): | |
7832 | """ | |
7833 | Lower(self) | |
7834 | ||
943e8dfd RD |
7835 | Lowers the window to the bottom of the window hierarchy. In current |
7836 | version of wxWidgets this works both for manage and child windows. | |
d55e5bfc | 7837 | """ |
5b5c9bc7 | 7838 | return _core_.Window_Lower(*args, **kwargs) |
d55e5bfc RD |
7839 | |
7840 | def SetClientSize(*args, **kwargs): | |
7841 | """ | |
5b5c9bc7 | 7842 | SetClientSize(self, Size size) |
d55e5bfc RD |
7843 | |
7844 | This sets the size of the window client area in pixels. Using this | |
7845 | function to size a window tends to be more device-independent than | |
7846 | wx.Window.SetSize, since the application need not worry about what | |
7847 | dimensions the border or title bar have when trying to fit the window | |
7848 | around panel items, for example. | |
7849 | """ | |
5b5c9bc7 | 7850 | return _core_.Window_SetClientSize(*args, **kwargs) |
d55e5bfc RD |
7851 | |
7852 | def SetClientSizeWH(*args, **kwargs): | |
7853 | """ | |
7854 | SetClientSizeWH(self, int width, int height) | |
7855 | ||
7856 | This sets the size of the window client area in pixels. Using this | |
7857 | function to size a window tends to be more device-independent than | |
7858 | wx.Window.SetSize, since the application need not worry about what | |
7859 | dimensions the border or title bar have when trying to fit the window | |
7860 | around panel items, for example. | |
7861 | """ | |
5b5c9bc7 | 7862 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
d55e5bfc RD |
7863 | |
7864 | def SetClientRect(*args, **kwargs): | |
7865 | """ | |
5b5c9bc7 | 7866 | SetClientRect(self, Rect rect) |
d55e5bfc RD |
7867 | |
7868 | This sets the size of the window client area in pixels. Using this | |
7869 | function to size a window tends to be more device-independent than | |
7870 | wx.Window.SetSize, since the application need not worry about what | |
7871 | dimensions the border or title bar have when trying to fit the window | |
7872 | around panel items, for example. | |
7873 | """ | |
5b5c9bc7 | 7874 | return _core_.Window_SetClientRect(*args, **kwargs) |
d55e5bfc RD |
7875 | |
7876 | def GetPosition(*args, **kwargs): | |
7877 | """ | |
5b5c9bc7 | 7878 | GetPosition(self) -> Point |
d55e5bfc | 7879 | |
1c71765a RD |
7880 | Get the window's position. Notice that the position is in client |
7881 | coordinates for child windows and screen coordinates for the top level | |
7882 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
7883 | kinds of windows. | |
d55e5bfc | 7884 | """ |
5b5c9bc7 | 7885 | return _core_.Window_GetPosition(*args, **kwargs) |
d55e5bfc RD |
7886 | |
7887 | def GetPositionTuple(*args, **kwargs): | |
7888 | """ | |
7889 | GetPositionTuple() -> (x,y) | |
7890 | ||
1c71765a RD |
7891 | Get the window's position. Notice that the position is in client |
7892 | coordinates for child windows and screen coordinates for the top level | |
7893 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
7894 | kinds of windows. | |
d55e5bfc | 7895 | """ |
5b5c9bc7 | 7896 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
d55e5bfc | 7897 | |
1c71765a RD |
7898 | def GetScreenPosition(*args, **kwargs): |
7899 | """ | |
7900 | GetScreenPosition(self) -> Point | |
7901 | ||
7902 | Get the position of the window in screen coordinantes. | |
7903 | """ | |
7904 | return _core_.Window_GetScreenPosition(*args, **kwargs) | |
7905 | ||
7906 | def GetScreenPositionTuple(*args, **kwargs): | |
7907 | """ | |
7908 | GetScreenPositionTuple() -> (x,y) | |
7909 | ||
7910 | Get the position of the window in screen coordinantes. | |
7911 | """ | |
7912 | return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | |
7913 | ||
7914 | def GetScreenRect(*args, **kwargs): | |
7915 | """ | |
7916 | GetScreenRect(self) -> Rect | |
7917 | ||
7918 | Returns the size and position of the window in screen coordinantes as | |
7919 | a `wx.Rect` object. | |
7920 | """ | |
7921 | return _core_.Window_GetScreenRect(*args, **kwargs) | |
7922 | ||
d55e5bfc RD |
7923 | def GetSize(*args, **kwargs): |
7924 | """ | |
5b5c9bc7 | 7925 | GetSize(self) -> Size |
d55e5bfc RD |
7926 | |
7927 | Get the window size. | |
7928 | """ | |
5b5c9bc7 | 7929 | return _core_.Window_GetSize(*args, **kwargs) |
d55e5bfc RD |
7930 | |
7931 | def GetSizeTuple(*args, **kwargs): | |
7932 | """ | |
7933 | GetSizeTuple() -> (width, height) | |
7934 | ||
7935 | Get the window size. | |
7936 | """ | |
5b5c9bc7 | 7937 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
d55e5bfc RD |
7938 | |
7939 | def GetRect(*args, **kwargs): | |
7940 | """ | |
5b5c9bc7 | 7941 | GetRect(self) -> Rect |
d55e5bfc | 7942 | |
1c71765a | 7943 | Returns the size and position of the window as a `wx.Rect` object. |
d55e5bfc | 7944 | """ |
5b5c9bc7 | 7945 | return _core_.Window_GetRect(*args, **kwargs) |
d55e5bfc RD |
7946 | |
7947 | def GetClientSize(*args, **kwargs): | |
7948 | """ | |
5b5c9bc7 | 7949 | GetClientSize(self) -> Size |
d55e5bfc RD |
7950 | |
7951 | This gets the size of the window's 'client area' in pixels. The client | |
7952 | area is the area which may be drawn on by the programmer, excluding | |
7953 | title bar, border, scrollbars, etc. | |
7954 | """ | |
5b5c9bc7 | 7955 | return _core_.Window_GetClientSize(*args, **kwargs) |
d55e5bfc RD |
7956 | |
7957 | def GetClientSizeTuple(*args, **kwargs): | |
7958 | """ | |
7959 | GetClientSizeTuple() -> (width, height) | |
7960 | ||
7961 | This gets the size of the window's 'client area' in pixels. The client | |
7962 | area is the area which may be drawn on by the programmer, excluding | |
7963 | title bar, border, scrollbars, etc. | |
7964 | """ | |
5b5c9bc7 | 7965 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
d55e5bfc RD |
7966 | |
7967 | def GetClientAreaOrigin(*args, **kwargs): | |
7968 | """ | |
5b5c9bc7 | 7969 | GetClientAreaOrigin(self) -> Point |
d55e5bfc RD |
7970 | |
7971 | Get the origin of the client area of the window relative to the | |
7972 | window's top left corner (the client area may be shifted because of | |
7973 | the borders, scrollbars, other decorations...) | |
7974 | """ | |
5b5c9bc7 | 7975 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
d55e5bfc RD |
7976 | |
7977 | def GetClientRect(*args, **kwargs): | |
7978 | """ | |
5b5c9bc7 | 7979 | GetClientRect(self) -> Rect |
d55e5bfc | 7980 | |
0439c23b | 7981 | Get the client area position and size as a `wx.Rect` object. |
d55e5bfc | 7982 | """ |
5b5c9bc7 | 7983 | return _core_.Window_GetClientRect(*args, **kwargs) |
d55e5bfc RD |
7984 | |
7985 | def GetBestSize(*args, **kwargs): | |
7986 | """ | |
5b5c9bc7 | 7987 | GetBestSize(self) -> Size |
d55e5bfc | 7988 | |
bfddbb17 | 7989 | This function returns the best acceptable minimal size for the |
15817c7e RD |
7990 | window, if applicable. For example, for a static text control, it will |
7991 | be the minimal size such that the control label is not truncated. For | |
7992 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
7993 | this function will be the same as the size the window would have had | |
7994 | after calling Fit. | |
d55e5bfc | 7995 | """ |
5b5c9bc7 | 7996 | return _core_.Window_GetBestSize(*args, **kwargs) |
d55e5bfc RD |
7997 | |
7998 | def GetBestSizeTuple(*args, **kwargs): | |
7999 | """ | |
8000 | GetBestSizeTuple() -> (width, height) | |
8001 | ||
bfddbb17 | 8002 | This function returns the best acceptable minimal size for the |
15817c7e RD |
8003 | window, if applicable. For example, for a static text control, it will |
8004 | be the minimal size such that the control label is not truncated. For | |
8005 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8006 | this function will be the same as the size the window would have had | |
8007 | after calling Fit. | |
d55e5bfc | 8008 | """ |
5b5c9bc7 | 8009 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
d55e5bfc | 8010 | |
a001823c RD |
8011 | def InvalidateBestSize(*args, **kwargs): |
8012 | """ | |
8013 | InvalidateBestSize(self) | |
8014 | ||
8015 | Reset the cached best size value so it will be recalculated the next | |
8016 | time it is needed. | |
8017 | """ | |
5b5c9bc7 | 8018 | return _core_.Window_InvalidateBestSize(*args, **kwargs) |
a001823c | 8019 | |
e2813725 RD |
8020 | def CacheBestSize(*args, **kwargs): |
8021 | """ | |
8022 | CacheBestSize(self, Size size) | |
8023 | ||
8024 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8025 | some properties of the window change.) | |
8026 | """ | |
8027 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8028 | ||
a001823c RD |
8029 | def GetBestFittingSize(*args, **kwargs): |
8030 | """ | |
5b5c9bc7 | 8031 | GetBestFittingSize(self) -> Size |
a001823c RD |
8032 | |
8033 | This function will merge the window's best size into the window's | |
8034 | minimum size, giving priority to the min size components, and returns | |
8035 | the results. | |
8036 | ||
8037 | """ | |
5b5c9bc7 | 8038 | return _core_.Window_GetBestFittingSize(*args, **kwargs) |
a001823c | 8039 | |
d55e5bfc RD |
8040 | def GetAdjustedBestSize(*args, **kwargs): |
8041 | """ | |
5b5c9bc7 | 8042 | GetAdjustedBestSize(self) -> Size |
d55e5bfc RD |
8043 | |
8044 | This method is similar to GetBestSize, except in one | |
8045 | thing. GetBestSize should return the minimum untruncated size of the | |
8046 | window, while this method will return the largest of BestSize and any | |
8047 | user specified minimum size. ie. it is the minimum size the window | |
8048 | should currently be drawn at, not the minimal size it can possibly | |
8049 | tolerate. | |
8050 | """ | |
5b5c9bc7 | 8051 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) |
d55e5bfc RD |
8052 | |
8053 | def Center(*args, **kwargs): | |
8054 | """ | |
5b5c9bc7 | 8055 | Center(self, int direction=BOTH) |
d55e5bfc RD |
8056 | |
8057 | Centers the window. The parameter specifies the direction for | |
8058 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8059 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8060 | on the entire screen and not on its parent window. If it is a | |
8061 | top-level window and has no parent then it will always be centered | |
8062 | relative to the screen. | |
8063 | """ | |
5b5c9bc7 | 8064 | return _core_.Window_Center(*args, **kwargs) |
d55e5bfc RD |
8065 | |
8066 | Centre = Center | |
d55e5bfc RD |
8067 | def CenterOnParent(*args, **kwargs): |
8068 | """ | |
5b5c9bc7 | 8069 | CenterOnParent(self, int dir=BOTH) |
d55e5bfc RD |
8070 | |
8071 | Center with respect to the the parent window | |
8072 | """ | |
5b5c9bc7 | 8073 | return _core_.Window_CenterOnParent(*args, **kwargs) |
d55e5bfc RD |
8074 | |
8075 | CentreOnParent = CenterOnParent | |
8076 | def Fit(*args, **kwargs): | |
8077 | """ | |
8078 | Fit(self) | |
8079 | ||
8080 | Sizes the window so that it fits around its subwindows. This function | |
8081 | won't do anything if there are no subwindows and will only really work | |
8082 | correctly if sizers are used for the subwindows layout. Also, if the | |
8083 | window has exactly one subwindow it is better (faster and the result | |
8084 | is more precise as Fit adds some margin to account for fuzziness of | |
8085 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8086 | instead of calling Fit. | |
8087 | """ | |
5b5c9bc7 | 8088 | return _core_.Window_Fit(*args, **kwargs) |
d55e5bfc RD |
8089 | |
8090 | def FitInside(*args, **kwargs): | |
8091 | """ | |
8092 | FitInside(self) | |
8093 | ||
8094 | Similar to Fit, but sizes the interior (virtual) size of a | |
8095 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8096 | sizing changes that do not trigger a size event, and/or scrolled | |
8097 | windows without an interior sizer. This function similarly won't do | |
8098 | anything if there are no subwindows. | |
8099 | """ | |
5b5c9bc7 | 8100 | return _core_.Window_FitInside(*args, **kwargs) |
d55e5bfc | 8101 | |
03837c5c | 8102 | def SetSizeHints(*args, **kwargs): |
d55e5bfc RD |
8103 | """ |
8104 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, | |
8105 | int incH=-1) | |
d55e5bfc RD |
8106 | |
8107 | Allows specification of minimum and maximum window sizes, and window | |
8108 | size increments. If a pair of values is not set (or set to -1), the | |
8109 | default values will be used. If this function is called, the user | |
908b74cd RD |
8110 | will not be able to size the window outside the given bounds (if it is |
8111 | a top-level window.) Sizers will also inspect the minimum window size | |
8112 | and will use that value if set when calculating layout. | |
8113 | ||
8114 | The resizing increments are only significant under Motif or Xt. | |
d55e5bfc | 8115 | """ |
5b5c9bc7 | 8116 | return _core_.Window_SetSizeHints(*args, **kwargs) |
d55e5bfc | 8117 | |
03837c5c RD |
8118 | def SetSizeHintsSz(*args, **kwargs): |
8119 | """ | |
5b5c9bc7 | 8120 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) |
03837c5c RD |
8121 | |
8122 | Allows specification of minimum and maximum window sizes, and window | |
8123 | size increments. If a pair of values is not set (or set to -1), the | |
8124 | default values will be used. If this function is called, the user | |
8125 | will not be able to size the window outside the given bounds (if it is | |
8126 | a top-level window.) Sizers will also inspect the minimum window size | |
8127 | and will use that value if set when calculating layout. | |
8128 | ||
8129 | The resizing increments are only significant under Motif or Xt. | |
8130 | """ | |
5b5c9bc7 | 8131 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) |
03837c5c RD |
8132 | |
8133 | def SetVirtualSizeHints(*args, **kwargs): | |
d55e5bfc | 8134 | """ |
908b74cd | 8135 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
d55e5bfc RD |
8136 | |
8137 | Allows specification of minimum and maximum virtual window sizes. If a | |
8138 | pair of values is not set (or set to -1), the default values will be | |
8139 | used. If this function is called, the user will not be able to size | |
8140 | the virtual area of the window outside the given bounds. | |
8141 | """ | |
5b5c9bc7 | 8142 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
03837c5c RD |
8143 | |
8144 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8145 | """ | |
5b5c9bc7 | 8146 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) |
03837c5c RD |
8147 | |
8148 | Allows specification of minimum and maximum virtual window sizes. If a | |
8149 | pair of values is not set (or set to -1), the default values will be | |
8150 | used. If this function is called, the user will not be able to size | |
8151 | the virtual area of the window outside the given bounds. | |
8152 | """ | |
5b5c9bc7 | 8153 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) |
d55e5bfc | 8154 | |
908b74cd | 8155 | def GetMaxSize(*args, **kwargs): |
5b5c9bc7 RD |
8156 | """GetMaxSize(self) -> Size""" |
8157 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
908b74cd RD |
8158 | |
8159 | def GetMinSize(*args, **kwargs): | |
5b5c9bc7 RD |
8160 | """GetMinSize(self) -> Size""" |
8161 | return _core_.Window_GetMinSize(*args, **kwargs) | |
908b74cd RD |
8162 | |
8163 | def SetMinSize(*args, **kwargs): | |
8164 | """ | |
5b5c9bc7 | 8165 | SetMinSize(self, Size minSize) |
908b74cd RD |
8166 | |
8167 | A more convenient method than `SetSizeHints` for setting just the | |
8168 | min size. | |
8169 | """ | |
5b5c9bc7 | 8170 | return _core_.Window_SetMinSize(*args, **kwargs) |
908b74cd RD |
8171 | |
8172 | def SetMaxSize(*args, **kwargs): | |
8173 | """ | |
5b5c9bc7 | 8174 | SetMaxSize(self, Size maxSize) |
908b74cd RD |
8175 | |
8176 | A more convenient method than `SetSizeHints` for setting just the | |
8177 | max size. | |
8178 | """ | |
5b5c9bc7 | 8179 | return _core_.Window_SetMaxSize(*args, **kwargs) |
908b74cd | 8180 | |
d55e5bfc RD |
8181 | def GetMinWidth(*args, **kwargs): |
8182 | """GetMinWidth(self) -> int""" | |
5b5c9bc7 | 8183 | return _core_.Window_GetMinWidth(*args, **kwargs) |
d55e5bfc RD |
8184 | |
8185 | def GetMinHeight(*args, **kwargs): | |
8186 | """GetMinHeight(self) -> int""" | |
5b5c9bc7 | 8187 | return _core_.Window_GetMinHeight(*args, **kwargs) |
d55e5bfc RD |
8188 | |
8189 | def GetMaxWidth(*args, **kwargs): | |
8190 | """GetMaxWidth(self) -> int""" | |
5b5c9bc7 | 8191 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
d55e5bfc RD |
8192 | |
8193 | def GetMaxHeight(*args, **kwargs): | |
8194 | """GetMaxHeight(self) -> int""" | |
5b5c9bc7 | 8195 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
d55e5bfc | 8196 | |
d55e5bfc RD |
8197 | def SetVirtualSize(*args, **kwargs): |
8198 | """ | |
5b5c9bc7 | 8199 | SetVirtualSize(self, Size size) |
d55e5bfc RD |
8200 | |
8201 | Set the the virtual size of a window in pixels. For most windows this | |
8202 | is just the client area of the window, but for some like scrolled | |
8203 | windows it is more or less independent of the screen window size. | |
8204 | """ | |
5b5c9bc7 | 8205 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8206 | |
8207 | def SetVirtualSizeWH(*args, **kwargs): | |
8208 | """ | |
8209 | SetVirtualSizeWH(self, int w, int h) | |
8210 | ||
8211 | Set the the virtual size of a window in pixels. For most windows this | |
8212 | is just the client area of the window, but for some like scrolled | |
8213 | windows it is more or less independent of the screen window size. | |
8214 | """ | |
5b5c9bc7 | 8215 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
d55e5bfc RD |
8216 | |
8217 | def GetVirtualSize(*args, **kwargs): | |
8218 | """ | |
5b5c9bc7 | 8219 | GetVirtualSize(self) -> Size |
d55e5bfc RD |
8220 | |
8221 | Get the the virtual size of the window in pixels. For most windows | |
8222 | this is just the client area of the window, but for some like scrolled | |
8223 | windows it is more or less independent of the screen window size. | |
8224 | """ | |
5b5c9bc7 | 8225 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8226 | |
8227 | def GetVirtualSizeTuple(*args, **kwargs): | |
8228 | """ | |
8229 | GetVirtualSizeTuple() -> (width, height) | |
8230 | ||
8231 | Get the the virtual size of the window in pixels. For most windows | |
8232 | this is just the client area of the window, but for some like scrolled | |
8233 | windows it is more or less independent of the screen window size. | |
8234 | """ | |
5b5c9bc7 | 8235 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
d55e5bfc RD |
8236 | |
8237 | def GetBestVirtualSize(*args, **kwargs): | |
8238 | """ | |
5b5c9bc7 | 8239 | GetBestVirtualSize(self) -> Size |
d55e5bfc RD |
8240 | |
8241 | Return the largest of ClientSize and BestSize (as determined by a | |
8242 | sizer, interior children, or other means) | |
8243 | """ | |
5b5c9bc7 | 8244 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8245 | |
8246 | def Show(*args, **kwargs): | |
8247 | """ | |
8248 | Show(self, bool show=True) -> bool | |
8249 | ||
8250 | Shows or hides the window. You may need to call Raise for a top level | |
8251 | window if you want to bring it to top, although this is not needed if | |
8252 | Show is called immediately after the frame creation. Returns True if | |
8253 | the window has been shown or hidden or False if nothing was done | |
8254 | because it already was in the requested state. | |
8255 | """ | |
5b5c9bc7 | 8256 | return _core_.Window_Show(*args, **kwargs) |
d55e5bfc RD |
8257 | |
8258 | def Hide(*args, **kwargs): | |
8259 | """ | |
8260 | Hide(self) -> bool | |
8261 | ||
8262 | Equivalent to calling Show(False). | |
8263 | """ | |
5b5c9bc7 | 8264 | return _core_.Window_Hide(*args, **kwargs) |
d55e5bfc RD |
8265 | |
8266 | def Enable(*args, **kwargs): | |
8267 | """ | |
8268 | Enable(self, bool enable=True) -> bool | |
8269 | ||
8270 | Enable or disable the window for user input. Note that when a parent | |
8271 | window is disabled, all of its children are disabled as well and they | |
8272 | are reenabled again when the parent is. Returns true if the window | |
8273 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8274 | window had already been in the specified state. | |
8275 | """ | |
5b5c9bc7 | 8276 | return _core_.Window_Enable(*args, **kwargs) |
d55e5bfc RD |
8277 | |
8278 | def Disable(*args, **kwargs): | |
8279 | """ | |
8280 | Disable(self) -> bool | |
8281 | ||
8282 | Disables the window, same as Enable(false). | |
8283 | """ | |
5b5c9bc7 | 8284 | return _core_.Window_Disable(*args, **kwargs) |
d55e5bfc RD |
8285 | |
8286 | def IsShown(*args, **kwargs): | |
8287 | """ | |
8288 | IsShown(self) -> bool | |
8289 | ||
8290 | Returns true if the window is shown, false if it has been hidden. | |
8291 | """ | |
5b5c9bc7 | 8292 | return _core_.Window_IsShown(*args, **kwargs) |
d55e5bfc RD |
8293 | |
8294 | def IsEnabled(*args, **kwargs): | |
8295 | """ | |
8296 | IsEnabled(self) -> bool | |
8297 | ||
8298 | Returns true if the window is enabled for input, false otherwise. | |
8299 | """ | |
5b5c9bc7 | 8300 | return _core_.Window_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
8301 | |
8302 | def SetWindowStyleFlag(*args, **kwargs): | |
8303 | """ | |
8304 | SetWindowStyleFlag(self, long style) | |
8305 | ||
15817c7e RD |
8306 | Sets the style of the window. Please note that some styles cannot be |
8307 | changed after the window creation and that Refresh() might need to be | |
8308 | called after changing the others for the change to take place | |
8309 | immediately. | |
d55e5bfc | 8310 | """ |
5b5c9bc7 | 8311 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
d55e5bfc RD |
8312 | |
8313 | def GetWindowStyleFlag(*args, **kwargs): | |
8314 | """ | |
8315 | GetWindowStyleFlag(self) -> long | |
8316 | ||
8317 | Gets the window style that was passed to the constructor or Create | |
8318 | method. | |
8319 | """ | |
5b5c9bc7 | 8320 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
d55e5bfc RD |
8321 | |
8322 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag | |
8323 | def HasFlag(*args, **kwargs): | |
8324 | """ | |
8325 | HasFlag(self, int flag) -> bool | |
8326 | ||
8327 | Test if the given style is set for this window. | |
8328 | """ | |
5b5c9bc7 | 8329 | return _core_.Window_HasFlag(*args, **kwargs) |
d55e5bfc RD |
8330 | |
8331 | def IsRetained(*args, **kwargs): | |
8332 | """ | |
8333 | IsRetained(self) -> bool | |
8334 | ||
8335 | Returns true if the window is retained, false otherwise. Retained | |
8336 | windows are only available on X platforms. | |
8337 | """ | |
5b5c9bc7 | 8338 | return _core_.Window_IsRetained(*args, **kwargs) |
d55e5bfc RD |
8339 | |
8340 | def SetExtraStyle(*args, **kwargs): | |
8341 | """ | |
8342 | SetExtraStyle(self, long exStyle) | |
8343 | ||
8344 | Sets the extra style bits for the window. Extra styles are the less | |
8345 | often used style bits which can't be set with the constructor or with | |
8346 | SetWindowStyleFlag() | |
8347 | """ | |
5b5c9bc7 | 8348 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
d55e5bfc RD |
8349 | |
8350 | def GetExtraStyle(*args, **kwargs): | |
8351 | """ | |
8352 | GetExtraStyle(self) -> long | |
8353 | ||
8354 | Returns the extra style bits for the window. | |
8355 | """ | |
5b5c9bc7 | 8356 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
d55e5bfc RD |
8357 | |
8358 | def MakeModal(*args, **kwargs): | |
8359 | """ | |
8360 | MakeModal(self, bool modal=True) | |
8361 | ||
8362 | Disables all other windows in the application so that the user can | |
8363 | only interact with this window. Passing False will reverse this | |
8364 | effect. | |
8365 | """ | |
5b5c9bc7 | 8366 | return _core_.Window_MakeModal(*args, **kwargs) |
d55e5bfc RD |
8367 | |
8368 | def SetThemeEnabled(*args, **kwargs): | |
8369 | """ | |
8370 | SetThemeEnabled(self, bool enableTheme) | |
8371 | ||
8372 | This function tells a window if it should use the system's "theme" | |
8373 | code to draw the windows' background instead if its own background | |
8374 | drawing code. This will only have an effect on platforms that support | |
8375 | the notion of themes in user defined windows. One such platform is | |
8376 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8377 | user's selected theme. | |
8378 | ||
8379 | Dialogs, notebook pages and the status bar have this flag set to true | |
8380 | by default so that the default look and feel is simulated best. | |
8381 | """ | |
5b5c9bc7 | 8382 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
d55e5bfc RD |
8383 | |
8384 | def GetThemeEnabled(*args, **kwargs): | |
8385 | """ | |
8386 | GetThemeEnabled(self) -> bool | |
8387 | ||
8388 | Return the themeEnabled flag. | |
8389 | """ | |
5b5c9bc7 | 8390 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
d55e5bfc RD |
8391 | |
8392 | def SetFocus(*args, **kwargs): | |
8393 | """ | |
8394 | SetFocus(self) | |
8395 | ||
8396 | Set's the focus to this window, allowing it to receive keyboard input. | |
8397 | """ | |
5b5c9bc7 | 8398 | return _core_.Window_SetFocus(*args, **kwargs) |
d55e5bfc RD |
8399 | |
8400 | def SetFocusFromKbd(*args, **kwargs): | |
8401 | """ | |
8402 | SetFocusFromKbd(self) | |
8403 | ||
8404 | Set focus to this window as the result of a keyboard action. Normally | |
8405 | only called internally. | |
8406 | """ | |
5b5c9bc7 | 8407 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
d55e5bfc RD |
8408 | |
8409 | def FindFocus(*args, **kwargs): | |
8410 | """ | |
5b5c9bc7 | 8411 | FindFocus() -> Window |
d55e5bfc RD |
8412 | |
8413 | Returns the window or control that currently has the keyboard focus, | |
8414 | or None. | |
8415 | """ | |
5b5c9bc7 | 8416 | return _core_.Window_FindFocus(*args, **kwargs) |
d55e5bfc RD |
8417 | |
8418 | FindFocus = staticmethod(FindFocus) | |
8419 | def AcceptsFocus(*args, **kwargs): | |
8420 | """ | |
8421 | AcceptsFocus(self) -> bool | |
8422 | ||
8423 | Can this window have focus? | |
8424 | """ | |
5b5c9bc7 | 8425 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
d55e5bfc RD |
8426 | |
8427 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
8428 | """ | |
8429 | AcceptsFocusFromKeyboard(self) -> bool | |
8430 | ||
8431 | Can this window be given focus by keyboard navigation? if not, the | |
8432 | only way to give it focus (provided it accepts it at all) is to click | |
8433 | it. | |
8434 | """ | |
5b5c9bc7 | 8435 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
d55e5bfc | 8436 | |
908b74cd RD |
8437 | def Navigate(*args, **kwargs): |
8438 | """ | |
8439 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8440 | ||
fd2dc343 RD |
8441 | Does keyboard navigation from this window to another, by sending a |
8442 | `wx.NavigationKeyEvent`. | |
908b74cd | 8443 | """ |
5b5c9bc7 | 8444 | return _core_.Window_Navigate(*args, **kwargs) |
908b74cd | 8445 | |
bf26d883 RD |
8446 | def MoveAfterInTabOrder(*args, **kwargs): |
8447 | """ | |
5b5c9bc7 | 8448 | MoveAfterInTabOrder(self, Window win) |
bf26d883 RD |
8449 | |
8450 | Moves this window in the tab navigation order after the specified | |
8451 | sibling window. This means that when the user presses the TAB key on | |
8452 | that other window, the focus switches to this window. | |
8453 | ||
8454 | The default tab order is the same as creation order. This function | |
8455 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8456 | windows. | |
8457 | ||
8458 | """ | |
5b5c9bc7 | 8459 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) |
bf26d883 RD |
8460 | |
8461 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8462 | """ | |
5b5c9bc7 | 8463 | MoveBeforeInTabOrder(self, Window win) |
bf26d883 RD |
8464 | |
8465 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8466 | before win instead of putting it right after it. | |
8467 | """ | |
5b5c9bc7 | 8468 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) |
bf26d883 | 8469 | |
d55e5bfc RD |
8470 | def GetChildren(*args, **kwargs): |
8471 | """ | |
8472 | GetChildren(self) -> PyObject | |
8473 | ||
8474 | Returns a list of the window's children. NOTE: Currently this is a | |
8475 | copy of the child window list maintained by the window, so the return | |
8476 | value of this function is only valid as long as the window's children | |
8477 | do not change. | |
8478 | """ | |
5b5c9bc7 | 8479 | return _core_.Window_GetChildren(*args, **kwargs) |
d55e5bfc RD |
8480 | |
8481 | def GetParent(*args, **kwargs): | |
8482 | """ | |
5b5c9bc7 | 8483 | GetParent(self) -> Window |
d55e5bfc RD |
8484 | |
8485 | Returns the parent window of this window, or None if there isn't one. | |
8486 | """ | |
5b5c9bc7 | 8487 | return _core_.Window_GetParent(*args, **kwargs) |
d55e5bfc RD |
8488 | |
8489 | def GetGrandParent(*args, **kwargs): | |
8490 | """ | |
5b5c9bc7 | 8491 | GetGrandParent(self) -> Window |
d55e5bfc | 8492 | |
15817c7e RD |
8493 | Returns the parent of the parent of this window, or None if there |
8494 | isn't one. | |
d55e5bfc | 8495 | """ |
5b5c9bc7 | 8496 | return _core_.Window_GetGrandParent(*args, **kwargs) |
d55e5bfc RD |
8497 | |
8498 | def IsTopLevel(*args, **kwargs): | |
8499 | """ | |
8500 | IsTopLevel(self) -> bool | |
8501 | ||
8502 | Returns true if the given window is a top-level one. Currently all | |
8503 | frames and dialogs are always considered to be top-level windows (even | |
8504 | if they have a parent window). | |
8505 | """ | |
5b5c9bc7 | 8506 | return _core_.Window_IsTopLevel(*args, **kwargs) |
d55e5bfc RD |
8507 | |
8508 | def Reparent(*args, **kwargs): | |
8509 | """ | |
5b5c9bc7 | 8510 | Reparent(self, Window newParent) -> bool |
d55e5bfc RD |
8511 | |
8512 | Reparents the window, i.e the window will be removed from its current | |
8513 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
8514 | re-inserted into another. Available on Windows and GTK. Returns True | |
8515 | if the parent was changed, False otherwise (error or newParent == | |
8516 | oldParent) | |
8517 | """ | |
5b5c9bc7 | 8518 | return _core_.Window_Reparent(*args, **kwargs) |
d55e5bfc RD |
8519 | |
8520 | def AddChild(*args, **kwargs): | |
8521 | """ | |
5b5c9bc7 | 8522 | AddChild(self, Window child) |
d55e5bfc RD |
8523 | |
8524 | Adds a child window. This is called automatically by window creation | |
8525 | functions so should not be required by the application programmer. | |
8526 | """ | |
5b5c9bc7 | 8527 | return _core_.Window_AddChild(*args, **kwargs) |
d55e5bfc RD |
8528 | |
8529 | def RemoveChild(*args, **kwargs): | |
8530 | """ | |
5b5c9bc7 | 8531 | RemoveChild(self, Window child) |
d55e5bfc RD |
8532 | |
8533 | Removes a child window. This is called automatically by window | |
8534 | deletion functions so should not be required by the application | |
8535 | programmer. | |
8536 | """ | |
5b5c9bc7 | 8537 | return _core_.Window_RemoveChild(*args, **kwargs) |
d55e5bfc | 8538 | |
704eda0c RD |
8539 | def SetDoubleBuffered(*args, **kwargs): |
8540 | """ | |
8541 | SetDoubleBuffered(self, bool on) | |
8542 | ||
8543 | Currently wxGTK2 only. | |
8544 | """ | |
8545 | return _core_.Window_SetDoubleBuffered(*args, **kwargs) | |
8546 | ||
d55e5bfc RD |
8547 | def FindWindowById(*args, **kwargs): |
8548 | """ | |
5b5c9bc7 | 8549 | FindWindowById(self, long winid) -> Window |
d55e5bfc RD |
8550 | |
8551 | Find a chld of this window by window ID | |
8552 | """ | |
5b5c9bc7 | 8553 | return _core_.Window_FindWindowById(*args, **kwargs) |
d55e5bfc RD |
8554 | |
8555 | def FindWindowByName(*args, **kwargs): | |
8556 | """ | |
5b5c9bc7 | 8557 | FindWindowByName(self, String name) -> Window |
d55e5bfc RD |
8558 | |
8559 | Find a child of this window by name | |
8560 | """ | |
5b5c9bc7 | 8561 | return _core_.Window_FindWindowByName(*args, **kwargs) |
d55e5bfc RD |
8562 | |
8563 | def GetEventHandler(*args, **kwargs): | |
8564 | """ | |
5b5c9bc7 | 8565 | GetEventHandler(self) -> EvtHandler |
d55e5bfc RD |
8566 | |
8567 | Returns the event handler for this window. By default, the window is | |
8568 | its own event handler. | |
8569 | """ | |
5b5c9bc7 | 8570 | return _core_.Window_GetEventHandler(*args, **kwargs) |
d55e5bfc RD |
8571 | |
8572 | def SetEventHandler(*args, **kwargs): | |
8573 | """ | |
5b5c9bc7 | 8574 | SetEventHandler(self, EvtHandler handler) |
d55e5bfc RD |
8575 | |
8576 | Sets the event handler for this window. An event handler is an object | |
8577 | that is capable of processing the events sent to a window. By default, | |
8578 | the window is its own event handler, but an application may wish to | |
8579 | substitute another, for example to allow central implementation of | |
8580 | event-handling for a variety of different window classes. | |
8581 | ||
15817c7e | 8582 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
d55e5bfc RD |
8583 | up a chain of event handlers, where an event not handled by one event |
8584 | handler is handed to the next one in the chain. | |
8585 | """ | |
5b5c9bc7 | 8586 | return _core_.Window_SetEventHandler(*args, **kwargs) |
d55e5bfc RD |
8587 | |
8588 | def PushEventHandler(*args, **kwargs): | |
8589 | """ | |
5b5c9bc7 | 8590 | PushEventHandler(self, EvtHandler handler) |
d55e5bfc RD |
8591 | |
8592 | Pushes this event handler onto the event handler stack for the window. | |
8593 | An event handler is an object that is capable of processing the events | |
8594 | sent to a window. By default, the window is its own event handler, but | |
8595 | an application may wish to substitute another, for example to allow | |
8596 | central implementation of event-handling for a variety of different | |
8597 | window classes. | |
8598 | ||
8599 | wx.Window.PushEventHandler allows an application to set up a chain of | |
8600 | event handlers, where an event not handled by one event handler is | |
15817c7e | 8601 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` to |
d55e5bfc RD |
8602 | remove the event handler. |
8603 | """ | |
5b5c9bc7 | 8604 | return _core_.Window_PushEventHandler(*args, **kwargs) |
d55e5bfc RD |
8605 | |
8606 | def PopEventHandler(*args, **kwargs): | |
8607 | """ | |
5b5c9bc7 | 8608 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
d55e5bfc RD |
8609 | |
8610 | Removes and returns the top-most event handler on the event handler | |
8611 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
8612 | destroyed after it is popped. | |
8613 | """ | |
5b5c9bc7 | 8614 | return _core_.Window_PopEventHandler(*args, **kwargs) |
d55e5bfc RD |
8615 | |
8616 | def RemoveEventHandler(*args, **kwargs): | |
8617 | """ | |
5b5c9bc7 | 8618 | RemoveEventHandler(self, EvtHandler handler) -> bool |
d55e5bfc | 8619 | |
15817c7e RD |
8620 | Find the given handler in the event handler chain and remove (but not |
8621 | delete) it from the event handler chain, return True if it was found | |
8622 | and False otherwise (this also results in an assert failure so this | |
8623 | function should only be called when the handler is supposed to be | |
8624 | there.) | |
d55e5bfc | 8625 | """ |
5b5c9bc7 | 8626 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
d55e5bfc RD |
8627 | |
8628 | def SetValidator(*args, **kwargs): | |
8629 | """ | |
5b5c9bc7 | 8630 | SetValidator(self, Validator validator) |
d55e5bfc RD |
8631 | |
8632 | Deletes the current validator (if any) and sets the window validator, | |
8633 | having called wx.Validator.Clone to create a new validator of this | |
8634 | type. | |
8635 | """ | |
5b5c9bc7 | 8636 | return _core_.Window_SetValidator(*args, **kwargs) |
d55e5bfc RD |
8637 | |
8638 | def GetValidator(*args, **kwargs): | |
8639 | """ | |
5b5c9bc7 | 8640 | GetValidator(self) -> Validator |
d55e5bfc RD |
8641 | |
8642 | Returns a pointer to the current validator for the window, or None if | |
8643 | there is none. | |
8644 | """ | |
5b5c9bc7 | 8645 | return _core_.Window_GetValidator(*args, **kwargs) |
d55e5bfc RD |
8646 | |
8647 | def Validate(*args, **kwargs): | |
8648 | """ | |
8649 | Validate(self) -> bool | |
8650 | ||
8651 | Validates the current values of the child controls using their | |
15817c7e RD |
8652 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
8653 | style flag set, the method will also call Validate() of all child | |
8654 | windows. Returns false if any of the validations failed. | |
d55e5bfc | 8655 | """ |
5b5c9bc7 | 8656 | return _core_.Window_Validate(*args, **kwargs) |
d55e5bfc RD |
8657 | |
8658 | def TransferDataToWindow(*args, **kwargs): | |
8659 | """ | |
8660 | TransferDataToWindow(self) -> bool | |
8661 | ||
15817c7e RD |
8662 | Transfers values to child controls from data areas specified by their |
8663 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
8664 | style flag set, the method will also call TransferDataToWindow() of | |
8665 | all child windows. | |
d55e5bfc | 8666 | """ |
5b5c9bc7 | 8667 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
d55e5bfc RD |
8668 | |
8669 | def TransferDataFromWindow(*args, **kwargs): | |
8670 | """ | |
8671 | TransferDataFromWindow(self) -> bool | |
8672 | ||
15817c7e RD |
8673 | Transfers values from child controls to data areas specified by their |
8674 | validators. Returns false if a transfer failed. If the window has | |
8675 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
8676 | also call TransferDataFromWindow() of all child windows. | |
d55e5bfc | 8677 | """ |
5b5c9bc7 | 8678 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
d55e5bfc RD |
8679 | |
8680 | def InitDialog(*args, **kwargs): | |
8681 | """ | |
8682 | InitDialog(self) | |
8683 | ||
15817c7e RD |
8684 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
8685 | to the dialog via validators. | |
d55e5bfc | 8686 | """ |
5b5c9bc7 | 8687 | return _core_.Window_InitDialog(*args, **kwargs) |
d55e5bfc RD |
8688 | |
8689 | def SetAcceleratorTable(*args, **kwargs): | |
8690 | """ | |
5b5c9bc7 | 8691 | SetAcceleratorTable(self, AcceleratorTable accel) |
d55e5bfc RD |
8692 | |
8693 | Sets the accelerator table for this window. | |
8694 | """ | |
5b5c9bc7 | 8695 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
d55e5bfc RD |
8696 | |
8697 | def GetAcceleratorTable(*args, **kwargs): | |
8698 | """ | |
5b5c9bc7 | 8699 | GetAcceleratorTable(self) -> AcceleratorTable |
d55e5bfc RD |
8700 | |
8701 | Gets the accelerator table for this window. | |
8702 | """ | |
5b5c9bc7 | 8703 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
d55e5bfc RD |
8704 | |
8705 | def RegisterHotKey(*args, **kwargs): | |
8706 | """ | |
8707 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool | |
8708 | ||
8709 | Registers a system wide hotkey. Every time the user presses the hotkey | |
8710 | registered here, this window will receive a hotkey event. It will | |
8711 | receive the event even if the application is in the background and | |
8712 | does not have the input focus because the user is working with some | |
8713 | other application. To bind an event handler function to this hotkey | |
8714 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
8715 | hotkey was registered successfully. | |
8716 | """ | |
5b5c9bc7 | 8717 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
d55e5bfc RD |
8718 | |
8719 | def UnregisterHotKey(*args, **kwargs): | |
8720 | """ | |
8721 | UnregisterHotKey(self, int hotkeyId) -> bool | |
8722 | ||
8723 | Unregisters a system wide hotkey. | |
8724 | """ | |
5b5c9bc7 | 8725 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
d55e5bfc RD |
8726 | |
8727 | def ConvertDialogPointToPixels(*args, **kwargs): | |
8728 | """ | |
5b5c9bc7 | 8729 | ConvertDialogPointToPixels(self, Point pt) -> Point |
d55e5bfc RD |
8730 | |
8731 | Converts a point or size from dialog units to pixels. Dialog units | |
8732 | are used for maintaining a dialog's proportions even if the font | |
8733 | changes. For the x dimension, the dialog units are multiplied by the | |
8734 | average character width and then divided by 4. For the y dimension, | |
8735 | the dialog units are multiplied by the average character height and | |
8736 | then divided by 8. | |
8737 | """ | |
5b5c9bc7 | 8738 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
d55e5bfc RD |
8739 | |
8740 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
8741 | """ | |
5b5c9bc7 | 8742 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
d55e5bfc RD |
8743 | |
8744 | Converts a point or size from dialog units to pixels. Dialog units | |
8745 | are used for maintaining a dialog's proportions even if the font | |
8746 | changes. For the x dimension, the dialog units are multiplied by the | |
8747 | average character width and then divided by 4. For the y dimension, | |
8748 | the dialog units are multiplied by the average character height and | |
8749 | then divided by 8. | |
8750 | """ | |
5b5c9bc7 | 8751 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
d55e5bfc RD |
8752 | |
8753 | def DLG_PNT(*args, **kwargs): | |
8754 | """ | |
5b5c9bc7 | 8755 | DLG_PNT(self, Point pt) -> Point |
d55e5bfc RD |
8756 | |
8757 | Converts a point or size from dialog units to pixels. Dialog units | |
8758 | are used for maintaining a dialog's proportions even if the font | |
8759 | changes. For the x dimension, the dialog units are multiplied by the | |
8760 | average character width and then divided by 4. For the y dimension, | |
8761 | the dialog units are multiplied by the average character height and | |
8762 | then divided by 8. | |
8763 | """ | |
5b5c9bc7 | 8764 | return _core_.Window_DLG_PNT(*args, **kwargs) |
d55e5bfc RD |
8765 | |
8766 | def DLG_SZE(*args, **kwargs): | |
8767 | """ | |
5b5c9bc7 | 8768 | DLG_SZE(self, Size sz) -> Size |
d55e5bfc RD |
8769 | |
8770 | Converts a point or size from dialog units to pixels. Dialog units | |
8771 | are used for maintaining a dialog's proportions even if the font | |
8772 | changes. For the x dimension, the dialog units are multiplied by the | |
8773 | average character width and then divided by 4. For the y dimension, | |
8774 | the dialog units are multiplied by the average character height and | |
8775 | then divided by 8. | |
8776 | """ | |
5b5c9bc7 | 8777 | return _core_.Window_DLG_SZE(*args, **kwargs) |
d55e5bfc RD |
8778 | |
8779 | def ConvertPixelPointToDialog(*args, **kwargs): | |
5b5c9bc7 RD |
8780 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
8781 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) | |
d55e5bfc RD |
8782 | |
8783 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
5b5c9bc7 RD |
8784 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
8785 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) | |
d55e5bfc RD |
8786 | |
8787 | def WarpPointer(*args, **kwargs): | |
8788 | """ | |
8789 | WarpPointer(self, int x, int y) | |
8790 | ||
8791 | Moves the pointer to the given position on the window. | |
8792 | ||
8793 | NOTE: This function is not supported under Mac because Apple Human | |
8794 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
8795 | """ | |
5b5c9bc7 | 8796 | return _core_.Window_WarpPointer(*args, **kwargs) |
d55e5bfc RD |
8797 | |
8798 | def CaptureMouse(*args, **kwargs): | |
8799 | """ | |
8800 | CaptureMouse(self) | |
8801 | ||
8802 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
8803 | release the capture. | |
8804 | ||
8805 | Note that wxWindows maintains the stack of windows having captured the | |
8806 | mouse and when the mouse is released the capture returns to the window | |
8807 | which had had captured it previously and it is only really released if | |
8808 | there were no previous window. In particular, this means that you must | |
34e0a3bb RD |
8809 | release the mouse as many times as you capture it, unless the window |
8810 | receives the `wx.MouseCaptureLostEvent` event. | |
8811 | ||
8812 | Any application which captures the mouse in the beginning of some | |
8813 | operation *must* handle `wx.MouseCaptureLostEvent` and cancel this | |
8814 | operation when it receives the event. The event handler must not | |
8815 | recapture mouse. | |
d55e5bfc | 8816 | """ |
5b5c9bc7 | 8817 | return _core_.Window_CaptureMouse(*args, **kwargs) |
d55e5bfc RD |
8818 | |
8819 | def ReleaseMouse(*args, **kwargs): | |
8820 | """ | |
8821 | ReleaseMouse(self) | |
8822 | ||
8823 | Releases mouse input captured with wx.Window.CaptureMouse. | |
8824 | """ | |
5b5c9bc7 | 8825 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
d55e5bfc RD |
8826 | |
8827 | def GetCapture(*args, **kwargs): | |
8828 | """ | |
5b5c9bc7 | 8829 | GetCapture() -> Window |
d55e5bfc RD |
8830 | |
8831 | Returns the window which currently captures the mouse or None | |
8832 | """ | |
5b5c9bc7 | 8833 | return _core_.Window_GetCapture(*args, **kwargs) |
d55e5bfc RD |
8834 | |
8835 | GetCapture = staticmethod(GetCapture) | |
8836 | def HasCapture(*args, **kwargs): | |
8837 | """ | |
8838 | HasCapture(self) -> bool | |
8839 | ||
8840 | Returns true if this window has the current mouse capture. | |
8841 | """ | |
5b5c9bc7 | 8842 | return _core_.Window_HasCapture(*args, **kwargs) |
d55e5bfc RD |
8843 | |
8844 | def Refresh(*args, **kwargs): | |
8845 | """ | |
5b5c9bc7 | 8846 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
d55e5bfc RD |
8847 | |
8848 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
8849 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
8850 | to the window. | |
8851 | """ | |
5b5c9bc7 | 8852 | return _core_.Window_Refresh(*args, **kwargs) |
d55e5bfc RD |
8853 | |
8854 | def RefreshRect(*args, **kwargs): | |
8855 | """ | |
5b5c9bc7 | 8856 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
d55e5bfc RD |
8857 | |
8858 | Redraws the contents of the given rectangle: the area inside it will | |
8859 | be repainted. This is the same as Refresh but has a nicer syntax. | |
8860 | """ | |
5b5c9bc7 | 8861 | return _core_.Window_RefreshRect(*args, **kwargs) |
d55e5bfc RD |
8862 | |
8863 | def Update(*args, **kwargs): | |
8864 | """ | |
8865 | Update(self) | |
8866 | ||
8867 | Calling this method immediately repaints the invalidated area of the | |
8868 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
8869 | this would usually only happen when the flow of control returns to the | |
8870 | event loop.) Notice that this function doesn't refresh the window and | |
8871 | does nothing if the window has been already repainted. Use Refresh | |
8872 | first if you want to immediately redraw the window (or some portion of | |
8873 | it) unconditionally. | |
8874 | """ | |
5b5c9bc7 | 8875 | return _core_.Window_Update(*args, **kwargs) |
d55e5bfc RD |
8876 | |
8877 | def ClearBackground(*args, **kwargs): | |
8878 | """ | |
8879 | ClearBackground(self) | |
8880 | ||
8881 | Clears the window by filling it with the current background | |
8882 | colour. Does not cause an erase background event to be generated. | |
8883 | """ | |
5b5c9bc7 | 8884 | return _core_.Window_ClearBackground(*args, **kwargs) |
d55e5bfc RD |
8885 | |
8886 | def Freeze(*args, **kwargs): | |
8887 | """ | |
8888 | Freeze(self) | |
8889 | ||
15817c7e RD |
8890 | Freezes the window or, in other words, prevents any updates from |
8891 | taking place on screen, the window is not redrawn at all. Thaw must be | |
8892 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
8893 | nested, with the actual Thaw being delayed until all the nesting has | |
8894 | been undone. | |
d55e5bfc RD |
8895 | |
8896 | This method is useful for visual appearance optimization (for example, | |
8897 | it is a good idea to use it before inserting large amount of text into | |
8898 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
8899 | for all controls so it is mostly just a hint to wxWindows and not a | |
8900 | mandatory directive. | |
8901 | """ | |
5b5c9bc7 | 8902 | return _core_.Window_Freeze(*args, **kwargs) |
d55e5bfc RD |
8903 | |
8904 | def Thaw(*args, **kwargs): | |
8905 | """ | |
8906 | Thaw(self) | |
8907 | ||
8908 | Reenables window updating after a previous call to Freeze. Calls to | |
15817c7e RD |
8909 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
8910 | times that Freeze was before the window will be updated. | |
d55e5bfc | 8911 | """ |
5b5c9bc7 | 8912 | return _core_.Window_Thaw(*args, **kwargs) |
d55e5bfc RD |
8913 | |
8914 | def PrepareDC(*args, **kwargs): | |
8915 | """ | |
5b5c9bc7 | 8916 | PrepareDC(self, DC dc) |
d55e5bfc RD |
8917 | |
8918 | Call this function to prepare the device context for drawing a | |
8919 | scrolled image. It sets the device origin according to the current | |
8920 | scroll position. | |
8921 | """ | |
5b5c9bc7 | 8922 | return _core_.Window_PrepareDC(*args, **kwargs) |
d55e5bfc RD |
8923 | |
8924 | def GetUpdateRegion(*args, **kwargs): | |
8925 | """ | |
5b5c9bc7 | 8926 | GetUpdateRegion(self) -> Region |
d55e5bfc RD |
8927 | |
8928 | Returns the region specifying which parts of the window have been | |
8929 | damaged. Should only be called within an EVT_PAINT handler. | |
8930 | """ | |
5b5c9bc7 | 8931 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
d55e5bfc RD |
8932 | |
8933 | def GetUpdateClientRect(*args, **kwargs): | |
8934 | """ | |
5b5c9bc7 | 8935 | GetUpdateClientRect(self) -> Rect |
d55e5bfc RD |
8936 | |
8937 | Get the update rectangle region bounding box in client coords. | |
8938 | """ | |
5b5c9bc7 | 8939 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
d55e5bfc RD |
8940 | |
8941 | def IsExposed(*args, **kwargs): | |
8942 | """ | |
8943 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool | |
8944 | ||
8945 | Returns true if the given point or rectangle area has been exposed | |
8946 | since the last repaint. Call this in an paint event handler to | |
8947 | optimize redrawing by only redrawing those areas, which have been | |
8948 | exposed. | |
8949 | """ | |
5b5c9bc7 | 8950 | return _core_.Window_IsExposed(*args, **kwargs) |
d55e5bfc RD |
8951 | |
8952 | def IsExposedPoint(*args, **kwargs): | |
8953 | """ | |
5b5c9bc7 | 8954 | IsExposedPoint(self, Point pt) -> bool |
d55e5bfc RD |
8955 | |
8956 | Returns true if the given point or rectangle area has been exposed | |
8957 | since the last repaint. Call this in an paint event handler to | |
8958 | optimize redrawing by only redrawing those areas, which have been | |
8959 | exposed. | |
8960 | """ | |
5b5c9bc7 | 8961 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
d55e5bfc RD |
8962 | |
8963 | def IsExposedRect(*args, **kwargs): | |
8964 | """ | |
5b5c9bc7 | 8965 | IsExposedRect(self, Rect rect) -> bool |
d55e5bfc RD |
8966 | |
8967 | Returns true if the given point or rectangle area has been exposed | |
8968 | since the last repaint. Call this in an paint event handler to | |
8969 | optimize redrawing by only redrawing those areas, which have been | |
8970 | exposed. | |
8971 | """ | |
5b5c9bc7 | 8972 | return _core_.Window_IsExposedRect(*args, **kwargs) |
d55e5bfc RD |
8973 | |
8974 | def GetDefaultAttributes(*args, **kwargs): | |
8975 | """ | |
5b5c9bc7 | 8976 | GetDefaultAttributes(self) -> VisualAttributes |
d55e5bfc | 8977 | |
15817c7e RD |
8978 | Get the default attributes for an instance of this class. This is |
8979 | useful if you want to use the same font or colour in your own control | |
8980 | as in a standard control -- which is a much better idea than hard | |
8981 | coding specific colours or fonts which might look completely out of | |
a5ee0656 | 8982 | place on the user's system, especially if it uses themes. |
d55e5bfc | 8983 | """ |
5b5c9bc7 | 8984 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
8985 | |
8986 | def GetClassDefaultAttributes(*args, **kwargs): | |
8987 | """ | |
5b5c9bc7 | 8988 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
d55e5bfc | 8989 | |
15817c7e RD |
8990 | Get the default attributes for this class. This is useful if you want |
8991 | to use the same font or colour in your own control as in a standard | |
8992 | control -- which is a much better idea than hard coding specific | |
a5ee0656 RD |
8993 | colours or fonts which might look completely out of place on the |
8994 | user's system, especially if it uses themes. | |
d55e5bfc RD |
8995 | |
8996 | The variant parameter is only relevant under Mac currently and is | |
15817c7e | 8997 | ignore under other platforms. Under Mac, it will change the size of |
a5ee0656 RD |
8998 | the returned font. See `wx.Window.SetWindowVariant` for more about |
8999 | this. | |
d55e5bfc | 9000 | """ |
5b5c9bc7 | 9001 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
9002 | |
9003 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
9004 | def SetBackgroundColour(*args, **kwargs): | |
9005 | """ | |
5b5c9bc7 | 9006 | SetBackgroundColour(self, Colour colour) -> bool |
d55e5bfc RD |
9007 | |
9008 | Sets the background colour of the window. Returns True if the colour | |
9009 | was changed. The background colour is usually painted by the default | |
9010 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9011 | automatically under GTK. Using `wx.NullColour` will reset the window |
9012 | to the default background colour. | |
d55e5bfc | 9013 | |
a5ee0656 | 9014 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9015 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
d55e5bfc RD |
9016 | calling this function. |
9017 | ||
f8167d6e RD |
9018 | Using this function will disable attempts to use themes for this |
9019 | window, if the system supports them. Use with care since usually the | |
9020 | themes represent the appearance chosen by the user to be used for all | |
9021 | applications on the system. | |
d55e5bfc | 9022 | """ |
5b5c9bc7 | 9023 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
d55e5bfc | 9024 | |
412d302d | 9025 | def SetOwnBackgroundColour(*args, **kwargs): |
5b5c9bc7 RD |
9026 | """SetOwnBackgroundColour(self, Colour colour)""" |
9027 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
d55e5bfc RD |
9028 | |
9029 | def SetForegroundColour(*args, **kwargs): | |
9030 | """ | |
5b5c9bc7 | 9031 | SetForegroundColour(self, Colour colour) -> bool |
d55e5bfc RD |
9032 | |
9033 | Sets the foreground colour of the window. Returns True is the colour | |
9034 | was changed. The interpretation of foreground colour is dependent on | |
9035 | the window class; it may be the text colour or other colour, or it may | |
9036 | not be used at all. | |
9037 | """ | |
5b5c9bc7 | 9038 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
d55e5bfc | 9039 | |
fa47d7a7 | 9040 | def SetOwnForegroundColour(*args, **kwargs): |
5b5c9bc7 RD |
9041 | """SetOwnForegroundColour(self, Colour colour)""" |
9042 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
d55e5bfc RD |
9043 | |
9044 | def GetBackgroundColour(*args, **kwargs): | |
9045 | """ | |
5b5c9bc7 | 9046 | GetBackgroundColour(self) -> Colour |
d55e5bfc RD |
9047 | |
9048 | Returns the background colour of the window. | |
9049 | """ | |
5b5c9bc7 | 9050 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
d55e5bfc RD |
9051 | |
9052 | def GetForegroundColour(*args, **kwargs): | |
9053 | """ | |
5b5c9bc7 | 9054 | GetForegroundColour(self) -> Colour |
d55e5bfc RD |
9055 | |
9056 | Returns the foreground colour of the window. The interpretation of | |
9057 | foreground colour is dependent on the window class; it may be the text | |
9058 | colour or other colour, or it may not be used at all. | |
9059 | """ | |
5b5c9bc7 | 9060 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
d55e5bfc | 9061 | |
dcb8fc74 RD |
9062 | def InheritsBackgroundColour(*args, **kwargs): |
9063 | """InheritsBackgroundColour(self) -> bool""" | |
5b5c9bc7 | 9064 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) |
dcb8fc74 RD |
9065 | |
9066 | def UseBgCol(*args, **kwargs): | |
9067 | """UseBgCol(self) -> bool""" | |
5b5c9bc7 | 9068 | return _core_.Window_UseBgCol(*args, **kwargs) |
dcb8fc74 | 9069 | |
0f63ec68 RD |
9070 | def SetBackgroundStyle(*args, **kwargs): |
9071 | """ | |
9072 | SetBackgroundStyle(self, int style) -> bool | |
9073 | ||
9074 | Returns the background style of the window. The background style | |
9075 | indicates how the background of the window is drawn. | |
9076 | ||
9077 | ====================== ======================================== | |
9078 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9079 | be determined by the system | |
9080 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9081 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9082 | application. | |
9083 | ====================== ======================================== | |
9084 | ||
9085 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9086 | a custom background, such as a tiled bitmap. Currently the style has | |
9087 | no effect on other platforms. | |
9088 | ||
9089 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9090 | """ | |
5b5c9bc7 | 9091 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) |
0f63ec68 RD |
9092 | |
9093 | def GetBackgroundStyle(*args, **kwargs): | |
9094 | """ | |
9095 | GetBackgroundStyle(self) -> int | |
9096 | ||
9097 | Returns the background style of the window. | |
9098 | ||
9099 | :see: `SetBackgroundStyle` | |
9100 | """ | |
5b5c9bc7 | 9101 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) |
0f63ec68 | 9102 | |
51b83b37 RD |
9103 | def HasTransparentBackground(*args, **kwargs): |
9104 | """ | |
9105 | HasTransparentBackground(self) -> bool | |
9106 | ||
9107 | Returns True if this window's background is transparent (as, for | |
9108 | example, for `wx.StaticText`) and should show the parent window's | |
9109 | background. | |
9110 | ||
9111 | This method is mostly used internally by the library itself and you | |
9112 | normally shouldn't have to call it. You may, however, have to override | |
9113 | it in your custom control classes to ensure that background is painted | |
9114 | correctly. | |
9115 | """ | |
5b5c9bc7 | 9116 | return _core_.Window_HasTransparentBackground(*args, **kwargs) |
51b83b37 | 9117 | |
d55e5bfc RD |
9118 | def SetCursor(*args, **kwargs): |
9119 | """ | |
5b5c9bc7 | 9120 | SetCursor(self, Cursor cursor) -> bool |
d55e5bfc RD |
9121 | |
9122 | Sets the window's cursor. Notice that the window cursor also sets it | |
9123 | for the children of the window implicitly. | |
9124 | ||
9125 | The cursor may be wx.NullCursor in which case the window cursor will | |
9126 | be reset back to default. | |
9127 | """ | |
5b5c9bc7 | 9128 | return _core_.Window_SetCursor(*args, **kwargs) |
d55e5bfc RD |
9129 | |
9130 | def GetCursor(*args, **kwargs): | |
9131 | """ | |
5b5c9bc7 | 9132 | GetCursor(self) -> Cursor |
d55e5bfc RD |
9133 | |
9134 | Return the cursor associated with this window. | |
9135 | """ | |
5b5c9bc7 | 9136 | return _core_.Window_GetCursor(*args, **kwargs) |
d55e5bfc RD |
9137 | |
9138 | def SetFont(*args, **kwargs): | |
9139 | """ | |
5b5c9bc7 | 9140 | SetFont(self, Font font) -> bool |
d55e5bfc RD |
9141 | |
9142 | Sets the font for this window. | |
9143 | """ | |
5b5c9bc7 | 9144 | return _core_.Window_SetFont(*args, **kwargs) |
d55e5bfc | 9145 | |
fa47d7a7 | 9146 | def SetOwnFont(*args, **kwargs): |
5b5c9bc7 RD |
9147 | """SetOwnFont(self, Font font)""" |
9148 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
d55e5bfc RD |
9149 | |
9150 | def GetFont(*args, **kwargs): | |
9151 | """ | |
5b5c9bc7 | 9152 | GetFont(self) -> Font |
d55e5bfc RD |
9153 | |
9154 | Returns the default font used for this window. | |
9155 | """ | |
5b5c9bc7 | 9156 | return _core_.Window_GetFont(*args, **kwargs) |
d55e5bfc RD |
9157 | |
9158 | def SetCaret(*args, **kwargs): | |
9159 | """ | |
5b5c9bc7 | 9160 | SetCaret(self, Caret caret) |
d55e5bfc RD |
9161 | |
9162 | Sets the caret associated with the window. | |
9163 | """ | |
5b5c9bc7 | 9164 | return _core_.Window_SetCaret(*args, **kwargs) |
d55e5bfc RD |
9165 | |
9166 | def GetCaret(*args, **kwargs): | |
9167 | """ | |
5b5c9bc7 | 9168 | GetCaret(self) -> Caret |
d55e5bfc RD |
9169 | |
9170 | Returns the caret associated with the window. | |
9171 | """ | |
5b5c9bc7 | 9172 | return _core_.Window_GetCaret(*args, **kwargs) |
d55e5bfc RD |
9173 | |
9174 | def GetCharHeight(*args, **kwargs): | |
9175 | """ | |
9176 | GetCharHeight(self) -> int | |
9177 | ||
9178 | Get the (average) character size for the current font. | |
9179 | """ | |
5b5c9bc7 | 9180 | return _core_.Window_GetCharHeight(*args, **kwargs) |
d55e5bfc RD |
9181 | |
9182 | def GetCharWidth(*args, **kwargs): | |
9183 | """ | |
9184 | GetCharWidth(self) -> int | |
9185 | ||
9186 | Get the (average) character size for the current font. | |
9187 | """ | |
5b5c9bc7 | 9188 | return _core_.Window_GetCharWidth(*args, **kwargs) |
d55e5bfc RD |
9189 | |
9190 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9191 | """ |
9192 | GetTextExtent(String string) -> (width, height) | |
9193 | ||
9194 | Get the width and height of the text using the current font. | |
9195 | """ | |
5b5c9bc7 | 9196 | return _core_.Window_GetTextExtent(*args, **kwargs) |
d55e5bfc RD |
9197 | |
9198 | def GetFullTextExtent(*args, **kwargs): | |
9199 | """ | |
9200 | GetFullTextExtent(String string, Font font=None) -> | |
9201 | (width, height, descent, externalLeading) | |
9202 | ||
9203 | Get the width, height, decent and leading of the text using the | |
9204 | current or specified font. | |
9205 | """ | |
5b5c9bc7 | 9206 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
d55e5bfc RD |
9207 | |
9208 | def ClientToScreenXY(*args, **kwargs): | |
9209 | """ | |
9210 | ClientToScreenXY(int x, int y) -> (x,y) | |
9211 | ||
9212 | Converts to screen coordinates from coordinates relative to this window. | |
9213 | """ | |
5b5c9bc7 | 9214 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
d55e5bfc RD |
9215 | |
9216 | def ScreenToClientXY(*args, **kwargs): | |
9217 | """ | |
9218 | ScreenToClientXY(int x, int y) -> (x,y) | |
9219 | ||
9220 | Converts from screen to client window coordinates. | |
9221 | """ | |
5b5c9bc7 | 9222 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
d55e5bfc RD |
9223 | |
9224 | def ClientToScreen(*args, **kwargs): | |
9225 | """ | |
5b5c9bc7 | 9226 | ClientToScreen(self, Point pt) -> Point |
d55e5bfc RD |
9227 | |
9228 | Converts to screen coordinates from coordinates relative to this window. | |
9229 | """ | |
5b5c9bc7 | 9230 | return _core_.Window_ClientToScreen(*args, **kwargs) |
d55e5bfc RD |
9231 | |
9232 | def ScreenToClient(*args, **kwargs): | |
9233 | """ | |
5b5c9bc7 | 9234 | ScreenToClient(self, Point pt) -> Point |
d55e5bfc RD |
9235 | |
9236 | Converts from screen to client window coordinates. | |
9237 | """ | |
5b5c9bc7 | 9238 | return _core_.Window_ScreenToClient(*args, **kwargs) |
d55e5bfc RD |
9239 | |
9240 | def HitTestXY(*args, **kwargs): | |
9241 | """ | |
9242 | HitTestXY(self, int x, int y) -> int | |
9243 | ||
9244 | Test where the given (in client coords) point lies | |
9245 | """ | |
5b5c9bc7 | 9246 | return _core_.Window_HitTestXY(*args, **kwargs) |
d55e5bfc RD |
9247 | |
9248 | def HitTest(*args, **kwargs): | |
9249 | """ | |
5b5c9bc7 | 9250 | HitTest(self, Point pt) -> int |
d55e5bfc RD |
9251 | |
9252 | Test where the given (in client coords) point lies | |
9253 | """ | |
5b5c9bc7 | 9254 | return _core_.Window_HitTest(*args, **kwargs) |
d55e5bfc RD |
9255 | |
9256 | def GetBorder(*args): | |
9257 | """ | |
9258 | GetBorder(self, long flags) -> int | |
9259 | GetBorder(self) -> int | |
9260 | ||
9261 | Get border for the flags of this window | |
9262 | """ | |
5b5c9bc7 | 9263 | return _core_.Window_GetBorder(*args) |
d55e5bfc RD |
9264 | |
9265 | def UpdateWindowUI(*args, **kwargs): | |
9266 | """ | |
5b5c9bc7 | 9267 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
d55e5bfc RD |
9268 | |
9269 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9270 | implementation depends on the window; for example a wx.ToolBar will | |
9271 | send an update UI event for each toolbar button, and a wx.Frame will | |
9272 | send an update UI event for each menubar menu item. You can call this | |
9273 | function from your application to ensure that your UI is up-to-date at | |
9274 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9275 | concerned). This may be necessary if you have called | |
5ba5649b | 9276 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
d55e5bfc RD |
9277 | limit the overhead that wxWindows incurs by sending update UI events |
9278 | in idle time. | |
d55e5bfc | 9279 | """ |
5b5c9bc7 | 9280 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
d55e5bfc RD |
9281 | |
9282 | def PopupMenuXY(*args, **kwargs): | |
9283 | """ | |
5b5c9bc7 | 9284 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
d55e5bfc | 9285 | |
b0503257 RD |
9286 | Pops up the given menu at the specified coordinates, relative to this window, |
9287 | and returns control when the user has dismissed the menu. If a menu item is | |
9288 | selected, the corresponding menu event is generated and will be processed as | |
9289 | usual. If the default position is given then the current position of the | |
9290 | mouse cursor will be used. | |
d55e5bfc | 9291 | """ |
5b5c9bc7 | 9292 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
d55e5bfc RD |
9293 | |
9294 | def PopupMenu(*args, **kwargs): | |
9295 | """ | |
5b5c9bc7 | 9296 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
d55e5bfc | 9297 | |
b0503257 RD |
9298 | Pops up the given menu at the specified coordinates, relative to this window, |
9299 | and returns control when the user has dismissed the menu. If a menu item is | |
9300 | selected, the corresponding menu event is generated and will be processed as | |
9301 | usual. If the default position is given then the current position of the | |
9302 | mouse cursor will be used. | |
d55e5bfc | 9303 | """ |
5b5c9bc7 | 9304 | return _core_.Window_PopupMenu(*args, **kwargs) |
d55e5bfc | 9305 | |
1eeb270e RD |
9306 | def HasMultiplePages(*args, **kwargs): |
9307 | """HasMultiplePages(self) -> bool""" | |
9308 | return _core_.Window_HasMultiplePages(*args, **kwargs) | |
9309 | ||
d55e5bfc RD |
9310 | def GetHandle(*args, **kwargs): |
9311 | """ | |
9312 | GetHandle(self) -> long | |
9313 | ||
9314 | Returns the platform-specific handle (as a long integer) of the | |
9315 | physical window. Currently on wxMac it returns the handle of the | |
9316 | toplevel parent of the window. | |
9317 | """ | |
5b5c9bc7 | 9318 | return _core_.Window_GetHandle(*args, **kwargs) |
d55e5bfc | 9319 | |
629e65c2 RD |
9320 | def AssociateHandle(*args, **kwargs): |
9321 | """ | |
9322 | AssociateHandle(self, long handle) | |
9323 | ||
9324 | Associate the window with a new native handle | |
9325 | """ | |
5b5c9bc7 | 9326 | return _core_.Window_AssociateHandle(*args, **kwargs) |
629e65c2 RD |
9327 | |
9328 | def DissociateHandle(*args, **kwargs): | |
9329 | """ | |
9330 | DissociateHandle(self) | |
9331 | ||
9332 | Dissociate the current native handle from the window | |
9333 | """ | |
5b5c9bc7 | 9334 | return _core_.Window_DissociateHandle(*args, **kwargs) |
629e65c2 | 9335 | |
d55e5bfc RD |
9336 | def HasScrollbar(*args, **kwargs): |
9337 | """ | |
9338 | HasScrollbar(self, int orient) -> bool | |
9339 | ||
9340 | Does the window have the scrollbar for this orientation? | |
9341 | """ | |
5b5c9bc7 | 9342 | return _core_.Window_HasScrollbar(*args, **kwargs) |
d55e5bfc RD |
9343 | |
9344 | def SetScrollbar(*args, **kwargs): | |
9345 | """ | |
15817c7e | 9346 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
d55e5bfc RD |
9347 | bool refresh=True) |
9348 | ||
9349 | Sets the scrollbar properties of a built-in scrollbar. | |
d55e5bfc | 9350 | """ |
5b5c9bc7 | 9351 | return _core_.Window_SetScrollbar(*args, **kwargs) |
d55e5bfc RD |
9352 | |
9353 | def SetScrollPos(*args, **kwargs): | |
9354 | """ | |
9355 | SetScrollPos(self, int orientation, int pos, bool refresh=True) | |
9356 | ||
9357 | Sets the position of one of the built-in scrollbars. | |
9358 | """ | |
5b5c9bc7 | 9359 | return _core_.Window_SetScrollPos(*args, **kwargs) |
d55e5bfc RD |
9360 | |
9361 | def GetScrollPos(*args, **kwargs): | |
9362 | """ | |
9363 | GetScrollPos(self, int orientation) -> int | |
9364 | ||
9365 | Returns the built-in scrollbar position. | |
9366 | """ | |
5b5c9bc7 | 9367 | return _core_.Window_GetScrollPos(*args, **kwargs) |
d55e5bfc RD |
9368 | |
9369 | def GetScrollThumb(*args, **kwargs): | |
9370 | """ | |
9371 | GetScrollThumb(self, int orientation) -> int | |
9372 | ||
9373 | Returns the built-in scrollbar thumb size. | |
9374 | """ | |
5b5c9bc7 | 9375 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
d55e5bfc RD |
9376 | |
9377 | def GetScrollRange(*args, **kwargs): | |
9378 | """ | |
9379 | GetScrollRange(self, int orientation) -> int | |
9380 | ||
9381 | Returns the built-in scrollbar range. | |
9382 | """ | |
5b5c9bc7 | 9383 | return _core_.Window_GetScrollRange(*args, **kwargs) |
d55e5bfc RD |
9384 | |
9385 | def ScrollWindow(*args, **kwargs): | |
9386 | """ | |
5b5c9bc7 | 9387 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
d55e5bfc RD |
9388 | |
9389 | Physically scrolls the pixels in the window and move child windows | |
9390 | accordingly. Use this function to optimise your scrolling | |
9391 | implementations, to minimise the area that must be redrawn. Note that | |
9392 | it is rarely required to call this function from a user program. | |
d55e5bfc | 9393 | """ |
5b5c9bc7 | 9394 | return _core_.Window_ScrollWindow(*args, **kwargs) |
d55e5bfc RD |
9395 | |
9396 | def ScrollLines(*args, **kwargs): | |
9397 | """ | |
9398 | ScrollLines(self, int lines) -> bool | |
9399 | ||
9400 | If the platform and window class supports it, scrolls the window by | |
9401 | the given number of lines down, if lines is positive, or up if lines | |
9402 | is negative. Returns True if the window was scrolled, False if it was | |
9403 | already on top/bottom and nothing was done. | |
9404 | """ | |
5b5c9bc7 | 9405 | return _core_.Window_ScrollLines(*args, **kwargs) |
d55e5bfc RD |
9406 | |
9407 | def ScrollPages(*args, **kwargs): | |
9408 | """ | |
9409 | ScrollPages(self, int pages) -> bool | |
9410 | ||
15817c7e | 9411 | If the platform and window class supports it, scrolls the window by |
d55e5bfc RD |
9412 | the given number of pages down, if pages is positive, or up if pages |
9413 | is negative. Returns True if the window was scrolled, False if it was | |
9414 | already on top/bottom and nothing was done. | |
9415 | """ | |
5b5c9bc7 | 9416 | return _core_.Window_ScrollPages(*args, **kwargs) |
d55e5bfc RD |
9417 | |
9418 | def LineUp(*args, **kwargs): | |
9419 | """ | |
9420 | LineUp(self) -> bool | |
9421 | ||
9422 | This is just a wrapper for ScrollLines(-1). | |
9423 | """ | |
5b5c9bc7 | 9424 | return _core_.Window_LineUp(*args, **kwargs) |
d55e5bfc RD |
9425 | |
9426 | def LineDown(*args, **kwargs): | |
9427 | """ | |
9428 | LineDown(self) -> bool | |
9429 | ||
9430 | This is just a wrapper for ScrollLines(1). | |
9431 | """ | |
5b5c9bc7 | 9432 | return _core_.Window_LineDown(*args, **kwargs) |
d55e5bfc RD |
9433 | |
9434 | def PageUp(*args, **kwargs): | |
9435 | """ | |
9436 | PageUp(self) -> bool | |
9437 | ||
9438 | This is just a wrapper for ScrollPages(-1). | |
9439 | """ | |
5b5c9bc7 | 9440 | return _core_.Window_PageUp(*args, **kwargs) |
d55e5bfc RD |
9441 | |
9442 | def PageDown(*args, **kwargs): | |
9443 | """ | |
9444 | PageDown(self) -> bool | |
9445 | ||
9446 | This is just a wrapper for ScrollPages(1). | |
9447 | """ | |
5b5c9bc7 | 9448 | return _core_.Window_PageDown(*args, **kwargs) |
d55e5bfc RD |
9449 | |
9450 | def SetHelpText(*args, **kwargs): | |
9451 | """ | |
5b5c9bc7 | 9452 | SetHelpText(self, String text) |
d55e5bfc RD |
9453 | |
9454 | Sets the help text to be used as context-sensitive help for this | |
9455 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9456 | `wx.HelpProvider` implementation, and not in the window object itself. |
d55e5bfc | 9457 | """ |
5b5c9bc7 | 9458 | return _core_.Window_SetHelpText(*args, **kwargs) |
d55e5bfc RD |
9459 | |
9460 | def SetHelpTextForId(*args, **kwargs): | |
9461 | """ | |
5b5c9bc7 | 9462 | SetHelpTextForId(self, String text) |
d55e5bfc RD |
9463 | |
9464 | Associate this help text with all windows with the same id as this | |
9465 | one. | |
9466 | """ | |
5b5c9bc7 | 9467 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
d55e5bfc | 9468 | |
b850e7f3 RD |
9469 | def GetHelpTextAtPoint(*args, **kwargs): |
9470 | """ | |
9471 | GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String | |
9472 | ||
9473 | Get the help string associated with the given position in this window. | |
9474 | ||
9475 | Notice that pt may be invalid if event origin is keyboard or unknown | |
9476 | and this method should return the global window help text then | |
9477 | ||
9478 | """ | |
9479 | return _core_.Window_GetHelpTextAtPoint(*args, **kwargs) | |
9480 | ||
d55e5bfc RD |
9481 | def GetHelpText(*args, **kwargs): |
9482 | """ | |
5b5c9bc7 | 9483 | GetHelpText(self) -> String |
d55e5bfc RD |
9484 | |
9485 | Gets the help text to be used as context-sensitive help for this | |
9486 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9487 | `wx.HelpProvider` implementation, and not in the window object itself. |
d55e5bfc | 9488 | """ |
5b5c9bc7 | 9489 | return _core_.Window_GetHelpText(*args, **kwargs) |
d55e5bfc RD |
9490 | |
9491 | def SetToolTipString(*args, **kwargs): | |
9492 | """ | |
5b5c9bc7 | 9493 | SetToolTipString(self, String tip) |
d55e5bfc RD |
9494 | |
9495 | Attach a tooltip to the window. | |
9496 | """ | |
5b5c9bc7 | 9497 | return _core_.Window_SetToolTipString(*args, **kwargs) |
d55e5bfc RD |
9498 | |
9499 | def SetToolTip(*args, **kwargs): | |
9500 | """ | |
5b5c9bc7 | 9501 | SetToolTip(self, ToolTip tip) |
d55e5bfc RD |
9502 | |
9503 | Attach a tooltip to the window. | |
9504 | """ | |
5b5c9bc7 | 9505 | return _core_.Window_SetToolTip(*args, **kwargs) |
d55e5bfc RD |
9506 | |
9507 | def GetToolTip(*args, **kwargs): | |
9508 | """ | |
5b5c9bc7 | 9509 | GetToolTip(self) -> ToolTip |
d55e5bfc RD |
9510 | |
9511 | get the associated tooltip or None if none | |
9512 | """ | |
5b5c9bc7 | 9513 | return _core_.Window_GetToolTip(*args, **kwargs) |
d55e5bfc RD |
9514 | |
9515 | def SetDropTarget(*args, **kwargs): | |
9516 | """ | |
5b5c9bc7 | 9517 | SetDropTarget(self, DropTarget dropTarget) |
d55e5bfc RD |
9518 | |
9519 | Associates a drop target with this window. If the window already has | |
9520 | a drop target, it is deleted. | |
9521 | """ | |
5b5c9bc7 | 9522 | return _core_.Window_SetDropTarget(*args, **kwargs) |
d55e5bfc RD |
9523 | |
9524 | def GetDropTarget(*args, **kwargs): | |
9525 | """ | |
5b5c9bc7 | 9526 | GetDropTarget(self) -> DropTarget |
d55e5bfc RD |
9527 | |
9528 | Returns the associated drop target, which may be None. | |
9529 | """ | |
5b5c9bc7 | 9530 | return _core_.Window_GetDropTarget(*args, **kwargs) |
d55e5bfc | 9531 | |
5ba5649b RD |
9532 | def DragAcceptFiles(*args, **kwargs): |
9533 | """ | |
9534 | DragAcceptFiles(self, bool accept) | |
9535 | ||
9536 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
9537 | Only functional on Windows. | |
9538 | """ | |
9539 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
9540 | ||
d55e5bfc RD |
9541 | def SetConstraints(*args, **kwargs): |
9542 | """ | |
5b5c9bc7 | 9543 | SetConstraints(self, LayoutConstraints constraints) |
d55e5bfc RD |
9544 | |
9545 | Sets the window to have the given layout constraints. If an existing | |
9546 | layout constraints object is already owned by the window, it will be | |
9547 | deleted. Pass None to disassociate and delete the window's current | |
9548 | constraints. | |
9549 | ||
9550 | You must call SetAutoLayout to tell a window to use the constraints | |
9551 | automatically in its default EVT_SIZE handler; otherwise, you must | |
9552 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
9553 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
9554 | effect. | |
9555 | """ | |
5b5c9bc7 | 9556 | return _core_.Window_SetConstraints(*args, **kwargs) |
d55e5bfc RD |
9557 | |
9558 | def GetConstraints(*args, **kwargs): | |
9559 | """ | |
5b5c9bc7 | 9560 | GetConstraints(self) -> LayoutConstraints |
d55e5bfc RD |
9561 | |
9562 | Returns a pointer to the window's layout constraints, or None if there | |
9563 | are none. | |
9564 | """ | |
5b5c9bc7 | 9565 | return _core_.Window_GetConstraints(*args, **kwargs) |
d55e5bfc RD |
9566 | |
9567 | def SetAutoLayout(*args, **kwargs): | |
9568 | """ | |
9569 | SetAutoLayout(self, bool autoLayout) | |
9570 | ||
9571 | Determines whether the Layout function will be called automatically | |
b1fcee84 RD |
9572 | when the window is resized. lease note that this only happens for the |
9573 | windows usually used to contain children, namely `wx.Panel` and | |
9574 | `wx.TopLevelWindow` (and the classes deriving from them). | |
9575 | ||
9576 | This method is called implicitly by `SetSizer` but if you use | |
9577 | `SetConstraints` you should call it manually or otherwise the window | |
9578 | layout won't be correctly updated when its size changes. | |
d55e5bfc | 9579 | """ |
5b5c9bc7 | 9580 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
d55e5bfc RD |
9581 | |
9582 | def GetAutoLayout(*args, **kwargs): | |
9583 | """ | |
9584 | GetAutoLayout(self) -> bool | |
9585 | ||
9586 | Returns the current autoLayout setting | |
9587 | """ | |
5b5c9bc7 | 9588 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
d55e5bfc RD |
9589 | |
9590 | def Layout(*args, **kwargs): | |
9591 | """ | |
9592 | Layout(self) -> bool | |
9593 | ||
9594 | Invokes the constraint-based layout algorithm or the sizer-based | |
9595 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
9596 | this function gets called automatically by the default EVT_SIZE | |
9597 | handler when the window is resized. | |
9598 | """ | |
5b5c9bc7 | 9599 | return _core_.Window_Layout(*args, **kwargs) |
d55e5bfc RD |
9600 | |
9601 | def SetSizer(*args, **kwargs): | |
9602 | """ | |
5b5c9bc7 | 9603 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
d55e5bfc RD |
9604 | |
9605 | Sets the window to have the given layout sizer. The window will then | |
9606 | own the object, and will take care of its deletion. If an existing | |
9607 | layout sizer object is already owned by the window, it will be deleted | |
9608 | if the deleteOld parameter is true. Note that this function will also | |
9609 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
b411df4a | 9610 | non-None, and False otherwise. |
d55e5bfc | 9611 | """ |
5b5c9bc7 | 9612 | return _core_.Window_SetSizer(*args, **kwargs) |
d55e5bfc RD |
9613 | |
9614 | def SetSizerAndFit(*args, **kwargs): | |
9615 | """ | |
5b5c9bc7 | 9616 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
d55e5bfc RD |
9617 | |
9618 | The same as SetSizer, except it also sets the size hints for the | |
9619 | window based on the sizer's minimum size. | |
9620 | """ | |
5b5c9bc7 | 9621 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
d55e5bfc RD |
9622 | |
9623 | def GetSizer(*args, **kwargs): | |
9624 | """ | |
5b5c9bc7 | 9625 | GetSizer(self) -> Sizer |
d55e5bfc RD |
9626 | |
9627 | Return the sizer associated with the window by a previous call to | |
9628 | SetSizer or None if there isn't one. | |
9629 | """ | |
5b5c9bc7 | 9630 | return _core_.Window_GetSizer(*args, **kwargs) |
d55e5bfc RD |
9631 | |
9632 | def SetContainingSizer(*args, **kwargs): | |
9633 | """ | |
5b5c9bc7 | 9634 | SetContainingSizer(self, Sizer sizer) |
d55e5bfc RD |
9635 | |
9636 | This normally does not need to be called by application code. It is | |
9637 | called internally when a window is added to a sizer, and is used so | |
9638 | the window can remove itself from the sizer when it is destroyed. | |
9639 | """ | |
5b5c9bc7 | 9640 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
d55e5bfc RD |
9641 | |
9642 | def GetContainingSizer(*args, **kwargs): | |
9643 | """ | |
5b5c9bc7 | 9644 | GetContainingSizer(self) -> Sizer |
d55e5bfc RD |
9645 | |
9646 | Return the sizer that this window is a member of, if any, otherwise None. | |
9647 | """ | |
5b5c9bc7 | 9648 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
d55e5bfc RD |
9649 | |
9650 | def InheritAttributes(*args, **kwargs): | |
9651 | """ | |
9652 | InheritAttributes(self) | |
9653 | ||
15817c7e RD |
9654 | This function is (or should be, in case of custom controls) called |
9655 | during window creation to intelligently set up the window visual | |
9656 | attributes, that is the font and the foreground and background | |
9657 | colours. | |
9658 | ||
9659 | By 'intelligently' the following is meant: by default, all windows use | |
9660 | their own default attributes. However if some of the parent's | |
9661 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 9662 | SetOwnFont) and if the corresponding attribute hadn't been |
15817c7e RD |
9663 | explicitly set for this window itself, then this window takes the same |
9664 | value as used by the parent. In addition, if the window overrides | |
9665 | ShouldInheritColours to return false, the colours will not be changed | |
9666 | no matter what and only the font might. | |
9667 | ||
a7bb0a9d RD |
9668 | This rather complicated logic is necessary in order to accommodate the |
9669 | different usage scenarios. The most common one is when all default | |
15817c7e RD |
9670 | attributes are used and in this case, nothing should be inherited as |
9671 | in modern GUIs different controls use different fonts (and colours) | |
9672 | than their siblings so they can't inherit the same value from the | |
9673 | parent. However it was also deemed desirable to allow to simply change | |
9674 | the attributes of all children at once by just changing the font or | |
9675 | colour of their common parent, hence in this case we do inherit the | |
9676 | parents attributes. | |
9677 | ||
d55e5bfc | 9678 | """ |
5b5c9bc7 | 9679 | return _core_.Window_InheritAttributes(*args, **kwargs) |
d55e5bfc RD |
9680 | |
9681 | def ShouldInheritColours(*args, **kwargs): | |
9682 | """ | |
9683 | ShouldInheritColours(self) -> bool | |
9684 | ||
9685 | Return true from here to allow the colours of this window to be | |
15817c7e RD |
9686 | changed by InheritAttributes, returning false forbids inheriting them |
9687 | from the parent window. | |
d55e5bfc | 9688 | |
15817c7e RD |
9689 | The base class version returns false, but this method is overridden in |
9690 | wxControl where it returns true. | |
d55e5bfc | 9691 | """ |
5b5c9bc7 | 9692 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
d55e5bfc | 9693 | |
fc46b7f3 RD |
9694 | def CanSetTransparent(*args, **kwargs): |
9695 | """ | |
9696 | CanSetTransparent(self) -> bool | |
9697 | ||
9698 | Returns ``True`` if the platform supports setting the transparency for | |
9699 | this window. Note that this method will err on the side of caution, | |
9700 | so it is possible that this will return ``False`` when it is in fact | |
9701 | possible to set the transparency. | |
9702 | ||
9703 | NOTE: On X-windows systems the X server must have the composite | |
9704 | extension loaded, and there must be a composite manager program (such | |
9705 | as xcompmgr) running. | |
9706 | """ | |
9707 | return _core_.Window_CanSetTransparent(*args, **kwargs) | |
9708 | ||
9709 | def SetTransparent(*args, **kwargs): | |
9710 | """ | |
9711 | SetTransparent(self, byte alpha) -> bool | |
9712 | ||
9713 | Attempt to set the transparency of this window to the ``alpha`` value, | |
9714 | returns True on success. The ``alpha`` value is an integer in the | |
9715 | range of 0 to 255, where 0 is fully transparent and 255 is fully | |
9716 | opaque. | |
9717 | """ | |
9718 | return _core_.Window_SetTransparent(*args, **kwargs) | |
9719 | ||
d55e5bfc RD |
9720 | def PostCreate(self, pre): |
9721 | """ | |
9722 | Phase 3 of the 2-phase create <wink!> | |
9723 | Call this method after precreating the window with the 2-phase create method. | |
9724 | """ | |
9725 | self.this = pre.this | |
9726 | self.thisown = pre.thisown | |
9727 | pre.thisown = 0 | |
9728 | if hasattr(self, '_setOORInfo'): | |
9729 | self._setOORInfo(self) | |
9730 | if hasattr(self, '_setCallbackInfo'): | |
9731 | self._setCallbackInfo(self, self.__class__) | |
9732 | ||
7e08d4ef | 9733 | def SendSizeEvent(self): |
92515dfc | 9734 | self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1))) |
7e08d4ef | 9735 | |
2131d850 | 9736 | _core_.Window_swigregister(Window) |
d55e5bfc RD |
9737 | |
9738 | def PreWindow(*args, **kwargs): | |
9739 | """ | |
5b5c9bc7 | 9740 | PreWindow() -> Window |
d55e5bfc RD |
9741 | |
9742 | Precreate a Window for 2-phase creation. | |
9743 | """ | |
5b5c9bc7 | 9744 | val = _core_.new_PreWindow(*args, **kwargs) |
d55e5bfc RD |
9745 | return val |
9746 | ||
1bd55598 RD |
9747 | def Window_NewControlId(*args): |
9748 | """ | |
5b5c9bc7 | 9749 | Window_NewControlId() -> int |
d55e5bfc RD |
9750 | |
9751 | Generate a control id for the controls which were not given one. | |
9752 | """ | |
1bd55598 | 9753 | return _core_.Window_NewControlId(*args) |
d55e5bfc | 9754 | |
5b5c9bc7 | 9755 | def Window_NextControlId(*args, **kwargs): |
1bd55598 | 9756 | """ |
5b5c9bc7 | 9757 | Window_NextControlId(int winid) -> int |
d55e5bfc RD |
9758 | |
9759 | Get the id of the control following the one with the given | |
15817c7e | 9760 | autogenerated) id |
d55e5bfc | 9761 | """ |
1bd55598 | 9762 | return _core_.Window_NextControlId(*args, **kwargs) |
d55e5bfc | 9763 | |
5b5c9bc7 | 9764 | def Window_PrevControlId(*args, **kwargs): |
1bd55598 | 9765 | """ |
5b5c9bc7 | 9766 | Window_PrevControlId(int winid) -> int |
d55e5bfc RD |
9767 | |
9768 | Get the id of the control preceding the one with the given | |
15817c7e | 9769 | autogenerated) id |
d55e5bfc | 9770 | """ |
1bd55598 | 9771 | return _core_.Window_PrevControlId(*args, **kwargs) |
d55e5bfc | 9772 | |
1bd55598 RD |
9773 | def Window_FindFocus(*args): |
9774 | """ | |
5b5c9bc7 | 9775 | Window_FindFocus() -> Window |
d55e5bfc RD |
9776 | |
9777 | Returns the window or control that currently has the keyboard focus, | |
9778 | or None. | |
9779 | """ | |
1bd55598 | 9780 | return _core_.Window_FindFocus(*args) |
d55e5bfc | 9781 | |
1bd55598 RD |
9782 | def Window_GetCapture(*args): |
9783 | """ | |
5b5c9bc7 | 9784 | Window_GetCapture() -> Window |
d55e5bfc RD |
9785 | |
9786 | Returns the window which currently captures the mouse or None | |
9787 | """ | |
1bd55598 | 9788 | return _core_.Window_GetCapture(*args) |
d55e5bfc | 9789 | |
5b5c9bc7 | 9790 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
1bd55598 | 9791 | """ |
5b5c9bc7 | 9792 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
d55e5bfc | 9793 | |
15817c7e RD |
9794 | Get the default attributes for this class. This is useful if you want |
9795 | to use the same font or colour in your own control as in a standard | |
9796 | control -- which is a much better idea than hard coding specific | |
a5ee0656 RD |
9797 | colours or fonts which might look completely out of place on the |
9798 | user's system, especially if it uses themes. | |
d55e5bfc RD |
9799 | |
9800 | The variant parameter is only relevant under Mac currently and is | |
15817c7e | 9801 | ignore under other platforms. Under Mac, it will change the size of |
a5ee0656 RD |
9802 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9803 | this. | |
d55e5bfc | 9804 | """ |
1bd55598 | 9805 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
9806 | |
9807 | def DLG_PNT(win, point_or_x, y=None): | |
9808 | """ | |
9809 | Convenience function for converting a Point or (x,y) in | |
9810 | dialog units to pixel units. | |
9811 | """ | |
9812 | if y is None: | |
9813 | return win.ConvertDialogPointToPixels(point_or_x) | |
9814 | else: | |
9815 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) | |
9816 | ||
9817 | def DLG_SZE(win, size_width, height=None): | |
9818 | """ | |
9819 | Convenience function for converting a Size or (w,h) in | |
9820 | dialog units to pixel units. | |
9821 | """ | |
9822 | if height is None: | |
9823 | return win.ConvertDialogSizeToPixels(size_width) | |
9824 | else: | |
9825 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) | |
9826 | ||
9827 | ||
5b5c9bc7 | 9828 | def FindWindowById(*args, **kwargs): |
1bd55598 | 9829 | """ |
5b5c9bc7 | 9830 | FindWindowById(long id, Window parent=None) -> Window |
d55e5bfc RD |
9831 | |
9832 | Find the first window in the application with the given id. If parent | |
9833 | is None, the search will start from all top-level frames and dialog | |
9834 | boxes; if non-None, the search will be limited to the given window | |
9835 | hierarchy. The search is recursive in both cases. | |
9836 | """ | |
1bd55598 | 9837 | return _core_.FindWindowById(*args, **kwargs) |
d55e5bfc | 9838 | |
5b5c9bc7 | 9839 | def FindWindowByName(*args, **kwargs): |
1bd55598 | 9840 | """ |
5b5c9bc7 | 9841 | FindWindowByName(String name, Window parent=None) -> Window |
d55e5bfc RD |
9842 | |
9843 | Find a window by its name (as given in a window constructor or Create | |
9844 | function call). If parent is None, the search will start from all | |
9845 | top-level frames and dialog boxes; if non-None, the search will be | |
9846 | limited to the given window hierarchy. The search is recursive in both | |
9847 | cases. | |
9848 | ||
9849 | If no window with such name is found, wx.FindWindowByLabel is called. | |
9850 | """ | |
1bd55598 | 9851 | return _core_.FindWindowByName(*args, **kwargs) |
d55e5bfc | 9852 | |
5b5c9bc7 | 9853 | def FindWindowByLabel(*args, **kwargs): |
1bd55598 | 9854 | """ |
5b5c9bc7 | 9855 | FindWindowByLabel(String label, Window parent=None) -> Window |
d55e5bfc RD |
9856 | |
9857 | Find a window by its label. Depending on the type of window, the label | |
9858 | may be a window title or panel item label. If parent is None, the | |
9859 | search will start from all top-level frames and dialog boxes; if | |
9860 | non-None, the search will be limited to the given window | |
9861 | hierarchy. The search is recursive in both cases. | |
9862 | """ | |
1bd55598 | 9863 | return _core_.FindWindowByLabel(*args, **kwargs) |
d55e5bfc | 9864 | |
5b5c9bc7 | 9865 | def Window_FromHWND(*args, **kwargs): |
1bd55598 RD |
9866 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" |
9867 | return _core_.Window_FromHWND(*args, **kwargs) | |
3215336e | 9868 | |
1bd55598 RD |
9869 | def GetTopLevelWindows(*args): |
9870 | """ | |
3215336e RD |
9871 | GetTopLevelWindows() -> PyObject |
9872 | ||
9873 | Returns a list of the the application's top-level windows, (frames, | |
9874 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
9875 | by wxWidgets, and so it is only valid as long as no top-level windows | |
9876 | are closed or new top-level windows are created. | |
9877 | ||
9878 | """ | |
1bd55598 | 9879 | return _core_.GetTopLevelWindows(*args) |
d55e5bfc RD |
9880 | #--------------------------------------------------------------------------- |
9881 | ||
5b5c9bc7 RD |
9882 | class Validator(EvtHandler): |
9883 | """Proxy of C++ Validator class""" | |
1bd55598 RD |
9884 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
9885 | __repr__ = _swig_repr | |
9886 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 9887 | """__init__(self) -> Validator""" |
1bd55598 | 9888 | _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs)) |
d55e5bfc RD |
9889 | self._setOORInfo(self) |
9890 | ||
9891 | def Clone(*args, **kwargs): | |
5b5c9bc7 RD |
9892 | """Clone(self) -> Validator""" |
9893 | return _core_.Validator_Clone(*args, **kwargs) | |
d55e5bfc RD |
9894 | |
9895 | def Validate(*args, **kwargs): | |
5b5c9bc7 RD |
9896 | """Validate(self, Window parent) -> bool""" |
9897 | return _core_.Validator_Validate(*args, **kwargs) | |
d55e5bfc RD |
9898 | |
9899 | def TransferToWindow(*args, **kwargs): | |
9900 | """TransferToWindow(self) -> bool""" | |
5b5c9bc7 | 9901 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
d55e5bfc RD |
9902 | |
9903 | def TransferFromWindow(*args, **kwargs): | |
9904 | """TransferFromWindow(self) -> bool""" | |
5b5c9bc7 | 9905 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
d55e5bfc RD |
9906 | |
9907 | def GetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
9908 | """GetWindow(self) -> Window""" |
9909 | return _core_.Validator_GetWindow(*args, **kwargs) | |
d55e5bfc RD |
9910 | |
9911 | def SetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
9912 | """SetWindow(self, Window window)""" |
9913 | return _core_.Validator_SetWindow(*args, **kwargs) | |
d55e5bfc RD |
9914 | |
9915 | def IsSilent(*args, **kwargs): | |
d6c14a4c | 9916 | """IsSilent() -> bool""" |
5b5c9bc7 | 9917 | return _core_.Validator_IsSilent(*args, **kwargs) |
d55e5bfc RD |
9918 | |
9919 | IsSilent = staticmethod(IsSilent) | |
9920 | def SetBellOnError(*args, **kwargs): | |
d6c14a4c | 9921 | """SetBellOnError(int doIt=True)""" |
5b5c9bc7 | 9922 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
d55e5bfc RD |
9923 | |
9924 | SetBellOnError = staticmethod(SetBellOnError) | |
2131d850 | 9925 | _core_.Validator_swigregister(Validator) |
d55e5bfc | 9926 | |
1bd55598 RD |
9927 | def Validator_IsSilent(*args): |
9928 | """Validator_IsSilent() -> bool""" | |
9929 | return _core_.Validator_IsSilent(*args) | |
d55e5bfc | 9930 | |
5b5c9bc7 | 9931 | def Validator_SetBellOnError(*args, **kwargs): |
1bd55598 RD |
9932 | """Validator_SetBellOnError(int doIt=True)""" |
9933 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
d55e5bfc | 9934 | |
5b5c9bc7 RD |
9935 | class PyValidator(Validator): |
9936 | """Proxy of C++ PyValidator class""" | |
1bd55598 RD |
9937 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
9938 | __repr__ = _swig_repr | |
9939 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 9940 | """__init__(self) -> PyValidator""" |
1bd55598 | 9941 | _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs)) |
d55e5bfc RD |
9942 | |
9943 | self._setCallbackInfo(self, PyValidator, 1) | |
9944 | self._setOORInfo(self) | |
9945 | ||
9946 | def _setCallbackInfo(*args, **kwargs): | |
9947 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" | |
5b5c9bc7 | 9948 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
d55e5bfc | 9949 | |
2131d850 | 9950 | _core_.PyValidator_swigregister(PyValidator) |
d55e5bfc RD |
9951 | |
9952 | #--------------------------------------------------------------------------- | |
9953 | ||
5b5c9bc7 RD |
9954 | class Menu(EvtHandler): |
9955 | """Proxy of C++ Menu class""" | |
1bd55598 RD |
9956 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
9957 | __repr__ = _swig_repr | |
9958 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 9959 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
1bd55598 | 9960 | _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs)) |
d55e5bfc RD |
9961 | self._setOORInfo(self) |
9962 | ||
9963 | def Append(*args, **kwargs): | |
5b5c9bc7 RD |
9964 | """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
9965 | return _core_.Menu_Append(*args, **kwargs) | |
d55e5bfc RD |
9966 | |
9967 | def AppendSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
9968 | """AppendSeparator(self) -> MenuItem""" |
9969 | return _core_.Menu_AppendSeparator(*args, **kwargs) | |
d55e5bfc RD |
9970 | |
9971 | def AppendCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
9972 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
9973 | return _core_.Menu_AppendCheckItem(*args, **kwargs) | |
d55e5bfc RD |
9974 | |
9975 | def AppendRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
9976 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
9977 | return _core_.Menu_AppendRadioItem(*args, **kwargs) | |
d55e5bfc RD |
9978 | |
9979 | def AppendMenu(*args, **kwargs): | |
5b5c9bc7 RD |
9980 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
9981 | return _core_.Menu_AppendMenu(*args, **kwargs) | |
d55e5bfc | 9982 | |
da91cb0f RD |
9983 | def AppendSubMenu(*args, **kwargs): |
9984 | """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem""" | |
9985 | return _core_.Menu_AppendSubMenu(*args, **kwargs) | |
9986 | ||
d55e5bfc | 9987 | def AppendItem(*args, **kwargs): |
5b5c9bc7 RD |
9988 | """AppendItem(self, MenuItem item) -> MenuItem""" |
9989 | return _core_.Menu_AppendItem(*args, **kwargs) | |
d55e5bfc | 9990 | |
d55e5bfc | 9991 | def InsertItem(*args, **kwargs): |
5b5c9bc7 RD |
9992 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
9993 | return _core_.Menu_InsertItem(*args, **kwargs) | |
d55e5bfc | 9994 | |
1bd55598 RD |
9995 | def PrependItem(*args, **kwargs): |
9996 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
9997 | return _core_.Menu_PrependItem(*args, **kwargs) | |
9998 | ||
9999 | def Break(*args, **kwargs): | |
10000 | """Break(self)""" | |
10001 | return _core_.Menu_Break(*args, **kwargs) | |
10002 | ||
d55e5bfc RD |
10003 | def Insert(*args, **kwargs): |
10004 | """ | |
5b5c9bc7 RD |
10005 | Insert(self, size_t pos, int id, String text, String help=EmptyString, |
10006 | int kind=ITEM_NORMAL) -> MenuItem | |
d55e5bfc | 10007 | """ |
5b5c9bc7 | 10008 | return _core_.Menu_Insert(*args, **kwargs) |
d55e5bfc RD |
10009 | |
10010 | def InsertSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
10011 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
10012 | return _core_.Menu_InsertSeparator(*args, **kwargs) | |
d55e5bfc RD |
10013 | |
10014 | def InsertCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
10015 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
10016 | return _core_.Menu_InsertCheckItem(*args, **kwargs) | |
d55e5bfc RD |
10017 | |
10018 | def InsertRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
10019 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
10020 | return _core_.Menu_InsertRadioItem(*args, **kwargs) | |
d55e5bfc RD |
10021 | |
10022 | def InsertMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10023 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
10024 | return _core_.Menu_InsertMenu(*args, **kwargs) | |
d55e5bfc | 10025 | |
d55e5bfc | 10026 | def Prepend(*args, **kwargs): |
5b5c9bc7 RD |
10027 | """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
10028 | return _core_.Menu_Prepend(*args, **kwargs) | |
d55e5bfc RD |
10029 | |
10030 | def PrependSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
10031 | """PrependSeparator(self) -> MenuItem""" |
10032 | return _core_.Menu_PrependSeparator(*args, **kwargs) | |
d55e5bfc RD |
10033 | |
10034 | def PrependCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
10035 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10036 | return _core_.Menu_PrependCheckItem(*args, **kwargs) | |
d55e5bfc RD |
10037 | |
10038 | def PrependRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
10039 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10040 | return _core_.Menu_PrependRadioItem(*args, **kwargs) | |
d55e5bfc RD |
10041 | |
10042 | def PrependMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10043 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
10044 | return _core_.Menu_PrependMenu(*args, **kwargs) | |
d55e5bfc RD |
10045 | |
10046 | def Remove(*args, **kwargs): | |
5b5c9bc7 RD |
10047 | """Remove(self, int id) -> MenuItem""" |
10048 | return _core_.Menu_Remove(*args, **kwargs) | |
d55e5bfc RD |
10049 | |
10050 | def RemoveItem(*args, **kwargs): | |
5b5c9bc7 RD |
10051 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
10052 | return _core_.Menu_RemoveItem(*args, **kwargs) | |
d55e5bfc RD |
10053 | |
10054 | def Delete(*args, **kwargs): | |
10055 | """Delete(self, int id) -> bool""" | |
5b5c9bc7 | 10056 | return _core_.Menu_Delete(*args, **kwargs) |
d55e5bfc RD |
10057 | |
10058 | def DeleteItem(*args, **kwargs): | |
5b5c9bc7 RD |
10059 | """DeleteItem(self, MenuItem item) -> bool""" |
10060 | return _core_.Menu_DeleteItem(*args, **kwargs) | |
d55e5bfc RD |
10061 | |
10062 | def Destroy(*args, **kwargs): | |
10063 | """ | |
10064 | Destroy(self) | |
10065 | ||
10066 | Deletes the C++ object this Python object is a proxy for. | |
10067 | """ | |
7e08d4ef RD |
10068 | val = _core_.Menu_Destroy(*args, **kwargs) |
10069 | args[0].thisown = 0 | |
10070 | return val | |
d55e5bfc RD |
10071 | |
10072 | def DestroyId(*args, **kwargs): | |
10073 | """ | |
10074 | DestroyId(self, int id) -> bool | |
10075 | ||
10076 | Deletes the C++ object this Python object is a proxy for. | |
10077 | """ | |
7e08d4ef RD |
10078 | val = _core_.Menu_DestroyId(*args, **kwargs) |
10079 | args[0].thisown = 0 | |
10080 | return val | |
d55e5bfc RD |
10081 | |
10082 | def DestroyItem(*args, **kwargs): | |
10083 | """ | |
5b5c9bc7 | 10084 | DestroyItem(self, MenuItem item) -> bool |
d55e5bfc RD |
10085 | |
10086 | Deletes the C++ object this Python object is a proxy for. | |
10087 | """ | |
7e08d4ef RD |
10088 | val = _core_.Menu_DestroyItem(*args, **kwargs) |
10089 | args[0].thisown = 0 | |
10090 | return val | |
d55e5bfc RD |
10091 | |
10092 | def GetMenuItemCount(*args, **kwargs): | |
10093 | """GetMenuItemCount(self) -> size_t""" | |
5b5c9bc7 | 10094 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
d55e5bfc RD |
10095 | |
10096 | def GetMenuItems(*args, **kwargs): | |
10097 | """GetMenuItems(self) -> PyObject""" | |
5b5c9bc7 | 10098 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
d55e5bfc RD |
10099 | |
10100 | def FindItem(*args, **kwargs): | |
5b5c9bc7 RD |
10101 | """FindItem(self, String item) -> int""" |
10102 | return _core_.Menu_FindItem(*args, **kwargs) | |
d55e5bfc RD |
10103 | |
10104 | def FindItemById(*args, **kwargs): | |
5b5c9bc7 RD |
10105 | """FindItemById(self, int id) -> MenuItem""" |
10106 | return _core_.Menu_FindItemById(*args, **kwargs) | |
d55e5bfc RD |
10107 | |
10108 | def FindItemByPosition(*args, **kwargs): | |
5b5c9bc7 RD |
10109 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
10110 | return _core_.Menu_FindItemByPosition(*args, **kwargs) | |
d55e5bfc RD |
10111 | |
10112 | def Enable(*args, **kwargs): | |
10113 | """Enable(self, int id, bool enable)""" | |
5b5c9bc7 | 10114 | return _core_.Menu_Enable(*args, **kwargs) |
d55e5bfc RD |
10115 | |
10116 | def IsEnabled(*args, **kwargs): | |
10117 | """IsEnabled(self, int id) -> bool""" | |
5b5c9bc7 | 10118 | return _core_.Menu_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10119 | |
10120 | def Check(*args, **kwargs): | |
10121 | """Check(self, int id, bool check)""" | |
5b5c9bc7 | 10122 | return _core_.Menu_Check(*args, **kwargs) |
d55e5bfc RD |
10123 | |
10124 | def IsChecked(*args, **kwargs): | |
10125 | """IsChecked(self, int id) -> bool""" | |
5b5c9bc7 | 10126 | return _core_.Menu_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10127 | |
10128 | def SetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10129 | """SetLabel(self, int id, String label)""" |
10130 | return _core_.Menu_SetLabel(*args, **kwargs) | |
d55e5bfc RD |
10131 | |
10132 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10133 | """GetLabel(self, int id) -> String""" |
10134 | return _core_.Menu_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10135 | |
10136 | def SetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10137 | """SetHelpString(self, int id, String helpString)""" |
10138 | return _core_.Menu_SetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10139 | |
10140 | def GetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10141 | """GetHelpString(self, int id) -> String""" |
10142 | return _core_.Menu_GetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10143 | |
10144 | def SetTitle(*args, **kwargs): | |
5b5c9bc7 RD |
10145 | """SetTitle(self, String title)""" |
10146 | return _core_.Menu_SetTitle(*args, **kwargs) | |
d55e5bfc RD |
10147 | |
10148 | def GetTitle(*args, **kwargs): | |
5b5c9bc7 RD |
10149 | """GetTitle(self) -> String""" |
10150 | return _core_.Menu_GetTitle(*args, **kwargs) | |
d55e5bfc RD |
10151 | |
10152 | def SetEventHandler(*args, **kwargs): | |
5b5c9bc7 RD |
10153 | """SetEventHandler(self, EvtHandler handler)""" |
10154 | return _core_.Menu_SetEventHandler(*args, **kwargs) | |
d55e5bfc RD |
10155 | |
10156 | def GetEventHandler(*args, **kwargs): | |
5b5c9bc7 RD |
10157 | """GetEventHandler(self) -> EvtHandler""" |
10158 | return _core_.Menu_GetEventHandler(*args, **kwargs) | |
d55e5bfc RD |
10159 | |
10160 | def SetInvokingWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10161 | """SetInvokingWindow(self, Window win)""" |
10162 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) | |
d55e5bfc RD |
10163 | |
10164 | def GetInvokingWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10165 | """GetInvokingWindow(self) -> Window""" |
10166 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) | |
d55e5bfc RD |
10167 | |
10168 | def GetStyle(*args, **kwargs): | |
10169 | """GetStyle(self) -> long""" | |
5b5c9bc7 | 10170 | return _core_.Menu_GetStyle(*args, **kwargs) |
d55e5bfc RD |
10171 | |
10172 | def UpdateUI(*args, **kwargs): | |
5b5c9bc7 RD |
10173 | """UpdateUI(self, EvtHandler source=None)""" |
10174 | return _core_.Menu_UpdateUI(*args, **kwargs) | |
d55e5bfc RD |
10175 | |
10176 | def GetMenuBar(*args, **kwargs): | |
5b5c9bc7 RD |
10177 | """GetMenuBar(self) -> MenuBar""" |
10178 | return _core_.Menu_GetMenuBar(*args, **kwargs) | |
d55e5bfc RD |
10179 | |
10180 | def Attach(*args, **kwargs): | |
10181 | """Attach(self, wxMenuBarBase menubar)""" | |
5b5c9bc7 | 10182 | return _core_.Menu_Attach(*args, **kwargs) |
d55e5bfc RD |
10183 | |
10184 | def Detach(*args, **kwargs): | |
10185 | """Detach(self)""" | |
5b5c9bc7 | 10186 | return _core_.Menu_Detach(*args, **kwargs) |
d55e5bfc RD |
10187 | |
10188 | def IsAttached(*args, **kwargs): | |
10189 | """IsAttached(self) -> bool""" | |
5b5c9bc7 | 10190 | return _core_.Menu_IsAttached(*args, **kwargs) |
d55e5bfc RD |
10191 | |
10192 | def SetParent(*args, **kwargs): | |
5b5c9bc7 RD |
10193 | """SetParent(self, Menu parent)""" |
10194 | return _core_.Menu_SetParent(*args, **kwargs) | |
d55e5bfc RD |
10195 | |
10196 | def GetParent(*args, **kwargs): | |
5b5c9bc7 RD |
10197 | """GetParent(self) -> Menu""" |
10198 | return _core_.Menu_GetParent(*args, **kwargs) | |
d55e5bfc | 10199 | |
2131d850 | 10200 | _core_.Menu_swigregister(Menu) |
5b5c9bc7 | 10201 | DefaultValidator = cvar.DefaultValidator |
d55e5bfc RD |
10202 | |
10203 | #--------------------------------------------------------------------------- | |
10204 | ||
5b5c9bc7 RD |
10205 | class MenuBar(Window): |
10206 | """Proxy of C++ MenuBar class""" | |
1bd55598 RD |
10207 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10208 | __repr__ = _swig_repr | |
10209 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 10210 | """__init__(self, long style=0) -> MenuBar""" |
1bd55598 | 10211 | _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs)) |
d55e5bfc RD |
10212 | self._setOORInfo(self) |
10213 | ||
10214 | def Append(*args, **kwargs): | |
5b5c9bc7 RD |
10215 | """Append(self, Menu menu, String title) -> bool""" |
10216 | return _core_.MenuBar_Append(*args, **kwargs) | |
d55e5bfc RD |
10217 | |
10218 | def Insert(*args, **kwargs): | |
5b5c9bc7 RD |
10219 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
10220 | return _core_.MenuBar_Insert(*args, **kwargs) | |
d55e5bfc RD |
10221 | |
10222 | def GetMenuCount(*args, **kwargs): | |
10223 | """GetMenuCount(self) -> size_t""" | |
5b5c9bc7 | 10224 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
d55e5bfc RD |
10225 | |
10226 | def GetMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10227 | """GetMenu(self, size_t pos) -> Menu""" |
10228 | return _core_.MenuBar_GetMenu(*args, **kwargs) | |
d55e5bfc RD |
10229 | |
10230 | def Replace(*args, **kwargs): | |
5b5c9bc7 RD |
10231 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
10232 | return _core_.MenuBar_Replace(*args, **kwargs) | |
d55e5bfc RD |
10233 | |
10234 | def Remove(*args, **kwargs): | |
5b5c9bc7 RD |
10235 | """Remove(self, size_t pos) -> Menu""" |
10236 | return _core_.MenuBar_Remove(*args, **kwargs) | |
d55e5bfc RD |
10237 | |
10238 | def EnableTop(*args, **kwargs): | |
10239 | """EnableTop(self, size_t pos, bool enable)""" | |
5b5c9bc7 | 10240 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
d55e5bfc RD |
10241 | |
10242 | def IsEnabledTop(*args, **kwargs): | |
10243 | """IsEnabledTop(self, size_t pos) -> bool""" | |
5b5c9bc7 | 10244 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
d55e5bfc RD |
10245 | |
10246 | def SetLabelTop(*args, **kwargs): | |
5b5c9bc7 RD |
10247 | """SetLabelTop(self, size_t pos, String label)""" |
10248 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) | |
d55e5bfc RD |
10249 | |
10250 | def GetLabelTop(*args, **kwargs): | |
5b5c9bc7 RD |
10251 | """GetLabelTop(self, size_t pos) -> String""" |
10252 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) | |
d55e5bfc RD |
10253 | |
10254 | def FindMenuItem(*args, **kwargs): | |
5b5c9bc7 RD |
10255 | """FindMenuItem(self, String menu, String item) -> int""" |
10256 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) | |
d55e5bfc RD |
10257 | |
10258 | def FindItemById(*args, **kwargs): | |
5b5c9bc7 RD |
10259 | """FindItemById(self, int id) -> MenuItem""" |
10260 | return _core_.MenuBar_FindItemById(*args, **kwargs) | |
d55e5bfc RD |
10261 | |
10262 | def FindMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10263 | """FindMenu(self, String title) -> int""" |
10264 | return _core_.MenuBar_FindMenu(*args, **kwargs) | |
d55e5bfc RD |
10265 | |
10266 | def Enable(*args, **kwargs): | |
10267 | """Enable(self, int id, bool enable)""" | |
5b5c9bc7 | 10268 | return _core_.MenuBar_Enable(*args, **kwargs) |
d55e5bfc RD |
10269 | |
10270 | def Check(*args, **kwargs): | |
10271 | """Check(self, int id, bool check)""" | |
5b5c9bc7 | 10272 | return _core_.MenuBar_Check(*args, **kwargs) |
d55e5bfc RD |
10273 | |
10274 | def IsChecked(*args, **kwargs): | |
10275 | """IsChecked(self, int id) -> bool""" | |
5b5c9bc7 | 10276 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10277 | |
10278 | def IsEnabled(*args, **kwargs): | |
10279 | """IsEnabled(self, int id) -> bool""" | |
5b5c9bc7 | 10280 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10281 | |
10282 | def SetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10283 | """SetLabel(self, int id, String label)""" |
10284 | return _core_.MenuBar_SetLabel(*args, **kwargs) | |
d55e5bfc RD |
10285 | |
10286 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10287 | """GetLabel(self, int id) -> String""" |
10288 | return _core_.MenuBar_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10289 | |
10290 | def SetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10291 | """SetHelpString(self, int id, String helpString)""" |
10292 | return _core_.MenuBar_SetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10293 | |
10294 | def GetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10295 | """GetHelpString(self, int id) -> String""" |
10296 | return _core_.MenuBar_GetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10297 | |
10298 | def GetFrame(*args, **kwargs): | |
10299 | """GetFrame(self) -> wxFrame""" | |
5b5c9bc7 | 10300 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
d55e5bfc RD |
10301 | |
10302 | def IsAttached(*args, **kwargs): | |
10303 | """IsAttached(self) -> bool""" | |
5b5c9bc7 | 10304 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
d55e5bfc RD |
10305 | |
10306 | def Attach(*args, **kwargs): | |
10307 | """Attach(self, wxFrame frame)""" | |
5b5c9bc7 | 10308 | return _core_.MenuBar_Attach(*args, **kwargs) |
d55e5bfc RD |
10309 | |
10310 | def Detach(*args, **kwargs): | |
10311 | """Detach(self)""" | |
5b5c9bc7 | 10312 | return _core_.MenuBar_Detach(*args, **kwargs) |
d55e5bfc | 10313 | |
587d0f36 RD |
10314 | def UpdateMenus(*args, **kwargs): |
10315 | """UpdateMenus(self)""" | |
10316 | return _core_.MenuBar_UpdateMenus(*args, **kwargs) | |
10317 | ||
4f433fef RD |
10318 | def SetAutoWindowMenu(*args, **kwargs): |
10319 | """SetAutoWindowMenu(bool enable)""" | |
10320 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10321 | ||
10322 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
10323 | def GetAutoWindowMenu(*args, **kwargs): | |
10324 | """GetAutoWindowMenu() -> bool""" | |
10325 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10326 | ||
10327 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
2131d850 | 10328 | _core_.MenuBar_swigregister(MenuBar) |
d55e5bfc | 10329 | |
4f433fef | 10330 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
1bd55598 RD |
10331 | """MenuBar_SetAutoWindowMenu(bool enable)""" |
10332 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
4f433fef | 10333 | |
1bd55598 RD |
10334 | def MenuBar_GetAutoWindowMenu(*args): |
10335 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
10336 | return _core_.MenuBar_GetAutoWindowMenu(*args) | |
4f433fef | 10337 | |
d55e5bfc RD |
10338 | #--------------------------------------------------------------------------- |
10339 | ||
5b5c9bc7 RD |
10340 | class MenuItem(Object): |
10341 | """Proxy of C++ MenuItem class""" | |
1bd55598 RD |
10342 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10343 | __repr__ = _swig_repr | |
10344 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 10345 | """ |
5b5c9bc7 RD |
10346 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, |
10347 | String help=EmptyString, int kind=ITEM_NORMAL, | |
10348 | Menu subMenu=None) -> MenuItem | |
d55e5bfc | 10349 | """ |
1bd55598 RD |
10350 | _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs)) |
10351 | __swig_destroy__ = _core_.delete_MenuItem | |
10352 | __del__ = lambda self : None; | |
d55e5bfc | 10353 | def GetMenu(*args, **kwargs): |
5b5c9bc7 RD |
10354 | """GetMenu(self) -> Menu""" |
10355 | return _core_.MenuItem_GetMenu(*args, **kwargs) | |
d55e5bfc RD |
10356 | |
10357 | def SetMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10358 | """SetMenu(self, Menu menu)""" |
10359 | return _core_.MenuItem_SetMenu(*args, **kwargs) | |
d55e5bfc RD |
10360 | |
10361 | def SetId(*args, **kwargs): | |
10362 | """SetId(self, int id)""" | |
5b5c9bc7 | 10363 | return _core_.MenuItem_SetId(*args, **kwargs) |
d55e5bfc RD |
10364 | |
10365 | def GetId(*args, **kwargs): | |
10366 | """GetId(self) -> int""" | |
5b5c9bc7 | 10367 | return _core_.MenuItem_GetId(*args, **kwargs) |
d55e5bfc RD |
10368 | |
10369 | def IsSeparator(*args, **kwargs): | |
10370 | """IsSeparator(self) -> bool""" | |
5b5c9bc7 | 10371 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
d55e5bfc RD |
10372 | |
10373 | def SetText(*args, **kwargs): | |
5b5c9bc7 RD |
10374 | """SetText(self, String str)""" |
10375 | return _core_.MenuItem_SetText(*args, **kwargs) | |
d55e5bfc RD |
10376 | |
10377 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10378 | """GetLabel(self) -> String""" |
10379 | return _core_.MenuItem_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10380 | |
10381 | def GetText(*args, **kwargs): | |
5b5c9bc7 RD |
10382 | """GetText(self) -> String""" |
10383 | return _core_.MenuItem_GetText(*args, **kwargs) | |
d55e5bfc RD |
10384 | |
10385 | def GetLabelFromText(*args, **kwargs): | |
5b5c9bc7 RD |
10386 | """GetLabelFromText(String text) -> String""" |
10387 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d55e5bfc RD |
10388 | |
10389 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10390 | def GetKind(*args, **kwargs): | |
10391 | """GetKind(self) -> int""" | |
5b5c9bc7 | 10392 | return _core_.MenuItem_GetKind(*args, **kwargs) |
d55e5bfc RD |
10393 | |
10394 | def SetKind(*args, **kwargs): | |
10395 | """SetKind(self, int kind)""" | |
5b5c9bc7 | 10396 | return _core_.MenuItem_SetKind(*args, **kwargs) |
d55e5bfc RD |
10397 | |
10398 | def SetCheckable(*args, **kwargs): | |
10399 | """SetCheckable(self, bool checkable)""" | |
5b5c9bc7 | 10400 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
d55e5bfc RD |
10401 | |
10402 | def IsCheckable(*args, **kwargs): | |
10403 | """IsCheckable(self) -> bool""" | |
5b5c9bc7 | 10404 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
d55e5bfc RD |
10405 | |
10406 | def IsSubMenu(*args, **kwargs): | |
10407 | """IsSubMenu(self) -> bool""" | |
5b5c9bc7 | 10408 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
d55e5bfc RD |
10409 | |
10410 | def SetSubMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10411 | """SetSubMenu(self, Menu menu)""" |
10412 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) | |
d55e5bfc RD |
10413 | |
10414 | def GetSubMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10415 | """GetSubMenu(self) -> Menu""" |
10416 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) | |
d55e5bfc RD |
10417 | |
10418 | def Enable(*args, **kwargs): | |
10419 | """Enable(self, bool enable=True)""" | |
5b5c9bc7 | 10420 | return _core_.MenuItem_Enable(*args, **kwargs) |
d55e5bfc RD |
10421 | |
10422 | def IsEnabled(*args, **kwargs): | |
10423 | """IsEnabled(self) -> bool""" | |
5b5c9bc7 | 10424 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10425 | |
10426 | def Check(*args, **kwargs): | |
10427 | """Check(self, bool check=True)""" | |
5b5c9bc7 | 10428 | return _core_.MenuItem_Check(*args, **kwargs) |
d55e5bfc RD |
10429 | |
10430 | def IsChecked(*args, **kwargs): | |
10431 | """IsChecked(self) -> bool""" | |
5b5c9bc7 | 10432 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10433 | |
10434 | def Toggle(*args, **kwargs): | |
10435 | """Toggle(self)""" | |
5b5c9bc7 | 10436 | return _core_.MenuItem_Toggle(*args, **kwargs) |
d55e5bfc RD |
10437 | |
10438 | def SetHelp(*args, **kwargs): | |
5b5c9bc7 RD |
10439 | """SetHelp(self, String str)""" |
10440 | return _core_.MenuItem_SetHelp(*args, **kwargs) | |
d55e5bfc RD |
10441 | |
10442 | def GetHelp(*args, **kwargs): | |
5b5c9bc7 RD |
10443 | """GetHelp(self) -> String""" |
10444 | return _core_.MenuItem_GetHelp(*args, **kwargs) | |
d55e5bfc RD |
10445 | |
10446 | def GetAccel(*args, **kwargs): | |
5b5c9bc7 RD |
10447 | """GetAccel(self) -> AcceleratorEntry""" |
10448 | return _core_.MenuItem_GetAccel(*args, **kwargs) | |
d55e5bfc RD |
10449 | |
10450 | def SetAccel(*args, **kwargs): | |
5b5c9bc7 RD |
10451 | """SetAccel(self, AcceleratorEntry accel)""" |
10452 | return _core_.MenuItem_SetAccel(*args, **kwargs) | |
d55e5bfc | 10453 | |
32fe5131 RD |
10454 | def SetBitmap(*args, **kwargs): |
10455 | """SetBitmap(self, Bitmap bitmap)""" | |
10456 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
10457 | ||
10458 | def GetBitmap(*args, **kwargs): | |
10459 | """GetBitmap(self) -> Bitmap""" | |
10460 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
10461 | ||
c1280d1e | 10462 | def SetFont(*args, **kwargs): |
5b5c9bc7 RD |
10463 | """SetFont(self, Font font)""" |
10464 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
c1280d1e RD |
10465 | |
10466 | def GetFont(*args, **kwargs): | |
5b5c9bc7 RD |
10467 | """GetFont(self) -> Font""" |
10468 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
c1280d1e RD |
10469 | |
10470 | def SetTextColour(*args, **kwargs): | |
5b5c9bc7 RD |
10471 | """SetTextColour(self, Colour colText)""" |
10472 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
c1280d1e RD |
10473 | |
10474 | def GetTextColour(*args, **kwargs): | |
5b5c9bc7 RD |
10475 | """GetTextColour(self) -> Colour""" |
10476 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
c1280d1e RD |
10477 | |
10478 | def SetBackgroundColour(*args, **kwargs): | |
5b5c9bc7 RD |
10479 | """SetBackgroundColour(self, Colour colBack)""" |
10480 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
c1280d1e RD |
10481 | |
10482 | def GetBackgroundColour(*args, **kwargs): | |
5b5c9bc7 RD |
10483 | """GetBackgroundColour(self) -> Colour""" |
10484 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
c1280d1e RD |
10485 | |
10486 | def SetBitmaps(*args, **kwargs): | |
5b5c9bc7 RD |
10487 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" |
10488 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
c1280d1e RD |
10489 | |
10490 | def SetDisabledBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
10491 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" |
10492 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
c1280d1e RD |
10493 | |
10494 | def GetDisabledBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
10495 | """GetDisabledBitmap(self) -> Bitmap""" |
10496 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
c1280d1e RD |
10497 | |
10498 | def SetMarginWidth(*args, **kwargs): | |
10499 | """SetMarginWidth(self, int nWidth)""" | |
5b5c9bc7 | 10500 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) |
c1280d1e RD |
10501 | |
10502 | def GetMarginWidth(*args, **kwargs): | |
10503 | """GetMarginWidth(self) -> int""" | |
5b5c9bc7 | 10504 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) |
c1280d1e | 10505 | |
d55e5bfc | 10506 | def GetDefaultMarginWidth(*args, **kwargs): |
d6c14a4c | 10507 | """GetDefaultMarginWidth() -> int""" |
5b5c9bc7 | 10508 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
d55e5bfc RD |
10509 | |
10510 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
10511 | def IsOwnerDrawn(*args, **kwargs): |
10512 | """IsOwnerDrawn(self) -> bool""" | |
5b5c9bc7 | 10513 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) |
c1280d1e RD |
10514 | |
10515 | def SetOwnerDrawn(*args, **kwargs): | |
10516 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
5b5c9bc7 | 10517 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) |
c1280d1e RD |
10518 | |
10519 | def ResetOwnerDrawn(*args, **kwargs): | |
10520 | """ResetOwnerDrawn(self)""" | |
5b5c9bc7 | 10521 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) |
c1280d1e | 10522 | |
2131d850 | 10523 | _core_.MenuItem_swigregister(MenuItem) |
d55e5bfc | 10524 | |
5b5c9bc7 | 10525 | def MenuItem_GetLabelFromText(*args, **kwargs): |
1bd55598 RD |
10526 | """MenuItem_GetLabelFromText(String text) -> String""" |
10527 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d55e5bfc | 10528 | |
1bd55598 RD |
10529 | def MenuItem_GetDefaultMarginWidth(*args): |
10530 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
10531 | return _core_.MenuItem_GetDefaultMarginWidth(*args) | |
d55e5bfc RD |
10532 | |
10533 | #--------------------------------------------------------------------------- | |
10534 | ||
5b5c9bc7 | 10535 | class Control(Window): |
d55e5bfc RD |
10536 | """ |
10537 | This is the base class for a control or 'widget'. | |
10538 | ||
15817c7e RD |
10539 | A control is generally a small window which processes user input |
10540 | and/or displays one or more item of data. | |
d55e5bfc | 10541 | """ |
1bd55598 RD |
10542 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10543 | __repr__ = _swig_repr | |
10544 | def __init__(self, *args, **kwargs): | |
d55e5bfc | 10545 | """ |
5b5c9bc7 RD |
10546 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10547 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
10548 | String name=ControlNameStr) -> Control | |
d55e5bfc | 10549 | |
15817c7e RD |
10550 | Create a Control. Normally you should only call this from a subclass' |
10551 | __init__ as a plain old wx.Control is not very useful. | |
d55e5bfc | 10552 | """ |
1bd55598 | 10553 | _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs)) |
d55e5bfc RD |
10554 | self._setOORInfo(self) |
10555 | ||
10556 | def Create(*args, **kwargs): | |
10557 | """ | |
5b5c9bc7 RD |
10558 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10559 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
10560 | String name=ControlNameStr) -> bool | |
d55e5bfc RD |
10561 | |
10562 | Do the 2nd phase and create the GUI control. | |
10563 | """ | |
5b5c9bc7 | 10564 | return _core_.Control_Create(*args, **kwargs) |
d55e5bfc | 10565 | |
1eeb270e RD |
10566 | def GetAlignment(*args, **kwargs): |
10567 | """ | |
10568 | GetAlignment(self) -> int | |
10569 | ||
10570 | Get the control alignment (left/right/centre, top/bottom/centre) | |
10571 | """ | |
10572 | return _core_.Control_GetAlignment(*args, **kwargs) | |
10573 | ||
34e0a3bb | 10574 | def GetLabelText(*args, **kwargs): |
1eeb270e | 10575 | """ |
1eeb270e RD |
10576 | GetLabelText(self) -> String |
10577 | ||
10578 | Get just the text of the label, without mnemonic characters ('&') | |
10579 | """ | |
34e0a3bb | 10580 | return _core_.Control_GetLabelText(*args, **kwargs) |
1eeb270e | 10581 | |
d55e5bfc RD |
10582 | def Command(*args, **kwargs): |
10583 | """ | |
5b5c9bc7 | 10584 | Command(self, CommandEvent event) |
d55e5bfc | 10585 | |
15817c7e RD |
10586 | Simulates the effect of the user issuing a command to the item. |
10587 | ||
10588 | :see: `wx.CommandEvent` | |
10589 | ||
d55e5bfc | 10590 | """ |
5b5c9bc7 | 10591 | return _core_.Control_Command(*args, **kwargs) |
d55e5bfc RD |
10592 | |
10593 | def GetLabel(*args, **kwargs): | |
10594 | """ | |
5b5c9bc7 | 10595 | GetLabel(self) -> String |
d55e5bfc RD |
10596 | |
10597 | Return a control's text. | |
10598 | """ | |
5b5c9bc7 | 10599 | return _core_.Control_GetLabel(*args, **kwargs) |
d55e5bfc | 10600 | |
d55e5bfc | 10601 | def GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 | 10602 | """ |
5b5c9bc7 | 10603 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
110da5b0 RD |
10604 | |
10605 | Get the default attributes for this class. This is useful if you want | |
10606 | to use the same font or colour in your own control as in a standard | |
10607 | control -- which is a much better idea than hard coding specific | |
10608 | colours or fonts which might look completely out of place on the | |
10609 | user's system, especially if it uses themes. | |
10610 | ||
10611 | The variant parameter is only relevant under Mac currently and is | |
10612 | ignore under other platforms. Under Mac, it will change the size of | |
10613 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10614 | this. | |
10615 | """ | |
5b5c9bc7 | 10616 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
10617 | |
10618 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
2131d850 | 10619 | _core_.Control_swigregister(Control) |
d55e5bfc RD |
10620 | ControlNameStr = cvar.ControlNameStr |
10621 | ||
10622 | def PreControl(*args, **kwargs): | |
10623 | """ | |
5b5c9bc7 | 10624 | PreControl() -> Control |
d55e5bfc RD |
10625 | |
10626 | Precreate a Control control for 2-phase creation | |
10627 | """ | |
5b5c9bc7 | 10628 | val = _core_.new_PreControl(*args, **kwargs) |
d55e5bfc RD |
10629 | return val |
10630 | ||
5b5c9bc7 | 10631 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
1bd55598 | 10632 | """ |
5b5c9bc7 | 10633 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
110da5b0 RD |
10634 | |
10635 | Get the default attributes for this class. This is useful if you want | |
10636 | to use the same font or colour in your own control as in a standard | |
10637 | control -- which is a much better idea than hard coding specific | |
10638 | colours or fonts which might look completely out of place on the | |
10639 | user's system, especially if it uses themes. | |
10640 | ||
10641 | The variant parameter is only relevant under Mac currently and is | |
10642 | ignore under other platforms. Under Mac, it will change the size of | |
10643 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10644 | this. | |
10645 | """ | |
1bd55598 | 10646 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
10647 | |
10648 | #--------------------------------------------------------------------------- | |
10649 | ||
5b5c9bc7 | 10650 | class ItemContainer(object): |
d55e5bfc | 10651 | """ |
53aa7709 RD |
10652 | The wx.ItemContainer class defines an interface which is implemented |
10653 | by all controls which have string subitems, each of which may be | |
10654 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
10655 | as `wx.ComboBox` which implements an extended interface deriving from | |
15817c7e | 10656 | this one. |
d55e5bfc | 10657 | |
15817c7e RD |
10658 | It defines the methods for accessing the control's items and although |
10659 | each of the derived classes implements them differently, they still | |
10660 | all conform to the same interface. | |
d55e5bfc | 10661 | |
15817c7e RD |
10662 | The items in a wx.ItemContainer have (non empty) string labels and, |
10663 | optionally, client data associated with them. | |
d55e5bfc RD |
10664 | |
10665 | """ | |
1bd55598 RD |
10666 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10667 | def __init__(self): raise AttributeError, "No constructor defined" | |
10668 | __repr__ = _swig_repr | |
d55e5bfc RD |
10669 | def Append(*args, **kwargs): |
10670 | """ | |
5b5c9bc7 | 10671 | Append(self, String item, PyObject clientData=None) -> int |
d55e5bfc | 10672 | |
15817c7e RD |
10673 | Adds the item to the control, associating the given data with the item |
10674 | if not None. The return value is the index of the newly added item | |
10675 | which may be different from the last one if the control is sorted (e.g. | |
10676 | has wx.LB_SORT or wx.CB_SORT style). | |
d55e5bfc | 10677 | """ |
5b5c9bc7 | 10678 | return _core_.ItemContainer_Append(*args, **kwargs) |
d55e5bfc RD |
10679 | |
10680 | def AppendItems(*args, **kwargs): | |
10681 | """ | |
f5b96ee1 | 10682 | AppendItems(self, List strings) |
d55e5bfc | 10683 | |
15817c7e RD |
10684 | Apend several items at once to the control. Notice that calling this |
10685 | method may be much faster than appending the items one by one if you | |
10686 | need to add a lot of items. | |
d55e5bfc | 10687 | """ |
5b5c9bc7 | 10688 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
d55e5bfc RD |
10689 | |
10690 | def Insert(*args, **kwargs): | |
10691 | """ | |
50f151d7 | 10692 | Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int |
d55e5bfc | 10693 | |
15817c7e | 10694 | Insert an item into the control before the item at the ``pos`` index, |
d55e5bfc RD |
10695 | optionally associating some data object with the item. |
10696 | """ | |
5b5c9bc7 | 10697 | return _core_.ItemContainer_Insert(*args, **kwargs) |
d55e5bfc RD |
10698 | |
10699 | def Clear(*args, **kwargs): | |
10700 | """ | |
10701 | Clear(self) | |
10702 | ||
10703 | Removes all items from the control. | |
10704 | """ | |
5b5c9bc7 | 10705 | return _core_.ItemContainer_Clear(*args, **kwargs) |
d55e5bfc RD |
10706 | |
10707 | def Delete(*args, **kwargs): | |
10708 | """ | |
50f151d7 | 10709 | Delete(self, unsigned int n) |
d55e5bfc | 10710 | |
15817c7e RD |
10711 | Deletes the item at the zero-based index 'n' from the control. Note |
10712 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
10713 | enabled) to remove an item with the index negative or greater or equal | |
10714 | than the number of items in the control. | |
d55e5bfc | 10715 | """ |
5b5c9bc7 | 10716 | return _core_.ItemContainer_Delete(*args, **kwargs) |
d55e5bfc | 10717 | |
53aa7709 RD |
10718 | def GetClientData(*args, **kwargs): |
10719 | """ | |
50f151d7 | 10720 | GetClientData(self, unsigned int n) -> PyObject |
53aa7709 RD |
10721 | |
10722 | Returns the client data associated with the given item, (if any.) | |
10723 | """ | |
5b5c9bc7 | 10724 | return _core_.ItemContainer_GetClientData(*args, **kwargs) |
53aa7709 RD |
10725 | |
10726 | def SetClientData(*args, **kwargs): | |
10727 | """ | |
50f151d7 | 10728 | SetClientData(self, unsigned int n, PyObject clientData) |
53aa7709 RD |
10729 | |
10730 | Associate the given client data with the item at position n. | |
10731 | """ | |
5b5c9bc7 | 10732 | return _core_.ItemContainer_SetClientData(*args, **kwargs) |
53aa7709 | 10733 | |
d55e5bfc RD |
10734 | def GetCount(*args, **kwargs): |
10735 | """ | |
50f151d7 | 10736 | GetCount(self) -> unsigned int |
d55e5bfc RD |
10737 | |
10738 | Returns the number of items in the control. | |
10739 | """ | |
5b5c9bc7 | 10740 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
d55e5bfc RD |
10741 | |
10742 | def IsEmpty(*args, **kwargs): | |
10743 | """ | |
10744 | IsEmpty(self) -> bool | |
10745 | ||
10746 | Returns True if the control is empty or False if it has some items. | |
10747 | """ | |
5b5c9bc7 | 10748 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
d55e5bfc RD |
10749 | |
10750 | def GetString(*args, **kwargs): | |
10751 | """ | |
50f151d7 | 10752 | GetString(self, unsigned int n) -> String |
d55e5bfc RD |
10753 | |
10754 | Returns the label of the item with the given index. | |
10755 | """ | |
5b5c9bc7 | 10756 | return _core_.ItemContainer_GetString(*args, **kwargs) |
d55e5bfc RD |
10757 | |
10758 | def GetStrings(*args, **kwargs): | |
10759 | """GetStrings(self) -> wxArrayString""" | |
5b5c9bc7 | 10760 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
d55e5bfc RD |
10761 | |
10762 | def SetString(*args, **kwargs): | |
10763 | """ | |
50f151d7 | 10764 | SetString(self, unsigned int n, String s) |
d55e5bfc RD |
10765 | |
10766 | Sets the label for the given item. | |
10767 | """ | |
5b5c9bc7 | 10768 | return _core_.ItemContainer_SetString(*args, **kwargs) |
d55e5bfc RD |
10769 | |
10770 | def FindString(*args, **kwargs): | |
10771 | """ | |
5b5c9bc7 | 10772 | FindString(self, String s) -> int |
d55e5bfc RD |
10773 | |
10774 | Finds an item whose label matches the given string. Returns the | |
15817c7e RD |
10775 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
10776 | found. | |
d55e5bfc | 10777 | """ |
5b5c9bc7 | 10778 | return _core_.ItemContainer_FindString(*args, **kwargs) |
d55e5bfc | 10779 | |
53aa7709 | 10780 | def SetSelection(*args, **kwargs): |
d55e5bfc | 10781 | """ |
53aa7709 | 10782 | SetSelection(self, int n) |
d55e5bfc RD |
10783 | |
10784 | Sets the item at index 'n' to be the selected item. | |
10785 | """ | |
5b5c9bc7 | 10786 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
d55e5bfc | 10787 | |
d55e5bfc RD |
10788 | def GetSelection(*args, **kwargs): |
10789 | """ | |
10790 | GetSelection(self) -> int | |
10791 | ||
15817c7e RD |
10792 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
10793 | is selected. | |
d55e5bfc | 10794 | """ |
5b5c9bc7 | 10795 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
d55e5bfc | 10796 | |
53aa7709 | 10797 | def SetStringSelection(*args, **kwargs): |
5b5c9bc7 RD |
10798 | """SetStringSelection(self, String s) -> bool""" |
10799 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
53aa7709 | 10800 | |
d55e5bfc RD |
10801 | def GetStringSelection(*args, **kwargs): |
10802 | """ | |
5b5c9bc7 | 10803 | GetStringSelection(self) -> String |
d55e5bfc | 10804 | |
15817c7e RD |
10805 | Returns the label of the selected item or an empty string if no item |
10806 | is selected. | |
d55e5bfc | 10807 | """ |
5b5c9bc7 | 10808 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
d55e5bfc | 10809 | |
53aa7709 | 10810 | def Select(*args, **kwargs): |
d55e5bfc | 10811 | """ |
53aa7709 | 10812 | Select(self, int n) |
d55e5bfc | 10813 | |
53aa7709 RD |
10814 | This is the same as `SetSelection` and exists only because it is |
10815 | slightly more natural for controls which support multiple selection. | |
d55e5bfc | 10816 | """ |
5b5c9bc7 | 10817 | return _core_.ItemContainer_Select(*args, **kwargs) |
d55e5bfc | 10818 | |
2131d850 | 10819 | _core_.ItemContainer_swigregister(ItemContainer) |
d55e5bfc RD |
10820 | |
10821 | #--------------------------------------------------------------------------- | |
10822 | ||
5b5c9bc7 | 10823 | class ControlWithItems(Control,ItemContainer): |
d55e5bfc | 10824 | """ |
15817c7e RD |
10825 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
10826 | wx.Control class, and is used for the base class of various controls | |
10827 | that have items. | |
d55e5bfc | 10828 | """ |
1bd55598 RD |
10829 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10830 | def __init__(self): raise AttributeError, "No constructor defined" | |
10831 | __repr__ = _swig_repr | |
2131d850 | 10832 | _core_.ControlWithItems_swigregister(ControlWithItems) |
d55e5bfc RD |
10833 | |
10834 | #--------------------------------------------------------------------------- | |
10835 | ||
5b5c9bc7 | 10836 | class SizerItem(Object): |
bfddbb17 RD |
10837 | """ |
10838 | The wx.SizerItem class is used to track the position, size and other | |
2131d850 RD |
10839 | attributes of each item managed by a `wx.Sizer`. It is not usually |
10840 | necessary to use this class because the sizer elements can also be | |
10841 | identified by their positions or window or sizer references but | |
10842 | sometimes it may be more convenient to use wx.SizerItem directly. | |
10843 | Also, custom classes derived from `wx.PySizer` will probably need to | |
10844 | use the collection of wx.SizerItems held by wx.Sizer when calculating | |
10845 | layout. | |
bfddbb17 RD |
10846 | |
10847 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
10848 | """ | |
1bd55598 RD |
10849 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10850 | __repr__ = _swig_repr | |
10851 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 10852 | """ |
5b5c9bc7 | 10853 | __init__(self) -> SizerItem |
bfddbb17 RD |
10854 | |
10855 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
10856 | size will need to be set before this item can be used in a Sizer. | |
10857 | ||
10858 | You will probably never need to create a wx.SizerItem directly as they | |
10859 | are created automatically when the sizer's Add, Insert or Prepend | |
10860 | methods are called. | |
10861 | ||
10862 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
10863 | """ | |
1bd55598 RD |
10864 | _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs)) |
10865 | __swig_destroy__ = _core_.delete_SizerItem | |
10866 | __del__ = lambda self : None; | |
d55e5bfc | 10867 | def DeleteWindows(*args, **kwargs): |
bfddbb17 RD |
10868 | """ |
10869 | DeleteWindows(self) | |
10870 | ||
10871 | Destroy the window or the windows in a subsizer, depending on the type | |
10872 | of item. | |
10873 | """ | |
5b5c9bc7 | 10874 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
d55e5bfc RD |
10875 | |
10876 | def DetachSizer(*args, **kwargs): | |
bfddbb17 RD |
10877 | """ |
10878 | DetachSizer(self) | |
10879 | ||
10880 | Enable deleting the SizerItem without destroying the contained sizer. | |
10881 | """ | |
5b5c9bc7 | 10882 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
d55e5bfc RD |
10883 | |
10884 | def GetSize(*args, **kwargs): | |
bfddbb17 | 10885 | """ |
5b5c9bc7 | 10886 | GetSize(self) -> Size |
bfddbb17 RD |
10887 | |
10888 | Get the current size of the item, as set in the last Layout. | |
10889 | """ | |
5b5c9bc7 | 10890 | return _core_.SizerItem_GetSize(*args, **kwargs) |
d55e5bfc RD |
10891 | |
10892 | def CalcMin(*args, **kwargs): | |
bfddbb17 | 10893 | """ |
5b5c9bc7 | 10894 | CalcMin(self) -> Size |
bfddbb17 RD |
10895 | |
10896 | Calculates the minimum desired size for the item, including any space | |
10897 | needed by borders. | |
10898 | """ | |
5b5c9bc7 | 10899 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
d55e5bfc RD |
10900 | |
10901 | def SetDimension(*args, **kwargs): | |
bfddbb17 | 10902 | """ |
5b5c9bc7 | 10903 | SetDimension(self, Point pos, Size size) |
bfddbb17 RD |
10904 | |
10905 | Set the position and size of the space allocated for this item by the | |
10906 | sizer, and adjust the position and size of the item (window or | |
10907 | subsizer) to be within that space taking alignment and borders into | |
10908 | account. | |
10909 | """ | |
5b5c9bc7 | 10910 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
d55e5bfc RD |
10911 | |
10912 | def GetMinSize(*args, **kwargs): | |
bfddbb17 | 10913 | """ |
5b5c9bc7 | 10914 | GetMinSize(self) -> Size |
bfddbb17 RD |
10915 | |
10916 | Get the minimum size needed for the item. | |
10917 | """ | |
5b5c9bc7 | 10918 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
d55e5bfc | 10919 | |
a001823c RD |
10920 | def GetMinSizeWithBorder(*args, **kwargs): |
10921 | """ | |
5b5c9bc7 | 10922 | GetMinSizeWithBorder(self) -> Size |
a001823c RD |
10923 | |
10924 | Get the minimum size needed for the item with space for the borders | |
10925 | added, if needed. | |
10926 | """ | |
5b5c9bc7 | 10927 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) |
a001823c | 10928 | |
d55e5bfc RD |
10929 | def SetInitSize(*args, **kwargs): |
10930 | """SetInitSize(self, int x, int y)""" | |
5b5c9bc7 | 10931 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
d55e5bfc RD |
10932 | |
10933 | def SetRatioWH(*args, **kwargs): | |
bfddbb17 RD |
10934 | """ |
10935 | SetRatioWH(self, int width, int height) | |
10936 | ||
10937 | Set the ratio item attribute. | |
10938 | """ | |
5b5c9bc7 | 10939 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
d55e5bfc RD |
10940 | |
10941 | def SetRatioSize(*args, **kwargs): | |
bfddbb17 | 10942 | """ |
5b5c9bc7 | 10943 | SetRatioSize(self, Size size) |
bfddbb17 RD |
10944 | |
10945 | Set the ratio item attribute. | |
10946 | """ | |
5b5c9bc7 | 10947 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
d55e5bfc RD |
10948 | |
10949 | def SetRatio(*args, **kwargs): | |
bfddbb17 RD |
10950 | """ |
10951 | SetRatio(self, float ratio) | |
10952 | ||
10953 | Set the ratio item attribute. | |
10954 | """ | |
5b5c9bc7 | 10955 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
d55e5bfc RD |
10956 | |
10957 | def GetRatio(*args, **kwargs): | |
bfddbb17 RD |
10958 | """ |
10959 | GetRatio(self) -> float | |
10960 | ||
10961 | Set the ratio item attribute. | |
10962 | """ | |
5b5c9bc7 | 10963 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
d55e5bfc | 10964 | |
070c48b4 RD |
10965 | def GetRect(*args, **kwargs): |
10966 | """ | |
5b5c9bc7 | 10967 | GetRect(self) -> Rect |
070c48b4 RD |
10968 | |
10969 | Returns the rectangle that the sizer item should occupy | |
10970 | """ | |
5b5c9bc7 | 10971 | return _core_.SizerItem_GetRect(*args, **kwargs) |
070c48b4 | 10972 | |
d55e5bfc | 10973 | def IsWindow(*args, **kwargs): |
bfddbb17 RD |
10974 | """ |
10975 | IsWindow(self) -> bool | |
10976 | ||
10977 | Is this sizer item a window? | |
10978 | """ | |
5b5c9bc7 | 10979 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
d55e5bfc RD |
10980 | |
10981 | def IsSizer(*args, **kwargs): | |
bfddbb17 RD |
10982 | """ |
10983 | IsSizer(self) -> bool | |
10984 | ||
10985 | Is this sizer item a subsizer? | |
10986 | """ | |
5b5c9bc7 | 10987 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
d55e5bfc RD |
10988 | |
10989 | def IsSpacer(*args, **kwargs): | |
bfddbb17 RD |
10990 | """ |
10991 | IsSpacer(self) -> bool | |
10992 | ||
10993 | Is this sizer item a spacer? | |
10994 | """ | |
5b5c9bc7 | 10995 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
d55e5bfc RD |
10996 | |
10997 | def SetProportion(*args, **kwargs): | |
bfddbb17 RD |
10998 | """ |
10999 | SetProportion(self, int proportion) | |
11000 | ||
11001 | Set the proportion value for this item. | |
11002 | """ | |
5b5c9bc7 | 11003 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
d55e5bfc RD |
11004 | |
11005 | def GetProportion(*args, **kwargs): | |
bfddbb17 RD |
11006 | """ |
11007 | GetProportion(self) -> int | |
11008 | ||
11009 | Get the proportion value for this item. | |
11010 | """ | |
5b5c9bc7 | 11011 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
d55e5bfc | 11012 | |
bfddbb17 RD |
11013 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
11014 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
d55e5bfc | 11015 | def SetFlag(*args, **kwargs): |
bfddbb17 RD |
11016 | """ |
11017 | SetFlag(self, int flag) | |
11018 | ||
11019 | Set the flag value for this item. | |
11020 | """ | |
5b5c9bc7 | 11021 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
d55e5bfc RD |
11022 | |
11023 | def GetFlag(*args, **kwargs): | |
bfddbb17 RD |
11024 | """ |
11025 | GetFlag(self) -> int | |
11026 | ||
11027 | Get the flag value for this item. | |
11028 | """ | |
5b5c9bc7 | 11029 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
d55e5bfc RD |
11030 | |
11031 | def SetBorder(*args, **kwargs): | |
bfddbb17 RD |
11032 | """ |
11033 | SetBorder(self, int border) | |
11034 | ||
11035 | Set the border value for this item. | |
11036 | """ | |
5b5c9bc7 | 11037 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
d55e5bfc RD |
11038 | |
11039 | def GetBorder(*args, **kwargs): | |
bfddbb17 RD |
11040 | """ |
11041 | GetBorder(self) -> int | |
11042 | ||
11043 | Get the border value for this item. | |
11044 | """ | |
5b5c9bc7 | 11045 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
d55e5bfc RD |
11046 | |
11047 | def GetWindow(*args, **kwargs): | |
bfddbb17 | 11048 | """ |
5b5c9bc7 | 11049 | GetWindow(self) -> Window |
bfddbb17 RD |
11050 | |
11051 | Get the window (if any) that is managed by this sizer item. | |
11052 | """ | |
5b5c9bc7 | 11053 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
d55e5bfc RD |
11054 | |
11055 | def SetWindow(*args, **kwargs): | |
bfddbb17 | 11056 | """ |
5b5c9bc7 | 11057 | SetWindow(self, Window window) |
bfddbb17 RD |
11058 | |
11059 | Set the window to be managed by this sizer item. | |
11060 | """ | |
5b5c9bc7 | 11061 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
d55e5bfc RD |
11062 | |
11063 | def GetSizer(*args, **kwargs): | |
bfddbb17 | 11064 | """ |
5b5c9bc7 | 11065 | GetSizer(self) -> Sizer |
bfddbb17 RD |
11066 | |
11067 | Get the subsizer (if any) that is managed by this sizer item. | |
11068 | """ | |
5b5c9bc7 | 11069 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
d55e5bfc RD |
11070 | |
11071 | def SetSizer(*args, **kwargs): | |
bfddbb17 | 11072 | """ |
5b5c9bc7 | 11073 | SetSizer(self, Sizer sizer) |
bfddbb17 RD |
11074 | |
11075 | Set the subsizer to be managed by this sizer item. | |
11076 | """ | |
5b5c9bc7 | 11077 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
d55e5bfc RD |
11078 | |
11079 | def GetSpacer(*args, **kwargs): | |
bfddbb17 | 11080 | """ |
5b5c9bc7 | 11081 | GetSpacer(self) -> Size |
bfddbb17 RD |
11082 | |
11083 | Get the size of the spacer managed by this sizer item. | |
11084 | """ | |
5b5c9bc7 | 11085 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
d55e5bfc RD |
11086 | |
11087 | def SetSpacer(*args, **kwargs): | |
bfddbb17 | 11088 | """ |
5b5c9bc7 | 11089 | SetSpacer(self, Size size) |
bfddbb17 RD |
11090 | |
11091 | Set the size of the spacer to be managed by this sizer item. | |
11092 | """ | |
5b5c9bc7 | 11093 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
d55e5bfc RD |
11094 | |
11095 | def Show(*args, **kwargs): | |
bfddbb17 RD |
11096 | """ |
11097 | Show(self, bool show) | |
11098 | ||
11099 | Set the show item attribute, which sizers use to determine if the item | |
11100 | is to be made part of the layout or not. If the item is tracking a | |
11101 | window then it is shown or hidden as needed. | |
11102 | """ | |
5b5c9bc7 | 11103 | return _core_.SizerItem_Show(*args, **kwargs) |
d55e5bfc RD |
11104 | |
11105 | def IsShown(*args, **kwargs): | |
bfddbb17 RD |
11106 | """ |
11107 | IsShown(self) -> bool | |
11108 | ||
11109 | Is the item to be shown in the layout? | |
11110 | """ | |
5b5c9bc7 | 11111 | return _core_.SizerItem_IsShown(*args, **kwargs) |
d55e5bfc RD |
11112 | |
11113 | def GetPosition(*args, **kwargs): | |
bfddbb17 | 11114 | """ |
5b5c9bc7 | 11115 | GetPosition(self) -> Point |
bfddbb17 RD |
11116 | |
11117 | Returns the current position of the item, as set in the last Layout. | |
11118 | """ | |
5b5c9bc7 | 11119 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
d55e5bfc RD |
11120 | |
11121 | def GetUserData(*args, **kwargs): | |
bfddbb17 RD |
11122 | """ |
11123 | GetUserData(self) -> PyObject | |
11124 | ||
11125 | Returns the userData associated with this sizer item, or None if there | |
11126 | isn't any. | |
11127 | """ | |
5b5c9bc7 | 11128 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
d55e5bfc | 11129 | |
32fe5131 RD |
11130 | def SetUserData(*args, **kwargs): |
11131 | """ | |
11132 | SetUserData(self, PyObject userData) | |
11133 | ||
11134 | Associate a Python object with this sizer item. | |
11135 | """ | |
11136 | return _core_.SizerItem_SetUserData(*args, **kwargs) | |
11137 | ||
2131d850 | 11138 | _core_.SizerItem_swigregister(SizerItem) |
d55e5bfc | 11139 | |
bfddbb17 | 11140 | def SizerItemWindow(*args, **kwargs): |
d55e5bfc | 11141 | """ |
5b5c9bc7 RD |
11142 | SizerItemWindow(Window window, int proportion, int flag, int border, |
11143 | PyObject userData=None) -> SizerItem | |
bfddbb17 RD |
11144 | |
11145 | Constructs a `wx.SizerItem` for tracking a window. | |
d55e5bfc | 11146 | """ |
5b5c9bc7 | 11147 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d55e5bfc RD |
11148 | return val |
11149 | ||
bfddbb17 | 11150 | def SizerItemSpacer(*args, **kwargs): |
d55e5bfc | 11151 | """ |
bfddbb17 | 11152 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
5b5c9bc7 | 11153 | PyObject userData=None) -> SizerItem |
bfddbb17 RD |
11154 | |
11155 | Constructs a `wx.SizerItem` for tracking a spacer. | |
d55e5bfc | 11156 | """ |
5b5c9bc7 | 11157 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d55e5bfc RD |
11158 | return val |
11159 | ||
11160 | def SizerItemSizer(*args, **kwargs): | |
11161 | """ | |
5b5c9bc7 RD |
11162 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, |
11163 | PyObject userData=None) -> SizerItem | |
bfddbb17 RD |
11164 | |
11165 | Constructs a `wx.SizerItem` for tracking a subsizer | |
d55e5bfc | 11166 | """ |
5b5c9bc7 | 11167 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d55e5bfc RD |
11168 | return val |
11169 | ||
5b5c9bc7 | 11170 | class Sizer(Object): |
bfddbb17 RD |
11171 | """ |
11172 | wx.Sizer is the abstract base class used for laying out subwindows in | |
11173 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
11174 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
1d5ee749 RD |
11175 | `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and |
11176 | `wx.GridBagSizer`. | |
bfddbb17 RD |
11177 | |
11178 | The concept implemented by sizers in wxWidgets is closely related to | |
11179 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
11180 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
11181 | subwindows reporting their minimal required size and their ability to | |
11182 | get stretched if the size of the parent window has changed. This will | |
11183 | most often mean that the programmer does not set the original size of | |
11184 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
11185 | this sizer will be queried about the recommended size. The sizer in | |
11186 | turn will query its children, which can be normal windows or contorls, | |
11187 | empty space or other sizers, so that a hierarchy of sizers can be | |
11188 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
11189 | do not interfere with tab ordering and requires very little resources | |
11190 | compared to a real window on screen. | |
11191 | ||
11192 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
11193 | every control reports its own minimal size and the algorithm can | |
11194 | handle differences in font sizes or different window (dialog item) | |
11195 | sizes on different platforms without problems. If for example the | |
11196 | standard font as well as the overall design of Mac widgets requires | |
11197 | more space than on Windows, then the initial size of a dialog using a | |
11198 | sizer will automatically be bigger on Mac than on Windows. | |
11199 | """ | |
1bd55598 RD |
11200 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11201 | def __init__(self): raise AttributeError, "No constructor defined" | |
11202 | __repr__ = _swig_repr | |
11203 | __swig_destroy__ = _core_.delete_Sizer | |
11204 | __del__ = lambda self : None; | |
d55e5bfc RD |
11205 | def _setOORInfo(*args, **kwargs): |
11206 | """_setOORInfo(self, PyObject _self)""" | |
5b5c9bc7 | 11207 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
d55e5bfc RD |
11208 | |
11209 | def Add(*args, **kwargs): | |
11210 | """ | |
bfddbb17 | 11211 | Add(self, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11212 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11213 | |
11214 | Appends a child item to the sizer. | |
d55e5bfc | 11215 | """ |
5b5c9bc7 | 11216 | return _core_.Sizer_Add(*args, **kwargs) |
d55e5bfc RD |
11217 | |
11218 | def Insert(*args, **kwargs): | |
11219 | """ | |
bfddbb17 | 11220 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11221 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11222 | |
11223 | Inserts a new item into the list of items managed by this sizer before | |
11224 | the item at index *before*. See `Add` for a description of the parameters. | |
d55e5bfc | 11225 | """ |
5b5c9bc7 | 11226 | return _core_.Sizer_Insert(*args, **kwargs) |
d55e5bfc RD |
11227 | |
11228 | def Prepend(*args, **kwargs): | |
11229 | """ | |
bfddbb17 | 11230 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11231 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11232 | |
11233 | Adds a new item to the begining of the list of sizer items managed by | |
11234 | this sizer. See `Add` for a description of the parameters. | |
d55e5bfc | 11235 | """ |
5b5c9bc7 | 11236 | return _core_.Sizer_Prepend(*args, **kwargs) |
d55e5bfc RD |
11237 | |
11238 | def Remove(*args, **kwargs): | |
bfddbb17 RD |
11239 | """ |
11240 | Remove(self, item) -> bool | |
11241 | ||
11242 | Removes an item from the sizer and destroys it. This method does not | |
11243 | cause any layout or resizing to take place, call `Layout` to update | |
11244 | the layout on screen after removing a child from the sizer. The | |
11245 | *item* parameter can be either a window, a sizer, or the zero-based | |
11246 | index of an item to remove. Returns True if the child item was found | |
11247 | and removed. | |
11248 | """ | |
5b5c9bc7 | 11249 | return _core_.Sizer_Remove(*args, **kwargs) |
d55e5bfc | 11250 | |
1a6bba1e | 11251 | def Detach(*args, **kwargs): |
bfddbb17 RD |
11252 | """ |
11253 | Detach(self, item) -> bool | |
11254 | ||
11255 | Detaches an item from the sizer without destroying it. This method | |
11256 | does not cause any layout or resizing to take place, call `Layout` to | |
11257 | do so. The *item* parameter can be either a window, a sizer, or the | |
11258 | zero-based index of the item to be detached. Returns True if the child item | |
11259 | was found and detached. | |
11260 | """ | |
5b5c9bc7 | 11261 | return _core_.Sizer_Detach(*args, **kwargs) |
1a6bba1e | 11262 | |
070c48b4 RD |
11263 | def GetItem(*args, **kwargs): |
11264 | """ | |
11265 | GetItem(self, item) -> wx.SizerItem | |
11266 | ||
11267 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11268 | parameter can be either a window, a sizer, or the zero-based index of | |
4d170c95 | 11269 | the item to be found. |
070c48b4 | 11270 | """ |
5b5c9bc7 | 11271 | return _core_.Sizer_GetItem(*args, **kwargs) |
070c48b4 | 11272 | |
d55e5bfc | 11273 | def _SetItemMinSize(*args, **kwargs): |
5b5c9bc7 RD |
11274 | """_SetItemMinSize(self, PyObject item, Size size)""" |
11275 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) | |
d55e5bfc | 11276 | |
bfddbb17 RD |
11277 | def SetItemMinSize(self, item, *args): |
11278 | """ | |
11279 | SetItemMinSize(self, item, Size size) | |
11280 | ||
11281 | Sets the minimum size that will be allocated for an item in the sizer. | |
11282 | The *item* parameter can be either a window, a sizer, or the | |
11283 | zero-based index of the item. If a window or sizer is given then it | |
11284 | will be searched for recursivly in subsizers if neccessary. | |
11285 | """ | |
11286 | if len(args) == 2: | |
11287 | # for backward compatibility accept separate width,height args too | |
11288 | return self._SetItemMinSize(item, args) | |
11289 | else: | |
11290 | return self._SetItemMinSize(item, args[0]) | |
11291 | ||
d55e5bfc | 11292 | def AddItem(*args, **kwargs): |
bfddbb17 RD |
11293 | """ |
11294 | AddItem(self, SizerItem item) | |
11295 | ||
11296 | Adds a `wx.SizerItem` to the sizer. | |
11297 | """ | |
5b5c9bc7 | 11298 | return _core_.Sizer_AddItem(*args, **kwargs) |
d55e5bfc RD |
11299 | |
11300 | def InsertItem(*args, **kwargs): | |
bfddbb17 RD |
11301 | """ |
11302 | InsertItem(self, int index, SizerItem item) | |
11303 | ||
11304 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11305 | """ | |
5b5c9bc7 | 11306 | return _core_.Sizer_InsertItem(*args, **kwargs) |
d55e5bfc RD |
11307 | |
11308 | def PrependItem(*args, **kwargs): | |
bfddbb17 RD |
11309 | """ |
11310 | PrependItem(self, SizerItem item) | |
11311 | ||
11312 | Prepends a `wx.SizerItem` to the sizer. | |
11313 | """ | |
5b5c9bc7 | 11314 | return _core_.Sizer_PrependItem(*args, **kwargs) |
d55e5bfc | 11315 | |
bfddbb17 | 11316 | def AddMany(self, items): |
d6c14a4c RD |
11317 | """ |
11318 | AddMany is a convenience method for adding several items | |
11319 | to a sizer at one time. Simply pass it a list of tuples, | |
11320 | where each tuple consists of the parameters that you | |
11321 | would normally pass to the `Add` method. | |
11322 | """ | |
bfddbb17 RD |
11323 | for item in items: |
11324 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11325 | item = (item, ) | |
11326 | self.Add(*item) | |
d55e5bfc RD |
11327 | |
11328 | # for backwards compatibility only, please do not use in new code | |
7fbf8399 RD |
11329 | def AddWindow(self, *args, **kw): |
11330 | """Compatibility alias for `Add`.""" | |
11331 | return self.Add(*args, **kw) | |
11332 | def AddSizer(self, *args, **kw): | |
11333 | """Compatibility alias for `Add`.""" | |
11334 | return self.Add(*args, **kw) | |
11335 | def AddSpacer(self, *args, **kw): | |
11336 | """Compatibility alias for `Add`.""" | |
11337 | return self.Add(*args, **kw) | |
11338 | ||
11339 | def PrependWindow(self, *args, **kw): | |
11340 | """Compatibility alias for `Prepend`.""" | |
11341 | return self.Prepend(*args, **kw) | |
11342 | def PrependSizer(self, *args, **kw): | |
11343 | """Compatibility alias for `Prepend`.""" | |
11344 | return self.Prepend(*args, **kw) | |
11345 | def PrependSpacer(self, *args, **kw): | |
11346 | """Compatibility alias for `Prepend`.""" | |
11347 | return self.Prepend(*args, **kw) | |
11348 | ||
11349 | def InsertWindow(self, *args, **kw): | |
11350 | """Compatibility alias for `Insert`.""" | |
11351 | return self.Insert(*args, **kw) | |
11352 | def InsertSizer(self, *args, **kw): | |
11353 | """Compatibility alias for `Insert`.""" | |
11354 | return self.Insert(*args, **kw) | |
11355 | def InsertSpacer(self, *args, **kw): | |
11356 | """Compatibility alias for `Insert`.""" | |
11357 | return self.Insert(*args, **kw) | |
11358 | ||
11359 | def RemoveWindow(self, *args, **kw): | |
11360 | """Compatibility alias for `Remove`.""" | |
11361 | return self.Remove(*args, **kw) | |
11362 | def RemoveSizer(self, *args, **kw): | |
11363 | """Compatibility alias for `Remove`.""" | |
11364 | return self.Remove(*args, **kw) | |
11365 | def RemovePos(self, *args, **kw): | |
11366 | """Compatibility alias for `Remove`.""" | |
11367 | return self.Remove(*args, **kw) | |
d55e5bfc RD |
11368 | |
11369 | ||
d55e5bfc | 11370 | def SetDimension(*args, **kwargs): |
bfddbb17 RD |
11371 | """ |
11372 | SetDimension(self, int x, int y, int width, int height) | |
11373 | ||
11374 | Call this to force the sizer to take the given dimension and thus | |
11375 | force the items owned by the sizer to resize themselves according to | |
11376 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11377 | methods. | |
11378 | """ | |
5b5c9bc7 | 11379 | return _core_.Sizer_SetDimension(*args, **kwargs) |
d55e5bfc RD |
11380 | |
11381 | def SetMinSize(*args, **kwargs): | |
bfddbb17 | 11382 | """ |
5b5c9bc7 | 11383 | SetMinSize(self, Size size) |
bfddbb17 RD |
11384 | |
11385 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11386 | calculate its minimal size based purely on how much space its children | |
11387 | need. After calling this method `GetMinSize` will return either the | |
11388 | minimal size as requested by its children or the minimal size set | |
11389 | here, depending on which is bigger. | |
11390 | """ | |
5b5c9bc7 | 11391 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
d55e5bfc RD |
11392 | |
11393 | def GetSize(*args, **kwargs): | |
bfddbb17 | 11394 | """ |
5b5c9bc7 | 11395 | GetSize(self) -> Size |
bfddbb17 RD |
11396 | |
11397 | Returns the current size of the space managed by the sizer. | |
11398 | """ | |
5b5c9bc7 | 11399 | return _core_.Sizer_GetSize(*args, **kwargs) |
d55e5bfc RD |
11400 | |
11401 | def GetPosition(*args, **kwargs): | |
bfddbb17 | 11402 | """ |
5b5c9bc7 | 11403 | GetPosition(self) -> Point |
bfddbb17 RD |
11404 | |
11405 | Returns the current position of the sizer's managed space. | |
11406 | """ | |
5b5c9bc7 | 11407 | return _core_.Sizer_GetPosition(*args, **kwargs) |
d55e5bfc RD |
11408 | |
11409 | def GetMinSize(*args, **kwargs): | |
bfddbb17 | 11410 | """ |
5b5c9bc7 | 11411 | GetMinSize(self) -> Size |
bfddbb17 RD |
11412 | |
11413 | Returns the minimal size of the sizer. This is either the combined | |
11414 | minimal size of all the children and their borders or the minimal size | |
11415 | set by SetMinSize, depending on which is bigger. | |
11416 | """ | |
5b5c9bc7 | 11417 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
d55e5bfc RD |
11418 | |
11419 | def GetSizeTuple(self): | |
1a6bba1e | 11420 | return self.GetSize().Get() |
d55e5bfc | 11421 | def GetPositionTuple(self): |
1a6bba1e | 11422 | return self.GetPosition().Get() |
d55e5bfc | 11423 | def GetMinSizeTuple(self): |
1a6bba1e | 11424 | return self.GetMinSize().Get() |
d55e5bfc RD |
11425 | |
11426 | def RecalcSizes(*args, **kwargs): | |
bfddbb17 RD |
11427 | """ |
11428 | RecalcSizes(self) | |
11429 | ||
11430 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11431 | items managed by this sizer. You should not need to call this directly as | |
11432 | it is called by `Layout`. | |
11433 | """ | |
5b5c9bc7 | 11434 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
d55e5bfc RD |
11435 | |
11436 | def CalcMin(*args, **kwargs): | |
bfddbb17 | 11437 | """ |
5b5c9bc7 | 11438 | CalcMin(self) -> Size |
bfddbb17 RD |
11439 | |
11440 | This method is where the sizer will do the actual calculation of its | |
11441 | children's minimal sizes. You should not need to call this directly as | |
11442 | it is called by `Layout`. | |
11443 | """ | |
5b5c9bc7 | 11444 | return _core_.Sizer_CalcMin(*args, **kwargs) |
d55e5bfc RD |
11445 | |
11446 | def Layout(*args, **kwargs): | |
bfddbb17 RD |
11447 | """ |
11448 | Layout(self) | |
11449 | ||
11450 | This method will force the recalculation and layout of the items | |
11451 | controlled by the sizer using the current space allocated to the | |
11452 | sizer. Normally this is called automatically from the owning window's | |
11453 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11454 | one of the items in a sizer change size, or items are added or | |
11455 | removed. | |
11456 | """ | |
5b5c9bc7 | 11457 | return _core_.Sizer_Layout(*args, **kwargs) |
d55e5bfc RD |
11458 | |
11459 | def Fit(*args, **kwargs): | |
bfddbb17 | 11460 | """ |
5b5c9bc7 | 11461 | Fit(self, Window window) -> Size |
bfddbb17 RD |
11462 | |
11463 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11464 | size. This is commonly done in the constructor of the window itself in | |
11465 | order to set its initial size to match the needs of the children as | |
11466 | determined by the sizer. Returns the new size. | |
11467 | ||
11468 | For a top level window this is the total window size, not the client size. | |
11469 | """ | |
5b5c9bc7 | 11470 | return _core_.Sizer_Fit(*args, **kwargs) |
d55e5bfc RD |
11471 | |
11472 | def FitInside(*args, **kwargs): | |
bfddbb17 | 11473 | """ |
5b5c9bc7 | 11474 | FitInside(self, Window window) |
bfddbb17 RD |
11475 | |
11476 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
11477 | sizer's minimal size. This will not alter the on screen size of the | |
11478 | window, but may cause the addition/removal/alteration of scrollbars | |
11479 | required to view the virtual area in windows which manage it. | |
11480 | ||
11481 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
11482 | ||
11483 | """ | |
5b5c9bc7 | 11484 | return _core_.Sizer_FitInside(*args, **kwargs) |
d55e5bfc RD |
11485 | |
11486 | def SetSizeHints(*args, **kwargs): | |
bfddbb17 | 11487 | """ |
5b5c9bc7 | 11488 | SetSizeHints(self, Window window) |
bfddbb17 RD |
11489 | |
11490 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
11491 | match the sizer's minimal size. This is commonly done in the | |
11492 | constructor of the window itself if the window is resizable (as are | |
11493 | many dialogs under Unix and frames on probably all platforms) in order | |
11494 | to prevent the window from being sized smaller than the minimal size | |
11495 | required by the sizer. | |
11496 | """ | |
5b5c9bc7 | 11497 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
d55e5bfc RD |
11498 | |
11499 | def SetVirtualSizeHints(*args, **kwargs): | |
bfddbb17 | 11500 | """ |
5b5c9bc7 | 11501 | SetVirtualSizeHints(self, Window window) |
bfddbb17 RD |
11502 | |
11503 | Tell the sizer to set the minimal size of the window virtual area to | |
11504 | match the sizer's minimal size. For windows with managed scrollbars | |
11505 | this will set them appropriately. | |
11506 | ||
11507 | :see: `wx.ScrolledWindow.SetScrollbars` | |
11508 | ||
11509 | """ | |
5b5c9bc7 | 11510 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
d55e5bfc RD |
11511 | |
11512 | def Clear(*args, **kwargs): | |
bfddbb17 RD |
11513 | """ |
11514 | Clear(self, bool deleteWindows=False) | |
11515 | ||
11516 | Clear all items from the sizer, optionally destroying the window items | |
11517 | as well. | |
11518 | """ | |
5b5c9bc7 | 11519 | return _core_.Sizer_Clear(*args, **kwargs) |
d55e5bfc RD |
11520 | |
11521 | def DeleteWindows(*args, **kwargs): | |
bfddbb17 RD |
11522 | """ |
11523 | DeleteWindows(self) | |
11524 | ||
11525 | Destroy all windows managed by the sizer. | |
11526 | """ | |
5b5c9bc7 | 11527 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
d55e5bfc RD |
11528 | |
11529 | def GetChildren(*args, **kwargs): | |
bfddbb17 | 11530 | """ |
51b83b37 | 11531 | GetChildren(self) -> list |
bfddbb17 RD |
11532 | |
11533 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
11534 | """ | |
5b5c9bc7 | 11535 | return _core_.Sizer_GetChildren(*args, **kwargs) |
d55e5bfc RD |
11536 | |
11537 | def Show(*args, **kwargs): | |
bfddbb17 | 11538 | """ |
b411df4a | 11539 | Show(self, item, bool show=True, bool recursive=false) -> bool |
d55e5bfc | 11540 | |
bfddbb17 RD |
11541 | Shows or hides an item managed by the sizer. To make a sizer item |
11542 | disappear or reappear, use Show followed by `Layout`. The *item* | |
11543 | parameter can be either a window, a sizer, or the zero-based index of | |
629e65c2 RD |
11544 | the item. Use the recursive parameter to show or hide an item in a |
11545 | subsizer. Returns True if the item was found. | |
bfddbb17 | 11546 | """ |
5b5c9bc7 | 11547 | return _core_.Sizer_Show(*args, **kwargs) |
d55e5bfc RD |
11548 | |
11549 | def IsShown(*args, **kwargs): | |
bfddbb17 RD |
11550 | """ |
11551 | IsShown(self, item) | |
11552 | ||
b1fcee84 | 11553 | Determines if the item is currently shown. To make a sizer |
bfddbb17 RD |
11554 | item disappear or reappear, use Show followed by `Layout`. The *item* |
11555 | parameter can be either a window, a sizer, or the zero-based index of | |
11556 | the item. | |
11557 | """ | |
5b5c9bc7 | 11558 | return _core_.Sizer_IsShown(*args, **kwargs) |
d55e5bfc | 11559 | |
629e65c2 | 11560 | def Hide(self, item, recursive=False): |
bfddbb17 | 11561 | """ |
27fb7603 | 11562 | A convenience method for `Show` (item, False, recursive). |
bfddbb17 | 11563 | """ |
06759a38 | 11564 | return self.Show(item, False, recursive) |
bfddbb17 | 11565 | |
d55e5bfc | 11566 | def ShowItems(*args, **kwargs): |
bfddbb17 RD |
11567 | """ |
11568 | ShowItems(self, bool show) | |
11569 | ||
84f85550 | 11570 | Recursively call `wx.SizerItem.Show` on all sizer items. |
bfddbb17 | 11571 | """ |
5b5c9bc7 | 11572 | return _core_.Sizer_ShowItems(*args, **kwargs) |
d55e5bfc | 11573 | |
2131d850 | 11574 | _core_.Sizer_swigregister(Sizer) |
d55e5bfc | 11575 | |
5b5c9bc7 | 11576 | class PySizer(Sizer): |
bfddbb17 RD |
11577 | """ |
11578 | wx.PySizer is a special version of `wx.Sizer` that has been | |
11579 | instrumented to allow the C++ virtual methods to be overloaded in | |
11580 | Python derived classes. You would derive from this class if you are | |
11581 | wanting to implement a custom sizer in Python code. Simply implement | |
11582 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
11583 | For example:: | |
11584 | ||
11585 | class MySizer(wx.PySizer): | |
11586 | def __init__(self): | |
11587 | wx.PySizer.__init__(self) | |
11588 | ||
11589 | def CalcMin(self): | |
11590 | for item in self.GetChildren(): | |
11591 | # calculate the total minimum width and height needed | |
11592 | # by all items in the sizer according to this sizer's | |
11593 | # layout algorithm. | |
11594 | ... | |
11595 | return wx.Size(width, height) | |
11596 | ||
11597 | def RecalcSizes(self): | |
11598 | # find the space allotted to this sizer | |
11599 | pos = self.GetPosition() | |
11600 | size = self.GetSize() | |
11601 | for item in self.GetChildren(): | |
11602 | # Recalculate (if necessary) the position and size of | |
11603 | # each item and then call item.SetDimension to do the | |
11604 | # actual positioning and sizing of the items within the | |
11605 | # space alloted to this sizer. | |
11606 | ... | |
11607 | item.SetDimension(itemPos, itemSize) | |
11608 | ||
11609 | ||
11610 | When `Layout` is called it first calls `CalcMin` followed by | |
11611 | `RecalcSizes` so you can optimize a bit by saving the results of | |
62d32a5f | 11612 | `CalcMin` and reusing them in `RecalcSizes`. |
bfddbb17 RD |
11613 | |
11614 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
11615 | ||
11616 | ||
11617 | """ | |
1bd55598 RD |
11618 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11619 | __repr__ = _swig_repr | |
11620 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11621 | """ |
5b5c9bc7 | 11622 | __init__(self) -> PySizer |
bfddbb17 RD |
11623 | |
11624 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
11625 | class. | |
11626 | """ | |
1bd55598 | 11627 | _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs)) |
d55e5bfc RD |
11628 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) |
11629 | ||
11630 | def _setCallbackInfo(*args, **kwargs): | |
11631 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
5b5c9bc7 | 11632 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
d55e5bfc | 11633 | |
2131d850 | 11634 | _core_.PySizer_swigregister(PySizer) |
d55e5bfc RD |
11635 | |
11636 | #--------------------------------------------------------------------------- | |
11637 | ||
5b5c9bc7 | 11638 | class BoxSizer(Sizer): |
bfddbb17 RD |
11639 | """ |
11640 | The basic idea behind a box sizer is that windows will most often be | |
11641 | laid out in rather simple basic geometry, typically in a row or a | |
11642 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
11643 | its items in a simple row or column, depending on the orientation | |
11644 | parameter passed to the constructor. | |
11645 | """ | |
1bd55598 RD |
11646 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11647 | __repr__ = _swig_repr | |
11648 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11649 | """ |
5b5c9bc7 | 11650 | __init__(self, int orient=HORIZONTAL) -> BoxSizer |
bfddbb17 RD |
11651 | |
11652 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
11653 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
11654 | sizer. | |
11655 | """ | |
1bd55598 | 11656 | _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs)) |
d55e5bfc RD |
11657 | self._setOORInfo(self) |
11658 | ||
11659 | def GetOrientation(*args, **kwargs): | |
bfddbb17 RD |
11660 | """ |
11661 | GetOrientation(self) -> int | |
11662 | ||
11663 | Returns the current orientation of the sizer. | |
11664 | """ | |
5b5c9bc7 | 11665 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
11666 | |
11667 | def SetOrientation(*args, **kwargs): | |
bfddbb17 RD |
11668 | """ |
11669 | SetOrientation(self, int orient) | |
d55e5bfc | 11670 | |
bfddbb17 RD |
11671 | Resets the orientation of the sizer. |
11672 | """ | |
5b5c9bc7 | 11673 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) |
d55e5bfc | 11674 | |
2131d850 | 11675 | _core_.BoxSizer_swigregister(BoxSizer) |
d55e5bfc RD |
11676 | |
11677 | #--------------------------------------------------------------------------- | |
11678 | ||
5b5c9bc7 | 11679 | class StaticBoxSizer(BoxSizer): |
bfddbb17 RD |
11680 | """ |
11681 | wx.StaticBoxSizer derives from and functions identically to the | |
11682 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
11683 | manages. Note that this static box must be created separately and | |
11684 | passed to the sizer constructor. | |
11685 | """ | |
1bd55598 RD |
11686 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11687 | __repr__ = _swig_repr | |
11688 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11689 | """ |
5b5c9bc7 | 11690 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer |
bfddbb17 RD |
11691 | |
11692 | Constructor. It takes an associated static box and the orientation | |
11693 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
11694 | ``wx.HORIZONTAL``. | |
11695 | """ | |
1bd55598 | 11696 | _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs)) |
d55e5bfc RD |
11697 | self._setOORInfo(self) |
11698 | ||
11699 | def GetStaticBox(*args, **kwargs): | |
bfddbb17 | 11700 | """ |
5b5c9bc7 | 11701 | GetStaticBox(self) -> StaticBox |
d55e5bfc | 11702 | |
bfddbb17 RD |
11703 | Returns the static box associated with this sizer. |
11704 | """ | |
5b5c9bc7 | 11705 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) |
d55e5bfc | 11706 | |
2131d850 | 11707 | _core_.StaticBoxSizer_swigregister(StaticBoxSizer) |
d55e5bfc RD |
11708 | |
11709 | #--------------------------------------------------------------------------- | |
11710 | ||
5b5c9bc7 | 11711 | class GridSizer(Sizer): |
bfddbb17 RD |
11712 | """ |
11713 | A grid sizer is a sizer which lays out its children in a | |
11714 | two-dimensional table with all cells having the same size. In other | |
11715 | words, the width of each cell within the grid is the width of the | |
11716 | widest item added to the sizer and the height of each grid cell is the | |
11717 | height of the tallest item. An optional vertical and/or horizontal | |
11718 | gap between items can also be specified (in pixels.) | |
11719 | ||
11720 | Items are placed in the cells of the grid in the order they are added, | |
11721 | in row-major order. In other words, the first row is filled first, | |
11722 | then the second, and so on until all items have been added. (If | |
11723 | neccessary, additional rows will be added as items are added.) If you | |
11724 | need to have greater control over the cells that items are placed in | |
11725 | then use the `wx.GridBagSizer`. | |
11726 | ||
11727 | """ | |
1bd55598 RD |
11728 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11729 | __repr__ = _swig_repr | |
11730 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11731 | """ |
5b5c9bc7 | 11732 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer |
bfddbb17 RD |
11733 | |
11734 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
11735 | of columns and rows in the sizer - if either of the parameters is | |
11736 | zero, it will be calculated to from the total number of children in | |
11737 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
11738 | define extra space between all children. | |
11739 | """ | |
1bd55598 | 11740 | _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs)) |
d55e5bfc RD |
11741 | self._setOORInfo(self) |
11742 | ||
d55e5bfc | 11743 | def SetCols(*args, **kwargs): |
bfddbb17 RD |
11744 | """ |
11745 | SetCols(self, int cols) | |
11746 | ||
11747 | Sets the number of columns in the sizer. | |
11748 | """ | |
5b5c9bc7 | 11749 | return _core_.GridSizer_SetCols(*args, **kwargs) |
d55e5bfc RD |
11750 | |
11751 | def SetRows(*args, **kwargs): | |
bfddbb17 RD |
11752 | """ |
11753 | SetRows(self, int rows) | |
11754 | ||
11755 | Sets the number of rows in the sizer. | |
11756 | """ | |
5b5c9bc7 | 11757 | return _core_.GridSizer_SetRows(*args, **kwargs) |
d55e5bfc RD |
11758 | |
11759 | def SetVGap(*args, **kwargs): | |
bfddbb17 RD |
11760 | """ |
11761 | SetVGap(self, int gap) | |
11762 | ||
11763 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
11764 | """ | |
5b5c9bc7 | 11765 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
d55e5bfc RD |
11766 | |
11767 | def SetHGap(*args, **kwargs): | |
bfddbb17 RD |
11768 | """ |
11769 | SetHGap(self, int gap) | |
11770 | ||
11771 | Sets the horizontal gap (in pixels) between cells in the sizer | |
11772 | """ | |
5b5c9bc7 | 11773 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
d55e5bfc RD |
11774 | |
11775 | def GetCols(*args, **kwargs): | |
bfddbb17 RD |
11776 | """ |
11777 | GetCols(self) -> int | |
11778 | ||
11779 | Returns the number of columns in the sizer. | |
11780 | """ | |
5b5c9bc7 | 11781 | return _core_.GridSizer_GetCols(*args, **kwargs) |
d55e5bfc RD |
11782 | |
11783 | def GetRows(*args, **kwargs): | |
bfddbb17 RD |
11784 | """ |
11785 | GetRows(self) -> int | |
11786 | ||
11787 | Returns the number of rows in the sizer. | |
11788 | """ | |
5b5c9bc7 | 11789 | return _core_.GridSizer_GetRows(*args, **kwargs) |
d55e5bfc RD |
11790 | |
11791 | def GetVGap(*args, **kwargs): | |
bfddbb17 RD |
11792 | """ |
11793 | GetVGap(self) -> int | |
11794 | ||
11795 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
11796 | """ | |
5b5c9bc7 | 11797 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
d55e5bfc RD |
11798 | |
11799 | def GetHGap(*args, **kwargs): | |
bfddbb17 RD |
11800 | """ |
11801 | GetHGap(self) -> int | |
11802 | ||
11803 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
11804 | """ | |
5b5c9bc7 | 11805 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
d55e5bfc | 11806 | |
1bd55598 RD |
11807 | def CalcRowsCols(self): |
11808 | """ | |
11809 | CalcRowsCols() -> (rows, cols) | |
11810 | ||
11811 | Calculates how many rows and columns will be in the sizer based | |
11812 | on the current number of items and also the rows, cols specified | |
11813 | in the constructor. | |
11814 | """ | |
11815 | nitems = len(self.GetChildren()) | |
11816 | rows = self.GetRows() | |
11817 | cols = self.GetCols() | |
11818 | assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed" | |
11819 | if cols != 0: | |
11820 | rows = (nitems + cols - 1) / cols | |
11821 | elif rows != 0: | |
11822 | cols = (nitems + rows - 1) / rows | |
11823 | return (rows, cols) | |
d55e5bfc | 11824 | |
2131d850 | 11825 | _core_.GridSizer_swigregister(GridSizer) |
d55e5bfc RD |
11826 | |
11827 | #--------------------------------------------------------------------------- | |
11828 | ||
5b5c9bc7 RD |
11829 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
11830 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
11831 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
11832 | class FlexGridSizer(GridSizer): | |
bfddbb17 RD |
11833 | """ |
11834 | A flex grid sizer is a sizer which lays out its children in a | |
11835 | two-dimensional table with all table cells in one row having the same | |
11836 | height and all cells in one column having the same width, but all | |
11837 | rows or all columns are not necessarily the same height or width as in | |
11838 | the `wx.GridSizer`. | |
11839 | ||
11840 | wx.FlexGridSizer can also size items equally in one direction but | |
11841 | unequally ("flexibly") in the other. If the sizer is only flexible | |
11842 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
11843 | needs to be decided how the sizer should grow in the other ("non | |
11844 | flexible") direction in order to fill the available space. The | |
11845 | `SetNonFlexibleGrowMode` method serves this purpose. | |
11846 | ||
11847 | ||
11848 | """ | |
1bd55598 RD |
11849 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11850 | __repr__ = _swig_repr | |
11851 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11852 | """ |
5b5c9bc7 | 11853 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer |
bfddbb17 RD |
11854 | |
11855 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
11856 | number of columns and rows in the sizer - if either of the parameters | |
11857 | is zero, it will be calculated to from the total number of children in | |
11858 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
11859 | define extra space between all children. | |
11860 | """ | |
1bd55598 | 11861 | _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs)) |
d55e5bfc RD |
11862 | self._setOORInfo(self) |
11863 | ||
bfddbb17 RD |
11864 | def AddGrowableRow(*args, **kwargs): |
11865 | """ | |
11866 | AddGrowableRow(self, size_t idx, int proportion=0) | |
d55e5bfc | 11867 | |
bfddbb17 RD |
11868 | Specifies that row *idx* (starting from zero) should be grown if there |
11869 | is extra space available to the sizer. | |
d55e5bfc | 11870 | |
bfddbb17 RD |
11871 | The *proportion* parameter has the same meaning as the stretch factor |
11872 | for the box sizers except that if all proportions are 0, then all | |
11873 | columns are resized equally (instead of not being resized at all). | |
11874 | """ | |
5b5c9bc7 | 11875 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
d55e5bfc RD |
11876 | |
11877 | def RemoveGrowableRow(*args, **kwargs): | |
bfddbb17 RD |
11878 | """ |
11879 | RemoveGrowableRow(self, size_t idx) | |
11880 | ||
11881 | Specifies that row *idx* is no longer growable. | |
11882 | """ | |
5b5c9bc7 | 11883 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
d55e5bfc RD |
11884 | |
11885 | def AddGrowableCol(*args, **kwargs): | |
bfddbb17 RD |
11886 | """ |
11887 | AddGrowableCol(self, size_t idx, int proportion=0) | |
11888 | ||
11889 | Specifies that column *idx* (starting from zero) should be grown if | |
11890 | there is extra space available to the sizer. | |
11891 | ||
11892 | The *proportion* parameter has the same meaning as the stretch factor | |
11893 | for the box sizers except that if all proportions are 0, then all | |
11894 | columns are resized equally (instead of not being resized at all). | |
11895 | """ | |
5b5c9bc7 | 11896 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
d55e5bfc RD |
11897 | |
11898 | def RemoveGrowableCol(*args, **kwargs): | |
bfddbb17 RD |
11899 | """ |
11900 | RemoveGrowableCol(self, size_t idx) | |
11901 | ||
11902 | Specifies that column *idx* is no longer growable. | |
11903 | """ | |
5b5c9bc7 | 11904 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
d55e5bfc RD |
11905 | |
11906 | def SetFlexibleDirection(*args, **kwargs): | |
bfddbb17 RD |
11907 | """ |
11908 | SetFlexibleDirection(self, int direction) | |
11909 | ||
11910 | Specifies whether the sizer should flexibly resize its columns, rows, | |
11911 | or both. Argument *direction* can be one of the following values. Any | |
11912 | other value is ignored. | |
11913 | ||
11914 | ============== ======================================= | |
11915 | wx.VERTICAL Rows are flexibly sized. | |
11916 | wx.HORIZONTAL Columns are flexibly sized. | |
11917 | wx.BOTH Both rows and columns are flexibly sized | |
11918 | (this is the default value). | |
11919 | ============== ======================================= | |
11920 | ||
11921 | Note that this method does not trigger relayout. | |
11922 | ||
11923 | """ | |
5b5c9bc7 | 11924 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
d55e5bfc RD |
11925 | |
11926 | def GetFlexibleDirection(*args, **kwargs): | |
bfddbb17 RD |
11927 | """ |
11928 | GetFlexibleDirection(self) -> int | |
11929 | ||
11930 | Returns a value that specifies whether the sizer | |
11931 | flexibly resizes its columns, rows, or both (default). | |
11932 | ||
11933 | :see: `SetFlexibleDirection` | |
11934 | """ | |
5b5c9bc7 | 11935 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
d55e5bfc RD |
11936 | |
11937 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
bfddbb17 RD |
11938 | """ |
11939 | SetNonFlexibleGrowMode(self, int mode) | |
11940 | ||
11941 | Specifies how the sizer should grow in the non-flexible direction if | |
11942 | there is one (so `SetFlexibleDirection` must have been called | |
11943 | previously). Argument *mode* can be one of the following values: | |
11944 | ||
11945 | ========================== ================================================= | |
11946 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
11947 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
11948 | `AddGrowableCol` and `AddGrowableRow`. In this | |
11949 | case equal sizing applies to minimum sizes of | |
11950 | columns or rows (this is the default value). | |
11951 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
11952 | the non flexible direction, whether they are | |
11953 | growable or not in the flexbile direction. | |
11954 | ========================== ================================================= | |
11955 | ||
11956 | Note that this method does not trigger relayout. | |
11957 | ||
11958 | ||
11959 | """ | |
5b5c9bc7 | 11960 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
d55e5bfc RD |
11961 | |
11962 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
bfddbb17 RD |
11963 | """ |
11964 | GetNonFlexibleGrowMode(self) -> int | |
11965 | ||
11966 | Returns the value that specifies how the sizer grows in the | |
11967 | non-flexible direction if there is one. | |
11968 | ||
11969 | :see: `SetNonFlexibleGrowMode` | |
11970 | """ | |
5b5c9bc7 | 11971 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
d55e5bfc RD |
11972 | |
11973 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
11974 | """ |
11975 | GetRowHeights(self) -> list | |
11976 | ||
11977 | Returns a list of integers representing the heights of each of the | |
11978 | rows in the sizer. | |
11979 | """ | |
5b5c9bc7 | 11980 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
d55e5bfc RD |
11981 | |
11982 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
11983 | """ |
11984 | GetColWidths(self) -> list | |
11985 | ||
11986 | Returns a list of integers representing the widths of each of the | |
11987 | columns in the sizer. | |
11988 | """ | |
5b5c9bc7 | 11989 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
d55e5bfc | 11990 | |
2131d850 | 11991 | _core_.FlexGridSizer_swigregister(FlexGridSizer) |
d55e5bfc | 11992 | |
5b5c9bc7 | 11993 | class StdDialogButtonSizer(BoxSizer): |
62d32a5f RD |
11994 | """ |
11995 | A special sizer that knows how to order and position standard buttons | |
11996 | in order to conform to the current platform's standards. You simply | |
11997 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 11998 | buttons using the standard ID's. Then call `Realize` and the sizer |
62d32a5f RD |
11999 | will take care of the rest. |
12000 | ||
12001 | """ | |
1bd55598 RD |
12002 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12003 | __repr__ = _swig_repr | |
12004 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 | 12005 | """__init__(self) -> StdDialogButtonSizer""" |
1bd55598 | 12006 | _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs)) |
62d32a5f RD |
12007 | def AddButton(*args, **kwargs): |
12008 | """ | |
12009 | AddButton(self, wxButton button) | |
12010 | ||
12011 | Use this to add the buttons to this sizer. Do not use the `Add` | |
12012 | method in the base class. | |
12013 | """ | |
5b5c9bc7 | 12014 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) |
62d32a5f | 12015 | |
53aa7709 | 12016 | def Realize(*args, **kwargs): |
62d32a5f | 12017 | """ |
53aa7709 | 12018 | Realize(self) |
62d32a5f RD |
12019 | |
12020 | This funciton needs to be called after all the buttons have been added | |
12021 | to the sizer. It will reorder them and position them in a platform | |
12022 | specifc manner. | |
12023 | """ | |
5b5c9bc7 | 12024 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
12025 | |
12026 | def SetAffirmativeButton(*args, **kwargs): | |
12027 | """SetAffirmativeButton(self, wxButton button)""" | |
5b5c9bc7 | 12028 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) |
51b83b37 RD |
12029 | |
12030 | def SetNegativeButton(*args, **kwargs): | |
12031 | """SetNegativeButton(self, wxButton button)""" | |
5b5c9bc7 | 12032 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) |
51b83b37 RD |
12033 | |
12034 | def SetCancelButton(*args, **kwargs): | |
12035 | """SetCancelButton(self, wxButton button)""" | |
5b5c9bc7 | 12036 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) |
62d32a5f RD |
12037 | |
12038 | def GetAffirmativeButton(*args, **kwargs): | |
12039 | """GetAffirmativeButton(self) -> wxButton""" | |
5b5c9bc7 | 12040 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) |
62d32a5f RD |
12041 | |
12042 | def GetApplyButton(*args, **kwargs): | |
12043 | """GetApplyButton(self) -> wxButton""" | |
5b5c9bc7 | 12044 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) |
62d32a5f RD |
12045 | |
12046 | def GetNegativeButton(*args, **kwargs): | |
12047 | """GetNegativeButton(self) -> wxButton""" | |
5b5c9bc7 | 12048 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) |
62d32a5f RD |
12049 | |
12050 | def GetCancelButton(*args, **kwargs): | |
12051 | """GetCancelButton(self) -> wxButton""" | |
5b5c9bc7 | 12052 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) |
62d32a5f RD |
12053 | |
12054 | def GetHelpButton(*args, **kwargs): | |
12055 | """GetHelpButton(self) -> wxButton""" | |
5b5c9bc7 | 12056 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) |
62d32a5f | 12057 | |
2131d850 | 12058 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer) |
62d32a5f | 12059 | |
d55e5bfc RD |
12060 | #--------------------------------------------------------------------------- |
12061 | ||
5b5c9bc7 | 12062 | class GBPosition(object): |
bfddbb17 RD |
12063 | """ |
12064 | This class represents the position of an item in a virtual grid of | |
12065 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12066 | typemaps that will automatically convert from a 2-element sequence of | |
12067 | integers to a wx.GBPosition, so you can use the more pythonic | |
12068 | representation of the position nearly transparently in Python code. | |
12069 | """ | |
1bd55598 RD |
12070 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12071 | __repr__ = _swig_repr | |
12072 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12073 | """ |
5b5c9bc7 | 12074 | __init__(self, int row=0, int col=0) -> GBPosition |
bfddbb17 RD |
12075 | |
12076 | This class represents the position of an item in a virtual grid of | |
12077 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12078 | typemaps that will automatically convert from a 2-element sequence of | |
12079 | integers to a wx.GBPosition, so you can use the more pythonic | |
12080 | representation of the position nearly transparently in Python code. | |
12081 | """ | |
1bd55598 RD |
12082 | _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs)) |
12083 | __swig_destroy__ = _core_.delete_GBPosition | |
12084 | __del__ = lambda self : None; | |
d55e5bfc RD |
12085 | def GetRow(*args, **kwargs): |
12086 | """GetRow(self) -> int""" | |
5b5c9bc7 | 12087 | return _core_.GBPosition_GetRow(*args, **kwargs) |
d55e5bfc RD |
12088 | |
12089 | def GetCol(*args, **kwargs): | |
12090 | """GetCol(self) -> int""" | |
5b5c9bc7 | 12091 | return _core_.GBPosition_GetCol(*args, **kwargs) |
d55e5bfc RD |
12092 | |
12093 | def SetRow(*args, **kwargs): | |
12094 | """SetRow(self, int row)""" | |
5b5c9bc7 | 12095 | return _core_.GBPosition_SetRow(*args, **kwargs) |
d55e5bfc RD |
12096 | |
12097 | def SetCol(*args, **kwargs): | |
12098 | """SetCol(self, int col)""" | |
5b5c9bc7 | 12099 | return _core_.GBPosition_SetCol(*args, **kwargs) |
d55e5bfc RD |
12100 | |
12101 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
12102 | """ |
12103 | __eq__(self, PyObject other) -> bool | |
12104 | ||
12105 | Compare GBPosition for equality. | |
12106 | """ | |
5b5c9bc7 | 12107 | return _core_.GBPosition___eq__(*args, **kwargs) |
d55e5bfc RD |
12108 | |
12109 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
12110 | """ |
12111 | __ne__(self, PyObject other) -> bool | |
12112 | ||
12113 | Compare GBPosition for inequality. | |
12114 | """ | |
5b5c9bc7 | 12115 | return _core_.GBPosition___ne__(*args, **kwargs) |
d55e5bfc RD |
12116 | |
12117 | def Set(*args, **kwargs): | |
12118 | """Set(self, int row=0, int col=0)""" | |
5b5c9bc7 | 12119 | return _core_.GBPosition_Set(*args, **kwargs) |
d55e5bfc RD |
12120 | |
12121 | def Get(*args, **kwargs): | |
12122 | """Get(self) -> PyObject""" | |
5b5c9bc7 | 12123 | return _core_.GBPosition_Get(*args, **kwargs) |
d55e5bfc | 12124 | |
15817c7e | 12125 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
12126 | def __str__(self): return str(self.Get()) |
12127 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
12128 | def __len__(self): return len(self.Get()) | |
12129 | def __getitem__(self, index): return self.Get()[index] | |
12130 | def __setitem__(self, index, val): | |
12131 | if index == 0: self.SetRow(val) | |
12132 | elif index == 1: self.SetCol(val) | |
12133 | else: raise IndexError | |
12134 | def __nonzero__(self): return self.Get() != (0,0) | |
12135 | __safe_for_unpickling__ = True | |
12136 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
12137 | ||
12138 | row = property(GetRow, SetRow) | |
12139 | col = property(GetCol, SetCol) | |
12140 | ||
2131d850 | 12141 | _core_.GBPosition_swigregister(GBPosition) |
d55e5bfc | 12142 | |
5b5c9bc7 | 12143 | class GBSpan(object): |
bfddbb17 RD |
12144 | """ |
12145 | This class is used to hold the row and column spanning attributes of | |
12146 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
12147 | automatically convert from a 2-element sequence of integers to a | |
12148 | wx.GBSpan, so you can use the more pythonic representation of the span | |
12149 | nearly transparently in Python code. | |
12150 | ||
12151 | """ | |
1bd55598 RD |
12152 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12153 | __repr__ = _swig_repr | |
12154 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12155 | """ |
5b5c9bc7 | 12156 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan |
bfddbb17 RD |
12157 | |
12158 | Construct a new wxGBSpan, optionally setting the rowspan and | |
12159 | colspan. The default is (1,1). (Meaning that the item occupies one | |
12160 | cell in each direction. | |
12161 | """ | |
1bd55598 RD |
12162 | _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs)) |
12163 | __swig_destroy__ = _core_.delete_GBSpan | |
12164 | __del__ = lambda self : None; | |
d55e5bfc RD |
12165 | def GetRowspan(*args, **kwargs): |
12166 | """GetRowspan(self) -> int""" | |
5b5c9bc7 | 12167 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
d55e5bfc RD |
12168 | |
12169 | def GetColspan(*args, **kwargs): | |
12170 | """GetColspan(self) -> int""" | |
5b5c9bc7 | 12171 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
d55e5bfc RD |
12172 | |
12173 | def SetRowspan(*args, **kwargs): | |
12174 | """SetRowspan(self, int rowspan)""" | |
5b5c9bc7 | 12175 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
d55e5bfc RD |
12176 | |
12177 | def SetColspan(*args, **kwargs): | |
12178 | """SetColspan(self, int colspan)""" | |
5b5c9bc7 | 12179 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
d55e5bfc RD |
12180 | |
12181 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
12182 | """ |
12183 | __eq__(self, PyObject other) -> bool | |
12184 | ||
12185 | Compare wxGBSpan for equality. | |
12186 | """ | |
5b5c9bc7 | 12187 | return _core_.GBSpan___eq__(*args, **kwargs) |
d55e5bfc RD |
12188 | |
12189 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
12190 | """ |
12191 | __ne__(self, PyObject other) -> bool | |
12192 | ||
12193 | Compare GBSpan for inequality. | |
12194 | """ | |
5b5c9bc7 | 12195 | return _core_.GBSpan___ne__(*args, **kwargs) |
d55e5bfc RD |
12196 | |
12197 | def Set(*args, **kwargs): | |
12198 | """Set(self, int rowspan=1, int colspan=1)""" | |
5b5c9bc7 | 12199 | return _core_.GBSpan_Set(*args, **kwargs) |
d55e5bfc RD |
12200 | |
12201 | def Get(*args, **kwargs): | |
12202 | """Get(self) -> PyObject""" | |
5b5c9bc7 | 12203 | return _core_.GBSpan_Get(*args, **kwargs) |
d55e5bfc | 12204 | |
15817c7e | 12205 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
12206 | def __str__(self): return str(self.Get()) |
12207 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
12208 | def __len__(self): return len(self.Get()) | |
12209 | def __getitem__(self, index): return self.Get()[index] | |
12210 | def __setitem__(self, index, val): | |
12211 | if index == 0: self.SetRowspan(val) | |
12212 | elif index == 1: self.SetColspan(val) | |
12213 | else: raise IndexError | |
12214 | def __nonzero__(self): return self.Get() != (0,0) | |
12215 | __safe_for_unpickling__ = True | |
12216 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
12217 | ||
12218 | rowspan = property(GetRowspan, SetRowspan) | |
12219 | colspan = property(GetColspan, SetColspan) | |
12220 | ||
2131d850 | 12221 | _core_.GBSpan_swigregister(GBSpan) |
d55e5bfc | 12222 | |
5b5c9bc7 | 12223 | class GBSizerItem(SizerItem): |
bfddbb17 RD |
12224 | """ |
12225 | The wx.GBSizerItem class is used to track the additional data about | |
12226 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12227 | and how many rows or columns it spans. | |
12228 | ||
12229 | """ | |
1bd55598 RD |
12230 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12231 | __repr__ = _swig_repr | |
12232 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12233 | """ |
5b5c9bc7 | 12234 | __init__(self) -> GBSizerItem |
bfddbb17 RD |
12235 | |
12236 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12237 | size will need to be set, as well as a position and span before this | |
12238 | item can be used in a Sizer. | |
12239 | ||
12240 | You will probably never need to create a wx.GBSizerItem directly as they | |
12241 | are created automatically when the sizer's Add method is called. | |
12242 | """ | |
1bd55598 RD |
12243 | _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs)) |
12244 | __swig_destroy__ = _core_.delete_GBSizerItem | |
12245 | __del__ = lambda self : None; | |
d55e5bfc | 12246 | def GetPos(*args, **kwargs): |
bfddbb17 | 12247 | """ |
5b5c9bc7 | 12248 | GetPos(self) -> GBPosition |
bfddbb17 RD |
12249 | |
12250 | Get the grid position of the item | |
12251 | """ | |
5b5c9bc7 | 12252 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
d55e5bfc RD |
12253 | |
12254 | def GetPosTuple(self): return self.GetPos().Get() | |
12255 | def GetSpan(*args, **kwargs): | |
bfddbb17 | 12256 | """ |
5b5c9bc7 | 12257 | GetSpan(self) -> GBSpan |
bfddbb17 RD |
12258 | |
12259 | Get the row and column spanning of the item | |
12260 | """ | |
5b5c9bc7 | 12261 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
d55e5bfc RD |
12262 | |
12263 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12264 | def SetPos(*args, **kwargs): | |
bfddbb17 | 12265 | """ |
5b5c9bc7 | 12266 | SetPos(self, GBPosition pos) -> bool |
bfddbb17 RD |
12267 | |
12268 | If the item is already a member of a sizer then first ensure that | |
12269 | there is no other item that would intersect with this one at the new | |
12270 | position, then set the new position. Returns True if the change is | |
12271 | successful and after the next Layout() the item will be moved. | |
12272 | """ | |
5b5c9bc7 | 12273 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
d55e5bfc RD |
12274 | |
12275 | def SetSpan(*args, **kwargs): | |
bfddbb17 | 12276 | """ |
5b5c9bc7 | 12277 | SetSpan(self, GBSpan span) -> bool |
bfddbb17 RD |
12278 | |
12279 | If the item is already a member of a sizer then first ensure that | |
12280 | there is no other item that would intersect with this one with its new | |
12281 | spanning size, then set the new spanning. Returns True if the change | |
12282 | is successful and after the next Layout() the item will be resized. | |
12283 | ||
12284 | """ | |
5b5c9bc7 | 12285 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
d55e5bfc | 12286 | |
bfddbb17 | 12287 | def Intersects(*args, **kwargs): |
d55e5bfc | 12288 | """ |
5b5c9bc7 | 12289 | Intersects(self, GBSizerItem other) -> bool |
bfddbb17 RD |
12290 | |
12291 | Returns True if this item and the other item instersect. | |
d55e5bfc | 12292 | """ |
5b5c9bc7 | 12293 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
bfddbb17 RD |
12294 | |
12295 | def IntersectsPos(*args, **kwargs): | |
12296 | """ | |
5b5c9bc7 | 12297 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool |
bfddbb17 RD |
12298 | |
12299 | Returns True if the given pos/span would intersect with this item. | |
12300 | """ | |
5b5c9bc7 | 12301 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) |
d55e5bfc RD |
12302 | |
12303 | def GetEndPos(*args, **kwargs): | |
bfddbb17 | 12304 | """ |
5b5c9bc7 | 12305 | GetEndPos(self) -> GBPosition |
bfddbb17 RD |
12306 | |
12307 | Get the row and column of the endpoint of this item. | |
12308 | """ | |
5b5c9bc7 | 12309 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
d55e5bfc RD |
12310 | |
12311 | def GetGBSizer(*args, **kwargs): | |
bfddbb17 | 12312 | """ |
5b5c9bc7 | 12313 | GetGBSizer(self) -> GridBagSizer |
bfddbb17 RD |
12314 | |
12315 | Get the sizer this item is a member of. | |
12316 | """ | |
5b5c9bc7 | 12317 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
d55e5bfc RD |
12318 | |
12319 | def SetGBSizer(*args, **kwargs): | |
bfddbb17 | 12320 | """ |
5b5c9bc7 | 12321 | SetGBSizer(self, GridBagSizer sizer) |
bfddbb17 RD |
12322 | |
12323 | Set the sizer this item is a member of. | |
12324 | """ | |
5b5c9bc7 | 12325 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
d55e5bfc | 12326 | |
2131d850 | 12327 | _core_.GBSizerItem_swigregister(GBSizerItem) |
5b5c9bc7 | 12328 | DefaultSpan = cvar.DefaultSpan |
d55e5bfc RD |
12329 | |
12330 | def GBSizerItemWindow(*args, **kwargs): | |
12331 | """ | |
5b5c9bc7 RD |
12332 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, |
12333 | int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12334 | |
12335 | Construct a `wx.GBSizerItem` for a window. | |
d55e5bfc | 12336 | """ |
5b5c9bc7 | 12337 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d55e5bfc RD |
12338 | return val |
12339 | ||
12340 | def GBSizerItemSizer(*args, **kwargs): | |
12341 | """ | |
5b5c9bc7 RD |
12342 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, |
12343 | int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12344 | |
12345 | Construct a `wx.GBSizerItem` for a sizer | |
d55e5bfc | 12346 | """ |
5b5c9bc7 | 12347 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d55e5bfc RD |
12348 | return val |
12349 | ||
12350 | def GBSizerItemSpacer(*args, **kwargs): | |
12351 | """ | |
5b5c9bc7 RD |
12352 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, |
12353 | int flag, int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12354 | |
12355 | Construct a `wx.GBSizerItem` for a spacer. | |
d55e5bfc | 12356 | """ |
5b5c9bc7 | 12357 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d55e5bfc RD |
12358 | return val |
12359 | ||
5b5c9bc7 | 12360 | class GridBagSizer(FlexGridSizer): |
bfddbb17 RD |
12361 | """ |
12362 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12363 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12364 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12365 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12366 | virtual grid is determined by the largest row and column that items are | |
12367 | positioned at, adjusted for spanning. | |
12368 | ||
12369 | """ | |
1bd55598 RD |
12370 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12371 | __repr__ = _swig_repr | |
12372 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12373 | """ |
5b5c9bc7 | 12374 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer |
bfddbb17 RD |
12375 | |
12376 | Constructor, with optional parameters to specify the gap between the | |
12377 | rows and columns. | |
12378 | """ | |
1bd55598 | 12379 | _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs)) |
03e46024 RD |
12380 | self._setOORInfo(self) |
12381 | ||
d55e5bfc RD |
12382 | def Add(*args, **kwargs): |
12383 | """ | |
bfddbb17 | 12384 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
070c48b4 | 12385 | int border=0, userData=None) -> wx.GBSizerItem |
bfddbb17 RD |
12386 | |
12387 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12388 | more than one row or column as specified with *span*. The remaining | |
12389 | args behave similarly to `wx.Sizer.Add`. | |
12390 | ||
12391 | Returns True if the item was successfully placed at the given cell | |
12392 | position, False if something was already there. | |
12393 | ||
d55e5bfc | 12394 | """ |
5b5c9bc7 | 12395 | return _core_.GridBagSizer_Add(*args, **kwargs) |
d55e5bfc RD |
12396 | |
12397 | def AddItem(*args, **kwargs): | |
bfddbb17 | 12398 | """ |
070c48b4 | 12399 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
bfddbb17 RD |
12400 | |
12401 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12402 | the item was successfully placed at its given cell position, False if | |
12403 | something was already there. | |
12404 | """ | |
5b5c9bc7 | 12405 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
d55e5bfc | 12406 | |
84f85550 RD |
12407 | def GetCellSize(*args, **kwargs): |
12408 | """ | |
5b5c9bc7 | 12409 | GetCellSize(self, int row, int col) -> Size |
84f85550 RD |
12410 | |
12411 | Get the size of the specified cell, including hgap and | |
12412 | vgap. Only valid after a Layout. | |
12413 | """ | |
5b5c9bc7 | 12414 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) |
84f85550 | 12415 | |
d55e5bfc | 12416 | def GetEmptyCellSize(*args, **kwargs): |
bfddbb17 | 12417 | """ |
5b5c9bc7 | 12418 | GetEmptyCellSize(self) -> Size |
bfddbb17 RD |
12419 | |
12420 | Get the size used for cells in the grid with no item. | |
12421 | """ | |
5b5c9bc7 | 12422 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
d55e5bfc RD |
12423 | |
12424 | def SetEmptyCellSize(*args, **kwargs): | |
bfddbb17 | 12425 | """ |
5b5c9bc7 | 12426 | SetEmptyCellSize(self, Size sz) |
bfddbb17 RD |
12427 | |
12428 | Set the size used for cells in the grid with no item. | |
12429 | """ | |
5b5c9bc7 | 12430 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
d55e5bfc RD |
12431 | |
12432 | def GetItemPosition(*args): | |
12433 | """ | |
bfddbb17 RD |
12434 | GetItemPosition(self, item) -> GBPosition |
12435 | ||
12436 | Get the grid position of the specified *item* where *item* is either a | |
12437 | window or subsizer that is a member of this sizer, or a zero-based | |
12438 | index of an item. | |
d55e5bfc | 12439 | """ |
5b5c9bc7 | 12440 | return _core_.GridBagSizer_GetItemPosition(*args) |
d55e5bfc RD |
12441 | |
12442 | def SetItemPosition(*args): | |
12443 | """ | |
bfddbb17 RD |
12444 | SetItemPosition(self, item, GBPosition pos) -> bool |
12445 | ||
12446 | Set the grid position of the specified *item* where *item* is either a | |
12447 | window or subsizer that is a member of this sizer, or a zero-based | |
12448 | index of an item. Returns True on success. If the move is not | |
12449 | allowed (because an item is already there) then False is returned. | |
12450 | ||
d55e5bfc | 12451 | """ |
5b5c9bc7 | 12452 | return _core_.GridBagSizer_SetItemPosition(*args) |
d55e5bfc RD |
12453 | |
12454 | def GetItemSpan(*args): | |
12455 | """ | |
bfddbb17 RD |
12456 | GetItemSpan(self, item) -> GBSpan |
12457 | ||
12458 | Get the row/col spanning of the specified *item* where *item* is | |
12459 | either a window or subsizer that is a member of this sizer, or a | |
12460 | zero-based index of an item. | |
d55e5bfc | 12461 | """ |
5b5c9bc7 | 12462 | return _core_.GridBagSizer_GetItemSpan(*args) |
d55e5bfc RD |
12463 | |
12464 | def SetItemSpan(*args): | |
12465 | """ | |
bfddbb17 RD |
12466 | SetItemSpan(self, item, GBSpan span) -> bool |
12467 | ||
12468 | Set the row/col spanning of the specified *item* where *item* is | |
12469 | either a window or subsizer that is a member of this sizer, or a | |
12470 | zero-based index of an item. Returns True on success. If the move is | |
12471 | not allowed (because an item is already there) then False is returned. | |
d55e5bfc | 12472 | """ |
5b5c9bc7 | 12473 | return _core_.GridBagSizer_SetItemSpan(*args) |
d55e5bfc RD |
12474 | |
12475 | def FindItem(*args): | |
12476 | """ | |
bfddbb17 RD |
12477 | FindItem(self, item) -> GBSizerItem |
12478 | ||
12479 | Find the sizer item for the given window or subsizer, returns None if | |
12480 | not found. (non-recursive) | |
d55e5bfc | 12481 | """ |
5b5c9bc7 | 12482 | return _core_.GridBagSizer_FindItem(*args) |
d55e5bfc RD |
12483 | |
12484 | def FindItemAtPosition(*args, **kwargs): | |
bfddbb17 | 12485 | """ |
5b5c9bc7 | 12486 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem |
bfddbb17 RD |
12487 | |
12488 | Return the sizer item for the given grid cell, or None if there is no | |
12489 | item at that position. (non-recursive) | |
12490 | """ | |
5b5c9bc7 | 12491 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
d55e5bfc RD |
12492 | |
12493 | def FindItemAtPoint(*args, **kwargs): | |
bfddbb17 | 12494 | """ |
5b5c9bc7 | 12495 | FindItemAtPoint(self, Point pt) -> GBSizerItem |
bfddbb17 RD |
12496 | |
12497 | Return the sizer item located at the point given in *pt*, or None if | |
12498 | there is no item at that point. The (x,y) coordinates in pt correspond | |
12499 | to the client coordinates of the window using the sizer for | |
12500 | layout. (non-recursive) | |
12501 | """ | |
5b5c9bc7 | 12502 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
d55e5bfc | 12503 | |
bfddbb17 RD |
12504 | def CheckForIntersection(*args, **kwargs): |
12505 | """ | |
5b5c9bc7 | 12506 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool |
d55e5bfc | 12507 | |
bfddbb17 RD |
12508 | Look at all items and see if any intersect (or would overlap) the |
12509 | given *item*. Returns True if so, False if there would be no overlap. | |
12510 | If an *excludeItem* is given then it will not be checked for | |
12511 | intersection, for example it may be the item we are checking the | |
12512 | position of. | |
d55e5bfc | 12513 | |
bfddbb17 | 12514 | """ |
5b5c9bc7 | 12515 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) |
d55e5bfc | 12516 | |
bfddbb17 | 12517 | def CheckForIntersectionPos(*args, **kwargs): |
d55e5bfc | 12518 | """ |
5b5c9bc7 | 12519 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
bfddbb17 RD |
12520 | |
12521 | Look at all items and see if any intersect (or would overlap) the | |
12522 | given position and span. Returns True if so, False if there would be | |
12523 | no overlap. If an *excludeItem* is given then it will not be checked | |
12524 | for intersection, for example it may be the item we are checking the | |
12525 | position of. | |
d55e5bfc | 12526 | """ |
5b5c9bc7 | 12527 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
d55e5bfc | 12528 | |
2131d850 | 12529 | _core_.GridBagSizer_swigregister(GridBagSizer) |
d55e5bfc RD |
12530 | |
12531 | #--------------------------------------------------------------------------- | |
12532 | ||
5b5c9bc7 RD |
12533 | Left = _core_.Left |
12534 | Top = _core_.Top | |
12535 | Right = _core_.Right | |
12536 | Bottom = _core_.Bottom | |
12537 | Width = _core_.Width | |
12538 | Height = _core_.Height | |
12539 | Centre = _core_.Centre | |
12540 | Center = _core_.Center | |
12541 | CentreX = _core_.CentreX | |
12542 | CentreY = _core_.CentreY | |
12543 | Unconstrained = _core_.Unconstrained | |
12544 | AsIs = _core_.AsIs | |
12545 | PercentOf = _core_.PercentOf | |
12546 | Above = _core_.Above | |
12547 | Below = _core_.Below | |
12548 | LeftOf = _core_.LeftOf | |
12549 | RightOf = _core_.RightOf | |
12550 | SameAs = _core_.SameAs | |
12551 | Absolute = _core_.Absolute | |
12552 | class IndividualLayoutConstraint(Object): | |
d55e5bfc | 12553 | """ |
15817c7e RD |
12554 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
12555 | one of eight possible constraints that a window can be involved in. | |
12556 | You will never need to create an instance of | |
12557 | wx.IndividualLayoutConstraint, rather you should create a | |
12558 | `wx.LayoutConstraints` instance and use the individual contstraints | |
d55e5bfc | 12559 | that it contains. |
d55e5bfc | 12560 | """ |
1bd55598 RD |
12561 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12562 | def __init__(self): raise AttributeError, "No constructor defined" | |
12563 | __repr__ = _swig_repr | |
d55e5bfc | 12564 | def Set(*args, **kwargs): |
15817c7e | 12565 | """ |
5b5c9bc7 | 12566 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) |
15817c7e RD |
12567 | |
12568 | Sets the properties of the constraint. Normally called by one of the | |
12569 | convenience functions such as Above, RightOf, SameAs. | |
12570 | """ | |
5b5c9bc7 | 12571 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
d55e5bfc RD |
12572 | |
12573 | def LeftOf(*args, **kwargs): | |
12574 | """ | |
5b5c9bc7 | 12575 | LeftOf(self, Window sibling, int marg=0) |
d55e5bfc | 12576 | |
15817c7e RD |
12577 | Constrains this edge to be to the left of the given window, with an |
12578 | optional margin. Implicitly, this is relative to the left edge of the | |
12579 | other window. | |
d55e5bfc | 12580 | """ |
5b5c9bc7 | 12581 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
d55e5bfc RD |
12582 | |
12583 | def RightOf(*args, **kwargs): | |
12584 | """ | |
5b5c9bc7 | 12585 | RightOf(self, Window sibling, int marg=0) |
d55e5bfc | 12586 | |
15817c7e RD |
12587 | Constrains this edge to be to the right of the given window, with an |
12588 | optional margin. Implicitly, this is relative to the right edge of the | |
12589 | other window. | |
d55e5bfc | 12590 | """ |
5b5c9bc7 | 12591 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
d55e5bfc RD |
12592 | |
12593 | def Above(*args, **kwargs): | |
12594 | """ | |
5b5c9bc7 | 12595 | Above(self, Window sibling, int marg=0) |
d55e5bfc | 12596 | |
15817c7e RD |
12597 | Constrains this edge to be above the given window, with an optional |
12598 | margin. Implicitly, this is relative to the top edge of the other | |
12599 | window. | |
d55e5bfc | 12600 | """ |
5b5c9bc7 | 12601 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
d55e5bfc RD |
12602 | |
12603 | def Below(*args, **kwargs): | |
12604 | """ | |
5b5c9bc7 | 12605 | Below(self, Window sibling, int marg=0) |
d55e5bfc | 12606 | |
15817c7e RD |
12607 | Constrains this edge to be below the given window, with an optional |
12608 | margin. Implicitly, this is relative to the bottom edge of the other | |
12609 | window. | |
d55e5bfc | 12610 | """ |
5b5c9bc7 | 12611 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
d55e5bfc RD |
12612 | |
12613 | def SameAs(*args, **kwargs): | |
12614 | """ | |
5b5c9bc7 | 12615 | SameAs(self, Window otherW, int edge, int marg=0) |
d55e5bfc | 12616 | |
15817c7e RD |
12617 | Constrains this edge or dimension to be to the same as the edge of the |
12618 | given window, with an optional margin. | |
d55e5bfc | 12619 | """ |
5b5c9bc7 | 12620 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
d55e5bfc RD |
12621 | |
12622 | def PercentOf(*args, **kwargs): | |
12623 | """ | |
5b5c9bc7 | 12624 | PercentOf(self, Window otherW, int wh, int per) |
d55e5bfc | 12625 | |
15817c7e RD |
12626 | Constrains this edge or dimension to be to a percentage of the given |
12627 | window, with an optional margin. | |
d55e5bfc | 12628 | """ |
5b5c9bc7 | 12629 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
d55e5bfc RD |
12630 | |
12631 | def Absolute(*args, **kwargs): | |
12632 | """ | |
12633 | Absolute(self, int val) | |
12634 | ||
15817c7e | 12635 | Constrains this edge or dimension to be the given absolute value. |
d55e5bfc | 12636 | """ |
5b5c9bc7 | 12637 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
d55e5bfc RD |
12638 | |
12639 | def Unconstrained(*args, **kwargs): | |
12640 | """ | |
12641 | Unconstrained(self) | |
12642 | ||
15817c7e RD |
12643 | Sets this edge or dimension to be unconstrained, that is, dependent on |
12644 | other edges and dimensions from which this value can be deduced. | |
d55e5bfc | 12645 | """ |
5b5c9bc7 | 12646 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
d55e5bfc RD |
12647 | |
12648 | def AsIs(*args, **kwargs): | |
12649 | """ | |
12650 | AsIs(self) | |
12651 | ||
15817c7e RD |
12652 | Sets this edge or constraint to be whatever the window's value is at |
12653 | the moment. If either of the width and height constraints are *as is*, | |
12654 | the window will not be resized, but moved instead. This is important | |
12655 | when considering panel items which are intended to have a default | |
12656 | size, such as a button, which may take its size from the size of the | |
12657 | button label. | |
d55e5bfc | 12658 | """ |
5b5c9bc7 | 12659 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
d55e5bfc RD |
12660 | |
12661 | def GetOtherWindow(*args, **kwargs): | |
5b5c9bc7 RD |
12662 | """GetOtherWindow(self) -> Window""" |
12663 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) | |
d55e5bfc RD |
12664 | |
12665 | def GetMyEdge(*args, **kwargs): | |
12666 | """GetMyEdge(self) -> int""" | |
5b5c9bc7 | 12667 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
d55e5bfc RD |
12668 | |
12669 | def SetEdge(*args, **kwargs): | |
12670 | """SetEdge(self, int which)""" | |
5b5c9bc7 | 12671 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
d55e5bfc RD |
12672 | |
12673 | def SetValue(*args, **kwargs): | |
12674 | """SetValue(self, int v)""" | |
5b5c9bc7 | 12675 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
d55e5bfc RD |
12676 | |
12677 | def GetMargin(*args, **kwargs): | |
12678 | """GetMargin(self) -> int""" | |
5b5c9bc7 | 12679 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
d55e5bfc RD |
12680 | |
12681 | def SetMargin(*args, **kwargs): | |
12682 | """SetMargin(self, int m)""" | |
5b5c9bc7 | 12683 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
d55e5bfc RD |
12684 | |
12685 | def GetValue(*args, **kwargs): | |
12686 | """GetValue(self) -> int""" | |
5b5c9bc7 | 12687 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
d55e5bfc RD |
12688 | |
12689 | def GetPercent(*args, **kwargs): | |
12690 | """GetPercent(self) -> int""" | |
5b5c9bc7 | 12691 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
d55e5bfc RD |
12692 | |
12693 | def GetOtherEdge(*args, **kwargs): | |
12694 | """GetOtherEdge(self) -> int""" | |
5b5c9bc7 | 12695 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
d55e5bfc RD |
12696 | |
12697 | def GetDone(*args, **kwargs): | |
12698 | """GetDone(self) -> bool""" | |
5b5c9bc7 | 12699 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
d55e5bfc RD |
12700 | |
12701 | def SetDone(*args, **kwargs): | |
12702 | """SetDone(self, bool d)""" | |
5b5c9bc7 | 12703 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
d55e5bfc RD |
12704 | |
12705 | def GetRelationship(*args, **kwargs): | |
12706 | """GetRelationship(self) -> int""" | |
5b5c9bc7 | 12707 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
d55e5bfc RD |
12708 | |
12709 | def SetRelationship(*args, **kwargs): | |
12710 | """SetRelationship(self, int r)""" | |
5b5c9bc7 | 12711 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
d55e5bfc RD |
12712 | |
12713 | def ResetIfWin(*args, **kwargs): | |
12714 | """ | |
5b5c9bc7 | 12715 | ResetIfWin(self, Window otherW) -> bool |
d55e5bfc RD |
12716 | |
12717 | Reset constraint if it mentions otherWin | |
12718 | """ | |
5b5c9bc7 | 12719 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
d55e5bfc RD |
12720 | |
12721 | def SatisfyConstraint(*args, **kwargs): | |
12722 | """ | |
5b5c9bc7 | 12723 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
d55e5bfc RD |
12724 | |
12725 | Try to satisfy constraint | |
12726 | """ | |
5b5c9bc7 | 12727 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
d55e5bfc RD |
12728 | |
12729 | def GetEdge(*args, **kwargs): | |
12730 | """ | |
5b5c9bc7 | 12731 | GetEdge(self, int which, Window thisWin, Window other) -> int |
d55e5bfc RD |
12732 | |
12733 | Get the value of this edge or dimension, or if this | |
12734 | is not determinable, -1. | |
12735 | """ | |
5b5c9bc7 | 12736 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
d55e5bfc | 12737 | |
2131d850 | 12738 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint) |
d55e5bfc | 12739 | |
5b5c9bc7 | 12740 | class LayoutConstraints(Object): |
d55e5bfc | 12741 | """ |
15817c7e RD |
12742 | **Note:** constraints are now deprecated and you should use sizers |
12743 | instead. | |
d55e5bfc | 12744 | |
15817c7e RD |
12745 | Objects of this class can be associated with a window to define its |
12746 | layout constraints, with respect to siblings or its parent. | |
d55e5bfc RD |
12747 | |
12748 | The class consists of the following eight constraints of class | |
12749 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
12750 | directly to set the appropriate constraints. | |
12751 | ||
12752 | * left: represents the left hand edge of the window | |
12753 | * right: represents the right hand edge of the window | |
12754 | * top: represents the top edge of the window | |
12755 | * bottom: represents the bottom edge of the window | |
12756 | * width: represents the width of the window | |
12757 | * height: represents the height of the window | |
12758 | * centreX: represents the horizontal centre point of the window | |
12759 | * centreY: represents the vertical centre point of the window | |
12760 | ||
15817c7e RD |
12761 | Most constraints are initially set to have the relationship |
12762 | wxUnconstrained, which means that their values should be calculated by | |
12763 | looking at known constraints. The exceptions are width and height, | |
12764 | which are set to wxAsIs to ensure that if the user does not specify a | |
12765 | constraint, the existing width and height will be used, to be | |
12766 | compatible with panel items which often have take a default size. If | |
12767 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
12768 | ||
12769 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
d55e5bfc RD |
12770 | |
12771 | """ | |
1bd55598 RD |
12772 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12773 | __repr__ = _swig_repr | |
5b5c9bc7 RD |
12774 | left = property(_core_.LayoutConstraints_left_get) |
12775 | top = property(_core_.LayoutConstraints_top_get) | |
12776 | right = property(_core_.LayoutConstraints_right_get) | |
12777 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
12778 | width = property(_core_.LayoutConstraints_width_get) | |
12779 | height = property(_core_.LayoutConstraints_height_get) | |
12780 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
12781 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
1bd55598 | 12782 | def __init__(self, *args, **kwargs): |
5b5c9bc7 | 12783 | """__init__(self) -> LayoutConstraints""" |
1bd55598 RD |
12784 | _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs)) |
12785 | __swig_destroy__ = _core_.delete_LayoutConstraints | |
12786 | __del__ = lambda self : None; | |
d55e5bfc RD |
12787 | def SatisfyConstraints(*args, **kwargs): |
12788 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" | |
5b5c9bc7 | 12789 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
d55e5bfc RD |
12790 | |
12791 | def AreSatisfied(*args, **kwargs): | |
12792 | """AreSatisfied(self) -> bool""" | |
5b5c9bc7 | 12793 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
d55e5bfc | 12794 | |
2131d850 | 12795 | _core_.LayoutConstraints_swigregister(LayoutConstraints) |
d55e5bfc RD |
12796 | |
12797 | #---------------------------------------------------------------------------- | |
12798 | ||
12799 | # Use Python's bool constants if available, make some if not | |
12800 | try: | |
12801 | True | |
12802 | except NameError: | |
12803 | __builtins__.True = 1==1 | |
12804 | __builtins__.False = 1==0 | |
12805 | def bool(value): return not not value | |
12806 | __builtins__.bool = bool | |
12807 | ||
12808 | ||
12809 | ||
12810 | # workarounds for bad wxRTTI names | |
12811 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
12812 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
12813 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
12814 | ||
12815 | ||
12816 | #---------------------------------------------------------------------------- | |
12817 | # Load version numbers from __version__... Ensure that major and minor | |
0f63ec68 | 12818 | # versions are the same for both wxPython and wxWidgets. |
d55e5bfc RD |
12819 | |
12820 | from __version__ import * | |
12821 | __version__ = VERSION_STRING | |
12822 | ||
0f63ec68 RD |
12823 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
12824 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
d55e5bfc RD |
12825 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
12826 | import warnings | |
0f63ec68 | 12827 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d55e5bfc RD |
12828 | |
12829 | #---------------------------------------------------------------------------- | |
12830 | ||
7993762b RD |
12831 | # Set wxPython's default string<-->unicode conversion encoding from |
12832 | # the locale, but only if Python's default hasn't been changed. (We | |
12833 | # assume that if the user has customized it already then that is the | |
12834 | # encoding we need to use as well.) | |
12835 | # | |
12836 | # The encoding selected here is used when string or unicode objects | |
12837 | # need to be converted in order to pass them to wxWidgets. Please be | |
12838 | # aware that the default encoding within the same locale may be | |
12839 | # slightly different on different platforms. For example, please see | |
62d32a5f RD |
12840 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
12841 | # between the common latin/roman encodings. | |
3837a853 RD |
12842 | |
12843 | default = _sys.getdefaultencoding() | |
12844 | if default == 'ascii': | |
12845 | import locale | |
12846 | import codecs | |
12847 | try: | |
12848 | default = locale.getdefaultlocale()[1] | |
12849 | codecs.lookup(default) | |
7993762b | 12850 | except (ValueError, LookupError, TypeError): |
3837a853 RD |
12851 | default = _sys.getdefaultencoding() |
12852 | del locale | |
12853 | del codecs | |
5cbf236d RD |
12854 | if default: |
12855 | wx.SetDefaultPyEncoding(default) | |
12856 | del default | |
5cbf236d RD |
12857 | |
12858 | #---------------------------------------------------------------------------- | |
12859 | ||
d55e5bfc RD |
12860 | class PyDeadObjectError(AttributeError): |
12861 | pass | |
12862 | ||
12863 | class _wxPyDeadObject(object): | |
12864 | """ | |
12865 | Instances of wx objects that are OOR capable will have their __class__ | |
12866 | changed to this class when the C++ object is deleted. This should help | |
12867 | prevent crashes due to referencing a bogus C++ pointer. | |
12868 | """ | |
12869 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
12870 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
12871 | ||
12872 | def __repr__(self): | |
12873 | if not hasattr(self, "_name"): | |
12874 | self._name = "[unknown]" | |
12875 | return self.reprStr % self._name | |
12876 | ||
12877 | def __getattr__(self, *args): | |
12878 | if not hasattr(self, "_name"): | |
12879 | self._name = "[unknown]" | |
12880 | raise PyDeadObjectError(self.attrStr % self._name) | |
12881 | ||
12882 | def __nonzero__(self): | |
12883 | return 0 | |
12884 | ||
12885 | ||
12886 | ||
12887 | class PyUnbornObjectError(AttributeError): | |
12888 | pass | |
12889 | ||
12890 | class _wxPyUnbornObject(object): | |
12891 | """ | |
12892 | Some stock objects are created when the wx._core module is | |
12893 | imported, but their C++ instance is not created until the wx.App | |
12894 | object is created and initialized. These object instances will | |
12895 | temporarily have their __class__ changed to this class so an | |
12896 | exception will be raised if they are used before the C++ instance | |
12897 | is ready. | |
12898 | """ | |
12899 | ||
12900 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
12901 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
12902 | ||
12903 | def __repr__(self): | |
12904 | #if not hasattr(self, "_name"): | |
12905 | # self._name = "[unknown]" | |
12906 | return self.reprStr #% self._name | |
12907 | ||
12908 | def __getattr__(self, *args): | |
12909 | #if not hasattr(self, "_name"): | |
12910 | # self._name = "[unknown]" | |
12911 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
12912 | ||
12913 | def __nonzero__(self): | |
12914 | return 0 | |
12915 | ||
12916 | ||
12917 | #---------------------------------------------------------------------------- | |
d55e5bfc RD |
12918 | |
12919 | def CallAfter(callable, *args, **kw): | |
12920 | """ | |
12921 | Call the specified function after the current and pending event | |
12922 | handlers have been completed. This is also good for making GUI | |
0439c23b RD |
12923 | method calls from non-GUI threads. Any extra positional or |
12924 | keyword args are passed on to the callable when it is called. | |
12925 | ||
12926 | :see: `wx.FutureCall` | |
d55e5bfc RD |
12927 | """ |
12928 | app = wx.GetApp() | |
a001823c | 12929 | assert app is not None, 'No wx.App created yet' |
d55e5bfc | 12930 | |
891bb194 RD |
12931 | if not hasattr(app, "_CallAfterId"): |
12932 | app._CallAfterId = wx.NewEventType() | |
12933 | app.Connect(-1, -1, app._CallAfterId, | |
12934 | lambda event: event.callable(*event.args, **event.kw) ) | |
d55e5bfc | 12935 | evt = wx.PyEvent() |
891bb194 | 12936 | evt.SetEventType(app._CallAfterId) |
d55e5bfc RD |
12937 | evt.callable = callable |
12938 | evt.args = args | |
12939 | evt.kw = kw | |
12940 | wx.PostEvent(app, evt) | |
12941 | ||
d55e5bfc RD |
12942 | #---------------------------------------------------------------------------- |
12943 | ||
12944 | ||
12945 | class FutureCall: | |
12946 | """ | |
6e0de3df | 12947 | A convenience class for `wx.Timer`, that calls the given callable |
d55e5bfc RD |
12948 | object once after the given amount of milliseconds, passing any |
12949 | positional or keyword args. The return value of the callable is | |
0439c23b | 12950 | availbale after it has been run with the `GetResult` method. |
d55e5bfc RD |
12951 | |
12952 | If you don't need to get the return value or restart the timer | |
12953 | then there is no need to hold a reference to this object. It will | |
12954 | hold a reference to itself while the timer is running (the timer | |
12955 | has a reference to self.Notify) but the cycle will be broken when | |
12956 | the timer completes, automatically cleaning up the wx.FutureCall | |
12957 | object. | |
0439c23b RD |
12958 | |
12959 | :see: `wx.CallAfter` | |
d55e5bfc RD |
12960 | """ |
12961 | def __init__(self, millis, callable, *args, **kwargs): | |
12962 | self.millis = millis | |
12963 | self.callable = callable | |
12964 | self.SetArgs(*args, **kwargs) | |
12965 | self.runCount = 0 | |
12966 | self.running = False | |
12967 | self.hasRun = False | |
12968 | self.result = None | |
12969 | self.timer = None | |
12970 | self.Start() | |
12971 | ||
12972 | def __del__(self): | |
12973 | self.Stop() | |
12974 | ||
12975 | ||
12976 | def Start(self, millis=None, *args, **kwargs): | |
12977 | """ | |
12978 | (Re)start the timer | |
12979 | """ | |
12980 | self.hasRun = False | |
12981 | if millis is not None: | |
12982 | self.millis = millis | |
12983 | if args or kwargs: | |
12984 | self.SetArgs(*args, **kwargs) | |
12985 | self.Stop() | |
12986 | self.timer = wx.PyTimer(self.Notify) | |
12987 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
12988 | self.running = True | |
12989 | Restart = Start | |
12990 | ||
12991 | ||
12992 | def Stop(self): | |
12993 | """ | |
12994 | Stop and destroy the timer. | |
12995 | """ | |
12996 | if self.timer is not None: | |
12997 | self.timer.Stop() | |
12998 | self.timer = None | |
12999 | ||
13000 | ||
13001 | def GetInterval(self): | |
13002 | if self.timer is not None: | |
13003 | return self.timer.GetInterval() | |
13004 | else: | |
13005 | return 0 | |
13006 | ||
13007 | ||
13008 | def IsRunning(self): | |
13009 | return self.timer is not None and self.timer.IsRunning() | |
13010 | ||
13011 | ||
13012 | def SetArgs(self, *args, **kwargs): | |
13013 | """ | |
13014 | (Re)set the args passed to the callable object. This is | |
13015 | useful in conjunction with Restart if you want to schedule a | |
13016 | new call to the same callable object but with different | |
13017 | parameters. | |
13018 | """ | |
13019 | self.args = args | |
13020 | self.kwargs = kwargs | |
13021 | ||
13022 | ||
13023 | def HasRun(self): | |
13024 | return self.hasRun | |
13025 | ||
13026 | def GetResult(self): | |
13027 | return self.result | |
13028 | ||
13029 | def Notify(self): | |
13030 | """ | |
13031 | The timer has expired so call the callable. | |
13032 | """ | |
13033 | if self.callable and getattr(self.callable, 'im_self', True): | |
13034 | self.runCount += 1 | |
13035 | self.running = False | |
13036 | self.result = self.callable(*self.args, **self.kwargs) | |
13037 | self.hasRun = True | |
13038 | if not self.running: | |
13039 | # if it wasn't restarted, then cleanup | |
13040 | wx.CallAfter(self.Stop) | |
13041 | ||
13042 | ||
13043 | ||
13044 | #---------------------------------------------------------------------------- | |
13045 | # Control which items in this module should be documented by epydoc. | |
13046 | # We allow only classes and functions, which will help reduce the size | |
13047 | # of the docs by filtering out the zillions of constants, EVT objects, | |
13048 | # and etc that don't make much sense by themselves, but are instead | |
13049 | # documented (or will be) as part of the classes/functions/methods | |
13050 | # where they should be used. | |
13051 | ||
d6c14a4c RD |
13052 | class __DocFilter: |
13053 | """ | |
13054 | A filter for epydoc that only allows non-Ptr classes and | |
34e0a3bb | 13055 | functions, in order to reduce the clutter in the API docs. |
d6c14a4c RD |
13056 | """ |
13057 | def __init__(self, globals): | |
13058 | self._globals = globals | |
13059 | ||
13060 | def __call__(self, name): | |
13061 | import types | |
13062 | obj = self._globals.get(name, None) | |
34e0a3bb RD |
13063 | |
13064 | # only document classes and function | |
d6c14a4c RD |
13065 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: |
13066 | return False | |
34e0a3bb RD |
13067 | |
13068 | # skip other things that are private or will be documented as part of somethign else | |
1bd55598 | 13069 | if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') : |
d6c14a4c | 13070 | return False |
34e0a3bb RD |
13071 | |
13072 | # skip functions that are duplicates of static functions in a class | |
13073 | if name.find('_') != -1: | |
13074 | cls = self._globals.get(name.split('_')[0], None) | |
13075 | methname = name.split('_')[1] | |
13076 | if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType: | |
13077 | return False | |
13078 | ||
d6c14a4c | 13079 | return True |
d55e5bfc RD |
13080 | |
13081 | #---------------------------------------------------------------------------- | |
13082 | #---------------------------------------------------------------------------- | |
13083 | ||
13084 | # Import other modules in this package that should show up in the | |
13085 | # "core" wx namespace | |
13086 | from _gdi import * | |
13087 | from _windows import * | |
13088 | from _controls import * | |
13089 | from _misc import * | |
13090 | ||
d55e5bfc RD |
13091 | #---------------------------------------------------------------------------- |
13092 | #---------------------------------------------------------------------------- | |
13093 | ||
13094 | ||
32fe5131 | 13095 |