]>
Commit | Line | Data |
---|---|---|
d55e5bfc RD |
1 | # This file was created automatically by SWIG. |
2 | # Don't modify this file, modify the SWIG interface instead. | |
3 | ||
5b5c9bc7 | 4 | import _core_ |
d55e5bfc | 5 | |
36ed4f51 RD |
6 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1): |
7 | if (name == "this"): | |
8 | if isinstance(value, class_type): | |
9 | self.__dict__[name] = value.this | |
10 | if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown | |
11 | del value.thisown | |
12 | return | |
13 | method = class_type.__swig_setmethods__.get(name,None) | |
14 | if method: return method(self,value) | |
15 | if (not static) or hasattr(self,name) or (name == "thisown"): | |
16 | self.__dict__[name] = value | |
17 | else: | |
18 | raise AttributeError("You cannot add attributes to %s" % self) | |
19 | ||
20 | def _swig_setattr(self,class_type,name,value): | |
21 | return _swig_setattr_nondynamic(self,class_type,name,value,0) | |
22 | ||
23 | def _swig_getattr(self,class_type,name): | |
24 | method = class_type.__swig_getmethods__.get(name,None) | |
25 | if method: return method(self) | |
26 | raise AttributeError,name | |
27 | ||
28 | import types | |
29 | try: | |
30 | _object = types.ObjectType | |
31 | _newclass = 1 | |
32 | except AttributeError: | |
33 | class _object : pass | |
34 | _newclass = 0 | |
35 | del types | |
36 | ||
37 | ||
38 | def _swig_setattr_nondynamic_method(set): | |
39 | def set_attr(self,name,value): | |
40 | if hasattr(self,name) or (name in ("this", "thisown")): | |
41 | set(self,name,value) | |
42 | else: | |
43 | raise AttributeError("You cannot add attributes to %s" % self) | |
44 | return set_attr | |
45 | ||
46 | ||
d55e5bfc RD |
47 | #// Give a reference to the dictionary of this module to the C++ extension |
48 | #// code. | |
49 | _core_._wxPySetDictionary(vars()) | |
50 | ||
51 | #// A little trick to make 'wx' be a reference to this module so wx.Names can | |
52 | #// be used here. | |
53 | import sys as _sys | |
54 | wx = _sys.modules[__name__] | |
55 | ||
d6c14a4c RD |
56 | |
57 | #---------------------------------------------------------------------------- | |
58 | ||
59 | def _deprecated(callable, msg=None): | |
60 | """ | |
61 | Create a wrapper function that will raise a DeprecationWarning | |
62 | before calling the callable. | |
63 | """ | |
64 | if msg is None: | |
65 | msg = "%s is deprecated" % callable | |
66 | def deprecatedWrapper(*args, **kwargs): | |
67 | import warnings | |
68 | warnings.warn(msg, DeprecationWarning, stacklevel=2) | |
69 | return callable(*args, **kwargs) | |
70 | deprecatedWrapper.__doc__ = msg | |
71 | return deprecatedWrapper | |
72 | ||
73 | ||
74 | #---------------------------------------------------------------------------- | |
75 | ||
5b5c9bc7 RD |
76 | NOT_FOUND = _core_.NOT_FOUND |
77 | VSCROLL = _core_.VSCROLL | |
78 | HSCROLL = _core_.HSCROLL | |
79 | CAPTION = _core_.CAPTION | |
80 | DOUBLE_BORDER = _core_.DOUBLE_BORDER | |
81 | SUNKEN_BORDER = _core_.SUNKEN_BORDER | |
82 | RAISED_BORDER = _core_.RAISED_BORDER | |
83 | BORDER = _core_.BORDER | |
84 | SIMPLE_BORDER = _core_.SIMPLE_BORDER | |
85 | STATIC_BORDER = _core_.STATIC_BORDER | |
86 | TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW | |
87 | NO_BORDER = _core_.NO_BORDER | |
88 | DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER | |
6d88e192 | 89 | DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE |
5b5c9bc7 RD |
90 | TAB_TRAVERSAL = _core_.TAB_TRAVERSAL |
91 | WANTS_CHARS = _core_.WANTS_CHARS | |
92 | POPUP_WINDOW = _core_.POPUP_WINDOW | |
93 | CENTER_FRAME = _core_.CENTER_FRAME | |
94 | CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN | |
95 | CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN | |
96 | CLIP_CHILDREN = _core_.CLIP_CHILDREN | |
97 | CLIP_SIBLINGS = _core_.CLIP_SIBLINGS | |
98 | ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB | |
99 | RETAINED = _core_.RETAINED | |
100 | BACKINGSTORE = _core_.BACKINGSTORE | |
101 | COLOURED = _core_.COLOURED | |
102 | FIXED_LENGTH = _core_.FIXED_LENGTH | |
103 | LB_NEEDED_SB = _core_.LB_NEEDED_SB | |
104 | LB_ALWAYS_SB = _core_.LB_ALWAYS_SB | |
105 | LB_SORT = _core_.LB_SORT | |
106 | LB_SINGLE = _core_.LB_SINGLE | |
107 | LB_MULTIPLE = _core_.LB_MULTIPLE | |
108 | LB_EXTENDED = _core_.LB_EXTENDED | |
109 | LB_OWNERDRAW = _core_.LB_OWNERDRAW | |
110 | LB_HSCROLL = _core_.LB_HSCROLL | |
111 | PROCESS_ENTER = _core_.PROCESS_ENTER | |
112 | PASSWORD = _core_.PASSWORD | |
113 | CB_SIMPLE = _core_.CB_SIMPLE | |
114 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
115 | CB_SORT = _core_.CB_SORT | |
116 | CB_READONLY = _core_.CB_READONLY | |
117 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
118 | RA_VERTICAL = _core_.RA_VERTICAL | |
119 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
120 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
121 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX | |
122 | RB_GROUP = _core_.RB_GROUP | |
123 | RB_SINGLE = _core_.RB_SINGLE | |
124 | SB_HORIZONTAL = _core_.SB_HORIZONTAL | |
125 | SB_VERTICAL = _core_.SB_VERTICAL | |
126 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX | |
127 | ST_SIZEGRIP = _core_.ST_SIZEGRIP | |
128 | ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE | |
129 | FLOOD_SURFACE = _core_.FLOOD_SURFACE | |
130 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
131 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
132 | WINDING_RULE = _core_.WINDING_RULE | |
133 | TOOL_TOP = _core_.TOOL_TOP | |
134 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
135 | TOOL_LEFT = _core_.TOOL_LEFT | |
136 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
137 | OK = _core_.OK | |
138 | YES_NO = _core_.YES_NO | |
139 | CANCEL = _core_.CANCEL | |
140 | YES = _core_.YES | |
141 | NO = _core_.NO | |
142 | NO_DEFAULT = _core_.NO_DEFAULT | |
143 | YES_DEFAULT = _core_.YES_DEFAULT | |
144 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION | |
145 | ICON_HAND = _core_.ICON_HAND | |
146 | ICON_QUESTION = _core_.ICON_QUESTION | |
147 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
148 | ICON_STOP = _core_.ICON_STOP | |
149 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
150 | ICON_MASK = _core_.ICON_MASK | |
151 | ICON_WARNING = _core_.ICON_WARNING | |
152 | ICON_ERROR = _core_.ICON_ERROR | |
153 | FORWARD = _core_.FORWARD | |
154 | BACKWARD = _core_.BACKWARD | |
155 | RESET = _core_.RESET | |
156 | HELP = _core_.HELP | |
157 | MORE = _core_.MORE | |
158 | SETUP = _core_.SETUP | |
159 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
160 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
161 | SIZE_AUTO = _core_.SIZE_AUTO | |
162 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
163 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
164 | PORTRAIT = _core_.PORTRAIT | |
165 | LANDSCAPE = _core_.LANDSCAPE | |
166 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
167 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
168 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
169 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
170 | ID_ANY = _core_.ID_ANY | |
171 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
172 | ID_LOWEST = _core_.ID_LOWEST | |
173 | ID_OPEN = _core_.ID_OPEN | |
174 | ID_CLOSE = _core_.ID_CLOSE | |
175 | ID_NEW = _core_.ID_NEW | |
176 | ID_SAVE = _core_.ID_SAVE | |
177 | ID_SAVEAS = _core_.ID_SAVEAS | |
178 | ID_REVERT = _core_.ID_REVERT | |
179 | ID_EXIT = _core_.ID_EXIT | |
180 | ID_UNDO = _core_.ID_UNDO | |
181 | ID_REDO = _core_.ID_REDO | |
182 | ID_HELP = _core_.ID_HELP | |
183 | ID_PRINT = _core_.ID_PRINT | |
184 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
185 | ID_PREVIEW = _core_.ID_PREVIEW | |
186 | ID_ABOUT = _core_.ID_ABOUT | |
187 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
188 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
189 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
190 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
191 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL | |
192 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
193 | ID_CUT = _core_.ID_CUT | |
194 | ID_COPY = _core_.ID_COPY | |
195 | ID_PASTE = _core_.ID_PASTE | |
196 | ID_CLEAR = _core_.ID_CLEAR | |
197 | ID_FIND = _core_.ID_FIND | |
198 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
199 | ID_SELECTALL = _core_.ID_SELECTALL | |
200 | ID_DELETE = _core_.ID_DELETE | |
201 | ID_REPLACE = _core_.ID_REPLACE | |
202 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
203 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
204 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
205 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
206 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
207 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
208 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
209 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
210 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
211 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
212 | ID_FILE1 = _core_.ID_FILE1 | |
213 | ID_FILE2 = _core_.ID_FILE2 | |
214 | ID_FILE3 = _core_.ID_FILE3 | |
215 | ID_FILE4 = _core_.ID_FILE4 | |
216 | ID_FILE5 = _core_.ID_FILE5 | |
217 | ID_FILE6 = _core_.ID_FILE6 | |
218 | ID_FILE7 = _core_.ID_FILE7 | |
219 | ID_FILE8 = _core_.ID_FILE8 | |
220 | ID_FILE9 = _core_.ID_FILE9 | |
221 | ID_OK = _core_.ID_OK | |
222 | ID_CANCEL = _core_.ID_CANCEL | |
223 | ID_APPLY = _core_.ID_APPLY | |
224 | ID_YES = _core_.ID_YES | |
225 | ID_NO = _core_.ID_NO | |
226 | ID_STATIC = _core_.ID_STATIC | |
227 | ID_FORWARD = _core_.ID_FORWARD | |
228 | ID_BACKWARD = _core_.ID_BACKWARD | |
229 | ID_DEFAULT = _core_.ID_DEFAULT | |
230 | ID_MORE = _core_.ID_MORE | |
231 | ID_SETUP = _core_.ID_SETUP | |
232 | ID_RESET = _core_.ID_RESET | |
233 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
234 | ID_YESTOALL = _core_.ID_YESTOALL | |
235 | ID_NOTOALL = _core_.ID_NOTOALL | |
236 | ID_ABORT = _core_.ID_ABORT | |
237 | ID_RETRY = _core_.ID_RETRY | |
238 | ID_IGNORE = _core_.ID_IGNORE | |
239 | ID_ADD = _core_.ID_ADD | |
240 | ID_REMOVE = _core_.ID_REMOVE | |
241 | ID_UP = _core_.ID_UP | |
242 | ID_DOWN = _core_.ID_DOWN | |
243 | ID_HOME = _core_.ID_HOME | |
244 | ID_REFRESH = _core_.ID_REFRESH | |
245 | ID_STOP = _core_.ID_STOP | |
246 | ID_INDEX = _core_.ID_INDEX | |
247 | ID_BOLD = _core_.ID_BOLD | |
248 | ID_ITALIC = _core_.ID_ITALIC | |
249 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
250 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
251 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
252 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
253 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
254 | ID_INDENT = _core_.ID_INDENT | |
255 | ID_UNINDENT = _core_.ID_UNINDENT | |
256 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
257 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
258 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
259 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
260 | ID_UNDELETE = _core_.ID_UNDELETE | |
261 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
262 | ID_HIGHEST = _core_.ID_HIGHEST | |
263 | OPEN = _core_.OPEN | |
264 | SAVE = _core_.SAVE | |
265 | HIDE_READONLY = _core_.HIDE_READONLY | |
266 | OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT | |
267 | FILE_MUST_EXIST = _core_.FILE_MUST_EXIST | |
268 | MULTIPLE = _core_.MULTIPLE | |
269 | CHANGE_DIR = _core_.CHANGE_DIR | |
270 | ACCEL_ALT = _core_.ACCEL_ALT | |
271 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
272 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
273 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
274 | PD_AUTO_HIDE = _core_.PD_AUTO_HIDE | |
275 | PD_APP_MODAL = _core_.PD_APP_MODAL | |
276 | PD_CAN_ABORT = _core_.PD_CAN_ABORT | |
277 | PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME | |
278 | PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME | |
279 | PD_REMAINING_TIME = _core_.PD_REMAINING_TIME | |
280 | PD_SMOOTH = _core_.PD_SMOOTH | |
281 | PD_CAN_SKIP = _core_.PD_CAN_SKIP | |
282 | DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON | |
283 | DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE | |
284 | MENU_TEAROFF = _core_.MENU_TEAROFF | |
285 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
286 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
287 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
288 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
289 | LI_VERTICAL = _core_.LI_VERTICAL | |
290 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
291 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
292 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
293 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
294 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
295 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
296 | MM_TEXT = _core_.MM_TEXT | |
297 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
298 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
299 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
300 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
301 | MM_TWIPS = _core_.MM_TWIPS | |
302 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
303 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
304 | MM_POINTS = _core_.MM_POINTS | |
305 | MM_METRIC = _core_.MM_METRIC | |
306 | CENTRE = _core_.CENTRE | |
307 | CENTER = _core_.CENTER | |
308 | HORIZONTAL = _core_.HORIZONTAL | |
309 | VERTICAL = _core_.VERTICAL | |
310 | BOTH = _core_.BOTH | |
311 | LEFT = _core_.LEFT | |
312 | RIGHT = _core_.RIGHT | |
313 | UP = _core_.UP | |
314 | DOWN = _core_.DOWN | |
315 | TOP = _core_.TOP | |
316 | BOTTOM = _core_.BOTTOM | |
317 | NORTH = _core_.NORTH | |
318 | SOUTH = _core_.SOUTH | |
319 | WEST = _core_.WEST | |
320 | EAST = _core_.EAST | |
321 | ALL = _core_.ALL | |
322 | ALIGN_NOT = _core_.ALIGN_NOT | |
323 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
324 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
325 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
326 | ALIGN_TOP = _core_.ALIGN_TOP | |
327 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
328 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
329 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
330 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
331 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
332 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
333 | ALIGN_MASK = _core_.ALIGN_MASK | |
334 | STRETCH_NOT = _core_.STRETCH_NOT | |
335 | SHRINK = _core_.SHRINK | |
336 | GROW = _core_.GROW | |
337 | EXPAND = _core_.EXPAND | |
338 | SHAPED = _core_.SHAPED | |
339 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
340 | TILE = _core_.TILE | |
341 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
342 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
343 | BORDER_NONE = _core_.BORDER_NONE | |
344 | BORDER_STATIC = _core_.BORDER_STATIC | |
345 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
346 | BORDER_RAISED = _core_.BORDER_RAISED | |
347 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
348 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
349 | BORDER_MASK = _core_.BORDER_MASK | |
350 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM | |
351 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
352 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
353 | DEFAULT = _core_.DEFAULT | |
354 | DECORATIVE = _core_.DECORATIVE | |
355 | ROMAN = _core_.ROMAN | |
356 | SCRIPT = _core_.SCRIPT | |
357 | SWISS = _core_.SWISS | |
358 | MODERN = _core_.MODERN | |
359 | TELETYPE = _core_.TELETYPE | |
360 | VARIABLE = _core_.VARIABLE | |
361 | FIXED = _core_.FIXED | |
362 | NORMAL = _core_.NORMAL | |
363 | LIGHT = _core_.LIGHT | |
364 | BOLD = _core_.BOLD | |
365 | ITALIC = _core_.ITALIC | |
366 | SLANT = _core_.SLANT | |
367 | SOLID = _core_.SOLID | |
368 | DOT = _core_.DOT | |
369 | LONG_DASH = _core_.LONG_DASH | |
370 | SHORT_DASH = _core_.SHORT_DASH | |
371 | DOT_DASH = _core_.DOT_DASH | |
372 | USER_DASH = _core_.USER_DASH | |
373 | TRANSPARENT = _core_.TRANSPARENT | |
374 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
375 | STIPPLE_MASK = _core_.STIPPLE_MASK |
376 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
5b5c9bc7 RD |
377 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH |
378 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
379 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
380 | CROSS_HATCH = _core_.CROSS_HATCH | |
381 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
382 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
383 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
384 | JOIN_MITER = _core_.JOIN_MITER | |
385 | JOIN_ROUND = _core_.JOIN_ROUND | |
386 | CAP_ROUND = _core_.CAP_ROUND | |
387 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
388 | CAP_BUTT = _core_.CAP_BUTT | |
389 | CLEAR = _core_.CLEAR | |
390 | XOR = _core_.XOR | |
391 | INVERT = _core_.INVERT | |
392 | OR_REVERSE = _core_.OR_REVERSE | |
393 | AND_REVERSE = _core_.AND_REVERSE | |
394 | COPY = _core_.COPY | |
395 | AND = _core_.AND | |
396 | AND_INVERT = _core_.AND_INVERT | |
397 | NO_OP = _core_.NO_OP | |
398 | NOR = _core_.NOR | |
399 | EQUIV = _core_.EQUIV | |
400 | SRC_INVERT = _core_.SRC_INVERT | |
401 | OR_INVERT = _core_.OR_INVERT | |
402 | NAND = _core_.NAND | |
403 | OR = _core_.OR | |
404 | SET = _core_.SET | |
405 | WXK_BACK = _core_.WXK_BACK | |
406 | WXK_TAB = _core_.WXK_TAB | |
407 | WXK_RETURN = _core_.WXK_RETURN | |
408 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
409 | WXK_SPACE = _core_.WXK_SPACE | |
410 | WXK_DELETE = _core_.WXK_DELETE | |
411 | WXK_START = _core_.WXK_START | |
412 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
413 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
414 | WXK_CANCEL = _core_.WXK_CANCEL | |
415 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
416 | WXK_CLEAR = _core_.WXK_CLEAR | |
417 | WXK_SHIFT = _core_.WXK_SHIFT | |
418 | WXK_ALT = _core_.WXK_ALT | |
419 | WXK_CONTROL = _core_.WXK_CONTROL | |
420 | WXK_MENU = _core_.WXK_MENU | |
421 | WXK_PAUSE = _core_.WXK_PAUSE | |
422 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
423 | WXK_PRIOR = _core_.WXK_PRIOR | |
424 | WXK_NEXT = _core_.WXK_NEXT | |
425 | WXK_END = _core_.WXK_END | |
426 | WXK_HOME = _core_.WXK_HOME | |
427 | WXK_LEFT = _core_.WXK_LEFT | |
428 | WXK_UP = _core_.WXK_UP | |
429 | WXK_RIGHT = _core_.WXK_RIGHT | |
430 | WXK_DOWN = _core_.WXK_DOWN | |
431 | WXK_SELECT = _core_.WXK_SELECT | |
432 | WXK_PRINT = _core_.WXK_PRINT | |
433 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
434 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
435 | WXK_INSERT = _core_.WXK_INSERT | |
436 | WXK_HELP = _core_.WXK_HELP | |
437 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
438 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
439 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
440 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
441 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
442 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
443 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
444 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
445 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
446 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
447 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
448 | WXK_ADD = _core_.WXK_ADD | |
449 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
450 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
451 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
452 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
453 | WXK_F1 = _core_.WXK_F1 | |
454 | WXK_F2 = _core_.WXK_F2 | |
455 | WXK_F3 = _core_.WXK_F3 | |
456 | WXK_F4 = _core_.WXK_F4 | |
457 | WXK_F5 = _core_.WXK_F5 | |
458 | WXK_F6 = _core_.WXK_F6 | |
459 | WXK_F7 = _core_.WXK_F7 | |
460 | WXK_F8 = _core_.WXK_F8 | |
461 | WXK_F9 = _core_.WXK_F9 | |
462 | WXK_F10 = _core_.WXK_F10 | |
463 | WXK_F11 = _core_.WXK_F11 | |
464 | WXK_F12 = _core_.WXK_F12 | |
465 | WXK_F13 = _core_.WXK_F13 | |
466 | WXK_F14 = _core_.WXK_F14 | |
467 | WXK_F15 = _core_.WXK_F15 | |
468 | WXK_F16 = _core_.WXK_F16 | |
469 | WXK_F17 = _core_.WXK_F17 | |
470 | WXK_F18 = _core_.WXK_F18 | |
471 | WXK_F19 = _core_.WXK_F19 | |
472 | WXK_F20 = _core_.WXK_F20 | |
473 | WXK_F21 = _core_.WXK_F21 | |
474 | WXK_F22 = _core_.WXK_F22 | |
475 | WXK_F23 = _core_.WXK_F23 | |
476 | WXK_F24 = _core_.WXK_F24 | |
477 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
478 | WXK_SCROLL = _core_.WXK_SCROLL | |
479 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
480 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
481 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
482 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
483 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
484 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
485 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
486 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
487 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
488 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
489 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
490 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
491 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
492 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
493 | WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR | |
494 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
495 | WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT | |
496 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
497 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
498 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
499 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
500 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
501 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
502 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
503 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
504 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
505 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
506 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
507 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
508 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
509 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
510 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
511 | WXK_COMMAND = _core_.WXK_COMMAND | |
512 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
513 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
514 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
515 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
516 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
517 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
518 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
519 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
520 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
521 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
522 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
523 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
524 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
525 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
526 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
527 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
528 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
529 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
530 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
531 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
532 | PAPER_NONE = _core_.PAPER_NONE | |
533 | PAPER_LETTER = _core_.PAPER_LETTER | |
534 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
535 | PAPER_A4 = _core_.PAPER_A4 | |
536 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
537 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
538 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
539 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
540 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
541 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
542 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
543 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
544 | PAPER_A3 = _core_.PAPER_A3 | |
545 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
546 | PAPER_A5 = _core_.PAPER_A5 | |
547 | PAPER_B4 = _core_.PAPER_B4 | |
548 | PAPER_B5 = _core_.PAPER_B5 | |
549 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
550 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
551 | PAPER_10X14 = _core_.PAPER_10X14 | |
552 | PAPER_11X17 = _core_.PAPER_11X17 | |
553 | PAPER_NOTE = _core_.PAPER_NOTE | |
554 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
555 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
556 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
557 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
558 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
559 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
560 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
561 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
562 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
563 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
564 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
565 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
566 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
567 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
568 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
569 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
570 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
571 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
572 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
573 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
574 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
575 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
576 | PAPER_9X11 = _core_.PAPER_9X11 | |
577 | PAPER_10X11 = _core_.PAPER_10X11 | |
578 | PAPER_15X11 = _core_.PAPER_15X11 | |
579 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
580 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
581 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
582 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
583 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
584 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
585 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
586 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
587 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
588 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
589 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
590 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
591 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
592 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
593 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
594 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
595 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
596 | PAPER_A2 = _core_.PAPER_A2 | |
597 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
598 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
034e3677 RD |
599 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD |
600 | PAPER_A6 = _core_.PAPER_A6 | |
601 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
602 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
603 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
604 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
605 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
606 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
607 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
608 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
609 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
610 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
611 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
612 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
613 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
614 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
615 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
616 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
617 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
618 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
619 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
620 | PAPER_12X11 = _core_.PAPER_12X11 | |
621 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
622 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
623 | PAPER_P16K = _core_.PAPER_P16K | |
624 | PAPER_P32K = _core_.PAPER_P32K | |
625 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
626 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
627 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
628 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
629 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
630 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
631 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
632 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
633 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
634 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
635 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
636 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
637 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
638 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
639 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
640 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
641 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
642 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
643 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
644 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
645 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
646 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
647 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
648 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
5b5c9bc7 RD |
649 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX |
650 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
651 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
652 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
653 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
654 | ITEM_CHECK = _core_.ITEM_CHECK | |
655 | ITEM_RADIO = _core_.ITEM_RADIO | |
656 | ITEM_MAX = _core_.ITEM_MAX | |
657 | HT_NOWHERE = _core_.HT_NOWHERE | |
658 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
659 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
660 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
661 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
662 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
663 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
664 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
665 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
666 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
667 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
668 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
669 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
670 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
671 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
672 | HT_MAX = _core_.HT_MAX | |
673 | MOD_NONE = _core_.MOD_NONE | |
674 | MOD_ALT = _core_.MOD_ALT | |
675 | MOD_CONTROL = _core_.MOD_CONTROL | |
676 | MOD_SHIFT = _core_.MOD_SHIFT | |
677 | MOD_WIN = _core_.MOD_WIN | |
678 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE | |
679 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
680 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
d55e5bfc RD |
681 | #--------------------------------------------------------------------------- |
682 | ||
5b5c9bc7 | 683 | class Object(object): |
d55e5bfc RD |
684 | """ |
685 | The base class for most wx objects, although in wxPython not | |
686 | much functionality is needed nor exposed. | |
687 | """ | |
688 | def __init__(self): raise RuntimeError, "No constructor defined" | |
689 | def __repr__(self): | |
690 | return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
691 | def GetClassName(*args, **kwargs): | |
692 | """ | |
5b5c9bc7 | 693 | GetClassName(self) -> String |
d55e5bfc RD |
694 | |
695 | Returns the class name of the C++ class using wxRTTI. | |
696 | """ | |
5b5c9bc7 | 697 | return _core_.Object_GetClassName(*args, **kwargs) |
d55e5bfc RD |
698 | |
699 | def Destroy(*args, **kwargs): | |
700 | """ | |
701 | Destroy(self) | |
702 | ||
703 | Deletes the C++ object this Python object is a proxy for. | |
704 | """ | |
5b5c9bc7 | 705 | return _core_.Object_Destroy(*args, **kwargs) |
d55e5bfc RD |
706 | |
707 | ||
5b5c9bc7 | 708 | class ObjectPtr(Object): |
d55e5bfc RD |
709 | def __init__(self, this): |
710 | self.this = this | |
711 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
712 | self.__class__ = Object |
713 | _core_.Object_swigregister(ObjectPtr) | |
714 | _wxPySetDictionary = _core_._wxPySetDictionary | |
d55e5bfc | 715 | |
5b5c9bc7 | 716 | _wxPyFixStockObjects = _core_._wxPyFixStockObjects |
d55e5bfc | 717 | |
5b5c9bc7 | 718 | cvar = _core_.cvar |
d55e5bfc RD |
719 | EmptyString = cvar.EmptyString |
720 | ||
721 | #--------------------------------------------------------------------------- | |
722 | ||
5b5c9bc7 RD |
723 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID |
724 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
725 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
726 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
727 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
728 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
729 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
730 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
731 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
732 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
733 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
734 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
735 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
736 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
737 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
738 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
739 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
740 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
741 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
742 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
743 | CURSOR_NONE = _core_.CURSOR_NONE | |
744 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
745 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
746 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
747 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
748 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
749 | CURSOR_HAND = _core_.CURSOR_HAND | |
750 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
751 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
752 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
753 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
754 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
755 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
756 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
757 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
758 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
759 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
760 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
761 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
762 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
763 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
764 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
765 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
766 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
767 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
768 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
769 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
770 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
771 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
772 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
773 | CURSOR_MAX = _core_.CURSOR_MAX | |
d55e5bfc RD |
774 | #--------------------------------------------------------------------------- |
775 | ||
5b5c9bc7 | 776 | class Size(object): |
d55e5bfc | 777 | """ |
15817c7e | 778 | wx.Size is a useful data structure used to represent the size of |
36ed4f51 RD |
779 | something. It simply contians integer width and height |
780 | proprtites. In most places in wxPython where a wx.Size is | |
781 | expected a (width, height) tuple can be used instead. | |
d55e5bfc RD |
782 | """ |
783 | def __repr__(self): | |
784 | return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 RD |
785 | width = property(_core_.Size_width_get, _core_.Size_width_set) |
786 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
d55e5bfc RD |
787 | x = width; y = height |
788 | def __init__(self, *args, **kwargs): | |
789 | """ | |
5b5c9bc7 | 790 | __init__(self, int w=0, int h=0) -> Size |
d55e5bfc RD |
791 | |
792 | Creates a size object. | |
793 | """ | |
5b5c9bc7 | 794 | newobj = _core_.new_Size(*args, **kwargs) |
d55e5bfc RD |
795 | self.this = newobj.this |
796 | self.thisown = 1 | |
797 | del newobj.thisown | |
5b5c9bc7 | 798 | def __del__(self, destroy=_core_.delete_Size): |
d55e5bfc RD |
799 | """__del__(self)""" |
800 | try: | |
801 | if self.thisown: destroy(self) | |
802 | except: pass | |
803 | ||
804 | def __eq__(*args, **kwargs): | |
805 | """ | |
5b5c9bc7 | 806 | __eq__(self, Size sz) -> bool |
d55e5bfc RD |
807 | |
808 | Test for equality of wx.Size objects. | |
809 | """ | |
5b5c9bc7 | 810 | return _core_.Size___eq__(*args, **kwargs) |
d55e5bfc RD |
811 | |
812 | def __ne__(*args, **kwargs): | |
813 | """ | |
5b5c9bc7 | 814 | __ne__(self, Size sz) -> bool |
d55e5bfc RD |
815 | |
816 | Test for inequality. | |
817 | """ | |
5b5c9bc7 | 818 | return _core_.Size___ne__(*args, **kwargs) |
d55e5bfc RD |
819 | |
820 | def __add__(*args, **kwargs): | |
821 | """ | |
5b5c9bc7 | 822 | __add__(self, Size sz) -> Size |
d55e5bfc RD |
823 | |
824 | Add sz's proprties to this and return the result. | |
825 | """ | |
5b5c9bc7 | 826 | return _core_.Size___add__(*args, **kwargs) |
d55e5bfc RD |
827 | |
828 | def __sub__(*args, **kwargs): | |
829 | """ | |
5b5c9bc7 | 830 | __sub__(self, Size sz) -> Size |
d55e5bfc RD |
831 | |
832 | Subtract sz's properties from this and return the result. | |
833 | """ | |
5b5c9bc7 | 834 | return _core_.Size___sub__(*args, **kwargs) |
d55e5bfc RD |
835 | |
836 | def IncTo(*args, **kwargs): | |
837 | """ | |
5b5c9bc7 | 838 | IncTo(self, Size sz) |
d55e5bfc RD |
839 | |
840 | Increments this object so that both of its dimensions are not less | |
841 | than the corresponding dimensions of the size. | |
842 | """ | |
5b5c9bc7 | 843 | return _core_.Size_IncTo(*args, **kwargs) |
d55e5bfc RD |
844 | |
845 | def DecTo(*args, **kwargs): | |
846 | """ | |
5b5c9bc7 | 847 | DecTo(self, Size sz) |
d55e5bfc RD |
848 | |
849 | Decrements this object so that both of its dimensions are not greater | |
850 | than the corresponding dimensions of the size. | |
851 | """ | |
5b5c9bc7 | 852 | return _core_.Size_DecTo(*args, **kwargs) |
d55e5bfc RD |
853 | |
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 | ||
916 | ||
5b5c9bc7 | 917 | class SizePtr(Size): |
d55e5bfc RD |
918 | def __init__(self, this): |
919 | self.this = this | |
920 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
921 | self.__class__ = Size |
922 | _core_.Size_swigregister(SizePtr) | |
d55e5bfc RD |
923 | |
924 | #--------------------------------------------------------------------------- | |
925 | ||
5b5c9bc7 | 926 | class RealPoint(object): |
d55e5bfc | 927 | """ |
15817c7e RD |
928 | A data structure for representing a point or position with floating |
929 | point x and y properties. In wxPython most places that expect a | |
930 | wx.RealPoint can also accept a (x,y) tuple. | |
d55e5bfc RD |
931 | """ |
932 | def __repr__(self): | |
933 | return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 RD |
934 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
935 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
d55e5bfc RD |
936 | def __init__(self, *args, **kwargs): |
937 | """ | |
5b5c9bc7 | 938 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
d55e5bfc RD |
939 | |
940 | Create a wx.RealPoint object | |
941 | """ | |
5b5c9bc7 | 942 | newobj = _core_.new_RealPoint(*args, **kwargs) |
d55e5bfc RD |
943 | self.this = newobj.this |
944 | self.thisown = 1 | |
945 | del newobj.thisown | |
5b5c9bc7 | 946 | def __del__(self, destroy=_core_.delete_RealPoint): |
d55e5bfc RD |
947 | """__del__(self)""" |
948 | try: | |
949 | if self.thisown: destroy(self) | |
950 | except: pass | |
951 | ||
952 | def __eq__(*args, **kwargs): | |
953 | """ | |
5b5c9bc7 | 954 | __eq__(self, RealPoint pt) -> bool |
d55e5bfc RD |
955 | |
956 | Test for equality of wx.RealPoint objects. | |
957 | """ | |
5b5c9bc7 | 958 | return _core_.RealPoint___eq__(*args, **kwargs) |
d55e5bfc RD |
959 | |
960 | def __ne__(*args, **kwargs): | |
961 | """ | |
5b5c9bc7 | 962 | __ne__(self, RealPoint pt) -> bool |
d55e5bfc RD |
963 | |
964 | Test for inequality of wx.RealPoint objects. | |
965 | """ | |
5b5c9bc7 | 966 | return _core_.RealPoint___ne__(*args, **kwargs) |
d55e5bfc RD |
967 | |
968 | def __add__(*args, **kwargs): | |
969 | """ | |
5b5c9bc7 | 970 | __add__(self, RealPoint pt) -> RealPoint |
d55e5bfc RD |
971 | |
972 | Add pt's proprties to this and return the result. | |
973 | """ | |
5b5c9bc7 | 974 | return _core_.RealPoint___add__(*args, **kwargs) |
d55e5bfc RD |
975 | |
976 | def __sub__(*args, **kwargs): | |
977 | """ | |
5b5c9bc7 | 978 | __sub__(self, RealPoint pt) -> RealPoint |
d55e5bfc RD |
979 | |
980 | Subtract pt's proprties from this and return the result | |
981 | """ | |
5b5c9bc7 | 982 | return _core_.RealPoint___sub__(*args, **kwargs) |
d55e5bfc RD |
983 | |
984 | def Set(*args, **kwargs): | |
985 | """ | |
986 | Set(self, double x, double y) | |
987 | ||
988 | Set both the x and y properties | |
989 | """ | |
5b5c9bc7 | 990 | return _core_.RealPoint_Set(*args, **kwargs) |
d55e5bfc RD |
991 | |
992 | def Get(*args, **kwargs): | |
993 | """ | |
994 | Get() -> (x,y) | |
995 | ||
996 | Return the x and y properties as a tuple. | |
997 | """ | |
5b5c9bc7 | 998 | return _core_.RealPoint_Get(*args, **kwargs) |
d55e5bfc | 999 | |
15817c7e | 1000 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1001 | def __str__(self): return str(self.Get()) |
1002 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
1003 | def __len__(self): return len(self.Get()) | |
1004 | def __getitem__(self, index): return self.Get()[index] | |
1005 | def __setitem__(self, index, val): | |
1006 | if index == 0: self.x = val | |
1007 | elif index == 1: self.y = val | |
1008 | else: raise IndexError | |
1009 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1010 | __safe_for_unpickling__ = True | |
1011 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
1012 | ||
1013 | ||
5b5c9bc7 | 1014 | class RealPointPtr(RealPoint): |
d55e5bfc RD |
1015 | def __init__(self, this): |
1016 | self.this = this | |
1017 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1018 | self.__class__ = RealPoint |
1019 | _core_.RealPoint_swigregister(RealPointPtr) | |
d55e5bfc RD |
1020 | |
1021 | #--------------------------------------------------------------------------- | |
1022 | ||
5b5c9bc7 | 1023 | class Point(object): |
d55e5bfc | 1024 | """ |
15817c7e RD |
1025 | A data structure for representing a point or position with integer x |
1026 | and y properties. Most places in wxPython that expect a wx.Point can | |
1027 | also accept a (x,y) tuple. | |
d55e5bfc RD |
1028 | """ |
1029 | def __repr__(self): | |
1030 | return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 RD |
1031 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1032 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
d55e5bfc RD |
1033 | def __init__(self, *args, **kwargs): |
1034 | """ | |
5b5c9bc7 | 1035 | __init__(self, int x=0, int y=0) -> Point |
d55e5bfc RD |
1036 | |
1037 | Create a wx.Point object | |
1038 | """ | |
5b5c9bc7 | 1039 | newobj = _core_.new_Point(*args, **kwargs) |
d55e5bfc RD |
1040 | self.this = newobj.this |
1041 | self.thisown = 1 | |
1042 | del newobj.thisown | |
5b5c9bc7 | 1043 | def __del__(self, destroy=_core_.delete_Point): |
d55e5bfc RD |
1044 | """__del__(self)""" |
1045 | try: | |
1046 | if self.thisown: destroy(self) | |
1047 | except: pass | |
1048 | ||
1049 | def __eq__(*args, **kwargs): | |
1050 | """ | |
5b5c9bc7 | 1051 | __eq__(self, Point pt) -> bool |
d55e5bfc RD |
1052 | |
1053 | Test for equality of wx.Point objects. | |
1054 | """ | |
5b5c9bc7 | 1055 | return _core_.Point___eq__(*args, **kwargs) |
d55e5bfc RD |
1056 | |
1057 | def __ne__(*args, **kwargs): | |
1058 | """ | |
5b5c9bc7 | 1059 | __ne__(self, Point pt) -> bool |
d55e5bfc RD |
1060 | |
1061 | Test for inequality of wx.Point objects. | |
1062 | """ | |
5b5c9bc7 | 1063 | return _core_.Point___ne__(*args, **kwargs) |
d55e5bfc RD |
1064 | |
1065 | def __add__(*args, **kwargs): | |
1066 | """ | |
5b5c9bc7 | 1067 | __add__(self, Point pt) -> Point |
d55e5bfc RD |
1068 | |
1069 | Add pt's proprties to this and return the result. | |
1070 | """ | |
5b5c9bc7 | 1071 | return _core_.Point___add__(*args, **kwargs) |
d55e5bfc RD |
1072 | |
1073 | def __sub__(*args, **kwargs): | |
1074 | """ | |
5b5c9bc7 | 1075 | __sub__(self, Point pt) -> Point |
d55e5bfc RD |
1076 | |
1077 | Subtract pt's proprties from this and return the result | |
1078 | """ | |
5b5c9bc7 | 1079 | return _core_.Point___sub__(*args, **kwargs) |
d55e5bfc RD |
1080 | |
1081 | def __iadd__(*args, **kwargs): | |
1082 | """ | |
5b5c9bc7 | 1083 | __iadd__(self, Point pt) -> Point |
d55e5bfc RD |
1084 | |
1085 | Add pt to this object. | |
1086 | """ | |
5b5c9bc7 | 1087 | return _core_.Point___iadd__(*args, **kwargs) |
d55e5bfc RD |
1088 | |
1089 | def __isub__(*args, **kwargs): | |
1090 | """ | |
5b5c9bc7 | 1091 | __isub__(self, Point pt) -> Point |
d55e5bfc RD |
1092 | |
1093 | Subtract pt from this object. | |
1094 | """ | |
5b5c9bc7 | 1095 | return _core_.Point___isub__(*args, **kwargs) |
d55e5bfc RD |
1096 | |
1097 | def Set(*args, **kwargs): | |
1098 | """ | |
1099 | Set(self, long x, long y) | |
1100 | ||
1101 | Set both the x and y properties | |
1102 | """ | |
5b5c9bc7 | 1103 | return _core_.Point_Set(*args, **kwargs) |
d55e5bfc RD |
1104 | |
1105 | def Get(*args, **kwargs): | |
1106 | """ | |
1107 | Get() -> (x,y) | |
1108 | ||
1109 | Return the x and y properties as a tuple. | |
1110 | """ | |
5b5c9bc7 | 1111 | return _core_.Point_Get(*args, **kwargs) |
d55e5bfc | 1112 | |
15817c7e | 1113 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1114 | def __str__(self): return str(self.Get()) |
1115 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1116 | def __len__(self): return len(self.Get()) | |
1117 | def __getitem__(self, index): return self.Get()[index] | |
1118 | def __setitem__(self, index, val): | |
1119 | if index == 0: self.x = val | |
1120 | elif index == 1: self.y = val | |
1121 | else: raise IndexError | |
1122 | def __nonzero__(self): return self.Get() != (0,0) | |
1123 | __safe_for_unpickling__ = True | |
1124 | def __reduce__(self): return (wx.Point, self.Get()) | |
1125 | ||
1126 | ||
5b5c9bc7 | 1127 | class PointPtr(Point): |
d55e5bfc RD |
1128 | def __init__(self, this): |
1129 | self.this = this | |
1130 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1131 | self.__class__ = Point |
1132 | _core_.Point_swigregister(PointPtr) | |
d55e5bfc RD |
1133 | |
1134 | #--------------------------------------------------------------------------- | |
1135 | ||
5b5c9bc7 | 1136 | class Rect(object): |
d55e5bfc | 1137 | """ |
15817c7e RD |
1138 | A class for representing and manipulating rectangles. It has x, y, |
1139 | width and height properties. In wxPython most palces that expect a | |
1140 | wx.Rect can also accept a (x,y,width,height) tuple. | |
d55e5bfc RD |
1141 | """ |
1142 | def __repr__(self): | |
1143 | return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1144 | def __init__(self, *args, **kwargs): | |
1145 | """ | |
5b5c9bc7 | 1146 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
d55e5bfc RD |
1147 | |
1148 | Create a new Rect object. | |
1149 | """ | |
5b5c9bc7 | 1150 | newobj = _core_.new_Rect(*args, **kwargs) |
d55e5bfc RD |
1151 | self.this = newobj.this |
1152 | self.thisown = 1 | |
1153 | del newobj.thisown | |
5b5c9bc7 | 1154 | def __del__(self, destroy=_core_.delete_Rect): |
d55e5bfc RD |
1155 | """__del__(self)""" |
1156 | try: | |
1157 | if self.thisown: destroy(self) | |
1158 | except: pass | |
1159 | ||
1160 | def GetX(*args, **kwargs): | |
1161 | """GetX(self) -> int""" | |
5b5c9bc7 | 1162 | return _core_.Rect_GetX(*args, **kwargs) |
d55e5bfc RD |
1163 | |
1164 | def SetX(*args, **kwargs): | |
1165 | """SetX(self, int x)""" | |
5b5c9bc7 | 1166 | return _core_.Rect_SetX(*args, **kwargs) |
d55e5bfc RD |
1167 | |
1168 | def GetY(*args, **kwargs): | |
1169 | """GetY(self) -> int""" | |
5b5c9bc7 | 1170 | return _core_.Rect_GetY(*args, **kwargs) |
d55e5bfc RD |
1171 | |
1172 | def SetY(*args, **kwargs): | |
1173 | """SetY(self, int y)""" | |
5b5c9bc7 | 1174 | return _core_.Rect_SetY(*args, **kwargs) |
d55e5bfc RD |
1175 | |
1176 | def GetWidth(*args, **kwargs): | |
1177 | """GetWidth(self) -> int""" | |
5b5c9bc7 | 1178 | return _core_.Rect_GetWidth(*args, **kwargs) |
d55e5bfc RD |
1179 | |
1180 | def SetWidth(*args, **kwargs): | |
1181 | """SetWidth(self, int w)""" | |
5b5c9bc7 | 1182 | return _core_.Rect_SetWidth(*args, **kwargs) |
d55e5bfc RD |
1183 | |
1184 | def GetHeight(*args, **kwargs): | |
1185 | """GetHeight(self) -> int""" | |
5b5c9bc7 | 1186 | return _core_.Rect_GetHeight(*args, **kwargs) |
d55e5bfc RD |
1187 | |
1188 | def SetHeight(*args, **kwargs): | |
1189 | """SetHeight(self, int h)""" | |
5b5c9bc7 | 1190 | return _core_.Rect_SetHeight(*args, **kwargs) |
d55e5bfc RD |
1191 | |
1192 | def GetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
1193 | """GetPosition(self) -> Point""" |
1194 | return _core_.Rect_GetPosition(*args, **kwargs) | |
d55e5bfc RD |
1195 | |
1196 | def SetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
1197 | """SetPosition(self, Point p)""" |
1198 | return _core_.Rect_SetPosition(*args, **kwargs) | |
d55e5bfc RD |
1199 | |
1200 | def GetSize(*args, **kwargs): | |
5b5c9bc7 RD |
1201 | """GetSize(self) -> Size""" |
1202 | return _core_.Rect_GetSize(*args, **kwargs) | |
d55e5bfc RD |
1203 | |
1204 | def SetSize(*args, **kwargs): | |
5b5c9bc7 RD |
1205 | """SetSize(self, Size s)""" |
1206 | return _core_.Rect_SetSize(*args, **kwargs) | |
d55e5bfc | 1207 | |
aff4cc5c RD |
1208 | def IsEmpty(*args, **kwargs): |
1209 | """IsEmpty(self) -> bool""" | |
5b5c9bc7 | 1210 | return _core_.Rect_IsEmpty(*args, **kwargs) |
aff4cc5c | 1211 | |
d55e5bfc | 1212 | def GetTopLeft(*args, **kwargs): |
5b5c9bc7 RD |
1213 | """GetTopLeft(self) -> Point""" |
1214 | return _core_.Rect_GetTopLeft(*args, **kwargs) | |
d55e5bfc RD |
1215 | |
1216 | def SetTopLeft(*args, **kwargs): | |
5b5c9bc7 RD |
1217 | """SetTopLeft(self, Point p)""" |
1218 | return _core_.Rect_SetTopLeft(*args, **kwargs) | |
d55e5bfc RD |
1219 | |
1220 | def GetBottomRight(*args, **kwargs): | |
5b5c9bc7 RD |
1221 | """GetBottomRight(self) -> Point""" |
1222 | return _core_.Rect_GetBottomRight(*args, **kwargs) | |
d55e5bfc RD |
1223 | |
1224 | def SetBottomRight(*args, **kwargs): | |
5b5c9bc7 RD |
1225 | """SetBottomRight(self, Point p)""" |
1226 | return _core_.Rect_SetBottomRight(*args, **kwargs) | |
d55e5bfc RD |
1227 | |
1228 | def GetLeft(*args, **kwargs): | |
1229 | """GetLeft(self) -> int""" | |
5b5c9bc7 | 1230 | return _core_.Rect_GetLeft(*args, **kwargs) |
d55e5bfc RD |
1231 | |
1232 | def GetTop(*args, **kwargs): | |
1233 | """GetTop(self) -> int""" | |
5b5c9bc7 | 1234 | return _core_.Rect_GetTop(*args, **kwargs) |
d55e5bfc RD |
1235 | |
1236 | def GetBottom(*args, **kwargs): | |
1237 | """GetBottom(self) -> int""" | |
5b5c9bc7 | 1238 | return _core_.Rect_GetBottom(*args, **kwargs) |
d55e5bfc RD |
1239 | |
1240 | def GetRight(*args, **kwargs): | |
1241 | """GetRight(self) -> int""" | |
5b5c9bc7 | 1242 | return _core_.Rect_GetRight(*args, **kwargs) |
d55e5bfc RD |
1243 | |
1244 | def SetLeft(*args, **kwargs): | |
1245 | """SetLeft(self, int left)""" | |
5b5c9bc7 | 1246 | return _core_.Rect_SetLeft(*args, **kwargs) |
d55e5bfc RD |
1247 | |
1248 | def SetRight(*args, **kwargs): | |
1249 | """SetRight(self, int right)""" | |
5b5c9bc7 | 1250 | return _core_.Rect_SetRight(*args, **kwargs) |
d55e5bfc RD |
1251 | |
1252 | def SetTop(*args, **kwargs): | |
1253 | """SetTop(self, int top)""" | |
5b5c9bc7 | 1254 | return _core_.Rect_SetTop(*args, **kwargs) |
d55e5bfc RD |
1255 | |
1256 | def SetBottom(*args, **kwargs): | |
1257 | """SetBottom(self, int bottom)""" | |
5b5c9bc7 | 1258 | return _core_.Rect_SetBottom(*args, **kwargs) |
d55e5bfc RD |
1259 | |
1260 | position = property(GetPosition, SetPosition) | |
1261 | size = property(GetSize, SetSize) | |
1262 | left = property(GetLeft, SetLeft) | |
1263 | right = property(GetRight, SetRight) | |
1264 | top = property(GetTop, SetTop) | |
1265 | bottom = property(GetBottom, SetBottom) | |
1266 | ||
1267 | def Inflate(*args, **kwargs): | |
1268 | """ | |
5b5c9bc7 | 1269 | Inflate(self, int dx, int dy) -> Rect |
d55e5bfc | 1270 | |
091fdbfa RD |
1271 | Increases the size of the rectangle. |
1272 | ||
1273 | The left border is moved farther left and the right border is moved | |
1274 | farther right by ``dx``. The upper border is moved farther up and the | |
1275 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1276 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1277 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1278 | opposite happens: the rectangle size decreases in the respective | |
1279 | direction. | |
1280 | ||
1281 | The change is made to the rectangle inplace, if instead you need a | |
1282 | copy that is inflated, preserving the original then make the copy | |
1283 | first:: | |
1284 | ||
1285 | copy = wx.Rect(*original) | |
1286 | copy.Inflate(10,15) | |
1287 | ||
1288 | ||
d55e5bfc | 1289 | """ |
5b5c9bc7 | 1290 | return _core_.Rect_Inflate(*args, **kwargs) |
d55e5bfc RD |
1291 | |
1292 | def Deflate(*args, **kwargs): | |
1293 | """ | |
5b5c9bc7 | 1294 | Deflate(self, int dx, int dy) -> Rect |
d55e5bfc | 1295 | |
091fdbfa RD |
1296 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1297 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1298 | `Inflate` for a full description. | |
d55e5bfc | 1299 | """ |
5b5c9bc7 | 1300 | return _core_.Rect_Deflate(*args, **kwargs) |
d55e5bfc RD |
1301 | |
1302 | def OffsetXY(*args, **kwargs): | |
1303 | """ | |
1304 | OffsetXY(self, int dx, int dy) | |
1305 | ||
15817c7e RD |
1306 | Moves the rectangle by the specified offset. If dx is positive, the |
1307 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1308 | bottom, otherwise it is moved to the left or top respectively. | |
d55e5bfc | 1309 | """ |
5b5c9bc7 | 1310 | return _core_.Rect_OffsetXY(*args, **kwargs) |
d55e5bfc RD |
1311 | |
1312 | def Offset(*args, **kwargs): | |
1313 | """ | |
5b5c9bc7 | 1314 | Offset(self, Point pt) |
d55e5bfc RD |
1315 | |
1316 | Same as OffsetXY but uses dx,dy from Point | |
1317 | """ | |
5b5c9bc7 | 1318 | return _core_.Rect_Offset(*args, **kwargs) |
d55e5bfc RD |
1319 | |
1320 | def Intersect(*args, **kwargs): | |
1321 | """ | |
5b5c9bc7 | 1322 | Intersect(self, Rect rect) -> Rect |
d55e5bfc | 1323 | |
5cbf236d | 1324 | Returns the intersectsion of this rectangle and rect. |
d55e5bfc | 1325 | """ |
5b5c9bc7 | 1326 | return _core_.Rect_Intersect(*args, **kwargs) |
d55e5bfc | 1327 | |
5cbf236d RD |
1328 | def Union(*args, **kwargs): |
1329 | """ | |
5b5c9bc7 | 1330 | Union(self, Rect rect) -> Rect |
5cbf236d RD |
1331 | |
1332 | Returns the union of this rectangle and rect. | |
1333 | """ | |
5b5c9bc7 | 1334 | return _core_.Rect_Union(*args, **kwargs) |
5cbf236d | 1335 | |
d55e5bfc RD |
1336 | def __add__(*args, **kwargs): |
1337 | """ | |
5b5c9bc7 | 1338 | __add__(self, Rect rect) -> Rect |
d55e5bfc RD |
1339 | |
1340 | Add the properties of rect to this rectangle and return the result. | |
1341 | """ | |
5b5c9bc7 | 1342 | return _core_.Rect___add__(*args, **kwargs) |
d55e5bfc RD |
1343 | |
1344 | def __iadd__(*args, **kwargs): | |
1345 | """ | |
5b5c9bc7 | 1346 | __iadd__(self, Rect rect) -> Rect |
d55e5bfc RD |
1347 | |
1348 | Add the properties of rect to this rectangle, updating this rectangle. | |
1349 | """ | |
5b5c9bc7 | 1350 | return _core_.Rect___iadd__(*args, **kwargs) |
d55e5bfc RD |
1351 | |
1352 | def __eq__(*args, **kwargs): | |
1353 | """ | |
5b5c9bc7 | 1354 | __eq__(self, Rect rect) -> bool |
d55e5bfc RD |
1355 | |
1356 | Test for equality. | |
1357 | """ | |
5b5c9bc7 | 1358 | return _core_.Rect___eq__(*args, **kwargs) |
d55e5bfc RD |
1359 | |
1360 | def __ne__(*args, **kwargs): | |
1361 | """ | |
5b5c9bc7 | 1362 | __ne__(self, Rect rect) -> bool |
d55e5bfc RD |
1363 | |
1364 | Test for inequality. | |
1365 | """ | |
5b5c9bc7 | 1366 | return _core_.Rect___ne__(*args, **kwargs) |
d55e5bfc RD |
1367 | |
1368 | def InsideXY(*args, **kwargs): | |
1369 | """ | |
1370 | InsideXY(self, int x, int y) -> bool | |
1371 | ||
1372 | Return True if the point is (not strcitly) inside the rect. | |
1373 | """ | |
5b5c9bc7 | 1374 | return _core_.Rect_InsideXY(*args, **kwargs) |
d55e5bfc RD |
1375 | |
1376 | def Inside(*args, **kwargs): | |
1377 | """ | |
5b5c9bc7 | 1378 | Inside(self, Point pt) -> bool |
d55e5bfc RD |
1379 | |
1380 | Return True if the point is (not strcitly) inside the rect. | |
1381 | """ | |
5b5c9bc7 | 1382 | return _core_.Rect_Inside(*args, **kwargs) |
d55e5bfc RD |
1383 | |
1384 | def Intersects(*args, **kwargs): | |
1385 | """ | |
5b5c9bc7 | 1386 | Intersects(self, Rect rect) -> bool |
d55e5bfc RD |
1387 | |
1388 | Returns True if the rectangles have a non empty intersection. | |
1389 | """ | |
5b5c9bc7 | 1390 | return _core_.Rect_Intersects(*args, **kwargs) |
d55e5bfc | 1391 | |
5b5c9bc7 RD |
1392 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) |
1393 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1394 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1395 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
d55e5bfc RD |
1396 | def Set(*args, **kwargs): |
1397 | """ | |
1398 | Set(self, int x=0, int y=0, int width=0, int height=0) | |
1399 | ||
1400 | Set all rectangle properties. | |
1401 | """ | |
5b5c9bc7 | 1402 | return _core_.Rect_Set(*args, **kwargs) |
d55e5bfc RD |
1403 | |
1404 | def Get(*args, **kwargs): | |
1405 | """ | |
1406 | Get() -> (x,y,width,height) | |
1407 | ||
1408 | Return the rectangle properties as a tuple. | |
1409 | """ | |
5b5c9bc7 | 1410 | return _core_.Rect_Get(*args, **kwargs) |
d55e5bfc | 1411 | |
15817c7e | 1412 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1413 | def __str__(self): return str(self.Get()) |
1414 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1415 | def __len__(self): return len(self.Get()) | |
1416 | def __getitem__(self, index): return self.Get()[index] | |
1417 | def __setitem__(self, index, val): | |
1418 | if index == 0: self.x = val | |
1419 | elif index == 1: self.y = val | |
1420 | elif index == 2: self.width = val | |
1421 | elif index == 3: self.height = val | |
1422 | else: raise IndexError | |
1423 | def __nonzero__(self): return self.Get() != (0,0,0,0) | |
1424 | __safe_for_unpickling__ = True | |
1425 | def __reduce__(self): return (wx.Rect, self.Get()) | |
1426 | ||
1427 | ||
5b5c9bc7 | 1428 | class RectPtr(Rect): |
d55e5bfc RD |
1429 | def __init__(self, this): |
1430 | self.this = this | |
1431 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1432 | self.__class__ = Rect |
1433 | _core_.Rect_swigregister(RectPtr) | |
d55e5bfc RD |
1434 | |
1435 | def RectPP(*args, **kwargs): | |
1436 | """ | |
5b5c9bc7 | 1437 | RectPP(Point topLeft, Point bottomRight) -> Rect |
d55e5bfc RD |
1438 | |
1439 | Create a new Rect object from Points representing two corners. | |
1440 | """ | |
5b5c9bc7 | 1441 | val = _core_.new_RectPP(*args, **kwargs) |
d55e5bfc RD |
1442 | val.thisown = 1 |
1443 | return val | |
1444 | ||
1445 | def RectPS(*args, **kwargs): | |
1446 | """ | |
5b5c9bc7 | 1447 | RectPS(Point pos, Size size) -> Rect |
d55e5bfc RD |
1448 | |
1449 | Create a new Rect from a position and size. | |
1450 | """ | |
5b5c9bc7 | 1451 | val = _core_.new_RectPS(*args, **kwargs) |
d55e5bfc RD |
1452 | val.thisown = 1 |
1453 | return val | |
1454 | ||
070c48b4 RD |
1455 | def RectS(*args, **kwargs): |
1456 | """ | |
5b5c9bc7 | 1457 | RectS(Size size) -> Rect |
070c48b4 RD |
1458 | |
1459 | Create a new Rect from a size only. | |
1460 | """ | |
5b5c9bc7 | 1461 | val = _core_.new_RectS(*args, **kwargs) |
070c48b4 RD |
1462 | val.thisown = 1 |
1463 | return val | |
1464 | ||
d55e5bfc | 1465 | |
5b5c9bc7 | 1466 | def IntersectRect(*args, **kwargs): |
d55e5bfc RD |
1467 | """ |
1468 | IntersectRect(Rect r1, Rect r2) -> Rect | |
1469 | ||
1470 | Calculate and return the intersection of r1 and r2. | |
1471 | """ | |
5b5c9bc7 | 1472 | return _core_.IntersectRect(*args, **kwargs) |
d55e5bfc RD |
1473 | #--------------------------------------------------------------------------- |
1474 | ||
5b5c9bc7 | 1475 | class Point2D(object): |
15817c7e RD |
1476 | """ |
1477 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1478 | with floating point values. | |
1479 | """ | |
d55e5bfc RD |
1480 | def __repr__(self): |
1481 | return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1482 | def __init__(self, *args, **kwargs): | |
1483 | """ | |
5b5c9bc7 | 1484 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
d55e5bfc RD |
1485 | |
1486 | Create a w.Point2D object. | |
1487 | """ | |
5b5c9bc7 | 1488 | newobj = _core_.new_Point2D(*args, **kwargs) |
d55e5bfc RD |
1489 | self.this = newobj.this |
1490 | self.thisown = 1 | |
1491 | del newobj.thisown | |
1492 | def GetFloor(*args, **kwargs): | |
fd2dc343 RD |
1493 | """ |
1494 | GetFloor() -> (x,y) | |
1495 | ||
1496 | Convert to integer | |
1497 | """ | |
5b5c9bc7 | 1498 | return _core_.Point2D_GetFloor(*args, **kwargs) |
d55e5bfc RD |
1499 | |
1500 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1501 | """ |
1502 | GetRounded() -> (x,y) | |
1503 | ||
1504 | Convert to integer | |
1505 | """ | |
5b5c9bc7 | 1506 | return _core_.Point2D_GetRounded(*args, **kwargs) |
d55e5bfc RD |
1507 | |
1508 | def GetVectorLength(*args, **kwargs): | |
1509 | """GetVectorLength(self) -> double""" | |
5b5c9bc7 | 1510 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
d55e5bfc RD |
1511 | |
1512 | def GetVectorAngle(*args, **kwargs): | |
1513 | """GetVectorAngle(self) -> double""" | |
5b5c9bc7 | 1514 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
d55e5bfc RD |
1515 | |
1516 | def SetVectorLength(*args, **kwargs): | |
1517 | """SetVectorLength(self, double length)""" | |
5b5c9bc7 | 1518 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
d55e5bfc RD |
1519 | |
1520 | def SetVectorAngle(*args, **kwargs): | |
1521 | """SetVectorAngle(self, double degrees)""" | |
5b5c9bc7 | 1522 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
d55e5bfc RD |
1523 | |
1524 | def SetPolarCoordinates(self, angle, length): | |
1525 | self.SetVectorLength(length) | |
1526 | self.SetVectorAngle(angle) | |
1527 | def Normalize(self): | |
1528 | self.SetVectorLength(1.0) | |
1529 | ||
1530 | def GetDistance(*args, **kwargs): | |
5b5c9bc7 RD |
1531 | """GetDistance(self, Point2D pt) -> double""" |
1532 | return _core_.Point2D_GetDistance(*args, **kwargs) | |
d55e5bfc RD |
1533 | |
1534 | def GetDistanceSquare(*args, **kwargs): | |
5b5c9bc7 RD |
1535 | """GetDistanceSquare(self, Point2D pt) -> double""" |
1536 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) | |
d55e5bfc RD |
1537 | |
1538 | def GetDotProduct(*args, **kwargs): | |
5b5c9bc7 RD |
1539 | """GetDotProduct(self, Point2D vec) -> double""" |
1540 | return _core_.Point2D_GetDotProduct(*args, **kwargs) | |
d55e5bfc RD |
1541 | |
1542 | def GetCrossProduct(*args, **kwargs): | |
5b5c9bc7 RD |
1543 | """GetCrossProduct(self, Point2D vec) -> double""" |
1544 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) | |
d55e5bfc RD |
1545 | |
1546 | def __neg__(*args, **kwargs): | |
1547 | """ | |
5b5c9bc7 | 1548 | __neg__(self) -> Point2D |
d55e5bfc RD |
1549 | |
1550 | the reflection of this point | |
1551 | """ | |
5b5c9bc7 | 1552 | return _core_.Point2D___neg__(*args, **kwargs) |
d55e5bfc RD |
1553 | |
1554 | def __iadd__(*args, **kwargs): | |
5b5c9bc7 RD |
1555 | """__iadd__(self, Point2D pt) -> Point2D""" |
1556 | return _core_.Point2D___iadd__(*args, **kwargs) | |
d55e5bfc RD |
1557 | |
1558 | def __isub__(*args, **kwargs): | |
5b5c9bc7 RD |
1559 | """__isub__(self, Point2D pt) -> Point2D""" |
1560 | return _core_.Point2D___isub__(*args, **kwargs) | |
d55e5bfc RD |
1561 | |
1562 | def __imul__(*args, **kwargs): | |
5b5c9bc7 RD |
1563 | """__imul__(self, Point2D pt) -> Point2D""" |
1564 | return _core_.Point2D___imul__(*args, **kwargs) | |
d55e5bfc RD |
1565 | |
1566 | def __idiv__(*args, **kwargs): | |
5b5c9bc7 RD |
1567 | """__idiv__(self, Point2D pt) -> Point2D""" |
1568 | return _core_.Point2D___idiv__(*args, **kwargs) | |
d55e5bfc RD |
1569 | |
1570 | def __eq__(*args, **kwargs): | |
1571 | """ | |
5b5c9bc7 | 1572 | __eq__(self, Point2D pt) -> bool |
d55e5bfc RD |
1573 | |
1574 | Test for equality | |
1575 | """ | |
5b5c9bc7 | 1576 | return _core_.Point2D___eq__(*args, **kwargs) |
d55e5bfc RD |
1577 | |
1578 | def __ne__(*args, **kwargs): | |
1579 | """ | |
5b5c9bc7 | 1580 | __ne__(self, Point2D pt) -> bool |
d55e5bfc RD |
1581 | |
1582 | Test for inequality | |
1583 | """ | |
5b5c9bc7 | 1584 | return _core_.Point2D___ne__(*args, **kwargs) |
d55e5bfc | 1585 | |
5b5c9bc7 RD |
1586 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1587 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
d55e5bfc RD |
1588 | def Set(*args, **kwargs): |
1589 | """Set(self, double x=0, double y=0)""" | |
5b5c9bc7 | 1590 | return _core_.Point2D_Set(*args, **kwargs) |
d55e5bfc RD |
1591 | |
1592 | def Get(*args, **kwargs): | |
1593 | """ | |
1594 | Get() -> (x,y) | |
1595 | ||
1596 | Return x and y properties as a tuple. | |
1597 | """ | |
5b5c9bc7 | 1598 | return _core_.Point2D_Get(*args, **kwargs) |
d55e5bfc | 1599 | |
15817c7e | 1600 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1601 | def __str__(self): return str(self.Get()) |
1602 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1603 | def __len__(self): return len(self.Get()) | |
1604 | def __getitem__(self, index): return self.Get()[index] | |
1605 | def __setitem__(self, index, val): | |
1606 | if index == 0: self.x = val | |
1607 | elif index == 1: self.y = val | |
1608 | else: raise IndexError | |
1609 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1610 | __safe_for_unpickling__ = True | |
1611 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
1612 | ||
1613 | ||
5b5c9bc7 | 1614 | class Point2DPtr(Point2D): |
d55e5bfc RD |
1615 | def __init__(self, this): |
1616 | self.this = this | |
1617 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1618 | self.__class__ = Point2D |
1619 | _core_.Point2D_swigregister(Point2DPtr) | |
d55e5bfc RD |
1620 | |
1621 | def Point2DCopy(*args, **kwargs): | |
1622 | """ | |
5b5c9bc7 | 1623 | Point2DCopy(Point2D pt) -> Point2D |
d55e5bfc RD |
1624 | |
1625 | Create a w.Point2D object. | |
1626 | """ | |
5b5c9bc7 | 1627 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d55e5bfc RD |
1628 | val.thisown = 1 |
1629 | return val | |
1630 | ||
1631 | def Point2DFromPoint(*args, **kwargs): | |
1632 | """ | |
5b5c9bc7 | 1633 | Point2DFromPoint(Point pt) -> Point2D |
d55e5bfc RD |
1634 | |
1635 | Create a w.Point2D object. | |
1636 | """ | |
5b5c9bc7 | 1637 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d55e5bfc RD |
1638 | val.thisown = 1 |
1639 | return val | |
1640 | ||
1641 | #--------------------------------------------------------------------------- | |
1642 | ||
5b5c9bc7 RD |
1643 | FromStart = _core_.FromStart |
1644 | FromCurrent = _core_.FromCurrent | |
1645 | FromEnd = _core_.FromEnd | |
d55e5bfc | 1646 | class InputStream(object): |
36ed4f51 | 1647 | """Proxy of C++ InputStream class""" |
d55e5bfc RD |
1648 | def __repr__(self): |
1649 | return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1650 | def __init__(self, *args, **kwargs): | |
1651 | """__init__(self, PyObject p) -> InputStream""" | |
5b5c9bc7 | 1652 | newobj = _core_.new_InputStream(*args, **kwargs) |
d55e5bfc RD |
1653 | self.this = newobj.this |
1654 | self.thisown = 1 | |
1655 | del newobj.thisown | |
5b5c9bc7 | 1656 | def __del__(self, destroy=_core_.delete_InputStream): |
8fb0e70a RD |
1657 | """__del__(self)""" |
1658 | try: | |
1659 | if self.thisown: destroy(self) | |
1660 | except: pass | |
1661 | ||
d55e5bfc RD |
1662 | def close(*args, **kwargs): |
1663 | """close(self)""" | |
5b5c9bc7 | 1664 | return _core_.InputStream_close(*args, **kwargs) |
d55e5bfc RD |
1665 | |
1666 | def flush(*args, **kwargs): | |
1667 | """flush(self)""" | |
5b5c9bc7 | 1668 | return _core_.InputStream_flush(*args, **kwargs) |
d55e5bfc RD |
1669 | |
1670 | def eof(*args, **kwargs): | |
1671 | """eof(self) -> bool""" | |
5b5c9bc7 | 1672 | return _core_.InputStream_eof(*args, **kwargs) |
d55e5bfc RD |
1673 | |
1674 | def read(*args, **kwargs): | |
1675 | """read(self, int size=-1) -> PyObject""" | |
5b5c9bc7 | 1676 | return _core_.InputStream_read(*args, **kwargs) |
d55e5bfc RD |
1677 | |
1678 | def readline(*args, **kwargs): | |
1679 | """readline(self, int size=-1) -> PyObject""" | |
5b5c9bc7 | 1680 | return _core_.InputStream_readline(*args, **kwargs) |
d55e5bfc RD |
1681 | |
1682 | def readlines(*args, **kwargs): | |
1683 | """readlines(self, int sizehint=-1) -> PyObject""" | |
5b5c9bc7 | 1684 | return _core_.InputStream_readlines(*args, **kwargs) |
d55e5bfc RD |
1685 | |
1686 | def seek(*args, **kwargs): | |
1687 | """seek(self, int offset, int whence=0)""" | |
5b5c9bc7 | 1688 | return _core_.InputStream_seek(*args, **kwargs) |
d55e5bfc RD |
1689 | |
1690 | def tell(*args, **kwargs): | |
1691 | """tell(self) -> int""" | |
5b5c9bc7 | 1692 | return _core_.InputStream_tell(*args, **kwargs) |
d55e5bfc RD |
1693 | |
1694 | def Peek(*args, **kwargs): | |
1695 | """Peek(self) -> char""" | |
5b5c9bc7 | 1696 | return _core_.InputStream_Peek(*args, **kwargs) |
d55e5bfc RD |
1697 | |
1698 | def GetC(*args, **kwargs): | |
1699 | """GetC(self) -> char""" | |
5b5c9bc7 | 1700 | return _core_.InputStream_GetC(*args, **kwargs) |
d55e5bfc RD |
1701 | |
1702 | def LastRead(*args, **kwargs): | |
1703 | """LastRead(self) -> size_t""" | |
5b5c9bc7 | 1704 | return _core_.InputStream_LastRead(*args, **kwargs) |
d55e5bfc RD |
1705 | |
1706 | def CanRead(*args, **kwargs): | |
1707 | """CanRead(self) -> bool""" | |
5b5c9bc7 | 1708 | return _core_.InputStream_CanRead(*args, **kwargs) |
d55e5bfc RD |
1709 | |
1710 | def Eof(*args, **kwargs): | |
1711 | """Eof(self) -> bool""" | |
5b5c9bc7 | 1712 | return _core_.InputStream_Eof(*args, **kwargs) |
d55e5bfc RD |
1713 | |
1714 | def Ungetch(*args, **kwargs): | |
1715 | """Ungetch(self, char c) -> bool""" | |
5b5c9bc7 | 1716 | return _core_.InputStream_Ungetch(*args, **kwargs) |
d55e5bfc RD |
1717 | |
1718 | def SeekI(*args, **kwargs): | |
5b5c9bc7 RD |
1719 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
1720 | return _core_.InputStream_SeekI(*args, **kwargs) | |
d55e5bfc RD |
1721 | |
1722 | def TellI(*args, **kwargs): | |
1723 | """TellI(self) -> long""" | |
5b5c9bc7 | 1724 | return _core_.InputStream_TellI(*args, **kwargs) |
d55e5bfc RD |
1725 | |
1726 | ||
1727 | class InputStreamPtr(InputStream): | |
1728 | def __init__(self, this): | |
1729 | self.this = this | |
1730 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1731 | self.__class__ = InputStream | |
5b5c9bc7 RD |
1732 | _core_.InputStream_swigregister(InputStreamPtr) |
1733 | DefaultPosition = cvar.DefaultPosition | |
1734 | DefaultSize = cvar.DefaultSize | |
d55e5bfc | 1735 | |
5b5c9bc7 RD |
1736 | class OutputStream(object): |
1737 | """Proxy of C++ OutputStream class""" | |
d55e5bfc RD |
1738 | def __init__(self): raise RuntimeError, "No constructor defined" |
1739 | def __repr__(self): | |
1740 | return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1741 | def write(*args, **kwargs): | |
1742 | """write(self, PyObject obj)""" | |
5b5c9bc7 | 1743 | return _core_.OutputStream_write(*args, **kwargs) |
d55e5bfc RD |
1744 | |
1745 | ||
5b5c9bc7 | 1746 | class OutputStreamPtr(OutputStream): |
d55e5bfc RD |
1747 | def __init__(self, this): |
1748 | self.this = this | |
1749 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1750 | self.__class__ = OutputStream |
1751 | _core_.OutputStream_swigregister(OutputStreamPtr) | |
d55e5bfc RD |
1752 | |
1753 | #--------------------------------------------------------------------------- | |
1754 | ||
5b5c9bc7 RD |
1755 | class FSFile(Object): |
1756 | """Proxy of C++ FSFile class""" | |
d55e5bfc RD |
1757 | def __repr__(self): |
1758 | return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1759 | def __init__(self, *args, **kwargs): | |
1760 | """ | |
5b5c9bc7 RD |
1761 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
1762 | DateTime modif) -> FSFile | |
d55e5bfc | 1763 | """ |
5b5c9bc7 | 1764 | newobj = _core_.new_FSFile(*args, **kwargs) |
d55e5bfc RD |
1765 | self.this = newobj.this |
1766 | self.thisown = 1 | |
1767 | del newobj.thisown | |
e2950dbb | 1768 | self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem |
4cf4100f | 1769 | |
5b5c9bc7 | 1770 | def __del__(self, destroy=_core_.delete_FSFile): |
d55e5bfc RD |
1771 | """__del__(self)""" |
1772 | try: | |
1773 | if self.thisown: destroy(self) | |
1774 | except: pass | |
1775 | ||
1776 | def GetStream(*args, **kwargs): | |
5b5c9bc7 RD |
1777 | """GetStream(self) -> InputStream""" |
1778 | return _core_.FSFile_GetStream(*args, **kwargs) | |
d55e5bfc RD |
1779 | |
1780 | def GetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
1781 | """GetMimeType(self) -> String""" |
1782 | return _core_.FSFile_GetMimeType(*args, **kwargs) | |
d55e5bfc RD |
1783 | |
1784 | def GetLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1785 | """GetLocation(self) -> String""" |
1786 | return _core_.FSFile_GetLocation(*args, **kwargs) | |
d55e5bfc RD |
1787 | |
1788 | def GetAnchor(*args, **kwargs): | |
5b5c9bc7 RD |
1789 | """GetAnchor(self) -> String""" |
1790 | return _core_.FSFile_GetAnchor(*args, **kwargs) | |
d55e5bfc RD |
1791 | |
1792 | def GetModificationTime(*args, **kwargs): | |
5b5c9bc7 RD |
1793 | """GetModificationTime(self) -> DateTime""" |
1794 | return _core_.FSFile_GetModificationTime(*args, **kwargs) | |
d55e5bfc RD |
1795 | |
1796 | ||
5b5c9bc7 | 1797 | class FSFilePtr(FSFile): |
d55e5bfc RD |
1798 | def __init__(self, this): |
1799 | self.this = this | |
1800 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1801 | self.__class__ = FSFile |
1802 | _core_.FSFile_swigregister(FSFilePtr) | |
d55e5bfc RD |
1803 | |
1804 | class CPPFileSystemHandler(object): | |
36ed4f51 | 1805 | """Proxy of C++ CPPFileSystemHandler class""" |
d55e5bfc RD |
1806 | def __init__(self): raise RuntimeError, "No constructor defined" |
1807 | def __repr__(self): | |
1808 | return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1809 | ||
1810 | class CPPFileSystemHandlerPtr(CPPFileSystemHandler): | |
1811 | def __init__(self, this): | |
1812 | self.this = this | |
1813 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1814 | self.__class__ = CPPFileSystemHandler | |
5b5c9bc7 | 1815 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr) |
d55e5bfc RD |
1816 | |
1817 | class FileSystemHandler(CPPFileSystemHandler): | |
36ed4f51 | 1818 | """Proxy of C++ FileSystemHandler class""" |
d55e5bfc RD |
1819 | def __repr__(self): |
1820 | return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1821 | def __init__(self, *args, **kwargs): | |
1822 | """__init__(self) -> FileSystemHandler""" | |
5b5c9bc7 | 1823 | newobj = _core_.new_FileSystemHandler(*args, **kwargs) |
d55e5bfc RD |
1824 | self.this = newobj.this |
1825 | self.thisown = 1 | |
1826 | del newobj.thisown | |
1827 | self._setCallbackInfo(self, FileSystemHandler) | |
1828 | ||
1829 | def _setCallbackInfo(*args, **kwargs): | |
1830 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
5b5c9bc7 | 1831 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
1832 | |
1833 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
1834 | """CanOpen(self, String location) -> bool""" |
1835 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1836 | |
1837 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1838 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1839 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1840 | |
1841 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
1842 | """FindFirst(self, String spec, int flags=0) -> String""" |
1843 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
1844 | |
1845 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
1846 | """FindNext(self) -> String""" |
1847 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) | |
d55e5bfc RD |
1848 | |
1849 | def GetProtocol(*args, **kwargs): | |
5b5c9bc7 RD |
1850 | """GetProtocol(self, String location) -> String""" |
1851 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) | |
d55e5bfc RD |
1852 | |
1853 | def GetLeftLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1854 | """GetLeftLocation(self, String location) -> String""" |
1855 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | |
d55e5bfc RD |
1856 | |
1857 | def GetAnchor(*args, **kwargs): | |
5b5c9bc7 RD |
1858 | """GetAnchor(self, String location) -> String""" |
1859 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) | |
d55e5bfc RD |
1860 | |
1861 | def GetRightLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1862 | """GetRightLocation(self, String location) -> String""" |
1863 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) | |
d55e5bfc RD |
1864 | |
1865 | def GetMimeTypeFromExt(*args, **kwargs): | |
5b5c9bc7 RD |
1866 | """GetMimeTypeFromExt(self, String location) -> String""" |
1867 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) | |
d55e5bfc RD |
1868 | |
1869 | ||
1870 | class FileSystemHandlerPtr(FileSystemHandler): | |
1871 | def __init__(self, this): | |
1872 | self.this = this | |
1873 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1874 | self.__class__ = FileSystemHandler | |
5b5c9bc7 | 1875 | _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr) |
d55e5bfc | 1876 | |
5b5c9bc7 RD |
1877 | class FileSystem(Object): |
1878 | """Proxy of C++ FileSystem class""" | |
d55e5bfc RD |
1879 | def __repr__(self): |
1880 | return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1881 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
1882 | """__init__(self) -> FileSystem""" |
1883 | newobj = _core_.new_FileSystem(*args, **kwargs) | |
d55e5bfc RD |
1884 | self.this = newobj.this |
1885 | self.thisown = 1 | |
1886 | del newobj.thisown | |
5b5c9bc7 | 1887 | def __del__(self, destroy=_core_.delete_FileSystem): |
d55e5bfc RD |
1888 | """__del__(self)""" |
1889 | try: | |
1890 | if self.thisown: destroy(self) | |
1891 | except: pass | |
1892 | ||
1893 | def ChangePathTo(*args, **kwargs): | |
5b5c9bc7 RD |
1894 | """ChangePathTo(self, String location, bool is_dir=False)""" |
1895 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) | |
d55e5bfc RD |
1896 | |
1897 | def GetPath(*args, **kwargs): | |
5b5c9bc7 RD |
1898 | """GetPath(self) -> String""" |
1899 | return _core_.FileSystem_GetPath(*args, **kwargs) | |
d55e5bfc RD |
1900 | |
1901 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1902 | """OpenFile(self, String location) -> FSFile""" |
1903 | return _core_.FileSystem_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1904 | |
1905 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
1906 | """FindFirst(self, String spec, int flags=0) -> String""" |
1907 | return _core_.FileSystem_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
1908 | |
1909 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
1910 | """FindNext(self) -> String""" |
1911 | return _core_.FileSystem_FindNext(*args, **kwargs) | |
d55e5bfc RD |
1912 | |
1913 | def AddHandler(*args, **kwargs): | |
d6c14a4c | 1914 | """AddHandler(CPPFileSystemHandler handler)""" |
5b5c9bc7 | 1915 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
d55e5bfc RD |
1916 | |
1917 | AddHandler = staticmethod(AddHandler) | |
1918 | def CleanUpHandlers(*args, **kwargs): | |
d6c14a4c | 1919 | """CleanUpHandlers()""" |
5b5c9bc7 | 1920 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
d55e5bfc RD |
1921 | |
1922 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1923 | def FileNameToURL(*args, **kwargs): | |
5b5c9bc7 RD |
1924 | """FileNameToURL(String filename) -> String""" |
1925 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d55e5bfc RD |
1926 | |
1927 | FileNameToURL = staticmethod(FileNameToURL) | |
b411df4a | 1928 | def URLToFileName(*args, **kwargs): |
5b5c9bc7 RD |
1929 | """URLToFileName(String url) -> String""" |
1930 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
b411df4a RD |
1931 | |
1932 | URLToFileName = staticmethod(URLToFileName) | |
d55e5bfc | 1933 | |
5b5c9bc7 | 1934 | class FileSystemPtr(FileSystem): |
d55e5bfc RD |
1935 | def __init__(self, this): |
1936 | self.this = this | |
1937 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1938 | self.__class__ = FileSystem |
1939 | _core_.FileSystem_swigregister(FileSystemPtr) | |
d55e5bfc | 1940 | |
5b5c9bc7 RD |
1941 | def FileSystem_AddHandler(*args, **kwargs): |
1942 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" | |
1943 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
d55e5bfc | 1944 | |
5b5c9bc7 RD |
1945 | def FileSystem_CleanUpHandlers(*args, **kwargs): |
1946 | """FileSystem_CleanUpHandlers()""" | |
1947 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) | |
d55e5bfc | 1948 | |
5b5c9bc7 RD |
1949 | def FileSystem_FileNameToURL(*args, **kwargs): |
1950 | """FileSystem_FileNameToURL(String filename) -> String""" | |
1951 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d55e5bfc | 1952 | |
5b5c9bc7 RD |
1953 | def FileSystem_URLToFileName(*args, **kwargs): |
1954 | """FileSystem_URLToFileName(String url) -> String""" | |
1955 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
b411df4a | 1956 | |
5b5c9bc7 RD |
1957 | class InternetFSHandler(CPPFileSystemHandler): |
1958 | """Proxy of C++ InternetFSHandler class""" | |
d55e5bfc RD |
1959 | def __repr__(self): |
1960 | return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1961 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
1962 | """__init__(self) -> InternetFSHandler""" |
1963 | newobj = _core_.new_InternetFSHandler(*args, **kwargs) | |
d55e5bfc RD |
1964 | self.this = newobj.this |
1965 | self.thisown = 1 | |
1966 | del newobj.thisown | |
1967 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
1968 | """CanOpen(self, String location) -> bool""" |
1969 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1970 | |
1971 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1972 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1973 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1974 | |
1975 | ||
5b5c9bc7 | 1976 | class InternetFSHandlerPtr(InternetFSHandler): |
d55e5bfc RD |
1977 | def __init__(self, this): |
1978 | self.this = this | |
1979 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1980 | self.__class__ = InternetFSHandler |
1981 | _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr) | |
d55e5bfc | 1982 | |
5b5c9bc7 RD |
1983 | class ZipFSHandler(CPPFileSystemHandler): |
1984 | """Proxy of C++ ZipFSHandler class""" | |
d55e5bfc RD |
1985 | def __repr__(self): |
1986 | return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1987 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
1988 | """__init__(self) -> ZipFSHandler""" |
1989 | newobj = _core_.new_ZipFSHandler(*args, **kwargs) | |
d55e5bfc RD |
1990 | self.this = newobj.this |
1991 | self.thisown = 1 | |
1992 | del newobj.thisown | |
1993 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
1994 | """CanOpen(self, String location) -> bool""" |
1995 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1996 | |
1997 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1998 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1999 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
2000 | |
2001 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
2002 | """FindFirst(self, String spec, int flags=0) -> String""" |
2003 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
2004 | |
2005 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
2006 | """FindNext(self) -> String""" |
2007 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) | |
d55e5bfc RD |
2008 | |
2009 | ||
5b5c9bc7 | 2010 | class ZipFSHandlerPtr(ZipFSHandler): |
d55e5bfc RD |
2011 | def __init__(self, this): |
2012 | self.this = this | |
2013 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2014 | self.__class__ = ZipFSHandler |
2015 | _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr) | |
d55e5bfc RD |
2016 | |
2017 | ||
2018 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): | |
5b5c9bc7 RD |
2019 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
2020 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
d55e5bfc RD |
2021 | |
2022 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
2023 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
2024 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
d55e5bfc RD |
2025 | |
2026 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): | |
5b5c9bc7 RD |
2027 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
2028 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
b411df4a RD |
2029 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
2030 | """ | |
2031 | Add 'file' to the memory filesystem. The dataItem parameter can | |
2032 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
2033 | arbitrary data. If a bitmap or image is used then the imgType | |
2034 | parameter should specify what kind of image file it should be | |
2035 | written as, wx.BITMAP_TYPE_PNG, etc. | |
2036 | """ | |
2037 | if isinstance(dataItem, wx.Image): | |
2038 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
2039 | elif isinstance(dataItem, wx.Bitmap): | |
2040 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
2041 | elif type(dataItem) == str: | |
2042 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
2043 | else: | |
2044 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d55e5bfc | 2045 | |
5b5c9bc7 RD |
2046 | class MemoryFSHandler(CPPFileSystemHandler): |
2047 | """Proxy of C++ MemoryFSHandler class""" | |
d55e5bfc RD |
2048 | def __repr__(self): |
2049 | return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2050 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
2051 | """__init__(self) -> MemoryFSHandler""" |
2052 | newobj = _core_.new_MemoryFSHandler(*args, **kwargs) | |
d55e5bfc RD |
2053 | self.this = newobj.this |
2054 | self.thisown = 1 | |
2055 | del newobj.thisown | |
2056 | def RemoveFile(*args, **kwargs): | |
5b5c9bc7 RD |
2057 | """RemoveFile(String filename)""" |
2058 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d55e5bfc RD |
2059 | |
2060 | RemoveFile = staticmethod(RemoveFile) | |
2061 | AddFile = staticmethod(MemoryFSHandler_AddFile) | |
2062 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
2063 | """CanOpen(self, String location) -> bool""" |
2064 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
2065 | |
2066 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
2067 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
2068 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
2069 | |
2070 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
2071 | """FindFirst(self, String spec, int flags=0) -> String""" |
2072 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
2073 | |
2074 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
2075 | """FindNext(self) -> String""" |
2076 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) | |
d55e5bfc RD |
2077 | |
2078 | ||
5b5c9bc7 | 2079 | class MemoryFSHandlerPtr(MemoryFSHandler): |
d55e5bfc RD |
2080 | def __init__(self, this): |
2081 | self.this = this | |
2082 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2083 | self.__class__ = MemoryFSHandler |
2084 | _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr) | |
d55e5bfc | 2085 | |
5b5c9bc7 RD |
2086 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
2087 | """MemoryFSHandler_RemoveFile(String filename)""" | |
2088 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d55e5bfc | 2089 | |
5b5c9bc7 RD |
2090 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
2091 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
2092 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
d55e5bfc RD |
2093 | #--------------------------------------------------------------------------- |
2094 | ||
5b5c9bc7 | 2095 | class ImageHandler(Object): |
27fb7603 RD |
2096 | """ |
2097 | This is the base class for implementing image file loading/saving, and | |
2098 | image creation from data. It is used within `wx.Image` and is not | |
2099 | normally seen by the application. | |
2100 | """ | |
d55e5bfc RD |
2101 | def __init__(self): raise RuntimeError, "No constructor defined" |
2102 | def __repr__(self): | |
2103 | return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2104 | def GetName(*args, **kwargs): | |
5b5c9bc7 RD |
2105 | """GetName(self) -> String""" |
2106 | return _core_.ImageHandler_GetName(*args, **kwargs) | |
d55e5bfc RD |
2107 | |
2108 | def GetExtension(*args, **kwargs): | |
5b5c9bc7 RD |
2109 | """GetExtension(self) -> String""" |
2110 | return _core_.ImageHandler_GetExtension(*args, **kwargs) | |
d55e5bfc RD |
2111 | |
2112 | def GetType(*args, **kwargs): | |
2113 | """GetType(self) -> long""" | |
5b5c9bc7 | 2114 | return _core_.ImageHandler_GetType(*args, **kwargs) |
d55e5bfc RD |
2115 | |
2116 | def GetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
2117 | """GetMimeType(self) -> String""" |
2118 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) | |
d55e5bfc RD |
2119 | |
2120 | def CanRead(*args, **kwargs): | |
5b5c9bc7 RD |
2121 | """CanRead(self, String name) -> bool""" |
2122 | return _core_.ImageHandler_CanRead(*args, **kwargs) | |
d55e5bfc RD |
2123 | |
2124 | def SetName(*args, **kwargs): | |
5b5c9bc7 RD |
2125 | """SetName(self, String name)""" |
2126 | return _core_.ImageHandler_SetName(*args, **kwargs) | |
d55e5bfc RD |
2127 | |
2128 | def SetExtension(*args, **kwargs): | |
5b5c9bc7 RD |
2129 | """SetExtension(self, String extension)""" |
2130 | return _core_.ImageHandler_SetExtension(*args, **kwargs) | |
d55e5bfc RD |
2131 | |
2132 | def SetType(*args, **kwargs): | |
2133 | """SetType(self, long type)""" | |
5b5c9bc7 | 2134 | return _core_.ImageHandler_SetType(*args, **kwargs) |
d55e5bfc RD |
2135 | |
2136 | def SetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
2137 | """SetMimeType(self, String mimetype)""" |
2138 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) | |
d55e5bfc RD |
2139 | |
2140 | ||
5b5c9bc7 | 2141 | class ImageHandlerPtr(ImageHandler): |
d55e5bfc RD |
2142 | def __init__(self, this): |
2143 | self.this = this | |
2144 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2145 | self.__class__ = ImageHandler |
2146 | _core_.ImageHandler_swigregister(ImageHandlerPtr) | |
d55e5bfc | 2147 | |
5b5c9bc7 RD |
2148 | class ImageHistogram(object): |
2149 | """Proxy of C++ ImageHistogram class""" | |
d55e5bfc RD |
2150 | def __repr__(self): |
2151 | return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2152 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
2153 | """__init__(self) -> ImageHistogram""" |
2154 | newobj = _core_.new_ImageHistogram(*args, **kwargs) | |
d55e5bfc RD |
2155 | self.this = newobj.this |
2156 | self.thisown = 1 | |
2157 | del newobj.thisown | |
2158 | def MakeKey(*args, **kwargs): | |
2159 | """ | |
7a27cf7c | 2160 | MakeKey(byte r, byte g, byte b) -> unsigned long |
d55e5bfc RD |
2161 | |
2162 | Get the key in the histogram for the given RGB values | |
2163 | """ | |
5b5c9bc7 | 2164 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d55e5bfc RD |
2165 | |
2166 | MakeKey = staticmethod(MakeKey) | |
2167 | def FindFirstUnusedColour(*args, **kwargs): | |
fd2dc343 RD |
2168 | """ |
2169 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2170 | ||
2171 | Find first colour that is not used in the image and has higher RGB | |
2172 | values than startR, startG, startB. Returns a tuple consisting of a | |
2173 | success flag and rgb values. | |
2174 | """ | |
5b5c9bc7 | 2175 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
d55e5bfc | 2176 | |
f1cbd8fa RD |
2177 | def GetCount(*args, **kwargs): |
2178 | """ | |
2179 | GetCount(self, unsigned long key) -> unsigned long | |
2180 | ||
2181 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2182 | key value from a RGB tripple. | |
2183 | """ | |
5b5c9bc7 | 2184 | return _core_.ImageHistogram_GetCount(*args, **kwargs) |
f1cbd8fa RD |
2185 | |
2186 | def GetCountRGB(*args, **kwargs): | |
2187 | """ | |
7a27cf7c | 2188 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2189 | |
2190 | Returns the pixel count for the given RGB values. | |
2191 | """ | |
5b5c9bc7 | 2192 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) |
f1cbd8fa RD |
2193 | |
2194 | def GetCountColour(*args, **kwargs): | |
2195 | """ | |
5b5c9bc7 | 2196 | GetCountColour(self, Colour colour) -> unsigned long |
f1cbd8fa RD |
2197 | |
2198 | Returns the pixel count for the given `wx.Colour` value. | |
2199 | """ | |
5b5c9bc7 | 2200 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) |
f1cbd8fa | 2201 | |
d55e5bfc | 2202 | |
5b5c9bc7 | 2203 | class ImageHistogramPtr(ImageHistogram): |
d55e5bfc RD |
2204 | def __init__(self, this): |
2205 | self.this = this | |
2206 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2207 | self.__class__ = ImageHistogram |
2208 | _core_.ImageHistogram_swigregister(ImageHistogramPtr) | |
d55e5bfc | 2209 | |
5b5c9bc7 | 2210 | def ImageHistogram_MakeKey(*args, **kwargs): |
d55e5bfc | 2211 | """ |
7a27cf7c | 2212 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
d55e5bfc RD |
2213 | |
2214 | Get the key in the histogram for the given RGB values | |
2215 | """ | |
5b5c9bc7 | 2216 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d55e5bfc | 2217 | |
5b5c9bc7 | 2218 | class Image(Object): |
7a27cf7c RD |
2219 | """ |
2220 | A platform-independent image class. An image can be created from | |
2221 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2222 | variety of formats. Functions are available to set and get image | |
2223 | bits, so it can be used for basic image manipulation. | |
2224 | ||
2225 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2226 | platform-specific `wx.Bitmap` object must be created from it using the | |
2227 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2228 | device context, using `wx.DC.DrawBitmap`. | |
2229 | ||
2230 | One colour value of the image may be used as a mask colour which will | |
2231 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2232 | bitmap object. | |
2233 | ||
2234 | wx.Image supports alpha channel data, that is in addition to a byte | |
2235 | for the red, green and blue colour components for each pixel it also | |
2236 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2237 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2238 | means that the pixel is 100% opaque. | |
2239 | ||
2240 | Unlike RGB data, not all images have an alpha channel and before using | |
2241 | `GetAlpha` you should check if this image contains an alpha channel | |
2242 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2243 | with transparency information will have an alpha channel. | |
2244 | """ | |
d55e5bfc RD |
2245 | def __repr__(self): |
2246 | return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2247 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2248 | """ |
2249 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2250 | ||
2251 | Loads an image from a file. | |
2252 | """ | |
5b5c9bc7 | 2253 | newobj = _core_.new_Image(*args, **kwargs) |
d55e5bfc RD |
2254 | self.this = newobj.this |
2255 | self.thisown = 1 | |
2256 | del newobj.thisown | |
5b5c9bc7 | 2257 | def __del__(self, destroy=_core_.delete_Image): |
d55e5bfc RD |
2258 | """__del__(self)""" |
2259 | try: | |
2260 | if self.thisown: destroy(self) | |
2261 | except: pass | |
2262 | ||
2263 | def Create(*args, **kwargs): | |
7a27cf7c RD |
2264 | """ |
2265 | Create(self, int width, int height, bool clear=True) | |
2266 | ||
2267 | Creates a fresh image. If clear is ``True``, the new image will be | |
2268 | initialized to black. Otherwise, the image data will be uninitialized. | |
2269 | """ | |
5b5c9bc7 | 2270 | return _core_.Image_Create(*args, **kwargs) |
d55e5bfc RD |
2271 | |
2272 | def Destroy(*args, **kwargs): | |
2273 | """ | |
2274 | Destroy(self) | |
2275 | ||
7a27cf7c | 2276 | Destroys the image data. |
d55e5bfc | 2277 | """ |
5b5c9bc7 | 2278 | return _core_.Image_Destroy(*args, **kwargs) |
d55e5bfc RD |
2279 | |
2280 | def Scale(*args, **kwargs): | |
7a27cf7c RD |
2281 | """ |
2282 | Scale(self, int width, int height) -> Image | |
2283 | ||
2284 | Returns a scaled version of the image. This is also useful for scaling | |
2285 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
2286 | `wx.MemoryDC` into another `wx.MemoryDC`. | |
2287 | """ | |
5b5c9bc7 | 2288 | return _core_.Image_Scale(*args, **kwargs) |
d55e5bfc RD |
2289 | |
2290 | def ShrinkBy(*args, **kwargs): | |
7a27cf7c RD |
2291 | """ |
2292 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2293 | ||
2294 | Return a version of the image scaled smaller by the given factors. | |
2295 | """ | |
5b5c9bc7 | 2296 | return _core_.Image_ShrinkBy(*args, **kwargs) |
d55e5bfc RD |
2297 | |
2298 | def Rescale(*args, **kwargs): | |
7a27cf7c RD |
2299 | """ |
2300 | Rescale(self, int width, int height) -> Image | |
2301 | ||
2302 | Changes the size of the image in-place by scaling it: after a call to | |
2303 | this function, the image will have the given width and height. | |
2304 | ||
2305 | Returns the (modified) image itself. | |
2306 | """ | |
5b5c9bc7 | 2307 | return _core_.Image_Rescale(*args, **kwargs) |
d55e5bfc | 2308 | |
aff4cc5c | 2309 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2310 | """ |
2311 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2312 | ||
2313 | Changes the size of the image in-place without scaling it, by adding | |
2314 | either a border with the given colour or cropping as necessary. The | |
2315 | image is pasted into a new image with the given size and background | |
2316 | colour at the position pos relative to the upper left of the new | |
2317 | image. If red = green = blue = -1 then use either the current mask | |
2318 | colour if set or find, use, and set a suitable mask colour for any | |
2319 | newly exposed areas. | |
2320 | ||
2321 | Returns the (modified) image itself. | |
2322 | """ | |
5b5c9bc7 | 2323 | return _core_.Image_Resize(*args, **kwargs) |
aff4cc5c | 2324 | |
d55e5bfc | 2325 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2326 | """ |
2327 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2328 | ||
2329 | Sets the pixel at the given coordinate. This routine performs | |
2330 | bounds-checks for the coordinate so it can be considered a safe way to | |
2331 | manipulate the data, but in some cases this might be too slow so that | |
2332 | the data will have to be set directly. In that case you will have to | |
2333 | get access to the image data using the `GetData` method. | |
2334 | """ | |
5b5c9bc7 | 2335 | return _core_.Image_SetRGB(*args, **kwargs) |
d55e5bfc | 2336 | |
aff4cc5c | 2337 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2338 | """ |
2339 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2340 | ||
2341 | Sets the colour of the pixels within the given rectangle. This routine | |
2342 | performs bounds-checks for the rectangle so it can be considered a | |
2343 | safe way to manipulate the data. | |
2344 | """ | |
5b5c9bc7 | 2345 | return _core_.Image_SetRGBRect(*args, **kwargs) |
aff4cc5c | 2346 | |
d55e5bfc | 2347 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2348 | """ |
2349 | GetRed(self, int x, int y) -> byte | |
2350 | ||
2351 | Returns the red intensity at the given coordinate. | |
2352 | """ | |
5b5c9bc7 | 2353 | return _core_.Image_GetRed(*args, **kwargs) |
d55e5bfc RD |
2354 | |
2355 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2356 | """ |
2357 | GetGreen(self, int x, int y) -> byte | |
2358 | ||
2359 | Returns the green intensity at the given coordinate. | |
2360 | """ | |
5b5c9bc7 | 2361 | return _core_.Image_GetGreen(*args, **kwargs) |
d55e5bfc RD |
2362 | |
2363 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2364 | """ |
2365 | GetBlue(self, int x, int y) -> byte | |
2366 | ||
2367 | Returns the blue intensity at the given coordinate. | |
2368 | """ | |
5b5c9bc7 | 2369 | return _core_.Image_GetBlue(*args, **kwargs) |
d55e5bfc RD |
2370 | |
2371 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2372 | """ |
2373 | SetAlpha(self, int x, int y, byte alpha) | |
2374 | ||
2375 | Sets the alpha value for the given pixel. This function should only be | |
2376 | called if the image has alpha channel data, use `HasAlpha` to check | |
2377 | for this. | |
2378 | """ | |
5b5c9bc7 | 2379 | return _core_.Image_SetAlpha(*args, **kwargs) |
d55e5bfc RD |
2380 | |
2381 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2382 | """ |
2383 | GetAlpha(self, int x, int y) -> byte | |
2384 | ||
2385 | Returns the alpha value for the given pixel. This function may only be | |
2386 | called for the images with alpha channel, use `HasAlpha` to check for | |
2387 | this. | |
2388 | ||
2389 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2390 | corresponds to the fully transparent pixels while the value of 255 to | |
2391 | the fully opaque pixels. | |
2392 | """ | |
5b5c9bc7 | 2393 | return _core_.Image_GetAlpha(*args, **kwargs) |
d55e5bfc RD |
2394 | |
2395 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2396 | """ |
2397 | HasAlpha(self) -> bool | |
2398 | ||
2399 | Returns true if this image has alpha channel, false otherwise. | |
2400 | """ | |
5b5c9bc7 | 2401 | return _core_.Image_HasAlpha(*args, **kwargs) |
d55e5bfc | 2402 | |
68350608 RD |
2403 | def InitAlpha(*args, **kwargs): |
2404 | """ | |
2405 | InitAlpha(self) | |
2406 | ||
2407 | Initializes the image alpha channel data. It is an error to call it if | |
2408 | the image already has alpha data. If it doesn't, alpha data will be by | |
2409 | default initialized to all pixels being fully opaque. But if the image | |
2410 | has a a mask colour, all mask pixels will be completely transparent. | |
2411 | """ | |
5b5c9bc7 RD |
2412 | return _core_.Image_InitAlpha(*args, **kwargs) |
2413 | ||
2414 | def IsTransparent(*args, **kwargs): | |
2415 | """ | |
7a27cf7c | 2416 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
5b5c9bc7 | 2417 | |
7a27cf7c RD |
2418 | Returns ``True`` if this pixel is masked or has an alpha value less |
2419 | than the spcified threshold. | |
5b5c9bc7 RD |
2420 | """ |
2421 | return _core_.Image_IsTransparent(*args, **kwargs) | |
68350608 | 2422 | |
d55e5bfc | 2423 | def FindFirstUnusedColour(*args, **kwargs): |
fd2dc343 RD |
2424 | """ |
2425 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2426 | ||
2427 | Find first colour that is not used in the image and has higher RGB | |
2428 | values than startR, startG, startB. Returns a tuple consisting of a | |
2429 | success flag and rgb values. | |
2430 | """ | |
5b5c9bc7 | 2431 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
d55e5bfc | 2432 | |
4cf4100f RD |
2433 | def ConvertAlphaToMask(*args, **kwargs): |
2434 | """ | |
5b5c9bc7 | 2435 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2436 | |
7a27cf7c RD |
2437 | If the image has alpha channel, this method converts it to mask. All |
2438 | pixels with alpha value less than ``threshold`` are replaced with the | |
2439 | mask colour and the alpha channel is removed. The mask colour is | |
2440 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2441 | |
2442 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2443 | nothing. | |
2444 | """ | |
5b5c9bc7 | 2445 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) |
4cf4100f | 2446 | |
8fb0e70a RD |
2447 | def ConvertColourToAlpha(*args, **kwargs): |
2448 | """ | |
7a27cf7c | 2449 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2450 | |
2451 | This method converts an image where the original alpha information is | |
2452 | only available as a shades of a colour (actually shades of grey) | |
2453 | typically when you draw anti-aliased text into a bitmap. The DC | |
2454 | drawing routines draw grey values on the black background although | |
2455 | they actually mean to draw white with differnt alpha values. This | |
2456 | method reverses it, assuming a black (!) background and white text. | |
2457 | The method will then fill up the whole image with the colour given. | |
2458 | """ | |
5b5c9bc7 | 2459 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) |
8fb0e70a | 2460 | |
d55e5bfc | 2461 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2462 | """ |
2463 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2464 | ||
2465 | Sets the image's mask so that the pixels that have RGB value of | |
2466 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2467 | by first finding an unused colour in the image, setting this colour as | |
2468 | the mask colour and then using this colour to draw all pixels in the | |
2469 | image who corresponding pixel in mask has given RGB value. | |
2470 | ||
2471 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2472 | image or if there is no unused colour left. Returns ``True`` if the | |
2473 | mask was successfully applied. | |
2474 | ||
2475 | Note that this method involves computing the histogram, which is | |
2476 | computationally intensive operation. | |
2477 | """ | |
5b5c9bc7 | 2478 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
d55e5bfc RD |
2479 | |
2480 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2481 | """ |
2482 | CanRead(String filename) -> bool | |
2483 | ||
2484 | Returns True if the image handlers can read this file. | |
2485 | """ | |
5b5c9bc7 | 2486 | return _core_.Image_CanRead(*args, **kwargs) |
d55e5bfc RD |
2487 | |
2488 | CanRead = staticmethod(CanRead) | |
2489 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2490 | """ |
2491 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2492 | ||
2493 | If the image file contains more than one image and the image handler | |
2494 | is capable of retrieving these individually, this function will return | |
2495 | the number of available images. | |
2496 | """ | |
5b5c9bc7 | 2497 | return _core_.Image_GetImageCount(*args, **kwargs) |
d55e5bfc RD |
2498 | |
2499 | GetImageCount = staticmethod(GetImageCount) | |
2500 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2501 | """ |
2502 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2503 | ||
2504 | Loads an image from a file. If no handler type is provided, the | |
2505 | library will try to autodetect the format. | |
2506 | """ | |
5b5c9bc7 | 2507 | return _core_.Image_LoadFile(*args, **kwargs) |
d55e5bfc RD |
2508 | |
2509 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2510 | """ |
2511 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2512 | ||
2513 | Loads an image from a file, specifying the image type with a MIME type | |
2514 | string. | |
2515 | """ | |
5b5c9bc7 | 2516 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
d55e5bfc RD |
2517 | |
2518 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2519 | """ |
2520 | SaveFile(self, String name, int type) -> bool | |
2521 | ||
2522 | Saves an image in the named file. | |
2523 | """ | |
5b5c9bc7 | 2524 | return _core_.Image_SaveFile(*args, **kwargs) |
d55e5bfc RD |
2525 | |
2526 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2527 | """ |
2528 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2529 | ||
2530 | Saves an image in the named file. | |
2531 | """ | |
5b5c9bc7 | 2532 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
d55e5bfc RD |
2533 | |
2534 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2535 | """ |
2536 | CanReadStream(InputStream stream) -> bool | |
2537 | ||
2538 | Returns True if the image handlers can read an image file from the | |
2539 | data currently on the input stream, or a readable Python file-like | |
2540 | object. | |
2541 | """ | |
5b5c9bc7 | 2542 | return _core_.Image_CanReadStream(*args, **kwargs) |
d55e5bfc RD |
2543 | |
2544 | CanReadStream = staticmethod(CanReadStream) | |
2545 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2546 | """ |
2547 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2548 | ||
2549 | Loads an image from an input stream or a readable Python file-like | |
2550 | object. If no handler type is provided, the library will try to | |
2551 | autodetect the format. | |
2552 | """ | |
5b5c9bc7 | 2553 | return _core_.Image_LoadStream(*args, **kwargs) |
d55e5bfc RD |
2554 | |
2555 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2556 | """ |
2557 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2558 | ||
2559 | Loads an image from an input stream or a readable Python file-like | |
2560 | object, using a MIME type string to specify the image file format. | |
2561 | """ | |
5b5c9bc7 | 2562 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
d55e5bfc RD |
2563 | |
2564 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2565 | """ |
2566 | Ok(self) -> bool | |
2567 | ||
2568 | Returns true if image data is present. | |
2569 | """ | |
5b5c9bc7 | 2570 | return _core_.Image_Ok(*args, **kwargs) |
d55e5bfc RD |
2571 | |
2572 | def GetWidth(*args, **kwargs): | |
7a27cf7c RD |
2573 | """ |
2574 | GetWidth(self) -> int | |
2575 | ||
2576 | Gets the width of the image in pixels. | |
2577 | """ | |
5b5c9bc7 | 2578 | return _core_.Image_GetWidth(*args, **kwargs) |
d55e5bfc RD |
2579 | |
2580 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
2581 | """ |
2582 | GetHeight(self) -> int | |
2583 | ||
2584 | Gets the height of the image in pixels. | |
2585 | """ | |
5b5c9bc7 | 2586 | return _core_.Image_GetHeight(*args, **kwargs) |
d55e5bfc RD |
2587 | |
2588 | def GetSize(*args, **kwargs): | |
7a27cf7c RD |
2589 | """ |
2590 | GetSize(self) -> Size | |
2591 | ||
2592 | Returns the size of the image in pixels. | |
2593 | """ | |
5b5c9bc7 | 2594 | return _core_.Image_GetSize(*args, **kwargs) |
d55e5bfc RD |
2595 | |
2596 | def GetSubImage(*args, **kwargs): | |
7a27cf7c RD |
2597 | """ |
2598 | GetSubImage(self, Rect rect) -> Image | |
2599 | ||
2600 | Returns a sub image of the current one as long as the rect belongs | |
2601 | entirely to the image. | |
2602 | """ | |
5b5c9bc7 | 2603 | return _core_.Image_GetSubImage(*args, **kwargs) |
d55e5bfc | 2604 | |
aff4cc5c | 2605 | def Size(*args, **kwargs): |
7a27cf7c RD |
2606 | """ |
2607 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2608 | ||
2609 | Returns a resized version of this image without scaling it by adding | |
2610 | either a border with the given colour or cropping as necessary. The | |
2611 | image is pasted into a new image with the given size and background | |
2612 | colour at the position ``pos`` relative to the upper left of the new | |
2613 | image. If red = green = blue = -1 then use either the current mask | |
2614 | colour if set or find, use, and set a suitable mask colour for any | |
2615 | newly exposed areas. | |
2616 | """ | |
5b5c9bc7 | 2617 | return _core_.Image_Size(*args, **kwargs) |
aff4cc5c | 2618 | |
d55e5bfc | 2619 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2620 | """ |
2621 | Copy(self) -> Image | |
2622 | ||
2623 | Returns an identical copy of the image. | |
2624 | """ | |
5b5c9bc7 | 2625 | return _core_.Image_Copy(*args, **kwargs) |
d55e5bfc RD |
2626 | |
2627 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
2628 | """ |
2629 | Paste(self, Image image, int x, int y) | |
2630 | ||
2631 | Pastes ``image`` into this instance and takes care of the mask colour | |
2632 | and any out of bounds problems. | |
2633 | """ | |
5b5c9bc7 | 2634 | return _core_.Image_Paste(*args, **kwargs) |
d55e5bfc RD |
2635 | |
2636 | def GetData(*args, **kwargs): | |
bb2ef2cc RD |
2637 | """ |
2638 | GetData(self) -> PyObject | |
2639 | ||
2640 | Returns a string containing a copy of the RGB bytes of the image. | |
2641 | """ | |
5b5c9bc7 | 2642 | return _core_.Image_GetData(*args, **kwargs) |
d55e5bfc RD |
2643 | |
2644 | def SetData(*args, **kwargs): | |
bb2ef2cc RD |
2645 | """ |
2646 | SetData(self, buffer data) | |
2647 | ||
2648 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2649 | either a string or a buffer object holding the data and the length of | |
2650 | the data must be width*height*3. | |
2651 | """ | |
5b5c9bc7 | 2652 | return _core_.Image_SetData(*args, **kwargs) |
d55e5bfc RD |
2653 | |
2654 | def GetDataBuffer(*args, **kwargs): | |
bb2ef2cc RD |
2655 | """ |
2656 | GetDataBuffer(self) -> PyObject | |
2657 | ||
2658 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
2659 | image data buffer inside the wx.Image. You need to ensure that you do |
2660 | not use this buffer object after the image has been destroyed. | |
bb2ef2cc | 2661 | """ |
5b5c9bc7 | 2662 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
d55e5bfc RD |
2663 | |
2664 | def SetDataBuffer(*args, **kwargs): | |
bb2ef2cc RD |
2665 | """ |
2666 | SetDataBuffer(self, buffer data) | |
2667 | ||
2668 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
2669 | object. This can save making an extra copy of the data but you must |
2670 | ensure that the buffer object lives longer than the wx.Image does. | |
bb2ef2cc | 2671 | """ |
5b5c9bc7 | 2672 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
d55e5bfc RD |
2673 | |
2674 | def GetAlphaData(*args, **kwargs): | |
bb2ef2cc RD |
2675 | """ |
2676 | GetAlphaData(self) -> PyObject | |
2677 | ||
2678 | Returns a string containing a copy of the alpha bytes of the image. | |
2679 | """ | |
5b5c9bc7 | 2680 | return _core_.Image_GetAlphaData(*args, **kwargs) |
d55e5bfc RD |
2681 | |
2682 | def SetAlphaData(*args, **kwargs): | |
bb2ef2cc RD |
2683 | """ |
2684 | SetAlphaData(self, buffer alpha) | |
2685 | ||
2686 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2687 | a string or a buffer object holding the data and the length of the | |
2688 | data must be width*height. | |
2689 | """ | |
5b5c9bc7 | 2690 | return _core_.Image_SetAlphaData(*args, **kwargs) |
d55e5bfc RD |
2691 | |
2692 | def GetAlphaBuffer(*args, **kwargs): | |
2693 | """GetAlphaBuffer(self) -> PyObject""" | |
5b5c9bc7 | 2694 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
d55e5bfc RD |
2695 | |
2696 | def SetAlphaBuffer(*args, **kwargs): | |
bb2ef2cc | 2697 | """SetAlphaBuffer(self, buffer alpha)""" |
5b5c9bc7 | 2698 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
d55e5bfc RD |
2699 | |
2700 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
2701 | """ |
2702 | SetMaskColour(self, byte r, byte g, byte b) | |
2703 | ||
2704 | Sets the mask colour for this image (and tells the image to use the | |
2705 | mask). | |
2706 | """ | |
5b5c9bc7 | 2707 | return _core_.Image_SetMaskColour(*args, **kwargs) |
d55e5bfc | 2708 | |
aff4cc5c RD |
2709 | def GetOrFindMaskColour(*args, **kwargs): |
2710 | """ | |
2711 | GetOrFindMaskColour() -> (r,g,b) | |
2712 | ||
2713 | Get the current mask colour or find a suitable colour. | |
2714 | """ | |
5b5c9bc7 | 2715 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) |
aff4cc5c | 2716 | |
d55e5bfc | 2717 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2718 | """ |
2719 | GetMaskRed(self) -> byte | |
2720 | ||
2721 | Gets the red component of the mask colour. | |
2722 | """ | |
5b5c9bc7 | 2723 | return _core_.Image_GetMaskRed(*args, **kwargs) |
d55e5bfc RD |
2724 | |
2725 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
2726 | """ |
2727 | GetMaskGreen(self) -> byte | |
2728 | ||
2729 | Gets the green component of the mask colour. | |
2730 | """ | |
5b5c9bc7 | 2731 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
d55e5bfc RD |
2732 | |
2733 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
2734 | """ |
2735 | GetMaskBlue(self) -> byte | |
2736 | ||
2737 | Gets the blue component of the mask colour. | |
2738 | """ | |
5b5c9bc7 | 2739 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
d55e5bfc RD |
2740 | |
2741 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
2742 | """ |
2743 | SetMask(self, bool mask=True) | |
2744 | ||
2745 | Specifies whether there is a mask or not. The area of the mask is | |
2746 | determined by the current mask colour. | |
2747 | """ | |
5b5c9bc7 | 2748 | return _core_.Image_SetMask(*args, **kwargs) |
d55e5bfc RD |
2749 | |
2750 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
2751 | """ |
2752 | HasMask(self) -> bool | |
2753 | ||
2754 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
2755 | """ | |
5b5c9bc7 | 2756 | return _core_.Image_HasMask(*args, **kwargs) |
d55e5bfc RD |
2757 | |
2758 | def Rotate(*args, **kwargs): | |
2759 | """ | |
5b5c9bc7 RD |
2760 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
2761 | Point offset_after_rotation=None) -> Image | |
7a27cf7c RD |
2762 | |
2763 | Rotates the image about the given point, by ``angle`` radians. Passing | |
2764 | ``True`` to ``interpolating`` results in better image quality, but is | |
2765 | slower. If the image has a mask, then the mask colour is used for the | |
2766 | uncovered pixels in the rotated image background. Otherwise, black | |
2767 | will be used as the fill colour. | |
2768 | ||
2769 | Returns the rotated image, leaving this image intact. | |
d55e5bfc | 2770 | """ |
5b5c9bc7 | 2771 | return _core_.Image_Rotate(*args, **kwargs) |
d55e5bfc RD |
2772 | |
2773 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
2774 | """ |
2775 | Rotate90(self, bool clockwise=True) -> Image | |
2776 | ||
2777 | Returns a copy of the image rotated 90 degrees in the direction | |
2778 | indicated by ``clockwise``. | |
2779 | """ | |
5b5c9bc7 | 2780 | return _core_.Image_Rotate90(*args, **kwargs) |
d55e5bfc RD |
2781 | |
2782 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
2783 | """ |
2784 | Mirror(self, bool horizontally=True) -> Image | |
2785 | ||
2786 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
2787 | indicates the orientation. | |
2788 | """ | |
5b5c9bc7 | 2789 | return _core_.Image_Mirror(*args, **kwargs) |
d55e5bfc RD |
2790 | |
2791 | def Replace(*args, **kwargs): | |
2792 | """ | |
7a27cf7c RD |
2793 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
2794 | ||
2795 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
2796 | ``(r2,g2,b2)``. | |
d55e5bfc | 2797 | """ |
5b5c9bc7 | 2798 | return _core_.Image_Replace(*args, **kwargs) |
d55e5bfc RD |
2799 | |
2800 | def ConvertToMono(*args, **kwargs): | |
7a27cf7c RD |
2801 | """ |
2802 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
2803 | ||
2804 | Returns monochromatic version of the image. The returned image has | |
2805 | white colour where the original has ``(r,g,b)`` colour and black | |
2806 | colour everywhere else. | |
2807 | """ | |
5b5c9bc7 | 2808 | return _core_.Image_ConvertToMono(*args, **kwargs) |
d55e5bfc RD |
2809 | |
2810 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
2811 | """ |
2812 | SetOption(self, String name, String value) | |
2813 | ||
2814 | Sets an image handler defined option. For example, when saving as a | |
2815 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
2816 | number between 0 and 100 (0 is terrible, 100 is very good). | |
2817 | """ | |
5b5c9bc7 | 2818 | return _core_.Image_SetOption(*args, **kwargs) |
d55e5bfc RD |
2819 | |
2820 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2821 | """ |
2822 | SetOptionInt(self, String name, int value) | |
2823 | ||
2824 | Sets an image option as an integer. | |
2825 | """ | |
5b5c9bc7 | 2826 | return _core_.Image_SetOptionInt(*args, **kwargs) |
d55e5bfc RD |
2827 | |
2828 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
2829 | """ |
2830 | GetOption(self, String name) -> String | |
2831 | ||
2832 | Gets the value of an image handler option. | |
2833 | """ | |
5b5c9bc7 | 2834 | return _core_.Image_GetOption(*args, **kwargs) |
d55e5bfc RD |
2835 | |
2836 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2837 | """ |
2838 | GetOptionInt(self, String name) -> int | |
2839 | ||
2840 | Gets the value of an image handler option as an integer. If the given | |
2841 | option is not present, the function returns 0. | |
2842 | """ | |
5b5c9bc7 | 2843 | return _core_.Image_GetOptionInt(*args, **kwargs) |
d55e5bfc RD |
2844 | |
2845 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
2846 | """ |
2847 | HasOption(self, String name) -> bool | |
2848 | ||
2849 | Returns true if the given option is present. | |
2850 | """ | |
5b5c9bc7 | 2851 | return _core_.Image_HasOption(*args, **kwargs) |
d55e5bfc RD |
2852 | |
2853 | def CountColours(*args, **kwargs): | |
2854 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" | |
5b5c9bc7 | 2855 | return _core_.Image_CountColours(*args, **kwargs) |
d55e5bfc RD |
2856 | |
2857 | def ComputeHistogram(*args, **kwargs): | |
5b5c9bc7 RD |
2858 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
2859 | return _core_.Image_ComputeHistogram(*args, **kwargs) | |
d55e5bfc RD |
2860 | |
2861 | def AddHandler(*args, **kwargs): | |
5b5c9bc7 RD |
2862 | """AddHandler(ImageHandler handler)""" |
2863 | return _core_.Image_AddHandler(*args, **kwargs) | |
d55e5bfc RD |
2864 | |
2865 | AddHandler = staticmethod(AddHandler) | |
2866 | def InsertHandler(*args, **kwargs): | |
5b5c9bc7 RD |
2867 | """InsertHandler(ImageHandler handler)""" |
2868 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d55e5bfc RD |
2869 | |
2870 | InsertHandler = staticmethod(InsertHandler) | |
2871 | def RemoveHandler(*args, **kwargs): | |
5b5c9bc7 RD |
2872 | """RemoveHandler(String name) -> bool""" |
2873 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d55e5bfc RD |
2874 | |
2875 | RemoveHandler = staticmethod(RemoveHandler) | |
2876 | def GetImageExtWildcard(*args, **kwargs): | |
7a27cf7c RD |
2877 | """ |
2878 | GetImageExtWildcard() -> String | |
2879 | ||
2880 | Iterates all registered wxImageHandler objects, and returns a string | |
2881 | containing file extension masks suitable for passing to file open/save | |
2882 | dialog boxes. | |
2883 | """ | |
5b5c9bc7 | 2884 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
d55e5bfc RD |
2885 | |
2886 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
2887 | def ConvertToBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
2888 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
2889 | return _core_.Image_ConvertToBitmap(*args, **kwargs) | |
d55e5bfc RD |
2890 | |
2891 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 2892 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
5b5c9bc7 | 2893 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
d55e5bfc RD |
2894 | |
2895 | def __nonzero__(self): return self.Ok() | |
2896 | ||
5b5c9bc7 | 2897 | class ImagePtr(Image): |
d55e5bfc RD |
2898 | def __init__(self, this): |
2899 | self.this = this | |
2900 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2901 | self.__class__ = Image |
2902 | _core_.Image_swigregister(ImagePtr) | |
d55e5bfc RD |
2903 | |
2904 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
2905 | """ |
2906 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
2907 | ||
2908 | Loads an image from a file, using a MIME type string (such as | |
2909 | 'image/jpeg') to specify image type. | |
2910 | """ | |
5b5c9bc7 | 2911 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d55e5bfc RD |
2912 | val.thisown = 1 |
2913 | return val | |
2914 | ||
2915 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
2916 | """ |
2917 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2918 | ||
2919 | Loads an image from an input stream, or any readable Python file-like | |
2920 | object. | |
2921 | """ | |
5b5c9bc7 | 2922 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d55e5bfc RD |
2923 | val.thisown = 1 |
2924 | return val | |
2925 | ||
2926 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
2927 | """ |
2928 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
2929 | ||
2930 | Loads an image from an input stream, or any readable Python file-like | |
2931 | object, specifying the image format with a MIME type string. | |
2932 | """ | |
5b5c9bc7 | 2933 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d55e5bfc RD |
2934 | val.thisown = 1 |
2935 | return val | |
2936 | ||
d6c14a4c | 2937 | def EmptyImage(*args, **kwargs): |
bb2ef2cc | 2938 | """ |
5b5c9bc7 | 2939 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image |
bb2ef2cc RD |
2940 | |
2941 | Construct an empty image of a given size, optionally setting all | |
2942 | pixels to black. | |
2943 | """ | |
5b5c9bc7 | 2944 | val = _core_.new_EmptyImage(*args, **kwargs) |
d55e5bfc RD |
2945 | val.thisown = 1 |
2946 | return val | |
2947 | ||
2948 | def ImageFromBitmap(*args, **kwargs): | |
bb2ef2cc | 2949 | """ |
5b5c9bc7 | 2950 | ImageFromBitmap(Bitmap bitmap) -> Image |
bb2ef2cc RD |
2951 | |
2952 | Construct an Image from a `wx.Bitmap`. | |
2953 | """ | |
5b5c9bc7 | 2954 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d55e5bfc RD |
2955 | val.thisown = 1 |
2956 | return val | |
2957 | ||
2958 | def ImageFromData(*args, **kwargs): | |
bb2ef2cc | 2959 | """ |
5b5c9bc7 | 2960 | ImageFromData(int width, int height, buffer data) -> Image |
bb2ef2cc RD |
2961 | |
2962 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
2963 | string or a buffer object holding the data and the length of the data | |
2964 | must be width*height*3. | |
2965 | """ | |
5b5c9bc7 | 2966 | val = _core_.new_ImageFromData(*args, **kwargs) |
d55e5bfc RD |
2967 | val.thisown = 1 |
2968 | return val | |
2969 | ||
03e46024 | 2970 | def ImageFromDataWithAlpha(*args, **kwargs): |
bb2ef2cc | 2971 | """ |
5b5c9bc7 | 2972 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image |
bb2ef2cc RD |
2973 | |
2974 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
2975 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
2976 | length of the data must be width*height*3 bytes, and the length of the |
2977 | alpha data must be width*height bytes. | |
bb2ef2cc | 2978 | """ |
5b5c9bc7 | 2979 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
03e46024 RD |
2980 | val.thisown = 1 |
2981 | return val | |
2982 | ||
5b5c9bc7 | 2983 | def Image_CanRead(*args, **kwargs): |
7a27cf7c RD |
2984 | """ |
2985 | Image_CanRead(String filename) -> bool | |
2986 | ||
2987 | Returns True if the image handlers can read this file. | |
2988 | """ | |
5b5c9bc7 | 2989 | return _core_.Image_CanRead(*args, **kwargs) |
d55e5bfc | 2990 | |
5b5c9bc7 | 2991 | def Image_GetImageCount(*args, **kwargs): |
7a27cf7c RD |
2992 | """ |
2993 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2994 | ||
2995 | If the image file contains more than one image and the image handler | |
2996 | is capable of retrieving these individually, this function will return | |
2997 | the number of available images. | |
2998 | """ | |
5b5c9bc7 | 2999 | return _core_.Image_GetImageCount(*args, **kwargs) |
d55e5bfc | 3000 | |
5b5c9bc7 | 3001 | def Image_CanReadStream(*args, **kwargs): |
7a27cf7c RD |
3002 | """ |
3003 | Image_CanReadStream(InputStream stream) -> bool | |
3004 | ||
3005 | Returns True if the image handlers can read an image file from the | |
3006 | data currently on the input stream, or a readable Python file-like | |
3007 | object. | |
3008 | """ | |
5b5c9bc7 | 3009 | return _core_.Image_CanReadStream(*args, **kwargs) |
d55e5bfc | 3010 | |
5b5c9bc7 RD |
3011 | def Image_AddHandler(*args, **kwargs): |
3012 | """Image_AddHandler(ImageHandler handler)""" | |
3013 | return _core_.Image_AddHandler(*args, **kwargs) | |
d55e5bfc | 3014 | |
5b5c9bc7 RD |
3015 | def Image_InsertHandler(*args, **kwargs): |
3016 | """Image_InsertHandler(ImageHandler handler)""" | |
3017 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d55e5bfc | 3018 | |
5b5c9bc7 RD |
3019 | def Image_RemoveHandler(*args, **kwargs): |
3020 | """Image_RemoveHandler(String name) -> bool""" | |
3021 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d55e5bfc | 3022 | |
5b5c9bc7 | 3023 | def Image_GetImageExtWildcard(*args, **kwargs): |
7a27cf7c RD |
3024 | """ |
3025 | Image_GetImageExtWildcard() -> String | |
3026 | ||
3027 | Iterates all registered wxImageHandler objects, and returns a string | |
3028 | containing file extension masks suitable for passing to file open/save | |
3029 | dialog boxes. | |
3030 | """ | |
5b5c9bc7 | 3031 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
d55e5bfc | 3032 | |
68e533f8 RD |
3033 | def InitAllImageHandlers(): |
3034 | """ | |
3035 | The former functionality of InitAllImageHanders is now done internal to | |
3036 | the _core_ extension module and so this function has become a simple NOP. | |
3037 | """ | |
3038 | pass | |
d55e5bfc | 3039 | |
5b5c9bc7 RD |
3040 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3041 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
3042 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR | |
3043 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3044 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
3045 | BMP_24BPP = _core_.BMP_24BPP | |
3046 | BMP_8BPP = _core_.BMP_8BPP | |
3047 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3048 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3049 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3050 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3051 | BMP_4BPP = _core_.BMP_4BPP | |
3052 | BMP_1BPP = _core_.BMP_1BPP | |
3053 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
3054 | class BMPHandler(ImageHandler): | |
27fb7603 | 3055 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
d55e5bfc RD |
3056 | def __repr__(self): |
3057 | return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3058 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3059 | """ |
3060 | __init__(self) -> BMPHandler | |
3061 | ||
3062 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3063 | """ | |
5b5c9bc7 | 3064 | newobj = _core_.new_BMPHandler(*args, **kwargs) |
d55e5bfc RD |
3065 | self.this = newobj.this |
3066 | self.thisown = 1 | |
3067 | del newobj.thisown | |
3068 | ||
5b5c9bc7 | 3069 | class BMPHandlerPtr(BMPHandler): |
d55e5bfc RD |
3070 | def __init__(self, this): |
3071 | self.this = this | |
3072 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3073 | self.__class__ = BMPHandler |
3074 | _core_.BMPHandler_swigregister(BMPHandlerPtr) | |
3075 | NullImage = cvar.NullImage | |
68350608 | 3076 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d55e5bfc RD |
3077 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3078 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3079 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3080 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
68350608 RD |
3081 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3082 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d55e5bfc | 3083 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3084 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
68350608 RD |
3085 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3086 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3087 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3088 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
7fbf8399 RD |
3089 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3090 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d55e5bfc | 3091 | |
5b5c9bc7 | 3092 | class ICOHandler(BMPHandler): |
27fb7603 | 3093 | """A `wx.ImageHandler` for \*.ico icon files.""" |
d55e5bfc RD |
3094 | def __repr__(self): |
3095 | return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3096 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3097 | """ |
3098 | __init__(self) -> ICOHandler | |
3099 | ||
3100 | A `wx.ImageHandler` for \*.ico icon files. | |
3101 | """ | |
5b5c9bc7 | 3102 | newobj = _core_.new_ICOHandler(*args, **kwargs) |
d55e5bfc RD |
3103 | self.this = newobj.this |
3104 | self.thisown = 1 | |
3105 | del newobj.thisown | |
3106 | ||
5b5c9bc7 | 3107 | class ICOHandlerPtr(ICOHandler): |
d55e5bfc RD |
3108 | def __init__(self, this): |
3109 | self.this = this | |
3110 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3111 | self.__class__ = ICOHandler |
3112 | _core_.ICOHandler_swigregister(ICOHandlerPtr) | |
d55e5bfc | 3113 | |
5b5c9bc7 | 3114 | class CURHandler(ICOHandler): |
27fb7603 | 3115 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
d55e5bfc RD |
3116 | def __repr__(self): |
3117 | return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3118 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3119 | """ |
3120 | __init__(self) -> CURHandler | |
3121 | ||
3122 | A `wx.ImageHandler` for \*.cur cursor files. | |
3123 | """ | |
5b5c9bc7 | 3124 | newobj = _core_.new_CURHandler(*args, **kwargs) |
d55e5bfc RD |
3125 | self.this = newobj.this |
3126 | self.thisown = 1 | |
3127 | del newobj.thisown | |
3128 | ||
5b5c9bc7 | 3129 | class CURHandlerPtr(CURHandler): |
d55e5bfc RD |
3130 | def __init__(self, this): |
3131 | self.this = this | |
3132 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3133 | self.__class__ = CURHandler |
3134 | _core_.CURHandler_swigregister(CURHandlerPtr) | |
d55e5bfc | 3135 | |
5b5c9bc7 | 3136 | class ANIHandler(CURHandler): |
27fb7603 | 3137 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
d55e5bfc RD |
3138 | def __repr__(self): |
3139 | return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3140 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3141 | """ |
3142 | __init__(self) -> ANIHandler | |
3143 | ||
3144 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3145 | """ | |
5b5c9bc7 | 3146 | newobj = _core_.new_ANIHandler(*args, **kwargs) |
d55e5bfc RD |
3147 | self.this = newobj.this |
3148 | self.thisown = 1 | |
3149 | del newobj.thisown | |
3150 | ||
5b5c9bc7 | 3151 | class ANIHandlerPtr(ANIHandler): |
d55e5bfc RD |
3152 | def __init__(self, this): |
3153 | self.this = this | |
3154 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3155 | self.__class__ = ANIHandler |
3156 | _core_.ANIHandler_swigregister(ANIHandlerPtr) | |
d55e5bfc | 3157 | |
5b5c9bc7 | 3158 | class PNGHandler(ImageHandler): |
27fb7603 | 3159 | """A `wx.ImageHandler` for PNG image files.""" |
d55e5bfc RD |
3160 | def __repr__(self): |
3161 | return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3162 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3163 | """ |
3164 | __init__(self) -> PNGHandler | |
3165 | ||
3166 | A `wx.ImageHandler` for PNG image files. | |
3167 | """ | |
5b5c9bc7 | 3168 | newobj = _core_.new_PNGHandler(*args, **kwargs) |
d55e5bfc RD |
3169 | self.this = newobj.this |
3170 | self.thisown = 1 | |
3171 | del newobj.thisown | |
3172 | ||
5b5c9bc7 | 3173 | class PNGHandlerPtr(PNGHandler): |
d55e5bfc RD |
3174 | def __init__(self, this): |
3175 | self.this = this | |
3176 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3177 | self.__class__ = PNGHandler |
3178 | _core_.PNGHandler_swigregister(PNGHandlerPtr) | |
d55e5bfc | 3179 | |
5b5c9bc7 | 3180 | class GIFHandler(ImageHandler): |
27fb7603 | 3181 | """A `wx.ImageHandler` for GIF image files.""" |
d55e5bfc RD |
3182 | def __repr__(self): |
3183 | return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3184 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3185 | """ |
3186 | __init__(self) -> GIFHandler | |
3187 | ||
3188 | A `wx.ImageHandler` for GIF image files. | |
3189 | """ | |
5b5c9bc7 | 3190 | newobj = _core_.new_GIFHandler(*args, **kwargs) |
d55e5bfc RD |
3191 | self.this = newobj.this |
3192 | self.thisown = 1 | |
3193 | del newobj.thisown | |
3194 | ||
5b5c9bc7 | 3195 | class GIFHandlerPtr(GIFHandler): |
d55e5bfc RD |
3196 | def __init__(self, this): |
3197 | self.this = this | |
3198 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3199 | self.__class__ = GIFHandler |
3200 | _core_.GIFHandler_swigregister(GIFHandlerPtr) | |
d55e5bfc | 3201 | |
5b5c9bc7 | 3202 | class PCXHandler(ImageHandler): |
27fb7603 | 3203 | """A `wx.ImageHandler` for PCX imager files.""" |
d55e5bfc RD |
3204 | def __repr__(self): |
3205 | return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3206 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3207 | """ |
3208 | __init__(self) -> PCXHandler | |
3209 | ||
3210 | A `wx.ImageHandler` for PCX imager files. | |
3211 | """ | |
5b5c9bc7 | 3212 | newobj = _core_.new_PCXHandler(*args, **kwargs) |
d55e5bfc RD |
3213 | self.this = newobj.this |
3214 | self.thisown = 1 | |
3215 | del newobj.thisown | |
3216 | ||
5b5c9bc7 | 3217 | class PCXHandlerPtr(PCXHandler): |
d55e5bfc RD |
3218 | def __init__(self, this): |
3219 | self.this = this | |
3220 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3221 | self.__class__ = PCXHandler |
3222 | _core_.PCXHandler_swigregister(PCXHandlerPtr) | |
d55e5bfc | 3223 | |
5b5c9bc7 | 3224 | class JPEGHandler(ImageHandler): |
27fb7603 | 3225 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
d55e5bfc RD |
3226 | def __repr__(self): |
3227 | return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3228 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3229 | """ |
3230 | __init__(self) -> JPEGHandler | |
3231 | ||
3232 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3233 | """ | |
5b5c9bc7 | 3234 | newobj = _core_.new_JPEGHandler(*args, **kwargs) |
d55e5bfc RD |
3235 | self.this = newobj.this |
3236 | self.thisown = 1 | |
3237 | del newobj.thisown | |
3238 | ||
5b5c9bc7 | 3239 | class JPEGHandlerPtr(JPEGHandler): |
d55e5bfc RD |
3240 | def __init__(self, this): |
3241 | self.this = this | |
3242 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3243 | self.__class__ = JPEGHandler |
3244 | _core_.JPEGHandler_swigregister(JPEGHandlerPtr) | |
d55e5bfc | 3245 | |
5b5c9bc7 | 3246 | class PNMHandler(ImageHandler): |
27fb7603 | 3247 | """A `wx.ImageHandler` for PNM image files.""" |
d55e5bfc RD |
3248 | def __repr__(self): |
3249 | return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3250 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3251 | """ |
3252 | __init__(self) -> PNMHandler | |
3253 | ||
3254 | A `wx.ImageHandler` for PNM image files. | |
3255 | """ | |
5b5c9bc7 | 3256 | newobj = _core_.new_PNMHandler(*args, **kwargs) |
d55e5bfc RD |
3257 | self.this = newobj.this |
3258 | self.thisown = 1 | |
3259 | del newobj.thisown | |
3260 | ||
5b5c9bc7 | 3261 | class PNMHandlerPtr(PNMHandler): |
d55e5bfc RD |
3262 | def __init__(self, this): |
3263 | self.this = this | |
3264 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3265 | self.__class__ = PNMHandler |
3266 | _core_.PNMHandler_swigregister(PNMHandlerPtr) | |
d55e5bfc | 3267 | |
5b5c9bc7 | 3268 | class XPMHandler(ImageHandler): |
27fb7603 | 3269 | """A `wx.ImageHandler` for XPM image.""" |
d55e5bfc RD |
3270 | def __repr__(self): |
3271 | return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3272 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3273 | """ |
3274 | __init__(self) -> XPMHandler | |
3275 | ||
3276 | A `wx.ImageHandler` for XPM image. | |
3277 | """ | |
5b5c9bc7 | 3278 | newobj = _core_.new_XPMHandler(*args, **kwargs) |
d55e5bfc RD |
3279 | self.this = newobj.this |
3280 | self.thisown = 1 | |
3281 | del newobj.thisown | |
3282 | ||
5b5c9bc7 | 3283 | class XPMHandlerPtr(XPMHandler): |
d55e5bfc RD |
3284 | def __init__(self, this): |
3285 | self.this = this | |
3286 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3287 | self.__class__ = XPMHandler |
3288 | _core_.XPMHandler_swigregister(XPMHandlerPtr) | |
d55e5bfc | 3289 | |
5b5c9bc7 | 3290 | class TIFFHandler(ImageHandler): |
27fb7603 | 3291 | """A `wx.ImageHandler` for TIFF image files.""" |
d55e5bfc RD |
3292 | def __repr__(self): |
3293 | return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3294 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3295 | """ |
3296 | __init__(self) -> TIFFHandler | |
3297 | ||
3298 | A `wx.ImageHandler` for TIFF image files. | |
3299 | """ | |
5b5c9bc7 | 3300 | newobj = _core_.new_TIFFHandler(*args, **kwargs) |
d55e5bfc RD |
3301 | self.this = newobj.this |
3302 | self.thisown = 1 | |
3303 | del newobj.thisown | |
3304 | ||
5b5c9bc7 | 3305 | class TIFFHandlerPtr(TIFFHandler): |
d55e5bfc RD |
3306 | def __init__(self, this): |
3307 | self.this = this | |
3308 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3309 | self.__class__ = TIFFHandler |
3310 | _core_.TIFFHandler_swigregister(TIFFHandlerPtr) | |
d55e5bfc | 3311 | |
5b5c9bc7 RD |
3312 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3313 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3314 | class Quantize(object): | |
c0de73ae RD |
3315 | """Performs quantization, or colour reduction, on a wxImage.""" |
3316 | def __init__(self): raise RuntimeError, "No constructor defined" | |
3317 | def __repr__(self): | |
3318 | return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3319 | def Quantize(*args, **kwargs): | |
3320 | """ | |
5b5c9bc7 | 3321 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
c0de73ae RD |
3322 | |
3323 | Reduce the colours in the source image and put the result into the | |
3324 | destination image, setting the palette in the destination if | |
3325 | needed. Both images may be the same, to overwrite the source image. | |
3326 | """ | |
5b5c9bc7 | 3327 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae RD |
3328 | |
3329 | Quantize = staticmethod(Quantize) | |
3330 | ||
5b5c9bc7 | 3331 | class QuantizePtr(Quantize): |
c0de73ae RD |
3332 | def __init__(self, this): |
3333 | self.this = this | |
3334 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3335 | self.__class__ = Quantize |
3336 | _core_.Quantize_swigregister(QuantizePtr) | |
c0de73ae | 3337 | |
5b5c9bc7 | 3338 | def Quantize_Quantize(*args, **kwargs): |
c0de73ae | 3339 | """ |
5b5c9bc7 | 3340 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
c0de73ae RD |
3341 | |
3342 | Reduce the colours in the source image and put the result into the | |
3343 | destination image, setting the palette in the destination if | |
3344 | needed. Both images may be the same, to overwrite the source image. | |
3345 | """ | |
5b5c9bc7 | 3346 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae | 3347 | |
d55e5bfc RD |
3348 | #--------------------------------------------------------------------------- |
3349 | ||
5b5c9bc7 RD |
3350 | class EvtHandler(Object): |
3351 | """Proxy of C++ EvtHandler class""" | |
d55e5bfc RD |
3352 | def __repr__(self): |
3353 | return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3354 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
3355 | """__init__(self) -> EvtHandler""" |
3356 | newobj = _core_.new_EvtHandler(*args, **kwargs) | |
d55e5bfc RD |
3357 | self.this = newobj.this |
3358 | self.thisown = 1 | |
3359 | del newobj.thisown | |
3360 | def GetNextHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3361 | """GetNextHandler(self) -> EvtHandler""" |
3362 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) | |
d55e5bfc RD |
3363 | |
3364 | def GetPreviousHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3365 | """GetPreviousHandler(self) -> EvtHandler""" |
3366 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) | |
d55e5bfc RD |
3367 | |
3368 | def SetNextHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3369 | """SetNextHandler(self, EvtHandler handler)""" |
3370 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) | |
d55e5bfc RD |
3371 | |
3372 | def SetPreviousHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3373 | """SetPreviousHandler(self, EvtHandler handler)""" |
3374 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) | |
d55e5bfc RD |
3375 | |
3376 | def GetEvtHandlerEnabled(*args, **kwargs): | |
3377 | """GetEvtHandlerEnabled(self) -> bool""" | |
5b5c9bc7 | 3378 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
d55e5bfc RD |
3379 | |
3380 | def SetEvtHandlerEnabled(*args, **kwargs): | |
3381 | """SetEvtHandlerEnabled(self, bool enabled)""" | |
5b5c9bc7 | 3382 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
d55e5bfc RD |
3383 | |
3384 | def ProcessEvent(*args, **kwargs): | |
5b5c9bc7 RD |
3385 | """ProcessEvent(self, Event event) -> bool""" |
3386 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) | |
d55e5bfc RD |
3387 | |
3388 | def AddPendingEvent(*args, **kwargs): | |
5b5c9bc7 RD |
3389 | """AddPendingEvent(self, Event event)""" |
3390 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) | |
d55e5bfc RD |
3391 | |
3392 | def ProcessPendingEvents(*args, **kwargs): | |
3393 | """ProcessPendingEvents(self)""" | |
5b5c9bc7 | 3394 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
d55e5bfc RD |
3395 | |
3396 | def Connect(*args, **kwargs): | |
3397 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" | |
5b5c9bc7 | 3398 | return _core_.EvtHandler_Connect(*args, **kwargs) |
d55e5bfc RD |
3399 | |
3400 | def Disconnect(*args, **kwargs): | |
3401 | """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool""" | |
5b5c9bc7 | 3402 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
d55e5bfc RD |
3403 | |
3404 | def _setOORInfo(*args, **kwargs): | |
36ed4f51 | 3405 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
5b5c9bc7 | 3406 | return _core_.EvtHandler__setOORInfo(*args, **kwargs) |
d55e5bfc RD |
3407 | |
3408 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): | |
3409 | """ | |
3410 | Bind an event to an event handler. | |
3411 | ||
a5ee0656 RD |
3412 | :param event: One of the EVT_* objects that specifies the |
3413 | type of event to bind, | |
d55e5bfc | 3414 | |
a5ee0656 RD |
3415 | :param handler: A callable object to be invoked when the |
3416 | event is delivered to self. Pass None to | |
3417 | disconnect an event handler. | |
d55e5bfc | 3418 | |
a5ee0656 RD |
3419 | :param source: Sometimes the event originates from a |
3420 | different window than self, but you still | |
3421 | want to catch it in self. (For example, a | |
3422 | button event delivered to a frame.) By | |
3423 | passing the source of the event, the event | |
3424 | handling system is able to differentiate | |
3425 | between the same event type from different | |
3426 | controls. | |
d55e5bfc | 3427 | |
a5ee0656 RD |
3428 | :param id: Used to spcify the event source by ID instead |
3429 | of instance. | |
3430 | ||
3431 | :param id2: Used when it is desirable to bind a handler | |
3432 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d55e5bfc RD |
3433 | """ |
3434 | if source is not None: | |
3435 | id = source.GetId() | |
3436 | event.Bind(self, id, id2, handler) | |
3437 | ||
d6c14a4c RD |
3438 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3439 | """ | |
3440 | Disconencts the event handler binding for event from self. | |
3441 | Returns True if successful. | |
3442 | """ | |
3443 | if source is not None: | |
3444 | id = source.GetId() | |
3445 | return event.Unbind(self, id, id2) | |
d55e5bfc RD |
3446 | |
3447 | ||
5b5c9bc7 | 3448 | class EvtHandlerPtr(EvtHandler): |
d55e5bfc RD |
3449 | def __init__(self, this): |
3450 | self.this = this | |
3451 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3452 | self.__class__ = EvtHandler |
3453 | _core_.EvtHandler_swigregister(EvtHandlerPtr) | |
d55e5bfc RD |
3454 | |
3455 | #--------------------------------------------------------------------------- | |
3456 | ||
3457 | class PyEventBinder(object): | |
3458 | """ | |
3459 | Instances of this class are used to bind specific events to event | |
3460 | handlers. | |
3461 | """ | |
3462 | def __init__(self, evtType, expectedIDs=0): | |
3463 | if expectedIDs not in [0, 1, 2]: | |
3464 | raise ValueError, "Invalid number of expectedIDs" | |
3465 | self.expectedIDs = expectedIDs | |
3466 | ||
3467 | if type(evtType) == list or type(evtType) == tuple: | |
3468 | self.evtType = evtType | |
3469 | else: | |
3470 | self.evtType = [evtType] | |
3471 | ||
3472 | ||
3473 | def Bind(self, target, id1, id2, function): | |
3474 | """Bind this set of event types to target.""" | |
3475 | for et in self.evtType: | |
3476 | target.Connect(id1, id2, et, function) | |
3477 | ||
d6c14a4c RD |
3478 | |
3479 | def Unbind(self, target, id1, id2): | |
3480 | """Remove an event binding.""" | |
3481 | success = 0 | |
3482 | for et in self.evtType: | |
3483 | success += target.Disconnect(id1, id2, et) | |
3484 | return success != 0 | |
3485 | ||
d55e5bfc RD |
3486 | |
3487 | def __call__(self, *args): | |
3488 | """ | |
3489 | For backwards compatibility with the old EVT_* functions. | |
3490 | Should be called with either (window, func), (window, ID, | |
3491 | func) or (window, ID1, ID2, func) parameters depending on the | |
3492 | type of the event. | |
3493 | """ | |
3494 | assert len(args) == 2 + self.expectedIDs | |
3495 | id1 = wx.ID_ANY | |
3496 | id2 = wx.ID_ANY | |
3497 | target = args[0] | |
3498 | if self.expectedIDs == 0: | |
3499 | func = args[1] | |
3500 | elif self.expectedIDs == 1: | |
3501 | id1 = args[1] | |
3502 | func = args[2] | |
3503 | elif self.expectedIDs == 2: | |
3504 | id1 = args[1] | |
3505 | id2 = args[2] | |
3506 | func = args[3] | |
3507 | else: | |
3508 | raise ValueError, "Unexpected number of IDs" | |
3509 | ||
3510 | self.Bind(target, id1, id2, func) | |
3511 | ||
3512 | ||
3513 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3514 | def EVT_COMMAND(win, id, cmd, func): | |
3515 | win.Connect(id, -1, cmd, func) | |
3516 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3517 | win.Connect(id1, id2, cmd, func) | |
3518 | ||
3519 | ||
3520 | #--------------------------------------------------------------------------- | |
3521 | ||
3522 | #--------------------------------------------------------------------------- | |
3523 | ||
5b5c9bc7 RD |
3524 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3525 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
3526 | ||
3527 | def NewEventType(*args, **kwargs): | |
3528 | """NewEventType() -> wxEventType""" | |
3529 | return _core_.NewEventType(*args, **kwargs) | |
3530 | wxEVT_NULL = _core_.wxEVT_NULL | |
3531 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3532 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3533 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3534 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3535 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3536 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3537 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3538 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3539 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3540 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3541 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3542 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3543 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3544 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3545 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3546 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3547 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3548 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3549 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3550 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3551 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3552 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3553 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3554 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3555 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3556 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3557 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3558 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3559 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3560 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3561 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3562 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3563 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3564 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3565 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3566 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3567 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3568 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3569 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3570 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3571 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3572 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3573 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3574 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3575 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3576 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3577 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3578 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3579 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3580 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3581 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3582 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3583 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3584 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3585 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3586 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3587 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3588 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3589 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3590 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3591 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
4f433fef RD |
3592 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
3593 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
5b5c9bc7 RD |
3594 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
3595 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3596 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3597 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3598 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3599 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3600 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3601 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3602 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3603 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3604 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3605 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3606 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3607 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
3608 | wxEVT_POWER = _core_.wxEVT_POWER | |
3609 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE | |
3610 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3611 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3612 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3613 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3614 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3615 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
3616 | wxEVT_PAINT = _core_.wxEVT_PAINT | |
3617 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3618 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3619 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3620 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3621 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3622 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3623 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3624 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3625 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3626 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3627 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3628 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3629 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3630 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3631 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3632 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3633 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3634 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3635 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3636 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3637 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
3638 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE | |
3639 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK | |
3640 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3641 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3642 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3643 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3644 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3645 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d55e5bfc RD |
3646 | # |
3647 | # Create some event binders | |
3648 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3649 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3650 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3651 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3652 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3653 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3654 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3655 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3656 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3657 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3658 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3659 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3660 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
3661 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) | |
3662 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) | |
3663 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3664 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3665 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3666 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3667 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3668 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3669 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3670 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3671 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
88c6b281 | 3672 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d55e5bfc RD |
3673 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3674 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3675 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3676 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3677 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3678 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3679 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3680 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3681 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3682 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3683 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3684 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3685 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3686 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3687 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3688 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
3689 | ||
3690 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3691 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3692 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3693 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3694 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3695 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3696 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3697 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3698 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3699 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3700 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3701 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3702 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3703 | ||
3704 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3705 | wxEVT_LEFT_UP, | |
3706 | wxEVT_MIDDLE_DOWN, | |
3707 | wxEVT_MIDDLE_UP, | |
3708 | wxEVT_RIGHT_DOWN, | |
3709 | wxEVT_RIGHT_UP, | |
3710 | wxEVT_MOTION, | |
3711 | wxEVT_LEFT_DCLICK, | |
3712 | wxEVT_MIDDLE_DCLICK, | |
3713 | wxEVT_RIGHT_DCLICK, | |
3714 | wxEVT_ENTER_WINDOW, | |
3715 | wxEVT_LEAVE_WINDOW, | |
3716 | wxEVT_MOUSEWHEEL | |
3717 | ]) | |
3718 | ||
3719 | ||
3720 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
3721 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, | |
3722 | wxEVT_SCROLLWIN_BOTTOM, | |
3723 | wxEVT_SCROLLWIN_LINEUP, | |
3724 | wxEVT_SCROLLWIN_LINEDOWN, | |
3725 | wxEVT_SCROLLWIN_PAGEUP, | |
3726 | wxEVT_SCROLLWIN_PAGEDOWN, | |
3727 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3728 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3729 | ]) | |
3730 | ||
3731 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3732 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3733 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3734 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3735 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3736 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3737 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3738 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3739 | ||
27fb7603 | 3740 | # Scrolling from wx.Slider and wx.ScrollBar |
d55e5bfc RD |
3741 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3742 | wxEVT_SCROLL_BOTTOM, | |
3743 | wxEVT_SCROLL_LINEUP, | |
3744 | wxEVT_SCROLL_LINEDOWN, | |
3745 | wxEVT_SCROLL_PAGEUP, | |
3746 | wxEVT_SCROLL_PAGEDOWN, | |
3747 | wxEVT_SCROLL_THUMBTRACK, | |
3748 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3749 | wxEVT_SCROLL_CHANGED, |
d55e5bfc RD |
3750 | ]) |
3751 | ||
3752 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3753 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3754 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3755 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3756 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3757 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3758 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3759 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4f433fef RD |
3760 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
3761 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
3762 | ||
27fb7603 | 3763 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
d55e5bfc RD |
3764 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3765 | wxEVT_SCROLL_BOTTOM, | |
3766 | wxEVT_SCROLL_LINEUP, | |
3767 | wxEVT_SCROLL_LINEDOWN, | |
3768 | wxEVT_SCROLL_PAGEUP, | |
3769 | wxEVT_SCROLL_PAGEDOWN, | |
3770 | wxEVT_SCROLL_THUMBTRACK, | |
3771 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3772 | wxEVT_SCROLL_CHANGED, |
d55e5bfc RD |
3773 | ], 1) |
3774 | ||
3775 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3776 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3777 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3778 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3779 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3780 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3781 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3782 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4f433fef RD |
3783 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
3784 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d55e5bfc RD |
3785 | |
3786 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) | |
3787 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3788 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3789 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3790 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3791 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3792 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3793 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3794 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3795 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3796 | ||
3797 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3798 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3799 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3800 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3801 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3802 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3803 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3804 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3805 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3806 | ||
3807 | ||
3808 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3809 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3810 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3811 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3812 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3813 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3814 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3815 | ||
3816 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
3817 | ||
3818 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
3819 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
3820 | ||
3821 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
3822 | ||
3823 | ||
3824 | ||
3825 | #--------------------------------------------------------------------------- | |
3826 | ||
5b5c9bc7 | 3827 | class Event(Object): |
27fb7603 RD |
3828 | """ |
3829 | An event is a structure holding information about an event passed to a | |
3830 | callback or member function. wx.Event is an abstract base class for | |
3831 | other event classes | |
3832 | """ | |
d55e5bfc RD |
3833 | def __init__(self): raise RuntimeError, "No constructor defined" |
3834 | def __repr__(self): | |
3835 | return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 | 3836 | def __del__(self, destroy=_core_.delete_Event): |
d55e5bfc RD |
3837 | """__del__(self)""" |
3838 | try: | |
3839 | if self.thisown: destroy(self) | |
3840 | except: pass | |
3841 | ||
3842 | def SetEventType(*args, **kwargs): | |
27fb7603 RD |
3843 | """ |
3844 | SetEventType(self, wxEventType typ) | |
3845 | ||
3846 | Sets the specific type of the event. | |
3847 | """ | |
5b5c9bc7 | 3848 | return _core_.Event_SetEventType(*args, **kwargs) |
d55e5bfc RD |
3849 | |
3850 | def GetEventType(*args, **kwargs): | |
27fb7603 RD |
3851 | """ |
3852 | GetEventType(self) -> wxEventType | |
3853 | ||
3854 | Returns the identifier of the given event type, such as | |
3855 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
3856 | """ | |
5b5c9bc7 | 3857 | return _core_.Event_GetEventType(*args, **kwargs) |
d55e5bfc RD |
3858 | |
3859 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
3860 | """ |
3861 | GetEventObject(self) -> Object | |
3862 | ||
3863 | Returns the object (usually a window) associated with the event, if | |
3864 | any. | |
3865 | """ | |
5b5c9bc7 | 3866 | return _core_.Event_GetEventObject(*args, **kwargs) |
d55e5bfc RD |
3867 | |
3868 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
3869 | """ |
3870 | SetEventObject(self, Object obj) | |
3871 | ||
3872 | Sets the originating object, or in other words, obj is normally the | |
3873 | object that is sending the event. | |
3874 | """ | |
5b5c9bc7 | 3875 | return _core_.Event_SetEventObject(*args, **kwargs) |
d55e5bfc RD |
3876 | |
3877 | def GetTimestamp(*args, **kwargs): | |
3878 | """GetTimestamp(self) -> long""" | |
5b5c9bc7 | 3879 | return _core_.Event_GetTimestamp(*args, **kwargs) |
d55e5bfc RD |
3880 | |
3881 | def SetTimestamp(*args, **kwargs): | |
3882 | """SetTimestamp(self, long ts=0)""" | |
5b5c9bc7 | 3883 | return _core_.Event_SetTimestamp(*args, **kwargs) |
d55e5bfc RD |
3884 | |
3885 | def GetId(*args, **kwargs): | |
27fb7603 RD |
3886 | """ |
3887 | GetId(self) -> int | |
3888 | ||
3889 | Returns the identifier associated with this event, such as a button | |
3890 | command id. | |
3891 | """ | |
5b5c9bc7 | 3892 | return _core_.Event_GetId(*args, **kwargs) |
d55e5bfc RD |
3893 | |
3894 | def SetId(*args, **kwargs): | |
27fb7603 RD |
3895 | """ |
3896 | SetId(self, int Id) | |
3897 | ||
3898 | Set's the ID for the event. This is usually the ID of the window that | |
3899 | is sending the event, but it can also be a command id from a menu | |
3900 | item, etc. | |
3901 | """ | |
5b5c9bc7 | 3902 | return _core_.Event_SetId(*args, **kwargs) |
d55e5bfc RD |
3903 | |
3904 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
3905 | """ |
3906 | IsCommandEvent(self) -> bool | |
3907 | ||
3908 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
3909 | it returns false. Note: Exists only for optimization purposes. | |
3910 | """ | |
5b5c9bc7 | 3911 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
d55e5bfc RD |
3912 | |
3913 | def Skip(*args, **kwargs): | |
51b83b37 RD |
3914 | """ |
3915 | Skip(self, bool skip=True) | |
3916 | ||
3917 | Called by an event handler, it controls whether additional event | |
3918 | handlers bound to this event will be called after the current event | |
3919 | handler returns. Skip(false) (the default setting) will prevent | |
3920 | additional event handlers from being called and control will be | |
3921 | returned to the sender of the event immediately after the current | |
3922 | handler has finished. Skip(True) will cause the event processing | |
3923 | system to continue searching for a handler function for this event. | |
3924 | ||
3925 | """ | |
5b5c9bc7 | 3926 | return _core_.Event_Skip(*args, **kwargs) |
d55e5bfc RD |
3927 | |
3928 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
3929 | """ |
3930 | GetSkipped(self) -> bool | |
3931 | ||
3932 | Returns true if the event handler should be skipped, false otherwise. | |
3933 | :see: `Skip` | |
3934 | """ | |
5b5c9bc7 | 3935 | return _core_.Event_GetSkipped(*args, **kwargs) |
d55e5bfc RD |
3936 | |
3937 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
3938 | """ |
3939 | ShouldPropagate(self) -> bool | |
3940 | ||
3941 | Test if this event should be propagated to the parent window or not, | |
3942 | i.e. if the propagation level is currently greater than 0. | |
3943 | """ | |
5b5c9bc7 | 3944 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
d55e5bfc RD |
3945 | |
3946 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
3947 | """ |
3948 | StopPropagation(self) -> int | |
3949 | ||
3950 | Stop the event from propagating to its parent window. Returns the old | |
3951 | propagation level value which may be later passed to | |
3952 | `ResumePropagation` to allow propagating the event again. | |
3953 | """ | |
5b5c9bc7 | 3954 | return _core_.Event_StopPropagation(*args, **kwargs) |
d55e5bfc RD |
3955 | |
3956 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
3957 | """ |
3958 | ResumePropagation(self, int propagationLevel) | |
3959 | ||
3960 | Resume the event propagation by restoring the propagation level. (For | |
3961 | example, you can use the value returned by an earlier call to | |
3962 | `StopPropagation`.) | |
3963 | ||
3964 | """ | |
5b5c9bc7 | 3965 | return _core_.Event_ResumePropagation(*args, **kwargs) |
d55e5bfc RD |
3966 | |
3967 | def Clone(*args, **kwargs): | |
5b5c9bc7 RD |
3968 | """Clone(self) -> Event""" |
3969 | return _core_.Event_Clone(*args, **kwargs) | |
d55e5bfc RD |
3970 | |
3971 | ||
5b5c9bc7 | 3972 | class EventPtr(Event): |
d55e5bfc RD |
3973 | def __init__(self, this): |
3974 | self.this = this | |
3975 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3976 | self.__class__ = Event |
3977 | _core_.Event_swigregister(EventPtr) | |
d55e5bfc RD |
3978 | |
3979 | #--------------------------------------------------------------------------- | |
3980 | ||
5b5c9bc7 | 3981 | class PropagationDisabler(object): |
27fb7603 RD |
3982 | """ |
3983 | Helper class to temporarily change an event not to propagate. Simply | |
3984 | create an instance of this class and then whe it is destroyed the | |
3985 | propogation of the event will be restored. | |
3986 | """ | |
d55e5bfc RD |
3987 | def __repr__(self): |
3988 | return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3989 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3990 | """ |
3991 | __init__(self, Event event) -> PropagationDisabler | |
3992 | ||
3993 | Helper class to temporarily change an event not to propagate. Simply | |
3994 | create an instance of this class and then whe it is destroyed the | |
3995 | propogation of the event will be restored. | |
3996 | """ | |
5b5c9bc7 | 3997 | newobj = _core_.new_PropagationDisabler(*args, **kwargs) |
d55e5bfc RD |
3998 | self.this = newobj.this |
3999 | self.thisown = 1 | |
4000 | del newobj.thisown | |
5b5c9bc7 | 4001 | def __del__(self, destroy=_core_.delete_PropagationDisabler): |
d55e5bfc RD |
4002 | """__del__(self)""" |
4003 | try: | |
4004 | if self.thisown: destroy(self) | |
4005 | except: pass | |
4006 | ||
4007 | ||
5b5c9bc7 | 4008 | class PropagationDisablerPtr(PropagationDisabler): |
d55e5bfc RD |
4009 | def __init__(self, this): |
4010 | self.this = this | |
4011 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4012 | self.__class__ = PropagationDisabler |
4013 | _core_.PropagationDisabler_swigregister(PropagationDisablerPtr) | |
d55e5bfc | 4014 | |
5b5c9bc7 | 4015 | class PropagateOnce(object): |
27fb7603 RD |
4016 | """ |
4017 | A helper class that will temporarily lower propagation level of an | |
4018 | event. Simply create an instance of this class and then whe it is | |
4019 | destroyed the propogation of the event will be restored. | |
4020 | """ | |
d55e5bfc RD |
4021 | def __repr__(self): |
4022 | return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4023 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4024 | """ |
4025 | __init__(self, Event event) -> PropagateOnce | |
4026 | ||
4027 | A helper class that will temporarily lower propagation level of an | |
4028 | event. Simply create an instance of this class and then whe it is | |
4029 | destroyed the propogation of the event will be restored. | |
4030 | """ | |
5b5c9bc7 | 4031 | newobj = _core_.new_PropagateOnce(*args, **kwargs) |
d55e5bfc RD |
4032 | self.this = newobj.this |
4033 | self.thisown = 1 | |
4034 | del newobj.thisown | |
5b5c9bc7 | 4035 | def __del__(self, destroy=_core_.delete_PropagateOnce): |
d55e5bfc RD |
4036 | """__del__(self)""" |
4037 | try: | |
4038 | if self.thisown: destroy(self) | |
4039 | except: pass | |
4040 | ||
4041 | ||
5b5c9bc7 | 4042 | class PropagateOncePtr(PropagateOnce): |
d55e5bfc RD |
4043 | def __init__(self, this): |
4044 | self.this = this | |
4045 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4046 | self.__class__ = PropagateOnce |
4047 | _core_.PropagateOnce_swigregister(PropagateOncePtr) | |
d55e5bfc RD |
4048 | |
4049 | #--------------------------------------------------------------------------- | |
4050 | ||
5b5c9bc7 | 4051 | class CommandEvent(Event): |
27fb7603 RD |
4052 | """ |
4053 | This event class contains information about command events, which | |
4054 | originate from a variety of simple controls, as well as menus and | |
4055 | toolbars. | |
4056 | """ | |
d55e5bfc RD |
4057 | def __repr__(self): |
4058 | return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4059 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4060 | """ |
4061 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent | |
4062 | ||
4063 | This event class contains information about command events, which | |
4064 | originate from a variety of simple controls, as well as menus and | |
4065 | toolbars. | |
4066 | """ | |
5b5c9bc7 | 4067 | newobj = _core_.new_CommandEvent(*args, **kwargs) |
d55e5bfc RD |
4068 | self.this = newobj.this |
4069 | self.thisown = 1 | |
4070 | del newobj.thisown | |
4071 | def GetSelection(*args, **kwargs): | |
27fb7603 RD |
4072 | """ |
4073 | GetSelection(self) -> int | |
4074 | ||
4075 | Returns item index for a listbox or choice selection event (not valid | |
4076 | for a deselection). | |
4077 | """ | |
5b5c9bc7 | 4078 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
d55e5bfc RD |
4079 | |
4080 | def SetString(*args, **kwargs): | |
5b5c9bc7 RD |
4081 | """SetString(self, String s)""" |
4082 | return _core_.CommandEvent_SetString(*args, **kwargs) | |
d55e5bfc RD |
4083 | |
4084 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4085 | """ |
4086 | GetString(self) -> String | |
4087 | ||
4088 | Returns item string for a listbox or choice selection event (not valid | |
4089 | for a deselection). | |
4090 | """ | |
5b5c9bc7 | 4091 | return _core_.CommandEvent_GetString(*args, **kwargs) |
d55e5bfc RD |
4092 | |
4093 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4094 | """ |
4095 | IsChecked(self) -> bool | |
4096 | ||
4097 | This method can be used with checkbox and menu events: for the | |
4098 | checkboxes, the method returns true for a selection event and false | |
4099 | for a deselection one. For the menu events, this method indicates if | |
4100 | the menu item just has become checked or unchecked (and thus only | |
4101 | makes sense for checkable menu items). | |
4102 | """ | |
5b5c9bc7 | 4103 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
d55e5bfc RD |
4104 | |
4105 | Checked = IsChecked | |
4106 | def IsSelection(*args, **kwargs): | |
27fb7603 RD |
4107 | """ |
4108 | IsSelection(self) -> bool | |
4109 | ||
4110 | For a listbox or similar event, returns true if it is a selection, | |
4111 | false if it is a deselection. | |
4112 | """ | |
5b5c9bc7 | 4113 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
d55e5bfc RD |
4114 | |
4115 | def SetExtraLong(*args, **kwargs): | |
4116 | """SetExtraLong(self, long extraLong)""" | |
5b5c9bc7 | 4117 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
d55e5bfc RD |
4118 | |
4119 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4120 | """ |
4121 | GetExtraLong(self) -> long | |
4122 | ||
5ba5649b RD |
4123 | Returns extra information dependant on the event objects type. If the |
4124 | event comes from a listbox selection, it is a boolean determining | |
4125 | whether the event was a selection (true) or a deselection (false). A | |
4126 | listbox deselection only occurs for multiple-selection boxes, and in | |
4127 | this case the index and string values are indeterminate and the | |
4128 | listbox must be examined by the application. | |
27fb7603 | 4129 | """ |
5b5c9bc7 | 4130 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
d55e5bfc RD |
4131 | |
4132 | def SetInt(*args, **kwargs): | |
4133 | """SetInt(self, int i)""" | |
5b5c9bc7 | 4134 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
d55e5bfc RD |
4135 | |
4136 | def GetInt(*args, **kwargs): | |
27fb7603 RD |
4137 | """ |
4138 | GetInt(self) -> long | |
4139 | ||
5ba5649b RD |
4140 | Returns the integer identifier corresponding to a listbox, choice or |
4141 | radiobox selection (only if the event was a selection, not a | |
4142 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4143 | """ |
5b5c9bc7 | 4144 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
d55e5bfc RD |
4145 | |
4146 | def Clone(*args, **kwargs): | |
5b5c9bc7 RD |
4147 | """Clone(self) -> Event""" |
4148 | return _core_.CommandEvent_Clone(*args, **kwargs) | |
d55e5bfc RD |
4149 | |
4150 | ||
5b5c9bc7 | 4151 | class CommandEventPtr(CommandEvent): |
d55e5bfc RD |
4152 | def __init__(self, this): |
4153 | self.this = this | |
4154 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4155 | self.__class__ = CommandEvent |
4156 | _core_.CommandEvent_swigregister(CommandEventPtr) | |
d55e5bfc RD |
4157 | |
4158 | #--------------------------------------------------------------------------- | |
4159 | ||
5b5c9bc7 | 4160 | class NotifyEvent(CommandEvent): |
27fb7603 RD |
4161 | """ |
4162 | An instance of this class (or one of its derived classes) is sent from | |
4163 | a control when the control's state is being changed and the control | |
4164 | allows that change to be prevented from happening. The event handler | |
4165 | can call `Veto` or `Allow` to tell the control what to do. | |
4166 | """ | |
d55e5bfc RD |
4167 | def __repr__(self): |
4168 | return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4169 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4170 | """ |
4171 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent | |
4172 | ||
4173 | An instance of this class (or one of its derived classes) is sent from | |
4174 | a control when the control's state is being changed and the control | |
4175 | allows that change to be prevented from happening. The event handler | |
4176 | can call `Veto` or `Allow` to tell the control what to do. | |
4177 | """ | |
5b5c9bc7 | 4178 | newobj = _core_.new_NotifyEvent(*args, **kwargs) |
d55e5bfc RD |
4179 | self.this = newobj.this |
4180 | self.thisown = 1 | |
4181 | del newobj.thisown | |
4182 | def Veto(*args, **kwargs): | |
27fb7603 RD |
4183 | """ |
4184 | Veto(self) | |
4185 | ||
4186 | Prevents the change announced by this event from happening. | |
4187 | ||
4188 | It is in general a good idea to notify the user about the reasons for | |
4189 | vetoing the change because otherwise the applications behaviour (which | |
4190 | just refuses to do what the user wants) might be quite surprising. | |
4191 | """ | |
5b5c9bc7 | 4192 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
d55e5bfc RD |
4193 | |
4194 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4195 | """ |
4196 | Allow(self) | |
4197 | ||
4198 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4199 | processed. For most events it is not necessary to call this method as | |
4200 | the events are allowed anyhow but some are forbidden by default (this | |
4201 | will be mentioned in the corresponding event description). | |
4202 | """ | |
5b5c9bc7 | 4203 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
d55e5bfc RD |
4204 | |
4205 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4206 | """ |
4207 | IsAllowed(self) -> bool | |
4208 | ||
4209 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4210 | false otherwise (if it was). | |
4211 | """ | |
5b5c9bc7 | 4212 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
d55e5bfc RD |
4213 | |
4214 | ||
5b5c9bc7 | 4215 | class NotifyEventPtr(NotifyEvent): |
d55e5bfc RD |
4216 | def __init__(self, this): |
4217 | self.this = this | |
4218 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4219 | self.__class__ = NotifyEvent |
4220 | _core_.NotifyEvent_swigregister(NotifyEventPtr) | |
d55e5bfc RD |
4221 | |
4222 | #--------------------------------------------------------------------------- | |
4223 | ||
5b5c9bc7 | 4224 | class ScrollEvent(CommandEvent): |
27fb7603 RD |
4225 | """ |
4226 | A scroll event holds information about events sent from stand-alone | |
4227 | scrollbars and sliders. Note that scrolled windows do not send | |
4228 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4229 | instead. | |
4230 | """ | |
d55e5bfc RD |
4231 | def __repr__(self): |
4232 | return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4233 | def __init__(self, *args, **kwargs): | |
4234 | """ | |
4235 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0, | |
5b5c9bc7 | 4236 | int orient=0) -> ScrollEvent |
d55e5bfc | 4237 | """ |
5b5c9bc7 | 4238 | newobj = _core_.new_ScrollEvent(*args, **kwargs) |
d55e5bfc RD |
4239 | self.this = newobj.this |
4240 | self.thisown = 1 | |
4241 | del newobj.thisown | |
4242 | def GetOrientation(*args, **kwargs): | |
27fb7603 RD |
4243 | """ |
4244 | GetOrientation(self) -> int | |
4245 | ||
4246 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4247 | the scrollbar. | |
4248 | """ | |
5b5c9bc7 | 4249 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
4250 | |
4251 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4252 | """ |
4253 | GetPosition(self) -> int | |
4254 | ||
4255 | Returns the position of the scrollbar. | |
4256 | """ | |
5b5c9bc7 | 4257 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4258 | |
4259 | def SetOrientation(*args, **kwargs): | |
4260 | """SetOrientation(self, int orient)""" | |
5b5c9bc7 | 4261 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
d55e5bfc RD |
4262 | |
4263 | def SetPosition(*args, **kwargs): | |
4264 | """SetPosition(self, int pos)""" | |
5b5c9bc7 | 4265 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
d55e5bfc RD |
4266 | |
4267 | ||
5b5c9bc7 | 4268 | class ScrollEventPtr(ScrollEvent): |
d55e5bfc RD |
4269 | def __init__(self, this): |
4270 | self.this = this | |
4271 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4272 | self.__class__ = ScrollEvent |
4273 | _core_.ScrollEvent_swigregister(ScrollEventPtr) | |
d55e5bfc RD |
4274 | |
4275 | #--------------------------------------------------------------------------- | |
4276 | ||
5b5c9bc7 | 4277 | class ScrollWinEvent(Event): |
27fb7603 RD |
4278 | """ |
4279 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4280 | scrolling windows. | |
4281 | """ | |
d55e5bfc RD |
4282 | def __repr__(self): |
4283 | return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4284 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4285 | """ |
4286 | __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent | |
4287 | ||
4288 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4289 | scrolling windows. | |
4290 | """ | |
5b5c9bc7 | 4291 | newobj = _core_.new_ScrollWinEvent(*args, **kwargs) |
d55e5bfc RD |
4292 | self.this = newobj.this |
4293 | self.thisown = 1 | |
4294 | del newobj.thisown | |
4295 | def GetOrientation(*args, **kwargs): | |
27fb7603 RD |
4296 | """ |
4297 | GetOrientation(self) -> int | |
4298 | ||
4299 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4300 | the scrollbar. | |
4301 | """ | |
5b5c9bc7 | 4302 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
4303 | |
4304 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4305 | """ |
4306 | GetPosition(self) -> int | |
4307 | ||
4308 | Returns the position of the scrollbar for the thumb track and release | |
4309 | events. Note that this field can't be used for the other events, you | |
4310 | need to query the window itself for the current position in that case. | |
4311 | """ | |
5b5c9bc7 | 4312 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4313 | |
4314 | def SetOrientation(*args, **kwargs): | |
4315 | """SetOrientation(self, int orient)""" | |
5b5c9bc7 | 4316 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
d55e5bfc RD |
4317 | |
4318 | def SetPosition(*args, **kwargs): | |
4319 | """SetPosition(self, int pos)""" | |
5b5c9bc7 | 4320 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
d55e5bfc RD |
4321 | |
4322 | ||
5b5c9bc7 | 4323 | class ScrollWinEventPtr(ScrollWinEvent): |
d55e5bfc RD |
4324 | def __init__(self, this): |
4325 | self.this = this | |
4326 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4327 | self.__class__ = ScrollWinEvent |
4328 | _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr) | |
d55e5bfc RD |
4329 | |
4330 | #--------------------------------------------------------------------------- | |
4331 | ||
5b5c9bc7 RD |
4332 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4333 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4334 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4335 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4336 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
4337 | class MouseEvent(Event): | |
27fb7603 RD |
4338 | """ |
4339 | This event class contains information about the events generated by | |
4340 | the mouse: they include mouse buttons press and release events and | |
4341 | mouse move events. | |
4342 | ||
4343 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4344 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4345 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4346 | a middle button so a portable application should avoid relying on the | |
4347 | events from it. | |
4348 | ||
4349 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4350 | the former returns true when the event corresponds to the left mouse | |
4351 | button click while the latter returns true if the left mouse button is | |
4352 | currently being pressed. For example, when the user is dragging the | |
4353 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4354 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4355 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4356 | underlying GUI behaviour is (which is platform-dependent). The same | |
4357 | applies, of course, to other mouse buttons as well. | |
4358 | """ | |
d55e5bfc RD |
4359 | def __repr__(self): |
4360 | return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4361 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4362 | """ |
4363 | __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent | |
4364 | ||
4365 | Constructs a wx.MouseEvent. Valid event types are: | |
4366 | ||
4367 | * wxEVT_ENTER_WINDOW | |
4368 | * wxEVT_LEAVE_WINDOW | |
4369 | * wxEVT_LEFT_DOWN | |
4370 | * wxEVT_LEFT_UP | |
4371 | * wxEVT_LEFT_DCLICK | |
4372 | * wxEVT_MIDDLE_DOWN | |
4373 | * wxEVT_MIDDLE_UP | |
4374 | * wxEVT_MIDDLE_DCLICK | |
4375 | * wxEVT_RIGHT_DOWN | |
4376 | * wxEVT_RIGHT_UP | |
4377 | * wxEVT_RIGHT_DCLICK | |
4378 | * wxEVT_MOTION | |
4379 | * wxEVT_MOUSEWHEEL | |
4380 | """ | |
5b5c9bc7 | 4381 | newobj = _core_.new_MouseEvent(*args, **kwargs) |
d55e5bfc RD |
4382 | self.this = newobj.this |
4383 | self.thisown = 1 | |
4384 | del newobj.thisown | |
4385 | def IsButton(*args, **kwargs): | |
27fb7603 RD |
4386 | """ |
4387 | IsButton(self) -> bool | |
4388 | ||
4389 | Returns true if the event was a mouse button event (not necessarily a | |
4390 | button down event - that may be tested using `ButtonDown`). | |
4391 | """ | |
5b5c9bc7 | 4392 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
d55e5bfc RD |
4393 | |
4394 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4395 | """ |
4396 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4397 | ||
5ba5649b RD |
4398 | If the argument is omitted, this returns true if the event was any |
4399 | mouse button down event. Otherwise the argument specifies which | |
4400 | button-down event shold be checked for (see `Button` for the possible | |
4401 | values). | |
27fb7603 | 4402 | """ |
5b5c9bc7 | 4403 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
d55e5bfc RD |
4404 | |
4405 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4406 | """ |
4407 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4408 | ||
4409 | If the argument is omitted, this returns true if the event was any | |
4410 | mouse double click event. Otherwise the argument specifies which | |
4411 | double click event to check for (see `Button` for the possible | |
4412 | values). | |
4413 | """ | |
5b5c9bc7 | 4414 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
d55e5bfc RD |
4415 | |
4416 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4417 | """ |
4418 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4419 | ||
4420 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4421 | mouse button up event. Otherwise the argument specifies which button |
4422 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4423 | """ |
5b5c9bc7 | 4424 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
d55e5bfc RD |
4425 | |
4426 | def Button(*args, **kwargs): | |
27fb7603 RD |
4427 | """ |
4428 | Button(self, int button) -> bool | |
4429 | ||
4430 | Returns true if the identified mouse button is changing state. Valid | |
4431 | values of button are: | |
4432 | ||
4433 | ==================== ===================================== | |
4434 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4435 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4436 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4437 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4438 | ==================== ===================================== | |
4439 | ||
4440 | """ | |
5b5c9bc7 | 4441 | return _core_.MouseEvent_Button(*args, **kwargs) |
d55e5bfc RD |
4442 | |
4443 | def ButtonIsDown(*args, **kwargs): | |
4444 | """ButtonIsDown(self, int but) -> bool""" | |
5b5c9bc7 | 4445 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
d55e5bfc RD |
4446 | |
4447 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4448 | """ |
4449 | GetButton(self) -> int | |
4450 | ||
4451 | Returns the mouse button which generated this event or | |
4452 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4453 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4454 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4455 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4456 | right buttons respectively. | |
4457 | """ | |
5b5c9bc7 | 4458 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
d55e5bfc RD |
4459 | |
4460 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4461 | """ |
4462 | ControlDown(self) -> bool | |
4463 | ||
4464 | Returns true if the control key was down at the time of the event. | |
4465 | """ | |
5b5c9bc7 | 4466 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
d55e5bfc RD |
4467 | |
4468 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4469 | """ |
4470 | MetaDown(self) -> bool | |
4471 | ||
4472 | Returns true if the Meta key was down at the time of the event. | |
4473 | """ | |
5b5c9bc7 | 4474 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
d55e5bfc RD |
4475 | |
4476 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4477 | """ |
4478 | AltDown(self) -> bool | |
4479 | ||
4480 | Returns true if the Alt key was down at the time of the event. | |
4481 | """ | |
5b5c9bc7 | 4482 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
d55e5bfc RD |
4483 | |
4484 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4485 | """ |
4486 | ShiftDown(self) -> bool | |
4487 | ||
4488 | Returns true if the Shift key was down at the time of the event. | |
4489 | """ | |
5b5c9bc7 | 4490 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
d55e5bfc | 4491 | |
412d302d RD |
4492 | def CmdDown(*args, **kwargs): |
4493 | """ | |
4494 | CmdDown(self) -> bool | |
4495 | ||
4496 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4497 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4498 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4499 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4500 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4501 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4502 | and Macs this is the same as `MetaDown`. | |
4503 | """ | |
5b5c9bc7 | 4504 | return _core_.MouseEvent_CmdDown(*args, **kwargs) |
412d302d | 4505 | |
d55e5bfc | 4506 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4507 | """ |
4508 | LeftDown(self) -> bool | |
4509 | ||
4510 | Returns true if the left mouse button state changed to down. | |
4511 | """ | |
5b5c9bc7 | 4512 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
d55e5bfc RD |
4513 | |
4514 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4515 | """ |
4516 | MiddleDown(self) -> bool | |
4517 | ||
4518 | Returns true if the middle mouse button state changed to down. | |
4519 | """ | |
5b5c9bc7 | 4520 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
d55e5bfc RD |
4521 | |
4522 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4523 | """ |
4524 | RightDown(self) -> bool | |
4525 | ||
4526 | Returns true if the right mouse button state changed to down. | |
4527 | """ | |
5b5c9bc7 | 4528 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
d55e5bfc RD |
4529 | |
4530 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4531 | """ |
4532 | LeftUp(self) -> bool | |
4533 | ||
4534 | Returns true if the left mouse button state changed to up. | |
4535 | """ | |
5b5c9bc7 | 4536 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
d55e5bfc RD |
4537 | |
4538 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4539 | """ |
4540 | MiddleUp(self) -> bool | |
4541 | ||
4542 | Returns true if the middle mouse button state changed to up. | |
4543 | """ | |
5b5c9bc7 | 4544 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
d55e5bfc RD |
4545 | |
4546 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4547 | """ |
4548 | RightUp(self) -> bool | |
4549 | ||
4550 | Returns true if the right mouse button state changed to up. | |
4551 | """ | |
5b5c9bc7 | 4552 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
d55e5bfc RD |
4553 | |
4554 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4555 | """ |
4556 | LeftDClick(self) -> bool | |
4557 | ||
4558 | Returns true if the event was a left button double click. | |
4559 | """ | |
5b5c9bc7 | 4560 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
d55e5bfc RD |
4561 | |
4562 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4563 | """ |
4564 | MiddleDClick(self) -> bool | |
4565 | ||
4566 | Returns true if the event was a middle button double click. | |
4567 | """ | |
5b5c9bc7 | 4568 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
d55e5bfc RD |
4569 | |
4570 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4571 | """ |
4572 | RightDClick(self) -> bool | |
4573 | ||
4574 | Returns true if the event was a right button double click. | |
4575 | """ | |
5b5c9bc7 | 4576 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
d55e5bfc RD |
4577 | |
4578 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4579 | """ |
4580 | LeftIsDown(self) -> bool | |
4581 | ||
4582 | Returns true if the left mouse button is currently down, independent | |
4583 | of the current event type. | |
4584 | ||
4585 | Please notice that it is not the same as LeftDown which returns true | |
4586 | if the left mouse button was just pressed. Rather, it describes the | |
4587 | state of the mouse button before the event happened. | |
4588 | ||
4589 | This event is usually used in the mouse event handlers which process | |
4590 | "move mouse" messages to determine whether the user is (still) | |
4591 | dragging the mouse. | |
4592 | """ | |
5b5c9bc7 | 4593 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
d55e5bfc RD |
4594 | |
4595 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4596 | """ |
4597 | MiddleIsDown(self) -> bool | |
4598 | ||
4599 | Returns true if the middle mouse button is currently down, independent | |
4600 | of the current event type. | |
4601 | """ | |
5b5c9bc7 | 4602 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
d55e5bfc RD |
4603 | |
4604 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4605 | """ |
4606 | RightIsDown(self) -> bool | |
4607 | ||
4608 | Returns true if the right mouse button is currently down, independent | |
4609 | of the current event type. | |
4610 | """ | |
5b5c9bc7 | 4611 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
d55e5bfc RD |
4612 | |
4613 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4614 | """ |
4615 | Dragging(self) -> bool | |
4616 | ||
4617 | Returns true if this was a dragging event (motion while a button is | |
4618 | depressed). | |
4619 | """ | |
5b5c9bc7 | 4620 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
d55e5bfc RD |
4621 | |
4622 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4623 | """ |
4624 | Moving(self) -> bool | |
4625 | ||
4626 | Returns true if this was a motion event and no mouse buttons were | |
4627 | pressed. If any mouse button is held pressed, then this method returns | |
4628 | false and Dragging returns true. | |
4629 | """ | |
5b5c9bc7 | 4630 | return _core_.MouseEvent_Moving(*args, **kwargs) |
d55e5bfc RD |
4631 | |
4632 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4633 | """ |
4634 | Entering(self) -> bool | |
4635 | ||
4636 | Returns true if the mouse was entering the window. | |
4637 | """ | |
5b5c9bc7 | 4638 | return _core_.MouseEvent_Entering(*args, **kwargs) |
d55e5bfc RD |
4639 | |
4640 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4641 | """ |
4642 | Leaving(self) -> bool | |
4643 | ||
4644 | Returns true if the mouse was leaving the window. | |
4645 | """ | |
5b5c9bc7 | 4646 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
d55e5bfc RD |
4647 | |
4648 | def GetPosition(*args, **kwargs): | |
4649 | """ | |
5b5c9bc7 | 4650 | GetPosition(self) -> Point |
d55e5bfc | 4651 | |
27fb7603 RD |
4652 | Returns the pixel position of the mouse in window coordinates when the |
4653 | event happened. | |
d55e5bfc | 4654 | """ |
5b5c9bc7 | 4655 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4656 | |
4657 | def GetPositionTuple(*args, **kwargs): | |
4658 | """ | |
4659 | GetPositionTuple() -> (x,y) | |
4660 | ||
27fb7603 RD |
4661 | Returns the pixel position of the mouse in window coordinates when the |
4662 | event happened. | |
d55e5bfc | 4663 | """ |
5b5c9bc7 | 4664 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
d55e5bfc RD |
4665 | |
4666 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4667 | """ |
4668 | GetLogicalPosition(self, DC dc) -> Point | |
4669 | ||
4670 | Returns the logical mouse position in pixels (i.e. translated | |
4671 | according to the translation set for the DC, which usually indicates | |
4672 | that the window has been scrolled). | |
4673 | """ | |
5b5c9bc7 | 4674 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
d55e5bfc RD |
4675 | |
4676 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4677 | """ |
4678 | GetX(self) -> int | |
4679 | ||
4680 | Returns X coordinate of the physical mouse event position. | |
4681 | """ | |
5b5c9bc7 | 4682 | return _core_.MouseEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
4683 | |
4684 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4685 | """ |
4686 | GetY(self) -> int | |
4687 | ||
4688 | Returns Y coordinate of the physical mouse event position. | |
4689 | """ | |
5b5c9bc7 | 4690 | return _core_.MouseEvent_GetY(*args, **kwargs) |
d55e5bfc RD |
4691 | |
4692 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4693 | """ |
4694 | GetWheelRotation(self) -> int | |
4695 | ||
4696 | Get wheel rotation, positive or negative indicates direction of | |
4697 | rotation. Current devices all send an event when rotation is equal to | |
4698 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4699 | created in the future. Because of this you shouldn't assume that one | |
4700 | event is equal to 1 line or whatever, but you should be able to either | |
4701 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4702 | have been accumulated before scrolling. | |
4703 | """ | |
5b5c9bc7 | 4704 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
d55e5bfc RD |
4705 | |
4706 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4707 | """ |
4708 | GetWheelDelta(self) -> int | |
4709 | ||
4710 | Get wheel delta, normally 120. This is the threshold for action to be | |
4711 | taken, and one such action (for example, scrolling one increment) | |
4712 | should occur for each delta. | |
4713 | """ | |
5b5c9bc7 | 4714 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
d55e5bfc RD |
4715 | |
4716 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4717 | """ |
4718 | GetLinesPerAction(self) -> int | |
4719 | ||
4720 | Returns the configured number of lines (or whatever) to be scrolled | |
4721 | per wheel action. Defaults to three. | |
4722 | """ | |
5b5c9bc7 | 4723 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
d55e5bfc RD |
4724 | |
4725 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4726 | """ |
4727 | IsPageScroll(self) -> bool | |
4728 | ||
4729 | Returns true if the system has been setup to do page scrolling with | |
4730 | the mouse wheel instead of line scrolling. | |
4731 | """ | |
5b5c9bc7 RD |
4732 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4733 | ||
4734 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4735 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4736 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4737 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4738 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4739 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4740 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4741 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4742 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4743 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4744 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4745 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
4746 | ||
4747 | class MouseEventPtr(MouseEvent): | |
d55e5bfc RD |
4748 | def __init__(self, this): |
4749 | self.this = this | |
4750 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4751 | self.__class__ = MouseEvent |
4752 | _core_.MouseEvent_swigregister(MouseEventPtr) | |
d55e5bfc RD |
4753 | |
4754 | #--------------------------------------------------------------------------- | |
4755 | ||
5b5c9bc7 | 4756 | class SetCursorEvent(Event): |
5ba5649b RD |
4757 | """ |
4758 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4759 | as a result of mouse motion. This event gives the application the | |
4760 | chance to perform specific mouse cursor processing based on the | |
4761 | current position of the mouse within the window. Use the `SetCursor` | |
4762 | method to specify the cursor you want to be displayed. | |
4763 | """ | |
d55e5bfc RD |
4764 | def __repr__(self): |
4765 | return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4766 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4767 | """ |
4768 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4769 | ||
4770 | Construct a new `wx.SetCursorEvent`. | |
4771 | """ | |
5b5c9bc7 | 4772 | newobj = _core_.new_SetCursorEvent(*args, **kwargs) |
d55e5bfc RD |
4773 | self.this = newobj.this |
4774 | self.thisown = 1 | |
4775 | del newobj.thisown | |
4776 | def GetX(*args, **kwargs): | |
5ba5649b RD |
4777 | """ |
4778 | GetX(self) -> int | |
4779 | ||
4780 | Returns the X coordinate of the mouse in client coordinates. | |
4781 | """ | |
5b5c9bc7 | 4782 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
4783 | |
4784 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4785 | """ |
4786 | GetY(self) -> int | |
4787 | ||
4788 | Returns the Y coordinate of the mouse in client coordinates. | |
4789 | """ | |
5b5c9bc7 | 4790 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
d55e5bfc RD |
4791 | |
4792 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4793 | """ |
4794 | SetCursor(self, Cursor cursor) | |
4795 | ||
4796 | Sets the cursor associated with this event. | |
4797 | """ | |
5b5c9bc7 | 4798 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
d55e5bfc RD |
4799 | |
4800 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4801 | """ |
4802 | GetCursor(self) -> Cursor | |
4803 | ||
4804 | Returns a reference to the cursor specified by this event. | |
4805 | """ | |
5b5c9bc7 | 4806 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
d55e5bfc RD |
4807 | |
4808 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
4809 | """ |
4810 | HasCursor(self) -> bool | |
4811 | ||
4812 | Returns true if the cursor specified by this event is a valid cursor. | |
4813 | """ | |
5b5c9bc7 | 4814 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
d55e5bfc RD |
4815 | |
4816 | ||
5b5c9bc7 | 4817 | class SetCursorEventPtr(SetCursorEvent): |
d55e5bfc RD |
4818 | def __init__(self, this): |
4819 | self.this = this | |
4820 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4821 | self.__class__ = SetCursorEvent |
4822 | _core_.SetCursorEvent_swigregister(SetCursorEventPtr) | |
d55e5bfc RD |
4823 | |
4824 | #--------------------------------------------------------------------------- | |
4825 | ||
5b5c9bc7 | 4826 | class KeyEvent(Event): |
5ba5649b RD |
4827 | """ |
4828 | This event class contains information about keypress and character | |
4829 | events. These events are only sent to the widget that currently has | |
4830 | the keyboard focus. | |
4831 | ||
4832 | Notice that there are three different kinds of keyboard events in | |
4833 | wxWidgets: key down and up events and char events. The difference | |
4834 | between the first two is clear - the first corresponds to a key press | |
4835 | and the second to a key release - otherwise they are identical. Just | |
4836 | note that if the key is maintained in a pressed state you will | |
4837 | typically get a lot of (automatically generated) down events but only | |
4838 | one up so it is wrong to assume that there is one up event | |
4839 | corresponding to each down one. | |
4840 | ||
4841 | Both key events provide untranslated key codes while the char event | |
4842 | carries the translated one. The untranslated code for alphanumeric | |
4843 | keys is always an upper case value. For the other keys it is one of | |
4844 | WXK_XXX values from the keycodes table. The translated key is, in | |
4845 | general, the character the user expects to appear as the result of the | |
4846 | key combination when typing the text into a text entry zone, for | |
4847 | example. | |
4848 | ||
4849 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
4850 | and the standard US keyboard): when the 'A' key is pressed, the key | |
4851 | down event key code is equal to ASCII A == 65. But the char event key | |
4852 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
4853 | 'A' keys simultaneously , the key code in key down event will still be | |
4854 | just 'A' while the char event key code parameter will now be 'A' as | |
4855 | well. | |
4856 | ||
4857 | Although in this simple case it is clear that the correct key code | |
4858 | could be found in the key down event handler by checking the value | |
4859 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
4860 | as for non alphanumeric keys or non-US keyboard layouts the | |
4861 | translation is keyboard-layout dependent and can only be done properly | |
4862 | by the system itself. | |
4863 | ||
4864 | Another kind of translation is done when the control key is pressed: | |
4865 | for example, for CTRL-A key press the key down event still carries the | |
4866 | same key code 'A' as usual but the char event will have key code of 1, | |
4867 | the ASCII value of this key combination. | |
4868 | ||
4869 | You may discover how the other keys on your system behave | |
4870 | interactively by running the KeyEvents sample in the wxPython demo and | |
4871 | pressing some keys while the blue box at the top has the keyboard | |
4872 | focus. | |
4873 | ||
4874 | **Note**: If a key down event is caught and the event handler does not | |
4875 | call event.Skip() then the coresponding char event will not | |
4876 | happen. This is by design and enables the programs that handle both | |
4877 | types of events to be a bit simpler. | |
4878 | ||
4879 | **Note for Windows programmers**: The key and char events in wxWidgets | |
4880 | are similar to but slightly different from Windows WM_KEYDOWN and | |
4881 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
4882 | event in wxWidgets (unless it is used as an accelerator). | |
4883 | ||
4884 | **Tip**: be sure to call event.Skip() for events that you don't | |
4885 | process in key event function, otherwise menu shortcuts may cease to | |
4886 | work under Windows. | |
4887 | ||
4888 | """ | |
d55e5bfc RD |
4889 | def __repr__(self): |
4890 | return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4891 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4892 | """ |
4893 | __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent | |
4894 | ||
4895 | Construct a new `wx.KeyEvent`. Valid event types are: | |
4896 | * | |
4897 | """ | |
5b5c9bc7 | 4898 | newobj = _core_.new_KeyEvent(*args, **kwargs) |
d55e5bfc RD |
4899 | self.this = newobj.this |
4900 | self.thisown = 1 | |
4901 | del newobj.thisown | |
4902 | def ControlDown(*args, **kwargs): | |
5ba5649b RD |
4903 | """ |
4904 | ControlDown(self) -> bool | |
4905 | ||
4906 | Returns ``True`` if the Control key was down at the time of the event. | |
4907 | """ | |
5b5c9bc7 | 4908 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
d55e5bfc RD |
4909 | |
4910 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
4911 | """ |
4912 | MetaDown(self) -> bool | |
4913 | ||
4914 | Returns ``True`` if the Meta key was down at the time of the event. | |
4915 | """ | |
5b5c9bc7 | 4916 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
d55e5bfc RD |
4917 | |
4918 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
4919 | """ |
4920 | AltDown(self) -> bool | |
4921 | ||
4922 | Returns ``True`` if the Alt key was down at the time of the event. | |
4923 | """ | |
5b5c9bc7 | 4924 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
d55e5bfc RD |
4925 | |
4926 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
4927 | """ |
4928 | ShiftDown(self) -> bool | |
4929 | ||
4930 | Returns ``True`` if the Shift key was down at the time of the event. | |
4931 | """ | |
5b5c9bc7 | 4932 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
d55e5bfc | 4933 | |
412d302d RD |
4934 | def CmdDown(*args, **kwargs): |
4935 | """ | |
4936 | CmdDown(self) -> bool | |
4937 | ||
4938 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4939 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4940 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
4941 | because Cmd key is used for the same thing under Mac as Ctrl |
4942 | elsewhere. The Ctrl still exists, it's just not used for this | |
4943 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
4944 | and Macs this is the same as `MetaDown`. | |
4945 | """ | |
5b5c9bc7 | 4946 | return _core_.KeyEvent_CmdDown(*args, **kwargs) |
412d302d | 4947 | |
d55e5bfc | 4948 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
4949 | """ |
4950 | HasModifiers(self) -> bool | |
4951 | ||
4952 | Returns true if either CTRL or ALT keys was down at the time of the | |
4953 | key event. Note that this function does not take into account neither | |
4954 | SHIFT nor META key states (the reason for ignoring the latter is that | |
4955 | it is common for NUMLOCK key to be configured as META under X but the | |
4956 | key presses even while NUMLOCK is on should be still processed | |
4957 | normally). | |
4958 | """ | |
5b5c9bc7 | 4959 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
d55e5bfc RD |
4960 | |
4961 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
4962 | """ |
4963 | GetKeyCode(self) -> int | |
4964 | ||
4965 | Returns the virtual key code. ASCII events return normal ASCII values, | |
4966 | while non-ASCII events return values such as WXK_LEFT for the left | |
4967 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
4968 | codes. | |
4969 | ||
4970 | Note that in Unicode build, the returned value is meaningful only if | |
4971 | the user entered a character that can be represented in current | |
4972 | locale's default charset. You can obtain the corresponding Unicode | |
4973 | character using `GetUnicodeKey`. | |
4974 | """ | |
5b5c9bc7 | 4975 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
d55e5bfc RD |
4976 | |
4977 | KeyCode = GetKeyCode | |
bb4524c4 | 4978 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
4979 | """ |
4980 | GetUnicodeKey(self) -> int | |
4981 | ||
4982 | Returns the Unicode character corresponding to this key event. This | |
4983 | function is only meaningfule in a Unicode build of wxPython. | |
4984 | """ | |
5b5c9bc7 | 4985 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
d55e5bfc | 4986 | |
bb4524c4 | 4987 | GetUniChar = GetUnicodeKey |
d55e5bfc | 4988 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
4989 | """ |
4990 | GetRawKeyCode(self) -> unsigned int | |
4991 | ||
4992 | Returns the raw key code for this event. This is a platform-dependent | |
4993 | scan code which should only be used in advanced | |
4994 | applications. Currently the raw key codes are not supported by all | |
4995 | ports. | |
4996 | """ | |
5b5c9bc7 | 4997 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
d55e5bfc RD |
4998 | |
4999 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
5000 | """ |
5001 | GetRawKeyFlags(self) -> unsigned int | |
5002 | ||
5003 | Returns the low level key flags for this event. The flags are | |
5004 | platform-dependent and should only be used in advanced applications. | |
5005 | Currently the raw key flags are not supported by all ports. | |
5006 | """ | |
5b5c9bc7 | 5007 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
d55e5bfc RD |
5008 | |
5009 | def GetPosition(*args, **kwargs): | |
5010 | """ | |
5b5c9bc7 | 5011 | GetPosition(self) -> Point |
d55e5bfc | 5012 | |
5ba5649b | 5013 | Find the position of the event, if applicable. |
d55e5bfc | 5014 | """ |
5b5c9bc7 | 5015 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
5016 | |
5017 | def GetPositionTuple(*args, **kwargs): | |
5018 | """ | |
5019 | GetPositionTuple() -> (x,y) | |
5020 | ||
5ba5649b | 5021 | Find the position of the event, if applicable. |
d55e5bfc | 5022 | """ |
5b5c9bc7 | 5023 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
d55e5bfc RD |
5024 | |
5025 | def GetX(*args, **kwargs): | |
5ba5649b RD |
5026 | """ |
5027 | GetX(self) -> int | |
5028 | ||
5029 | Returns the X position (in client coordinates) of the event, if | |
5030 | applicable. | |
5031 | """ | |
5b5c9bc7 | 5032 | return _core_.KeyEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
5033 | |
5034 | def GetY(*args, **kwargs): | |
5ba5649b RD |
5035 | """ |
5036 | GetY(self) -> int | |
5037 | ||
5038 | Returns the Y position (in client coordinates) of the event, if | |
5039 | applicable. | |
5040 | """ | |
5b5c9bc7 RD |
5041 | return _core_.KeyEvent_GetY(*args, **kwargs) |
5042 | ||
5043 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
5044 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
5045 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
5046 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
5047 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
5048 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
5049 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
5050 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
5051 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
5052 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
5053 | ||
5054 | class KeyEventPtr(KeyEvent): | |
d55e5bfc RD |
5055 | def __init__(self, this): |
5056 | self.this = this | |
5057 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5058 | self.__class__ = KeyEvent |
5059 | _core_.KeyEvent_swigregister(KeyEventPtr) | |
d55e5bfc RD |
5060 | |
5061 | #--------------------------------------------------------------------------- | |
5062 | ||
5b5c9bc7 | 5063 | class SizeEvent(Event): |
5ba5649b RD |
5064 | """ |
5065 | A size event holds information about size change events. The EVT_SIZE | |
5066 | handler function will be called when the window it is bound to has | |
5067 | been resized. | |
5068 | ||
5069 | Note that the size passed is of the whole window: call | |
5070 | `wx.Window.GetClientSize` for the area which may be used by the | |
5071 | application. | |
5072 | ||
5073 | When a window is resized, usually only a small part of the window is | |
5074 | damaged and and that area is all that is in the update region for the | |
5075 | next paint event. However, if your drawing depends on the size of the | |
5076 | window, you may need to clear the DC explicitly and repaint the whole | |
5077 | window. In which case, you may need to call `wx.Window.Refresh` to | |
5078 | invalidate the entire window. | |
5079 | ||
5080 | """ | |
d55e5bfc RD |
5081 | def __repr__(self): |
5082 | return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5083 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5084 | """ |
5085 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
5086 | ||
5087 | Construct a new ``wx.SizeEvent``. | |
5088 | """ | |
5b5c9bc7 | 5089 | newobj = _core_.new_SizeEvent(*args, **kwargs) |
d55e5bfc RD |
5090 | self.this = newobj.this |
5091 | self.thisown = 1 | |
5092 | del newobj.thisown | |
5093 | def GetSize(*args, **kwargs): | |
5ba5649b RD |
5094 | """ |
5095 | GetSize(self) -> Size | |
5096 | ||
5097 | Returns the entire size of the window generating the size change | |
5098 | event. | |
5099 | """ | |
5b5c9bc7 | 5100 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
d55e5bfc RD |
5101 | |
5102 | def GetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5103 | """GetRect(self) -> Rect""" |
5104 | return _core_.SizeEvent_GetRect(*args, **kwargs) | |
d55e5bfc RD |
5105 | |
5106 | def SetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5107 | """SetRect(self, Rect rect)""" |
5108 | return _core_.SizeEvent_SetRect(*args, **kwargs) | |
d55e5bfc RD |
5109 | |
5110 | def SetSize(*args, **kwargs): | |
5b5c9bc7 RD |
5111 | """SetSize(self, Size size)""" |
5112 | return _core_.SizeEvent_SetSize(*args, **kwargs) | |
d55e5bfc | 5113 | |
5b5c9bc7 RD |
5114 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
5115 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
d55e5bfc | 5116 | |
5b5c9bc7 | 5117 | class SizeEventPtr(SizeEvent): |
d55e5bfc RD |
5118 | def __init__(self, this): |
5119 | self.this = this | |
5120 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5121 | self.__class__ = SizeEvent |
5122 | _core_.SizeEvent_swigregister(SizeEventPtr) | |
d55e5bfc RD |
5123 | |
5124 | #--------------------------------------------------------------------------- | |
5125 | ||
5b5c9bc7 | 5126 | class MoveEvent(Event): |
5ba5649b RD |
5127 | """ |
5128 | This event object is sent for EVT_MOVE event bindings when a window is | |
5129 | moved to a new position. | |
5130 | """ | |
d55e5bfc RD |
5131 | def __repr__(self): |
5132 | return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5133 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5134 | """ |
5135 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5136 | ||
5137 | Constructor. | |
5138 | """ | |
5b5c9bc7 | 5139 | newobj = _core_.new_MoveEvent(*args, **kwargs) |
d55e5bfc RD |
5140 | self.this = newobj.this |
5141 | self.thisown = 1 | |
5142 | del newobj.thisown | |
5143 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
5144 | """ |
5145 | GetPosition(self) -> Point | |
5146 | ||
5147 | Returns the position of the window generating the move change event. | |
5148 | """ | |
5b5c9bc7 | 5149 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
5150 | |
5151 | def GetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5152 | """GetRect(self) -> Rect""" |
5153 | return _core_.MoveEvent_GetRect(*args, **kwargs) | |
d55e5bfc RD |
5154 | |
5155 | def SetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5156 | """SetRect(self, Rect rect)""" |
5157 | return _core_.MoveEvent_SetRect(*args, **kwargs) | |
d55e5bfc RD |
5158 | |
5159 | def SetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
5160 | """SetPosition(self, Point pos)""" |
5161 | return _core_.MoveEvent_SetPosition(*args, **kwargs) | |
d55e5bfc | 5162 | |
fef4c27a RD |
5163 | m_pos = property(GetPosition, SetPosition) |
5164 | m_rect = property(GetRect, SetRect) | |
5165 | ||
d55e5bfc | 5166 | |
5b5c9bc7 | 5167 | class MoveEventPtr(MoveEvent): |
d55e5bfc RD |
5168 | def __init__(self, this): |
5169 | self.this = this | |
5170 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5171 | self.__class__ = MoveEvent |
5172 | _core_.MoveEvent_swigregister(MoveEventPtr) | |
d55e5bfc RD |
5173 | |
5174 | #--------------------------------------------------------------------------- | |
5175 | ||
5b5c9bc7 | 5176 | class PaintEvent(Event): |
5ba5649b RD |
5177 | """ |
5178 | A paint event is sent when a window's contents needs to be repainted. | |
5179 | Note that in an EVT_PAINT handler the application must *always* create | |
5180 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5181 | Windows assumes that the window has not been painted yet and will send | |
5182 | the event again, causing endless refreshes. | |
5183 | ||
5184 | You can optimize painting by retrieving the rectangles that have been | |
5185 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5186 | and only repainting these rectangles. The rectangles are in terms of | |
5187 | the client area, and are unscrolled, so you will need to do some | |
5188 | calculations using the current view position to obtain logical, | |
5189 | scrolled units. | |
5190 | ||
5191 | """ | |
d55e5bfc RD |
5192 | def __repr__(self): |
5193 | return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5194 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
5195 | """__init__(self, int Id=0) -> PaintEvent""" |
5196 | newobj = _core_.new_PaintEvent(*args, **kwargs) | |
d55e5bfc RD |
5197 | self.this = newobj.this |
5198 | self.thisown = 1 | |
5199 | del newobj.thisown | |
5200 | ||
5b5c9bc7 | 5201 | class PaintEventPtr(PaintEvent): |
d55e5bfc RD |
5202 | def __init__(self, this): |
5203 | self.this = this | |
5204 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5205 | self.__class__ = PaintEvent |
5206 | _core_.PaintEvent_swigregister(PaintEventPtr) | |
d55e5bfc | 5207 | |
5b5c9bc7 RD |
5208 | class NcPaintEvent(Event): |
5209 | """Proxy of C++ NcPaintEvent class""" | |
d55e5bfc RD |
5210 | def __repr__(self): |
5211 | return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5212 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
5213 | """__init__(self, int winid=0) -> NcPaintEvent""" |
5214 | newobj = _core_.new_NcPaintEvent(*args, **kwargs) | |
d55e5bfc RD |
5215 | self.this = newobj.this |
5216 | self.thisown = 1 | |
5217 | del newobj.thisown | |
5218 | ||
5b5c9bc7 | 5219 | class NcPaintEventPtr(NcPaintEvent): |
d55e5bfc RD |
5220 | def __init__(self, this): |
5221 | self.this = this | |
5222 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5223 | self.__class__ = NcPaintEvent |
5224 | _core_.NcPaintEvent_swigregister(NcPaintEventPtr) | |
d55e5bfc RD |
5225 | |
5226 | #--------------------------------------------------------------------------- | |
5227 | ||
5b5c9bc7 | 5228 | class EraseEvent(Event): |
5ba5649b RD |
5229 | """ |
5230 | An erase event is sent whenever the background of a window needs to be | |
5231 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5232 | binder. On some platforms, such as GTK+, this event is simulated | |
5233 | (simply generated just before the paint event) and may cause flicker. | |
5234 | ||
5235 | To paint a custom background use the `GetDC` method and use the returned | |
5236 | device context if it is not ``None``, otherwise create a temporary | |
5237 | `wx.ClientDC` and draw on that. | |
5238 | ||
5239 | """ | |
d55e5bfc RD |
5240 | def __repr__(self): |
5241 | return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5242 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5243 | """ |
5244 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5245 | ||
5246 | Constructor | |
5247 | """ | |
5b5c9bc7 | 5248 | newobj = _core_.new_EraseEvent(*args, **kwargs) |
d55e5bfc RD |
5249 | self.this = newobj.this |
5250 | self.thisown = 1 | |
5251 | del newobj.thisown | |
5252 | def GetDC(*args, **kwargs): | |
5ba5649b RD |
5253 | """ |
5254 | GetDC(self) -> DC | |
5255 | ||
5256 | Returns the device context the event handler should draw upon. If | |
5257 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5258 | that instead. | |
5259 | """ | |
5b5c9bc7 | 5260 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
d55e5bfc RD |
5261 | |
5262 | ||
5b5c9bc7 | 5263 | class EraseEventPtr(EraseEvent): |
d55e5bfc RD |
5264 | def __init__(self, this): |
5265 | self.this = this | |
5266 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5267 | self.__class__ = EraseEvent |
5268 | _core_.EraseEvent_swigregister(EraseEventPtr) | |
d55e5bfc RD |
5269 | |
5270 | #--------------------------------------------------------------------------- | |
5271 | ||
5b5c9bc7 | 5272 | class FocusEvent(Event): |
5ba5649b RD |
5273 | """ |
5274 | A focus event is sent when a window's focus changes. The window losing | |
5275 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5276 | gets an EVT_SET_FOCUS event. | |
5277 | ||
5278 | Notice that the set focus event happens both when the user gives focus | |
5279 | to the window (whether using the mouse or keyboard) and when it is | |
5280 | done from the program itself using `wx.Window.SetFocus`. | |
5281 | ||
5282 | """ | |
d55e5bfc RD |
5283 | def __repr__(self): |
5284 | return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5285 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5286 | """ |
5287 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent | |
5288 | ||
5289 | Constructor | |
5290 | """ | |
5b5c9bc7 | 5291 | newobj = _core_.new_FocusEvent(*args, **kwargs) |
d55e5bfc RD |
5292 | self.this = newobj.this |
5293 | self.thisown = 1 | |
5294 | del newobj.thisown | |
5295 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
5296 | """ |
5297 | GetWindow(self) -> Window | |
5298 | ||
5299 | Returns the other window associated with this event, that is the | |
5300 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5301 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5302 | ||
5303 | Warning: the window returned may be None! | |
5304 | """ | |
5b5c9bc7 | 5305 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
5306 | |
5307 | def SetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
5308 | """SetWindow(self, Window win)""" |
5309 | return _core_.FocusEvent_SetWindow(*args, **kwargs) | |
d55e5bfc RD |
5310 | |
5311 | ||
5b5c9bc7 | 5312 | class FocusEventPtr(FocusEvent): |
d55e5bfc RD |
5313 | def __init__(self, this): |
5314 | self.this = this | |
5315 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5316 | self.__class__ = FocusEvent |
5317 | _core_.FocusEvent_swigregister(FocusEventPtr) | |
d55e5bfc RD |
5318 | |
5319 | #--------------------------------------------------------------------------- | |
5320 | ||
5b5c9bc7 | 5321 | class ChildFocusEvent(CommandEvent): |
5ba5649b RD |
5322 | """ |
5323 | wx.ChildFocusEvent notifies the parent that a child has received the | |
5324 | focus. Unlike `wx.FocusEvent` it is propagated up the window | |
5325 | heirarchy. | |
5326 | """ | |
d55e5bfc RD |
5327 | def __repr__(self): |
5328 | return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5329 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5330 | """ |
5331 | __init__(self, Window win=None) -> ChildFocusEvent | |
5332 | ||
5333 | Constructor | |
5334 | """ | |
5b5c9bc7 | 5335 | newobj = _core_.new_ChildFocusEvent(*args, **kwargs) |
d55e5bfc RD |
5336 | self.this = newobj.this |
5337 | self.thisown = 1 | |
5338 | del newobj.thisown | |
5339 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
5340 | """ |
5341 | GetWindow(self) -> Window | |
5342 | ||
5343 | The window which has just received the focus. | |
5344 | """ | |
5b5c9bc7 | 5345 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
5346 | |
5347 | ||
5b5c9bc7 | 5348 | class ChildFocusEventPtr(ChildFocusEvent): |
d55e5bfc RD |
5349 | def __init__(self, this): |
5350 | self.this = this | |
5351 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5352 | self.__class__ = ChildFocusEvent |
5353 | _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr) | |
d55e5bfc RD |
5354 | |
5355 | #--------------------------------------------------------------------------- | |
5356 | ||
5b5c9bc7 | 5357 | class ActivateEvent(Event): |
5ba5649b RD |
5358 | """ |
5359 | An activate event is sent when a top-level window or the entire | |
5360 | application is being activated or deactivated. | |
5361 | ||
5362 | A top-level window (a dialog or frame) receives an activate event when | |
5363 | is being activated or deactivated. This is indicated visually by the | |
5364 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5365 | An application is activated or deactivated when one of its frames | |
5366 | becomes activated, or a frame becomes inactivate resulting in all | |
5367 | application frames being inactive. | |
5368 | ||
5369 | Please note that usually you should call event.Skip() in your handlers | |
5370 | for these events so the default handlers will still be called, as not | |
5371 | doing so can result in strange effects. | |
5372 | ||
5373 | """ | |
d55e5bfc RD |
5374 | def __repr__(self): |
5375 | return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5376 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5377 | """ |
5378 | __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent | |
5379 | ||
5380 | Constructor | |
5381 | """ | |
5b5c9bc7 | 5382 | newobj = _core_.new_ActivateEvent(*args, **kwargs) |
d55e5bfc RD |
5383 | self.this = newobj.this |
5384 | self.thisown = 1 | |
5385 | del newobj.thisown | |
5386 | def GetActive(*args, **kwargs): | |
5ba5649b RD |
5387 | """ |
5388 | GetActive(self) -> bool | |
5389 | ||
5390 | Returns true if the application or window is being activated, false | |
5391 | otherwise. | |
5392 | """ | |
5b5c9bc7 | 5393 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
d55e5bfc RD |
5394 | |
5395 | ||
5b5c9bc7 | 5396 | class ActivateEventPtr(ActivateEvent): |
d55e5bfc RD |
5397 | def __init__(self, this): |
5398 | self.this = this | |
5399 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5400 | self.__class__ = ActivateEvent |
5401 | _core_.ActivateEvent_swigregister(ActivateEventPtr) | |
d55e5bfc RD |
5402 | |
5403 | #--------------------------------------------------------------------------- | |
5404 | ||
5b5c9bc7 | 5405 | class InitDialogEvent(Event): |
5ba5649b RD |
5406 | """ |
5407 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5408 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5409 | event can transfer data to the window, or anything else that should be | |
5410 | done before the user begins editing the form. The default handler | |
5411 | calls `wx.Window.TransferDataToWindow`. | |
5412 | """ | |
d55e5bfc RD |
5413 | def __repr__(self): |
5414 | return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5415 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5416 | """ |
5417 | __init__(self, int Id=0) -> InitDialogEvent | |
5418 | ||
5419 | Constructor | |
5420 | """ | |
5b5c9bc7 | 5421 | newobj = _core_.new_InitDialogEvent(*args, **kwargs) |
d55e5bfc RD |
5422 | self.this = newobj.this |
5423 | self.thisown = 1 | |
5424 | del newobj.thisown | |
5425 | ||
5b5c9bc7 | 5426 | class InitDialogEventPtr(InitDialogEvent): |
d55e5bfc RD |
5427 | def __init__(self, this): |
5428 | self.this = this | |
5429 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5430 | self.__class__ = InitDialogEvent |
5431 | _core_.InitDialogEvent_swigregister(InitDialogEventPtr) | |
d55e5bfc RD |
5432 | |
5433 | #--------------------------------------------------------------------------- | |
5434 | ||
5b5c9bc7 | 5435 | class MenuEvent(Event): |
5ba5649b RD |
5436 | """ |
5437 | This class is used for a variety of menu-related events. Note that | |
5438 | these do not include menu command events, which are handled by sending | |
5439 | `wx.CommandEvent` objects. | |
5440 | ||
5441 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5442 | text in the first field of the status bar. | |
5443 | """ | |
d55e5bfc RD |
5444 | def __repr__(self): |
5445 | return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5446 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5447 | """ |
5448 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent | |
5449 | ||
5450 | Constructor | |
5451 | """ | |
5b5c9bc7 | 5452 | newobj = _core_.new_MenuEvent(*args, **kwargs) |
d55e5bfc RD |
5453 | self.this = newobj.this |
5454 | self.thisown = 1 | |
5455 | del newobj.thisown | |
5456 | def GetMenuId(*args, **kwargs): | |
5ba5649b RD |
5457 | """ |
5458 | GetMenuId(self) -> int | |
5459 | ||
5460 | Returns the menu identifier associated with the event. This method | |
5461 | should be only used with the HIGHLIGHT events. | |
5462 | """ | |
5b5c9bc7 | 5463 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
d55e5bfc RD |
5464 | |
5465 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5466 | """ |
5467 | IsPopup(self) -> bool | |
5468 | ||
5469 | Returns ``True`` if the menu which is being opened or closed is a | |
5470 | popup menu, ``False`` if it is a normal one. This method should only | |
5471 | be used with the OPEN and CLOSE events. | |
5472 | """ | |
5b5c9bc7 | 5473 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
d55e5bfc RD |
5474 | |
5475 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5476 | """ |
5477 | GetMenu(self) -> Menu | |
5478 | ||
5479 | Returns the menu which is being opened or closed. This method should | |
5480 | only be used with the OPEN and CLOSE events. | |
5481 | """ | |
5b5c9bc7 | 5482 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
d55e5bfc RD |
5483 | |
5484 | ||
5b5c9bc7 | 5485 | class MenuEventPtr(MenuEvent): |
d55e5bfc RD |
5486 | def __init__(self, this): |
5487 | self.this = this | |
5488 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5489 | self.__class__ = MenuEvent |
5490 | _core_.MenuEvent_swigregister(MenuEventPtr) | |
d55e5bfc RD |
5491 | |
5492 | #--------------------------------------------------------------------------- | |
5493 | ||
5b5c9bc7 | 5494 | class CloseEvent(Event): |
5ba5649b RD |
5495 | """ |
5496 | This event class contains information about window and session close | |
5497 | events. | |
5498 | ||
5499 | The handler function for EVT_CLOSE is called when the user has tried | |
5500 | to close a a frame or dialog box using the window manager controls or | |
5501 | the system menu. It can also be invoked by the application itself | |
5502 | programmatically, for example by calling the `wx.Window.Close` | |
5503 | function. | |
5504 | ||
5505 | You should check whether the application is forcing the deletion of | |
5506 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5507 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5508 | it is up to you whether you respond by destroying the window or not. | |
5509 | For example you may wish to display a message dialog prompting to save | |
5510 | files or to cancel the close. | |
5511 | ||
5512 | If you don't destroy the window, you should call `Veto` to let the | |
5513 | calling code know that you did not destroy the window. This allows the | |
5514 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5515 | on whether the close instruction was honored or not. | |
5516 | """ | |
d55e5bfc RD |
5517 | def __repr__(self): |
5518 | return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5519 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5520 | """ |
5521 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent | |
5522 | ||
5523 | Constructor. | |
5524 | """ | |
5b5c9bc7 | 5525 | newobj = _core_.new_CloseEvent(*args, **kwargs) |
d55e5bfc RD |
5526 | self.this = newobj.this |
5527 | self.thisown = 1 | |
5528 | del newobj.thisown | |
5529 | def SetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5530 | """ |
5531 | SetLoggingOff(self, bool logOff) | |
5532 | ||
5533 | Sets the 'logging off' flag. | |
5534 | """ | |
5b5c9bc7 | 5535 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
d55e5bfc RD |
5536 | |
5537 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5538 | """ |
5539 | GetLoggingOff(self) -> bool | |
5540 | ||
034e3677 RD |
5541 | Returns ``True`` if the user is logging off or ``False`` if the |
5542 | system is shutting down. This method can only be called for end | |
5543 | session and query end session events, it doesn't make sense for close | |
5544 | window event. | |
5ba5649b | 5545 | """ |
5b5c9bc7 | 5546 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
d55e5bfc RD |
5547 | |
5548 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5549 | """ |
5550 | Veto(self, bool veto=True) | |
5551 | ||
5552 | Call this from your event handler to veto a system shutdown or to | |
5553 | signal to the calling application that a window close did not happen. | |
5554 | ||
5555 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5556 | """ | |
5b5c9bc7 | 5557 | return _core_.CloseEvent_Veto(*args, **kwargs) |
d55e5bfc | 5558 | |
5ba5649b RD |
5559 | def GetVeto(*args, **kwargs): |
5560 | """GetVeto(self) -> bool""" | |
5561 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5562 | ||
d55e5bfc | 5563 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5564 | """ |
5565 | SetCanVeto(self, bool canVeto) | |
5566 | ||
5567 | Sets the 'can veto' flag. | |
5568 | """ | |
5b5c9bc7 | 5569 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
d55e5bfc RD |
5570 | |
5571 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5572 | """ |
5573 | CanVeto(self) -> bool | |
d55e5bfc | 5574 | |
5ba5649b RD |
5575 | Returns true if you can veto a system shutdown or a window close |
5576 | event. Vetoing a window close event is not possible if the calling | |
5577 | code wishes to force the application to exit, and so this function | |
5578 | must be called to check this. | |
5579 | """ | |
5580 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
d55e5bfc RD |
5581 | |
5582 | ||
5b5c9bc7 | 5583 | class CloseEventPtr(CloseEvent): |
d55e5bfc RD |
5584 | def __init__(self, this): |
5585 | self.this = this | |
5586 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5587 | self.__class__ = CloseEvent |
5588 | _core_.CloseEvent_swigregister(CloseEventPtr) | |
d55e5bfc RD |
5589 | |
5590 | #--------------------------------------------------------------------------- | |
5591 | ||
5b5c9bc7 | 5592 | class ShowEvent(Event): |
5ba5649b | 5593 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
d55e5bfc RD |
5594 | def __repr__(self): |
5595 | return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5596 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5597 | """ |
5598 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5599 | ||
5600 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5601 | """ | |
5b5c9bc7 | 5602 | newobj = _core_.new_ShowEvent(*args, **kwargs) |
d55e5bfc RD |
5603 | self.this = newobj.this |
5604 | self.thisown = 1 | |
5605 | del newobj.thisown | |
5606 | def SetShow(*args, **kwargs): | |
5607 | """SetShow(self, bool show)""" | |
5b5c9bc7 | 5608 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
d55e5bfc RD |
5609 | |
5610 | def GetShow(*args, **kwargs): | |
5611 | """GetShow(self) -> bool""" | |
5b5c9bc7 | 5612 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
d55e5bfc RD |
5613 | |
5614 | ||
5b5c9bc7 | 5615 | class ShowEventPtr(ShowEvent): |
d55e5bfc RD |
5616 | def __init__(self, this): |
5617 | self.this = this | |
5618 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5619 | self.__class__ = ShowEvent |
5620 | _core_.ShowEvent_swigregister(ShowEventPtr) | |
d55e5bfc RD |
5621 | |
5622 | #--------------------------------------------------------------------------- | |
5623 | ||
5b5c9bc7 | 5624 | class IconizeEvent(Event): |
5ba5649b RD |
5625 | """ |
5626 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5627 | restored. | |
5628 | """ | |
d55e5bfc RD |
5629 | def __repr__(self): |
5630 | return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5631 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5632 | """ |
5633 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5634 | ||
5635 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5636 | restored. | |
5637 | """ | |
5b5c9bc7 | 5638 | newobj = _core_.new_IconizeEvent(*args, **kwargs) |
d55e5bfc RD |
5639 | self.this = newobj.this |
5640 | self.thisown = 1 | |
5641 | del newobj.thisown | |
5642 | def Iconized(*args, **kwargs): | |
5ba5649b RD |
5643 | """ |
5644 | Iconized(self) -> bool | |
5645 | ||
5646 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5647 | been restored. | |
5648 | """ | |
5b5c9bc7 | 5649 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
d55e5bfc RD |
5650 | |
5651 | ||
5b5c9bc7 | 5652 | class IconizeEventPtr(IconizeEvent): |
d55e5bfc RD |
5653 | def __init__(self, this): |
5654 | self.this = this | |
5655 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5656 | self.__class__ = IconizeEvent |
5657 | _core_.IconizeEvent_swigregister(IconizeEventPtr) | |
d55e5bfc RD |
5658 | |
5659 | #--------------------------------------------------------------------------- | |
5660 | ||
5b5c9bc7 | 5661 | class MaximizeEvent(Event): |
5ba5649b | 5662 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
d55e5bfc RD |
5663 | def __repr__(self): |
5664 | return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5665 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5666 | """ |
5667 | __init__(self, int id=0) -> MaximizeEvent | |
5668 | ||
5669 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5670 | """ | |
5b5c9bc7 | 5671 | newobj = _core_.new_MaximizeEvent(*args, **kwargs) |
d55e5bfc RD |
5672 | self.this = newobj.this |
5673 | self.thisown = 1 | |
5674 | del newobj.thisown | |
5675 | ||
5b5c9bc7 | 5676 | class MaximizeEventPtr(MaximizeEvent): |
d55e5bfc RD |
5677 | def __init__(self, this): |
5678 | self.this = this | |
5679 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5680 | self.__class__ = MaximizeEvent |
5681 | _core_.MaximizeEvent_swigregister(MaximizeEventPtr) | |
d55e5bfc RD |
5682 | |
5683 | #--------------------------------------------------------------------------- | |
5684 | ||
5b5c9bc7 | 5685 | class DropFilesEvent(Event): |
5ba5649b RD |
5686 | """ |
5687 | This class is used for drop files events, that is, when files have | |
5688 | been dropped onto the window. This functionality is only available | |
5689 | under Windows. The window must have previously been enabled for | |
5690 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5691 | ||
5692 | Important note: this is a separate implementation to the more general | |
5693 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5694 | implementation uses the older, Windows message-based approach of | |
5695 | dropping files. | |
5696 | ||
5697 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5698 | events. | |
5699 | ||
5700 | """ | |
d55e5bfc RD |
5701 | def __init__(self): raise RuntimeError, "No constructor defined" |
5702 | def __repr__(self): | |
5703 | return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5704 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
5705 | """ |
5706 | GetPosition(self) -> Point | |
5707 | ||
5708 | Returns the position at which the files were dropped. | |
5709 | """ | |
5b5c9bc7 | 5710 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
5711 | |
5712 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5713 | """ |
5714 | GetNumberOfFiles(self) -> int | |
5715 | ||
5716 | Returns the number of files dropped. | |
5717 | """ | |
5b5c9bc7 | 5718 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
d55e5bfc RD |
5719 | |
5720 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5721 | """ |
5722 | GetFiles(self) -> PyObject | |
5723 | ||
5724 | Returns a list of the filenames that were dropped. | |
5725 | """ | |
5b5c9bc7 | 5726 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
d55e5bfc RD |
5727 | |
5728 | ||
5b5c9bc7 | 5729 | class DropFilesEventPtr(DropFilesEvent): |
d55e5bfc RD |
5730 | def __init__(self, this): |
5731 | self.this = this | |
5732 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5733 | self.__class__ = DropFilesEvent |
5734 | _core_.DropFilesEvent_swigregister(DropFilesEventPtr) | |
d55e5bfc RD |
5735 | |
5736 | #--------------------------------------------------------------------------- | |
5737 | ||
5b5c9bc7 RD |
5738 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
5739 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
5740 | class UpdateUIEvent(CommandEvent): | |
5ba5649b RD |
5741 | """ |
5742 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5743 | wxWidgets to give an application the chance to update various user | |
5744 | interface elements. | |
5745 | ||
5746 | Without update UI events, an application has to work hard to | |
5747 | check/uncheck, enable/disable, and set the text for elements such as | |
5748 | menu items and toolbar buttons. The code for doing this has to be | |
5749 | mixed up with the code that is invoked when an action is invoked for a | |
5750 | menu item or button. | |
5751 | ||
5752 | With update UI events, you define an event handler to look at the | |
5753 | state of the application and change UI elements accordingly. wxWidgets | |
5754 | will call your handler functions in idle time, so you don't have to | |
5755 | worry where to call this code. In addition to being a clearer and more | |
5756 | declarative method, it also means you don't have to worry whether | |
5757 | you're updating a toolbar or menubar identifier. The same handler can | |
5758 | update a menu item and toolbar button, if the ID values are the same. | |
5759 | ||
5760 | Instead of directly manipulating the menu or button, you call | |
5761 | functions in the event object, such as `Check`. wxWidgets will | |
5762 | determine whether such a call has been made, and which UI element to | |
5763 | update. | |
5764 | ||
5765 | These events will work for popup menus as well as menubars. Just | |
5766 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5767 | any UI events for the window that owns the menu. | |
5768 | ||
5769 | If you find that the overhead of UI update processing is affecting | |
5770 | your application, you can do one or both of the following: | |
5771 | ||
5772 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5773 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5774 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5775 | receive update events. No other windows will receive update | |
5776 | events. | |
5777 | ||
5778 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5779 | value to set the delay between updates. You may need to call | |
5780 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5781 | a dialog is about to be shown, in case the user sees a slight | |
5782 | delay before windows are updated. | |
5783 | ||
5784 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5785 | handler for a window does not affect this because the events are sent | |
5786 | from an internal idle handler. | |
5787 | ||
5788 | wxWidgets tries to optimize update events on some platforms. On | |
5789 | Windows and GTK+, events for menubar items are only sent when the menu | |
5790 | is about to be shown, and not in idle time. | |
5791 | ||
5792 | """ | |
d55e5bfc RD |
5793 | def __repr__(self): |
5794 | return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5795 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5796 | """ |
5797 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5798 | ||
5799 | Constructor | |
5800 | """ | |
5b5c9bc7 | 5801 | newobj = _core_.new_UpdateUIEvent(*args, **kwargs) |
d55e5bfc RD |
5802 | self.this = newobj.this |
5803 | self.thisown = 1 | |
5804 | del newobj.thisown | |
5805 | def GetChecked(*args, **kwargs): | |
5ba5649b RD |
5806 | """ |
5807 | GetChecked(self) -> bool | |
5808 | ||
5809 | Returns ``True`` if the UI element should be checked. | |
5810 | """ | |
5b5c9bc7 | 5811 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
d55e5bfc RD |
5812 | |
5813 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
5814 | """ |
5815 | GetEnabled(self) -> bool | |
5816 | ||
5817 | Returns ``True`` if the UI element should be enabled. | |
5818 | """ | |
5b5c9bc7 | 5819 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
d55e5bfc RD |
5820 | |
5821 | def GetText(*args, **kwargs): | |
5ba5649b RD |
5822 | """ |
5823 | GetText(self) -> String | |
5824 | ||
5825 | Returns the text that should be set for the UI element. | |
5826 | """ | |
5b5c9bc7 | 5827 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
d55e5bfc RD |
5828 | |
5829 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
5830 | """ |
5831 | GetSetText(self) -> bool | |
5832 | ||
5833 | Returns ``True`` if the application has called `SetText`. For | |
5834 | wxWidgets internal use only. | |
5835 | """ | |
5b5c9bc7 | 5836 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
d55e5bfc RD |
5837 | |
5838 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
5839 | """ |
5840 | GetSetChecked(self) -> bool | |
5841 | ||
5842 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
5843 | internal use only. | |
5844 | """ | |
5b5c9bc7 | 5845 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
d55e5bfc RD |
5846 | |
5847 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
5848 | """ |
5849 | GetSetEnabled(self) -> bool | |
5850 | ||
5851 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
5852 | internal use only. | |
5853 | """ | |
5b5c9bc7 | 5854 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
d55e5bfc RD |
5855 | |
5856 | def Check(*args, **kwargs): | |
5ba5649b RD |
5857 | """ |
5858 | Check(self, bool check) | |
5859 | ||
5860 | Check or uncheck the UI element. | |
5861 | """ | |
5b5c9bc7 | 5862 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
d55e5bfc RD |
5863 | |
5864 | def Enable(*args, **kwargs): | |
5ba5649b RD |
5865 | """ |
5866 | Enable(self, bool enable) | |
5867 | ||
5868 | Enable or disable the UI element. | |
5869 | """ | |
5b5c9bc7 | 5870 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
d55e5bfc RD |
5871 | |
5872 | def SetText(*args, **kwargs): | |
5ba5649b RD |
5873 | """ |
5874 | SetText(self, String text) | |
5875 | ||
5876 | Sets the text for this UI element. | |
5877 | """ | |
5b5c9bc7 | 5878 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
d55e5bfc RD |
5879 | |
5880 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5881 | """ |
5882 | SetUpdateInterval(long updateInterval) | |
5883 | ||
5884 | Sets the interval between updates in milliseconds. Set to -1 to | |
5885 | disable updates, or to 0 to update as frequently as possible. The | |
5886 | default is 0. | |
5887 | ||
5888 | Use this to reduce the overhead of UI update events if your | |
5889 | application has a lot of windows. If you set the value to -1 or | |
5890 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5891 | at appropriate points in your application, such as when a dialog is | |
5892 | about to be shown. | |
5893 | """ | |
5b5c9bc7 | 5894 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d55e5bfc RD |
5895 | |
5896 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
5897 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5898 | """ |
5899 | GetUpdateInterval() -> long | |
5900 | ||
5901 | Returns the current interval between updates in milliseconds. -1 | |
5902 | disables updates, 0 updates as frequently as possible. | |
5903 | """ | |
5b5c9bc7 | 5904 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
d55e5bfc RD |
5905 | |
5906 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
5907 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
5908 | """ |
5909 | CanUpdate(Window win) -> bool | |
5910 | ||
5911 | Returns ``True`` if it is appropriate to update (send UI update events | |
5912 | to) this window. | |
5913 | ||
5914 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5915 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5916 | events were last sent in idle time, and the update interval, to | |
5917 | determine whether events should be sent to this window now. By default | |
5918 | this will always return true because the update mode is initially | |
5919 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5920 | events will be sent as often as possible. You can reduce the frequency | |
5921 | that events are sent by changing the mode and/or setting an update | |
5922 | interval. | |
5923 | ||
5924 | """ | |
5b5c9bc7 | 5925 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d55e5bfc RD |
5926 | |
5927 | CanUpdate = staticmethod(CanUpdate) | |
5928 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
5929 | """ |
5930 | ResetUpdateTime() | |
5931 | ||
5932 | Used internally to reset the last-updated time to the current time. It | |
5933 | is assumed that update events are normally sent in idle time, so this | |
5934 | is called at the end of idle processing. | |
5935 | """ | |
5b5c9bc7 | 5936 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
d55e5bfc RD |
5937 | |
5938 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
5939 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
5940 | """ |
5941 | SetMode(int mode) | |
5942 | ||
5943 | Specify how wxWidgets will send update events: to all windows, or only | |
5944 | to those which specify that they will process the events. | |
5945 | ||
5946 | The mode may be one of the following values: | |
5947 | ||
5948 | ============================= ========================================== | |
5949 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5950 | is the default setting. | |
5951 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5952 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5953 | style set. | |
5954 | ============================= ========================================== | |
5955 | ||
5956 | """ | |
5b5c9bc7 | 5957 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d55e5bfc RD |
5958 | |
5959 | SetMode = staticmethod(SetMode) | |
5960 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
5961 | """ |
5962 | GetMode() -> int | |
5963 | ||
5964 | Returns a value specifying how wxWidgets will send update events: to | |
5965 | all windows, or only to those which specify that they will process the | |
5966 | events. | |
5967 | """ | |
5b5c9bc7 | 5968 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
d55e5bfc RD |
5969 | |
5970 | GetMode = staticmethod(GetMode) | |
5971 | ||
5b5c9bc7 | 5972 | class UpdateUIEventPtr(UpdateUIEvent): |
d55e5bfc RD |
5973 | def __init__(self, this): |
5974 | self.this = this | |
5975 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5976 | self.__class__ = UpdateUIEvent |
5977 | _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr) | |
d55e5bfc | 5978 | |
5b5c9bc7 | 5979 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
5ba5649b RD |
5980 | """ |
5981 | UpdateUIEvent_SetUpdateInterval(long updateInterval) | |
5982 | ||
5983 | Sets the interval between updates in milliseconds. Set to -1 to | |
5984 | disable updates, or to 0 to update as frequently as possible. The | |
5985 | default is 0. | |
5986 | ||
5987 | Use this to reduce the overhead of UI update events if your | |
5988 | application has a lot of windows. If you set the value to -1 or | |
5989 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5990 | at appropriate points in your application, such as when a dialog is | |
5991 | about to be shown. | |
5992 | """ | |
5b5c9bc7 | 5993 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d55e5bfc | 5994 | |
5b5c9bc7 | 5995 | def UpdateUIEvent_GetUpdateInterval(*args, **kwargs): |
5ba5649b RD |
5996 | """ |
5997 | UpdateUIEvent_GetUpdateInterval() -> long | |
5998 | ||
5999 | Returns the current interval between updates in milliseconds. -1 | |
6000 | disables updates, 0 updates as frequently as possible. | |
6001 | """ | |
5b5c9bc7 | 6002 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
d55e5bfc | 6003 | |
5b5c9bc7 | 6004 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
5ba5649b RD |
6005 | """ |
6006 | UpdateUIEvent_CanUpdate(Window win) -> bool | |
6007 | ||
6008 | Returns ``True`` if it is appropriate to update (send UI update events | |
6009 | to) this window. | |
6010 | ||
6011 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6012 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6013 | events were last sent in idle time, and the update interval, to | |
6014 | determine whether events should be sent to this window now. By default | |
6015 | this will always return true because the update mode is initially | |
6016 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6017 | events will be sent as often as possible. You can reduce the frequency | |
6018 | that events are sent by changing the mode and/or setting an update | |
6019 | interval. | |
6020 | ||
6021 | """ | |
5b5c9bc7 | 6022 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d55e5bfc | 6023 | |
5b5c9bc7 | 6024 | def UpdateUIEvent_ResetUpdateTime(*args, **kwargs): |
5ba5649b RD |
6025 | """ |
6026 | UpdateUIEvent_ResetUpdateTime() | |
6027 | ||
6028 | Used internally to reset the last-updated time to the current time. It | |
6029 | is assumed that update events are normally sent in idle time, so this | |
6030 | is called at the end of idle processing. | |
6031 | """ | |
5b5c9bc7 | 6032 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
d55e5bfc | 6033 | |
5b5c9bc7 | 6034 | def UpdateUIEvent_SetMode(*args, **kwargs): |
5ba5649b RD |
6035 | """ |
6036 | UpdateUIEvent_SetMode(int mode) | |
6037 | ||
6038 | Specify how wxWidgets will send update events: to all windows, or only | |
6039 | to those which specify that they will process the events. | |
6040 | ||
6041 | The mode may be one of the following values: | |
6042 | ||
6043 | ============================= ========================================== | |
6044 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6045 | is the default setting. | |
6046 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6047 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6048 | style set. | |
6049 | ============================= ========================================== | |
6050 | ||
6051 | """ | |
5b5c9bc7 | 6052 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d55e5bfc | 6053 | |
5b5c9bc7 | 6054 | def UpdateUIEvent_GetMode(*args, **kwargs): |
5ba5649b RD |
6055 | """ |
6056 | UpdateUIEvent_GetMode() -> int | |
6057 | ||
6058 | Returns a value specifying how wxWidgets will send update events: to | |
6059 | all windows, or only to those which specify that they will process the | |
6060 | events. | |
6061 | """ | |
5b5c9bc7 | 6062 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
d55e5bfc RD |
6063 | |
6064 | #--------------------------------------------------------------------------- | |
6065 | ||
5b5c9bc7 | 6066 | class SysColourChangedEvent(Event): |
5ba5649b RD |
6067 | """ |
6068 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
6069 | when the user changes the colour settings using the control | |
6070 | panel. This is only applicable under Windows. | |
6071 | ||
6072 | The default event handler for this event propagates the event to child | |
6073 | windows, since Windows only sends the events to top-level windows. If | |
6074 | intercepting this event for a top-level window, remember to call | |
6075 | `Skip` so the the base class handler will still be executed, or to | |
6076 | pass the event on to the window's children explicitly. | |
6077 | ||
6078 | """ | |
d55e5bfc RD |
6079 | def __repr__(self): |
6080 | return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6081 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6082 | """ |
6083 | __init__(self) -> SysColourChangedEvent | |
6084 | ||
6085 | Constructor | |
6086 | """ | |
5b5c9bc7 | 6087 | newobj = _core_.new_SysColourChangedEvent(*args, **kwargs) |
d55e5bfc RD |
6088 | self.this = newobj.this |
6089 | self.thisown = 1 | |
6090 | del newobj.thisown | |
6091 | ||
5b5c9bc7 | 6092 | class SysColourChangedEventPtr(SysColourChangedEvent): |
d55e5bfc RD |
6093 | def __init__(self, this): |
6094 | self.this = this | |
6095 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6096 | self.__class__ = SysColourChangedEvent |
6097 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr) | |
d55e5bfc RD |
6098 | |
6099 | #--------------------------------------------------------------------------- | |
6100 | ||
5b5c9bc7 | 6101 | class MouseCaptureChangedEvent(Event): |
5ba5649b RD |
6102 | """ |
6103 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
6104 | a window that loses its mouse capture. This is called even if | |
6105 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
6106 | this event allows an application to cater for unexpected capture | |
6107 | releases which might otherwise confuse mouse handling code. | |
6108 | ||
6109 | This event is implemented under Windows only. | |
6110 | """ | |
d55e5bfc RD |
6111 | def __repr__(self): |
6112 | return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6113 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6114 | """ |
6115 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
6116 | ||
6117 | Constructor | |
6118 | """ | |
5b5c9bc7 | 6119 | newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs) |
d55e5bfc RD |
6120 | self.this = newobj.this |
6121 | self.thisown = 1 | |
6122 | del newobj.thisown | |
6123 | def GetCapturedWindow(*args, **kwargs): | |
5ba5649b RD |
6124 | """ |
6125 | GetCapturedWindow(self) -> Window | |
6126 | ||
6127 | Returns the window that gained the capture, or ``None`` if it was a | |
6128 | non-wxWidgets window. | |
6129 | """ | |
5b5c9bc7 | 6130 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
d55e5bfc RD |
6131 | |
6132 | ||
5b5c9bc7 | 6133 | class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent): |
d55e5bfc RD |
6134 | def __init__(self, this): |
6135 | self.this = this | |
6136 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6137 | self.__class__ = MouseCaptureChangedEvent |
6138 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr) | |
d55e5bfc RD |
6139 | |
6140 | #--------------------------------------------------------------------------- | |
6141 | ||
5b5c9bc7 | 6142 | class DisplayChangedEvent(Event): |
5ba5649b RD |
6143 | """ |
6144 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
6145 | resolution has changed. | |
6146 | ||
6147 | This event is implemented under Windows only. | |
6148 | """ | |
d55e5bfc RD |
6149 | def __repr__(self): |
6150 | return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6151 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
6152 | """__init__(self) -> DisplayChangedEvent""" |
6153 | newobj = _core_.new_DisplayChangedEvent(*args, **kwargs) | |
d55e5bfc RD |
6154 | self.this = newobj.this |
6155 | self.thisown = 1 | |
6156 | del newobj.thisown | |
6157 | ||
5b5c9bc7 | 6158 | class DisplayChangedEventPtr(DisplayChangedEvent): |
d55e5bfc RD |
6159 | def __init__(self, this): |
6160 | self.this = this | |
6161 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6162 | self.__class__ = DisplayChangedEvent |
6163 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr) | |
d55e5bfc RD |
6164 | |
6165 | #--------------------------------------------------------------------------- | |
6166 | ||
5b5c9bc7 | 6167 | class PaletteChangedEvent(Event): |
5ba5649b RD |
6168 | """ |
6169 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6170 | changed, thereby giving each window a chance to redo their own to | |
6171 | match. | |
6172 | ||
6173 | This event is implemented under Windows only. | |
6174 | """ | |
d55e5bfc RD |
6175 | def __repr__(self): |
6176 | return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6177 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6178 | """ |
6179 | __init__(self, int id=0) -> PaletteChangedEvent | |
6180 | ||
6181 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6182 | changed, thereby giving each window a chance to redo their own to | |
6183 | match. | |
6184 | ||
6185 | This event is implemented under Windows only. | |
6186 | """ | |
5b5c9bc7 | 6187 | newobj = _core_.new_PaletteChangedEvent(*args, **kwargs) |
d55e5bfc RD |
6188 | self.this = newobj.this |
6189 | self.thisown = 1 | |
6190 | del newobj.thisown | |
6191 | def SetChangedWindow(*args, **kwargs): | |
5b5c9bc7 RD |
6192 | """SetChangedWindow(self, Window win)""" |
6193 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) | |
d55e5bfc RD |
6194 | |
6195 | def GetChangedWindow(*args, **kwargs): | |
5b5c9bc7 RD |
6196 | """GetChangedWindow(self) -> Window""" |
6197 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) | |
d55e5bfc RD |
6198 | |
6199 | ||
5b5c9bc7 | 6200 | class PaletteChangedEventPtr(PaletteChangedEvent): |
d55e5bfc RD |
6201 | def __init__(self, this): |
6202 | self.this = this | |
6203 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6204 | self.__class__ = PaletteChangedEvent |
6205 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr) | |
d55e5bfc RD |
6206 | |
6207 | #--------------------------------------------------------------------------- | |
6208 | ||
5b5c9bc7 | 6209 | class QueryNewPaletteEvent(Event): |
5ba5649b RD |
6210 | """ |
6211 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6212 | focus and should re-do its palette. | |
6213 | ||
6214 | This event is implemented under Windows only. | |
6215 | """ | |
d55e5bfc RD |
6216 | def __repr__(self): |
6217 | return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6218 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6219 | """ |
6220 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6221 | ||
6222 | Constructor. | |
6223 | """ | |
5b5c9bc7 | 6224 | newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs) |
d55e5bfc RD |
6225 | self.this = newobj.this |
6226 | self.thisown = 1 | |
6227 | del newobj.thisown | |
6228 | def SetPaletteRealized(*args, **kwargs): | |
5ba5649b RD |
6229 | """ |
6230 | SetPaletteRealized(self, bool realized) | |
6231 | ||
6232 | App should set this if it changes the palette. | |
6233 | """ | |
5b5c9bc7 | 6234 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
d55e5bfc RD |
6235 | |
6236 | def GetPaletteRealized(*args, **kwargs): | |
6237 | """GetPaletteRealized(self) -> bool""" | |
5b5c9bc7 | 6238 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
d55e5bfc RD |
6239 | |
6240 | ||
5b5c9bc7 | 6241 | class QueryNewPaletteEventPtr(QueryNewPaletteEvent): |
d55e5bfc RD |
6242 | def __init__(self, this): |
6243 | self.this = this | |
6244 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6245 | self.__class__ = QueryNewPaletteEvent |
6246 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr) | |
d55e5bfc RD |
6247 | |
6248 | #--------------------------------------------------------------------------- | |
6249 | ||
5b5c9bc7 | 6250 | class NavigationKeyEvent(Event): |
5ba5649b RD |
6251 | """ |
6252 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6253 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6254 | catch navigation events in applications as there are already | |
6255 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6256 | it useful to send navigation events in certain situations to change | |
6257 | the focus in certain ways, although it's probably easier to just call | |
6258 | `wx.Window.Navigate`. | |
6259 | """ | |
d55e5bfc RD |
6260 | def __repr__(self): |
6261 | return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6262 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
6263 | """__init__(self) -> NavigationKeyEvent""" |
6264 | newobj = _core_.new_NavigationKeyEvent(*args, **kwargs) | |
d55e5bfc RD |
6265 | self.this = newobj.this |
6266 | self.thisown = 1 | |
6267 | del newobj.thisown | |
6268 | def GetDirection(*args, **kwargs): | |
5ba5649b RD |
6269 | """ |
6270 | GetDirection(self) -> bool | |
6271 | ||
6272 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6273 | """ | |
5b5c9bc7 | 6274 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
d55e5bfc RD |
6275 | |
6276 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6277 | """ |
6278 | SetDirection(self, bool forward) | |
6279 | ||
6280 | Specify the direction that the navigation should take. Usually the | |
6281 | difference between using Tab and Shift-Tab. | |
6282 | """ | |
5b5c9bc7 | 6283 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
d55e5bfc RD |
6284 | |
6285 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6286 | """ |
6287 | IsWindowChange(self) -> bool | |
6288 | ||
6289 | Returns ``True`` if window change is allowed. | |
6290 | """ | |
5b5c9bc7 | 6291 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
d55e5bfc RD |
6292 | |
6293 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6294 | """ |
6295 | SetWindowChange(self, bool ischange) | |
6296 | ||
6297 | Specify if the navigation should be able to change parent windows. | |
6298 | For example, changing notebook pages, etc. This is usually implemented | |
6299 | by using Control-Tab. | |
6300 | """ | |
5b5c9bc7 | 6301 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
d55e5bfc | 6302 | |
68350608 | 6303 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6304 | """ |
6305 | IsFromTab(self) -> bool | |
6306 | ||
6307 | Returns ``True`` if the navigation event is originated from the Tab | |
6308 | key. | |
6309 | """ | |
5b5c9bc7 | 6310 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
68350608 RD |
6311 | |
6312 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6313 | """ |
6314 | SetFromTab(self, bool bIs) | |
6315 | ||
6316 | Set to true under MSW if the event was generated using the tab key. | |
6317 | This is required for proper navogation over radio buttons. | |
6318 | """ | |
5b5c9bc7 | 6319 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
68350608 | 6320 | |
908b74cd | 6321 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6322 | """ |
6323 | SetFlags(self, long flags) | |
6324 | ||
6325 | Set the navigation flags to a combination of the following: | |
6326 | ||
6327 | * wx.NavigationKeyEvent.IsBackward | |
6328 | * wx.NavigationKeyEvent.IsForward | |
6329 | * wx.NavigationKeyEvent.WinChange | |
6330 | * wx.NavigationKeyEvent.FromTab | |
6331 | ||
6332 | """ | |
5b5c9bc7 | 6333 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
908b74cd | 6334 | |
d55e5bfc | 6335 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6336 | """ |
6337 | GetCurrentFocus(self) -> Window | |
6338 | ||
6339 | Returns the child window which currenty has the focus. May be | |
6340 | ``None``. | |
6341 | """ | |
5b5c9bc7 | 6342 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
d55e5bfc RD |
6343 | |
6344 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6345 | """ |
6346 | SetCurrentFocus(self, Window win) | |
6347 | ||
6348 | Set the window that has the focus. | |
6349 | """ | |
5b5c9bc7 | 6350 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
d55e5bfc | 6351 | |
5b5c9bc7 RD |
6352 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
6353 | IsForward = _core_.NavigationKeyEvent_IsForward | |
6354 | WinChange = _core_.NavigationKeyEvent_WinChange | |
6355 | FromTab = _core_.NavigationKeyEvent_FromTab | |
d55e5bfc | 6356 | |
5b5c9bc7 | 6357 | class NavigationKeyEventPtr(NavigationKeyEvent): |
d55e5bfc RD |
6358 | def __init__(self, this): |
6359 | self.this = this | |
6360 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6361 | self.__class__ = NavigationKeyEvent |
6362 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr) | |
d55e5bfc RD |
6363 | |
6364 | #--------------------------------------------------------------------------- | |
6365 | ||
5b5c9bc7 | 6366 | class WindowCreateEvent(CommandEvent): |
5ba5649b RD |
6367 | """ |
6368 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6369 | underlying GUI object) exists. | |
6370 | """ | |
d55e5bfc RD |
6371 | def __repr__(self): |
6372 | return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6373 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6374 | """ |
6375 | __init__(self, Window win=None) -> WindowCreateEvent | |
6376 | ||
6377 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6378 | underlying GUI object) exists. | |
6379 | """ | |
5b5c9bc7 | 6380 | newobj = _core_.new_WindowCreateEvent(*args, **kwargs) |
d55e5bfc RD |
6381 | self.this = newobj.this |
6382 | self.thisown = 1 | |
6383 | del newobj.thisown | |
6384 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
6385 | """ |
6386 | GetWindow(self) -> Window | |
6387 | ||
6388 | Returns the window that this event refers to. | |
6389 | """ | |
5b5c9bc7 | 6390 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
6391 | |
6392 | ||
5b5c9bc7 | 6393 | class WindowCreateEventPtr(WindowCreateEvent): |
d55e5bfc RD |
6394 | def __init__(self, this): |
6395 | self.this = this | |
6396 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6397 | self.__class__ = WindowCreateEvent |
6398 | _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr) | |
d55e5bfc | 6399 | |
5b5c9bc7 | 6400 | class WindowDestroyEvent(CommandEvent): |
5ba5649b RD |
6401 | """ |
6402 | The EVT_WINDOW_DESTROY event is sent right before the window is | |
6403 | destroyed. | |
6404 | """ | |
d55e5bfc RD |
6405 | def __repr__(self): |
6406 | return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6407 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6408 | """ |
6409 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6410 | ||
6411 | The EVT_WINDOW_DESTROY event is sent right before the window is | |
6412 | destroyed. | |
6413 | """ | |
5b5c9bc7 | 6414 | newobj = _core_.new_WindowDestroyEvent(*args, **kwargs) |
d55e5bfc RD |
6415 | self.this = newobj.this |
6416 | self.thisown = 1 | |
6417 | del newobj.thisown | |
6418 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
6419 | """ |
6420 | GetWindow(self) -> Window | |
6421 | ||
6422 | Returns the window that this event refers to. | |
6423 | """ | |
5b5c9bc7 | 6424 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
6425 | |
6426 | ||
5b5c9bc7 | 6427 | class WindowDestroyEventPtr(WindowDestroyEvent): |
d55e5bfc RD |
6428 | def __init__(self, this): |
6429 | self.this = this | |
6430 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6431 | self.__class__ = WindowDestroyEvent |
6432 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr) | |
d55e5bfc RD |
6433 | |
6434 | #--------------------------------------------------------------------------- | |
6435 | ||
5b5c9bc7 | 6436 | class ContextMenuEvent(CommandEvent): |
5ba5649b RD |
6437 | """ |
6438 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6439 | give the application a chance to show a context (popup) menu. | |
6440 | """ | |
d55e5bfc RD |
6441 | def __repr__(self): |
6442 | return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6443 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6444 | """ |
6445 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent | |
6446 | ||
6447 | Constructor. | |
6448 | """ | |
5b5c9bc7 | 6449 | newobj = _core_.new_ContextMenuEvent(*args, **kwargs) |
d55e5bfc RD |
6450 | self.this = newobj.this |
6451 | self.thisown = 1 | |
6452 | del newobj.thisown | |
6453 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
6454 | """ |
6455 | GetPosition(self) -> Point | |
6456 | ||
6457 | Returns the position (in screen coordinants) at which the menu should | |
6458 | be shown. | |
6459 | """ | |
5b5c9bc7 | 6460 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
6461 | |
6462 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6463 | """ |
6464 | SetPosition(self, Point pos) | |
6465 | ||
6466 | Sets the position at which the menu should be shown. | |
6467 | """ | |
5b5c9bc7 | 6468 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
d55e5bfc RD |
6469 | |
6470 | ||
5b5c9bc7 | 6471 | class ContextMenuEventPtr(ContextMenuEvent): |
d55e5bfc RD |
6472 | def __init__(self, this): |
6473 | self.this = this | |
6474 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6475 | self.__class__ = ContextMenuEvent |
6476 | _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr) | |
d55e5bfc RD |
6477 | |
6478 | #--------------------------------------------------------------------------- | |
6479 | ||
5b5c9bc7 RD |
6480 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6481 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
6482 | class IdleEvent(Event): | |
5ba5649b RD |
6483 | """ |
6484 | This class is used for EVT_IDLE events, which are generated and sent | |
6485 | when the application *becomes* idle. In other words, the when the | |
6486 | event queue becomes empty then idle events are sent to all windows (by | |
6487 | default) and as long as none of them call `RequestMore` then there are | |
6488 | no more idle events until after the system event queue has some normal | |
6489 | events and then becomes empty again. | |
6490 | ||
6491 | By default, idle events are sent to all windows. If this is causing a | |
6492 | significant overhead in your application, you can call | |
6493 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6494 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6495 | which should receive idle events. Then idle events will only be sent | |
6496 | to those windows and not to any others. | |
6497 | """ | |
d55e5bfc RD |
6498 | def __repr__(self): |
6499 | return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6500 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6501 | """ |
6502 | __init__(self) -> IdleEvent | |
6503 | ||
6504 | Constructor | |
6505 | """ | |
5b5c9bc7 | 6506 | newobj = _core_.new_IdleEvent(*args, **kwargs) |
d55e5bfc RD |
6507 | self.this = newobj.this |
6508 | self.thisown = 1 | |
6509 | del newobj.thisown | |
6510 | def RequestMore(*args, **kwargs): | |
5ba5649b RD |
6511 | """ |
6512 | RequestMore(self, bool needMore=True) | |
6513 | ||
6514 | Tells wxWidgets that more processing is required. This function can be | |
6515 | called by an EVT_IDLE handler for a window to indicate that the | |
6516 | application should forward the EVT_IDLE event once more to the | |
6517 | application windows. If no window calls this function during its | |
6518 | EVT_IDLE handler, then the application will remain in a passive event | |
6519 | loop until a new event is posted to the application by the windowing | |
6520 | system. | |
6521 | """ | |
5b5c9bc7 | 6522 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
d55e5bfc RD |
6523 | |
6524 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6525 | """ |
6526 | MoreRequested(self) -> bool | |
6527 | ||
6528 | Returns ``True`` if the OnIdle function processing this event | |
6529 | requested more processing time. | |
6530 | """ | |
5b5c9bc7 | 6531 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
d55e5bfc RD |
6532 | |
6533 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6534 | """ |
6535 | SetMode(int mode) | |
6536 | ||
6537 | Static method for specifying how wxWidgets will send idle events: to | |
6538 | all windows, or only to those which specify that they will process the | |
6539 | events. | |
6540 | ||
6541 | The mode can be one of the following values: | |
6542 | ||
6543 | ========================= ======================================== | |
6544 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6545 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6546 | the wx.WS_EX_PROCESS_IDLE extra style | |
6547 | flag set. | |
6548 | ========================= ======================================== | |
6549 | ||
6550 | """ | |
5b5c9bc7 | 6551 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d55e5bfc RD |
6552 | |
6553 | SetMode = staticmethod(SetMode) | |
6554 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6555 | """ |
6556 | GetMode() -> int | |
6557 | ||
6558 | Static method returning a value specifying how wxWidgets will send | |
6559 | idle events: to all windows, or only to those which specify that they | |
6560 | will process the events. | |
6561 | """ | |
5b5c9bc7 | 6562 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
d55e5bfc RD |
6563 | |
6564 | GetMode = staticmethod(GetMode) | |
6565 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6566 | """ |
6567 | CanSend(Window win) -> bool | |
6568 | ||
6569 | Returns ``True`` if it is appropriate to send idle events to this | |
6570 | window. | |
6571 | ||
6572 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6573 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6574 | events should be sent to this window now. By default this will always | |
6575 | return ``True`` because the update mode is initially | |
6576 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6577 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6578 | """ | |
5b5c9bc7 | 6579 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d55e5bfc RD |
6580 | |
6581 | CanSend = staticmethod(CanSend) | |
6582 | ||
5b5c9bc7 | 6583 | class IdleEventPtr(IdleEvent): |
d55e5bfc RD |
6584 | def __init__(self, this): |
6585 | self.this = this | |
6586 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6587 | self.__class__ = IdleEvent |
6588 | _core_.IdleEvent_swigregister(IdleEventPtr) | |
d55e5bfc | 6589 | |
5b5c9bc7 | 6590 | def IdleEvent_SetMode(*args, **kwargs): |
5ba5649b RD |
6591 | """ |
6592 | IdleEvent_SetMode(int mode) | |
6593 | ||
6594 | Static method for specifying how wxWidgets will send idle events: to | |
6595 | all windows, or only to those which specify that they will process the | |
6596 | events. | |
6597 | ||
6598 | The mode can be one of the following values: | |
6599 | ||
6600 | ========================= ======================================== | |
6601 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6602 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6603 | the wx.WS_EX_PROCESS_IDLE extra style | |
6604 | flag set. | |
6605 | ========================= ======================================== | |
6606 | ||
6607 | """ | |
5b5c9bc7 | 6608 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d55e5bfc | 6609 | |
5b5c9bc7 | 6610 | def IdleEvent_GetMode(*args, **kwargs): |
5ba5649b RD |
6611 | """ |
6612 | IdleEvent_GetMode() -> int | |
6613 | ||
6614 | Static method returning a value specifying how wxWidgets will send | |
6615 | idle events: to all windows, or only to those which specify that they | |
6616 | will process the events. | |
6617 | """ | |
5b5c9bc7 | 6618 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
d55e5bfc | 6619 | |
5b5c9bc7 | 6620 | def IdleEvent_CanSend(*args, **kwargs): |
5ba5649b RD |
6621 | """ |
6622 | IdleEvent_CanSend(Window win) -> bool | |
6623 | ||
6624 | Returns ``True`` if it is appropriate to send idle events to this | |
6625 | window. | |
6626 | ||
6627 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6628 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6629 | events should be sent to this window now. By default this will always | |
6630 | return ``True`` because the update mode is initially | |
6631 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6632 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6633 | """ | |
5b5c9bc7 | 6634 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d55e5bfc RD |
6635 | |
6636 | #--------------------------------------------------------------------------- | |
6637 | ||
5b5c9bc7 | 6638 | class PyEvent(Event): |
5ba5649b RD |
6639 | """ |
6640 | wx.PyEvent can be used as a base class for implementing custom event | |
6641 | types in Python. You should derived from this class instead of | |
6642 | `wx.Event` because this class is Python-aware and is able to transport | |
6643 | its Python bits safely through the wxWidgets event system and have | |
6644 | them still be there when the event handler is invoked. | |
6645 | ||
6646 | :see: `wx.PyCommandEvent` | |
6647 | ||
6648 | """ | |
d55e5bfc RD |
6649 | def __repr__(self): |
6650 | return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6651 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6652 | """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent""" |
5b5c9bc7 | 6653 | newobj = _core_.new_PyEvent(*args, **kwargs) |
d55e5bfc RD |
6654 | self.this = newobj.this |
6655 | self.thisown = 1 | |
6656 | del newobj.thisown | |
5ba5649b | 6657 | self._SetSelf(self) |
d55e5bfc | 6658 | |
5b5c9bc7 | 6659 | def __del__(self, destroy=_core_.delete_PyEvent): |
d55e5bfc RD |
6660 | """__del__(self)""" |
6661 | try: | |
6662 | if self.thisown: destroy(self) | |
6663 | except: pass | |
6664 | ||
5ba5649b RD |
6665 | def _SetSelf(*args, **kwargs): |
6666 | """_SetSelf(self, PyObject self)""" | |
6667 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
d55e5bfc | 6668 | |
5ba5649b RD |
6669 | def _GetSelf(*args, **kwargs): |
6670 | """_GetSelf(self) -> PyObject""" | |
6671 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
d55e5bfc RD |
6672 | |
6673 | ||
5b5c9bc7 | 6674 | class PyEventPtr(PyEvent): |
d55e5bfc RD |
6675 | def __init__(self, this): |
6676 | self.this = this | |
6677 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6678 | self.__class__ = PyEvent |
6679 | _core_.PyEvent_swigregister(PyEventPtr) | |
d55e5bfc | 6680 | |
5b5c9bc7 | 6681 | class PyCommandEvent(CommandEvent): |
5ba5649b RD |
6682 | """ |
6683 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6684 | event types in Python, where the event shoudl travel up to parent | |
6685 | windows looking for a handler. You should derived from this class | |
6686 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6687 | able to transport its Python bits safely through the wxWidgets event | |
6688 | system and have them still be there when the event handler is invoked. | |
6689 | ||
6690 | :see: `wx.PyEvent` | |
6691 | ||
6692 | """ | |
d55e5bfc RD |
6693 | def __repr__(self): |
6694 | return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6695 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6696 | """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
5b5c9bc7 | 6697 | newobj = _core_.new_PyCommandEvent(*args, **kwargs) |
d55e5bfc RD |
6698 | self.this = newobj.this |
6699 | self.thisown = 1 | |
6700 | del newobj.thisown | |
5ba5649b | 6701 | self._SetSelf(self) |
d55e5bfc | 6702 | |
5b5c9bc7 | 6703 | def __del__(self, destroy=_core_.delete_PyCommandEvent): |
d55e5bfc RD |
6704 | """__del__(self)""" |
6705 | try: | |
6706 | if self.thisown: destroy(self) | |
6707 | except: pass | |
6708 | ||
5ba5649b RD |
6709 | def _SetSelf(*args, **kwargs): |
6710 | """_SetSelf(self, PyObject self)""" | |
6711 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
d55e5bfc | 6712 | |
5ba5649b RD |
6713 | def _GetSelf(*args, **kwargs): |
6714 | """_GetSelf(self) -> PyObject""" | |
6715 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
d55e5bfc RD |
6716 | |
6717 | ||
5b5c9bc7 | 6718 | class PyCommandEventPtr(PyCommandEvent): |
d55e5bfc RD |
6719 | def __init__(self, this): |
6720 | self.this = this | |
6721 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6722 | self.__class__ = PyCommandEvent |
6723 | _core_.PyCommandEvent_swigregister(PyCommandEventPtr) | |
d55e5bfc | 6724 | |
5b5c9bc7 | 6725 | class DateEvent(CommandEvent): |
5ba5649b RD |
6726 | """ |
6727 | This event class holds information about a date change event and is | |
6728 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6729 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6730 | EVT_DATE_CHANGED. | |
6731 | """ | |
53aa7709 RD |
6732 | def __repr__(self): |
6733 | return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6734 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
6735 | """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent""" |
6736 | newobj = _core_.new_DateEvent(*args, **kwargs) | |
53aa7709 RD |
6737 | self.this = newobj.this |
6738 | self.thisown = 1 | |
6739 | del newobj.thisown | |
6740 | def GetDate(*args, **kwargs): | |
5ba5649b RD |
6741 | """ |
6742 | GetDate(self) -> DateTime | |
6743 | ||
6744 | Returns the date. | |
6745 | """ | |
5b5c9bc7 | 6746 | return _core_.DateEvent_GetDate(*args, **kwargs) |
53aa7709 RD |
6747 | |
6748 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6749 | """ |
6750 | SetDate(self, DateTime date) | |
6751 | ||
6752 | Sets the date carried by the event, normally only used by the library | |
6753 | internally. | |
6754 | """ | |
5b5c9bc7 | 6755 | return _core_.DateEvent_SetDate(*args, **kwargs) |
53aa7709 RD |
6756 | |
6757 | ||
5b5c9bc7 | 6758 | class DateEventPtr(DateEvent): |
53aa7709 RD |
6759 | def __init__(self, this): |
6760 | self.this = this | |
6761 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6762 | self.__class__ = DateEvent |
6763 | _core_.DateEvent_swigregister(DateEventPtr) | |
53aa7709 | 6764 | |
5b5c9bc7 | 6765 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED |
53aa7709 RD |
6766 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) |
6767 | ||
d55e5bfc RD |
6768 | #--------------------------------------------------------------------------- |
6769 | ||
5b5c9bc7 RD |
6770 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
6771 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6772 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6773 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6774 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6775 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
6776 | class PyApp(EvtHandler): | |
d6c14a4c RD |
6777 | """ |
6778 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6779 | `wx.App` class (or some other derived class) instead. | |
6780 | """ | |
d55e5bfc RD |
6781 | def __repr__(self): |
6782 | return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6783 | def __init__(self, *args, **kwargs): | |
6784 | """ | |
5b5c9bc7 | 6785 | __init__(self) -> PyApp |
d55e5bfc RD |
6786 | |
6787 | Create a new application object, starting the bootstrap process. | |
6788 | """ | |
5b5c9bc7 | 6789 | newobj = _core_.new_PyApp(*args, **kwargs) |
d55e5bfc RD |
6790 | self.this = newobj.this |
6791 | self.thisown = 1 | |
6792 | del newobj.thisown | |
7993762b RD |
6793 | self._setCallbackInfo(self, PyApp, False) |
6794 | self._setOORInfo(self, False) | |
d55e5bfc | 6795 | |
5b5c9bc7 | 6796 | def __del__(self, destroy=_core_.delete_PyApp): |
d55e5bfc RD |
6797 | """__del__(self)""" |
6798 | try: | |
6799 | if self.thisown: destroy(self) | |
6800 | except: pass | |
6801 | ||
6802 | def _setCallbackInfo(*args, **kwargs): | |
7993762b | 6803 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
5b5c9bc7 | 6804 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
6805 | |
6806 | def GetAppName(*args, **kwargs): | |
6807 | """ | |
5b5c9bc7 | 6808 | GetAppName(self) -> String |
d55e5bfc RD |
6809 | |
6810 | Get the application name. | |
6811 | """ | |
5b5c9bc7 | 6812 | return _core_.PyApp_GetAppName(*args, **kwargs) |
d55e5bfc RD |
6813 | |
6814 | def SetAppName(*args, **kwargs): | |
6815 | """ | |
5b5c9bc7 | 6816 | SetAppName(self, String name) |
d55e5bfc | 6817 | |
d6c14a4c RD |
6818 | Set the application name. This value may be used automatically by |
6819 | `wx.Config` and such. | |
d55e5bfc | 6820 | """ |
5b5c9bc7 | 6821 | return _core_.PyApp_SetAppName(*args, **kwargs) |
d55e5bfc RD |
6822 | |
6823 | def GetClassName(*args, **kwargs): | |
6824 | """ | |
5b5c9bc7 | 6825 | GetClassName(self) -> String |
d55e5bfc RD |
6826 | |
6827 | Get the application's class name. | |
6828 | """ | |
5b5c9bc7 | 6829 | return _core_.PyApp_GetClassName(*args, **kwargs) |
d55e5bfc RD |
6830 | |
6831 | def SetClassName(*args, **kwargs): | |
6832 | """ | |
5b5c9bc7 | 6833 | SetClassName(self, String name) |
d55e5bfc | 6834 | |
d6c14a4c RD |
6835 | Set the application's class name. This value may be used for |
6836 | X-resources if applicable for the platform | |
d55e5bfc | 6837 | """ |
5b5c9bc7 | 6838 | return _core_.PyApp_SetClassName(*args, **kwargs) |
d55e5bfc RD |
6839 | |
6840 | def GetVendorName(*args, **kwargs): | |
6841 | """ | |
5b5c9bc7 | 6842 | GetVendorName(self) -> String |
d55e5bfc RD |
6843 | |
6844 | Get the application's vendor name. | |
6845 | """ | |
5b5c9bc7 | 6846 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
d55e5bfc RD |
6847 | |
6848 | def SetVendorName(*args, **kwargs): | |
6849 | """ | |
5b5c9bc7 | 6850 | SetVendorName(self, String name) |
d55e5bfc | 6851 | |
d6c14a4c RD |
6852 | Set the application's vendor name. This value may be used |
6853 | automatically by `wx.Config` and such. | |
d55e5bfc | 6854 | """ |
5b5c9bc7 | 6855 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
d55e5bfc RD |
6856 | |
6857 | def GetTraits(*args, **kwargs): | |
6858 | """ | |
6859 | GetTraits(self) -> wxAppTraits | |
6860 | ||
d6c14a4c RD |
6861 | Return (and create if necessary) the app traits object to which we |
6862 | delegate for everything which either should be configurable by the | |
6863 | user (then he can change the default behaviour simply by overriding | |
6864 | CreateTraits() and returning his own traits object) or which is | |
6865 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
6866 | differences behind the common facade. | |
6867 | ||
6868 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
d55e5bfc | 6869 | """ |
5b5c9bc7 | 6870 | return _core_.PyApp_GetTraits(*args, **kwargs) |
d55e5bfc RD |
6871 | |
6872 | def ProcessPendingEvents(*args, **kwargs): | |
6873 | """ | |
6874 | ProcessPendingEvents(self) | |
6875 | ||
d6c14a4c RD |
6876 | Process all events in the Pending Events list -- it is necessary to |
6877 | call this function to process posted events. This normally happens | |
6878 | during each event loop iteration. | |
d55e5bfc | 6879 | """ |
5b5c9bc7 | 6880 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
d55e5bfc RD |
6881 | |
6882 | def Yield(*args, **kwargs): | |
6883 | """ | |
6884 | Yield(self, bool onlyIfNeeded=False) -> bool | |
6885 | ||
d6c14a4c RD |
6886 | Process all currently pending events right now, instead of waiting |
6887 | until return to the event loop. It is an error to call ``Yield`` | |
6888 | recursively unless the value of ``onlyIfNeeded`` is True. | |
d55e5bfc | 6889 | |
d6c14a4c | 6890 | :warning: This function is dangerous as it can lead to unexpected |
15817c7e RD |
6891 | reentrancies (i.e. when called from an event handler it may |
6892 | result in calling the same event handler again), use with | |
6893 | extreme care or, better, don't use at all! | |
d55e5bfc | 6894 | |
d6c14a4c | 6895 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
15817c7e | 6896 | |
d55e5bfc | 6897 | """ |
5b5c9bc7 | 6898 | return _core_.PyApp_Yield(*args, **kwargs) |
d55e5bfc RD |
6899 | |
6900 | def WakeUpIdle(*args, **kwargs): | |
6901 | """ | |
6902 | WakeUpIdle(self) | |
6903 | ||
d6c14a4c RD |
6904 | Make sure that idle events are sent again. |
6905 | :see: `wx.WakeUpIdle` | |
d55e5bfc | 6906 | """ |
5b5c9bc7 | 6907 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
d55e5bfc | 6908 | |
84f85550 RD |
6909 | def IsMainLoopRunning(*args, **kwargs): |
6910 | """ | |
6911 | IsMainLoopRunning() -> bool | |
6912 | ||
6913 | Returns True if we're running the main loop, i.e. if the events can | |
6914 | currently be dispatched. | |
6915 | """ | |
5b5c9bc7 | 6916 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) |
84f85550 RD |
6917 | |
6918 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
d55e5bfc RD |
6919 | def MainLoop(*args, **kwargs): |
6920 | """ | |
6921 | MainLoop(self) -> int | |
6922 | ||
d6c14a4c RD |
6923 | Execute the main GUI loop, the function doesn't normally return until |
6924 | all top level windows have been closed and destroyed. | |
d55e5bfc | 6925 | """ |
5b5c9bc7 | 6926 | return _core_.PyApp_MainLoop(*args, **kwargs) |
d55e5bfc RD |
6927 | |
6928 | def Exit(*args, **kwargs): | |
6929 | """ | |
6930 | Exit(self) | |
6931 | ||
6932 | Exit the main loop thus terminating the application. | |
d6c14a4c | 6933 | :see: `wx.Exit` |
d55e5bfc | 6934 | """ |
5b5c9bc7 | 6935 | return _core_.PyApp_Exit(*args, **kwargs) |
d55e5bfc RD |
6936 | |
6937 | def ExitMainLoop(*args, **kwargs): | |
6938 | """ | |
6939 | ExitMainLoop(self) | |
6940 | ||
d6c14a4c RD |
6941 | Exit the main GUI loop during the next iteration of the main |
6942 | loop, (i.e. it does not stop the program immediately!) | |
d55e5bfc | 6943 | """ |
5b5c9bc7 | 6944 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
d55e5bfc RD |
6945 | |
6946 | def Pending(*args, **kwargs): | |
6947 | """ | |
6948 | Pending(self) -> bool | |
6949 | ||
6950 | Returns True if there are unprocessed events in the event queue. | |
6951 | """ | |
5b5c9bc7 | 6952 | return _core_.PyApp_Pending(*args, **kwargs) |
d55e5bfc RD |
6953 | |
6954 | def Dispatch(*args, **kwargs): | |
6955 | """ | |
6956 | Dispatch(self) -> bool | |
6957 | ||
6958 | Process the first event in the event queue (blocks until an event | |
6959 | appears if there are none currently) | |
6960 | """ | |
5b5c9bc7 | 6961 | return _core_.PyApp_Dispatch(*args, **kwargs) |
d55e5bfc RD |
6962 | |
6963 | def ProcessIdle(*args, **kwargs): | |
6964 | """ | |
6965 | ProcessIdle(self) -> bool | |
6966 | ||
d6c14a4c RD |
6967 | Called from the MainLoop when the application becomes idle (there are |
6968 | no pending events) and sends a `wx.IdleEvent` to all interested | |
6969 | parties. Returns True if more idle events are needed, False if not. | |
d55e5bfc | 6970 | """ |
5b5c9bc7 | 6971 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
d55e5bfc RD |
6972 | |
6973 | def SendIdleEvents(*args, **kwargs): | |
6974 | """ | |
5b5c9bc7 | 6975 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
d55e5bfc | 6976 | |
d6c14a4c RD |
6977 | Send idle event to window and all subwindows. Returns True if more |
6978 | idle time is requested. | |
d55e5bfc | 6979 | """ |
5b5c9bc7 | 6980 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
d55e5bfc RD |
6981 | |
6982 | def IsActive(*args, **kwargs): | |
6983 | """ | |
6984 | IsActive(self) -> bool | |
6985 | ||
6986 | Return True if our app has focus. | |
6987 | """ | |
5b5c9bc7 | 6988 | return _core_.PyApp_IsActive(*args, **kwargs) |
d55e5bfc RD |
6989 | |
6990 | def SetTopWindow(*args, **kwargs): | |
6991 | """ | |
5b5c9bc7 | 6992 | SetTopWindow(self, Window win) |
d55e5bfc | 6993 | |
d6c14a4c | 6994 | Set the *main* top level window |
d55e5bfc | 6995 | """ |
5b5c9bc7 | 6996 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
d55e5bfc RD |
6997 | |
6998 | def GetTopWindow(*args, **kwargs): | |
6999 | """ | |
5b5c9bc7 | 7000 | GetTopWindow(self) -> Window |
d55e5bfc | 7001 | |
d6c14a4c RD |
7002 | Return the *main* top level window (if it hadn't been set previously |
7003 | with SetTopWindow(), will return just some top level window and, if | |
7004 | there not any, will return None) | |
d55e5bfc | 7005 | """ |
5b5c9bc7 | 7006 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
d55e5bfc RD |
7007 | |
7008 | def SetExitOnFrameDelete(*args, **kwargs): | |
7009 | """ | |
7010 | SetExitOnFrameDelete(self, bool flag) | |
7011 | ||
d6c14a4c RD |
7012 | Control the exit behaviour: by default, the program will exit the main |
7013 | loop (and so, usually, terminate) when the last top-level program | |
7014 | window is deleted. Beware that if you disable this behaviour (with | |
7015 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
7016 | explicitly from somewhere. | |
d55e5bfc | 7017 | """ |
5b5c9bc7 | 7018 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
d55e5bfc RD |
7019 | |
7020 | def GetExitOnFrameDelete(*args, **kwargs): | |
7021 | """ | |
7022 | GetExitOnFrameDelete(self) -> bool | |
7023 | ||
7024 | Get the current exit behaviour setting. | |
7025 | """ | |
5b5c9bc7 | 7026 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
d55e5bfc RD |
7027 | |
7028 | def SetUseBestVisual(*args, **kwargs): | |
7029 | """ | |
7030 | SetUseBestVisual(self, bool flag) | |
7031 | ||
d6c14a4c RD |
7032 | Set whether the app should try to use the best available visual on |
7033 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
d55e5bfc | 7034 | """ |
5b5c9bc7 | 7035 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
d55e5bfc RD |
7036 | |
7037 | def GetUseBestVisual(*args, **kwargs): | |
7038 | """ | |
7039 | GetUseBestVisual(self) -> bool | |
7040 | ||
7041 | Get current UseBestVisual setting. | |
7042 | """ | |
5b5c9bc7 | 7043 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
d55e5bfc RD |
7044 | |
7045 | def SetPrintMode(*args, **kwargs): | |
7046 | """SetPrintMode(self, int mode)""" | |
5b5c9bc7 | 7047 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
d55e5bfc RD |
7048 | |
7049 | def GetPrintMode(*args, **kwargs): | |
7050 | """GetPrintMode(self) -> int""" | |
5b5c9bc7 | 7051 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
d55e5bfc RD |
7052 | |
7053 | def SetAssertMode(*args, **kwargs): | |
7054 | """ | |
7055 | SetAssertMode(self, int mode) | |
7056 | ||
15817c7e | 7057 | Set the OnAssert behaviour for debug and hybrid builds. |
d55e5bfc | 7058 | """ |
5b5c9bc7 | 7059 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
d55e5bfc RD |
7060 | |
7061 | def GetAssertMode(*args, **kwargs): | |
7062 | """ | |
7063 | GetAssertMode(self) -> int | |
7064 | ||
7065 | Get the current OnAssert behaviour setting. | |
7066 | """ | |
5b5c9bc7 | 7067 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
d55e5bfc RD |
7068 | |
7069 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): | |
d6c14a4c | 7070 | """GetMacSupportPCMenuShortcuts() -> bool""" |
5b5c9bc7 | 7071 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
d55e5bfc RD |
7072 | |
7073 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
7074 | def GetMacAboutMenuItemId(*args, **kwargs): | |
d6c14a4c | 7075 | """GetMacAboutMenuItemId() -> long""" |
5b5c9bc7 | 7076 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7077 | |
7078 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
7079 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
d6c14a4c | 7080 | """GetMacPreferencesMenuItemId() -> long""" |
5b5c9bc7 | 7081 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7082 | |
7083 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
7084 | def GetMacExitMenuItemId(*args, **kwargs): | |
d6c14a4c | 7085 | """GetMacExitMenuItemId() -> long""" |
5b5c9bc7 | 7086 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7087 | |
7088 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
7089 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
5b5c9bc7 RD |
7090 | """GetMacHelpMenuTitleName() -> String""" |
7091 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc RD |
7092 | |
7093 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
7094 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
d6c14a4c | 7095 | """SetMacSupportPCMenuShortcuts(bool val)""" |
5b5c9bc7 | 7096 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
d55e5bfc RD |
7097 | |
7098 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
7099 | def SetMacAboutMenuItemId(*args, **kwargs): | |
d6c14a4c | 7100 | """SetMacAboutMenuItemId(long val)""" |
5b5c9bc7 | 7101 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7102 | |
7103 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
7104 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
d6c14a4c | 7105 | """SetMacPreferencesMenuItemId(long val)""" |
5b5c9bc7 | 7106 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7107 | |
7108 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
7109 | def SetMacExitMenuItemId(*args, **kwargs): | |
d6c14a4c | 7110 | """SetMacExitMenuItemId(long val)""" |
5b5c9bc7 | 7111 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7112 | |
7113 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
7114 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
5b5c9bc7 RD |
7115 | """SetMacHelpMenuTitleName(String val)""" |
7116 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc RD |
7117 | |
7118 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
7119 | def _BootstrapApp(*args, **kwargs): | |
7120 | """ | |
7121 | _BootstrapApp(self) | |
7122 | ||
7123 | For internal use only | |
7124 | """ | |
5b5c9bc7 | 7125 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
d55e5bfc RD |
7126 | |
7127 | def GetComCtl32Version(*args, **kwargs): | |
7128 | """ | |
d6c14a4c | 7129 | GetComCtl32Version() -> int |
d55e5bfc | 7130 | |
d6c14a4c RD |
7131 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7132 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc | 7133 | """ |
5b5c9bc7 | 7134 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
d55e5bfc RD |
7135 | |
7136 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
7137 | ||
5b5c9bc7 | 7138 | class PyAppPtr(PyApp): |
d55e5bfc RD |
7139 | def __init__(self, this): |
7140 | self.this = this | |
7141 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7142 | self.__class__ = PyApp |
7143 | _core_.PyApp_swigregister(PyAppPtr) | |
d55e5bfc | 7144 | |
5b5c9bc7 | 7145 | def PyApp_IsMainLoopRunning(*args, **kwargs): |
84f85550 | 7146 | """ |
5b5c9bc7 | 7147 | PyApp_IsMainLoopRunning() -> bool |
84f85550 RD |
7148 | |
7149 | Returns True if we're running the main loop, i.e. if the events can | |
7150 | currently be dispatched. | |
7151 | """ | |
5b5c9bc7 | 7152 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) |
84f85550 | 7153 | |
5b5c9bc7 RD |
7154 | def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs): |
7155 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
7156 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d55e5bfc | 7157 | |
5b5c9bc7 RD |
7158 | def PyApp_GetMacAboutMenuItemId(*args, **kwargs): |
7159 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
7160 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) | |
d55e5bfc | 7161 | |
5b5c9bc7 RD |
7162 | def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs): |
7163 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
7164 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) | |
d55e5bfc | 7165 | |
5b5c9bc7 RD |
7166 | def PyApp_GetMacExitMenuItemId(*args, **kwargs): |
7167 | """PyApp_GetMacExitMenuItemId() -> long""" | |
7168 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) | |
d55e5bfc | 7169 | |
5b5c9bc7 RD |
7170 | def PyApp_GetMacHelpMenuTitleName(*args, **kwargs): |
7171 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
7172 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc | 7173 | |
5b5c9bc7 RD |
7174 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
7175 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" | |
7176 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d55e5bfc | 7177 | |
5b5c9bc7 RD |
7178 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
7179 | """PyApp_SetMacAboutMenuItemId(long val)""" | |
7180 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
d55e5bfc | 7181 | |
5b5c9bc7 RD |
7182 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
7183 | """PyApp_SetMacPreferencesMenuItemId(long val)""" | |
7184 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
d55e5bfc | 7185 | |
5b5c9bc7 RD |
7186 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
7187 | """PyApp_SetMacExitMenuItemId(long val)""" | |
7188 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
d55e5bfc | 7189 | |
5b5c9bc7 RD |
7190 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
7191 | """PyApp_SetMacHelpMenuTitleName(String val)""" | |
7192 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc | 7193 | |
5b5c9bc7 | 7194 | def PyApp_GetComCtl32Version(*args, **kwargs): |
d55e5bfc | 7195 | """ |
5b5c9bc7 | 7196 | PyApp_GetComCtl32Version() -> int |
d55e5bfc | 7197 | |
d6c14a4c RD |
7198 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7199 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc | 7200 | """ |
5b5c9bc7 | 7201 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
d55e5bfc RD |
7202 | |
7203 | #--------------------------------------------------------------------------- | |
7204 | ||
7205 | ||
5b5c9bc7 | 7206 | def Exit(*args, **kwargs): |
d55e5bfc | 7207 | """ |
5b5c9bc7 | 7208 | Exit() |
d55e5bfc RD |
7209 | |
7210 | Force an exit of the application. Convenience for wx.GetApp().Exit() | |
7211 | """ | |
5b5c9bc7 | 7212 | return _core_.Exit(*args, **kwargs) |
d55e5bfc | 7213 | |
5b5c9bc7 | 7214 | def Yield(*args, **kwargs): |
d55e5bfc | 7215 | """ |
5b5c9bc7 | 7216 | Yield() -> bool |
d55e5bfc RD |
7217 | |
7218 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() | |
7219 | """ | |
5b5c9bc7 | 7220 | return _core_.Yield(*args, **kwargs) |
d55e5bfc | 7221 | |
5b5c9bc7 | 7222 | def YieldIfNeeded(*args, **kwargs): |
d55e5bfc | 7223 | """ |
5b5c9bc7 | 7224 | YieldIfNeeded() -> bool |
d55e5bfc RD |
7225 | |
7226 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) | |
7227 | """ | |
5b5c9bc7 | 7228 | return _core_.YieldIfNeeded(*args, **kwargs) |
d55e5bfc | 7229 | |
5b5c9bc7 | 7230 | def SafeYield(*args, **kwargs): |
d55e5bfc | 7231 | """ |
5b5c9bc7 | 7232 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool |
d55e5bfc | 7233 | |
d6c14a4c RD |
7234 | This function is similar to `wx.Yield`, except that it disables the |
7235 | user input to all program windows before calling `wx.Yield` and | |
7236 | re-enables it again afterwards. If ``win`` is not None, this window | |
7237 | will remain enabled, allowing the implementation of some limited user | |
7238 | interaction. | |
d55e5bfc | 7239 | |
d6c14a4c | 7240 | :Returns: the result of the call to `wx.Yield`. |
d55e5bfc | 7241 | """ |
5b5c9bc7 | 7242 | return _core_.SafeYield(*args, **kwargs) |
d55e5bfc | 7243 | |
5b5c9bc7 | 7244 | def WakeUpIdle(*args, **kwargs): |
d55e5bfc | 7245 | """ |
5b5c9bc7 | 7246 | WakeUpIdle() |
d55e5bfc | 7247 | |
d6c14a4c RD |
7248 | Cause the message queue to become empty again, so idle events will be |
7249 | sent. | |
d55e5bfc | 7250 | """ |
5b5c9bc7 | 7251 | return _core_.WakeUpIdle(*args, **kwargs) |
d55e5bfc | 7252 | |
5b5c9bc7 | 7253 | def PostEvent(*args, **kwargs): |
d55e5bfc | 7254 | """ |
5b5c9bc7 | 7255 | PostEvent(EvtHandler dest, Event event) |
d55e5bfc | 7256 | |
d6c14a4c RD |
7257 | Send an event to a window or other wx.EvtHandler to be processed |
7258 | later. | |
d55e5bfc | 7259 | """ |
5b5c9bc7 | 7260 | return _core_.PostEvent(*args, **kwargs) |
d55e5bfc | 7261 | |
5b5c9bc7 | 7262 | def App_CleanUp(*args, **kwargs): |
d55e5bfc | 7263 | """ |
5b5c9bc7 | 7264 | App_CleanUp() |
d55e5bfc | 7265 | |
15817c7e | 7266 | For internal use only, it is used to cleanup after wxWidgets when |
d6c14a4c | 7267 | Python shuts down. |
d55e5bfc | 7268 | """ |
5b5c9bc7 | 7269 | return _core_.App_CleanUp(*args, **kwargs) |
d55e5bfc RD |
7270 | |
7271 | def GetApp(*args, **kwargs): | |
7272 | """ | |
5b5c9bc7 | 7273 | GetApp() -> PyApp |
d55e5bfc RD |
7274 | |
7275 | Return a reference to the current wx.App object. | |
7276 | """ | |
5b5c9bc7 | 7277 | return _core_.GetApp(*args, **kwargs) |
5cbf236d | 7278 | |
5b5c9bc7 | 7279 | def SetDefaultPyEncoding(*args, **kwargs): |
5cbf236d RD |
7280 | """ |
7281 | SetDefaultPyEncoding(string encoding) | |
7282 | ||
7283 | Sets the encoding that wxPython will use when it needs to convert a | |
7284 | Python string or unicode object to or from a wxString. | |
62d32a5f RD |
7285 | |
7286 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7287 | but please be aware that the default encoding within the same locale | |
7288 | may be slightly different on different platforms. For example, please | |
7289 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7290 | between the common latin/roman encodings. | |
5cbf236d | 7291 | """ |
5b5c9bc7 | 7292 | return _core_.SetDefaultPyEncoding(*args, **kwargs) |
5cbf236d | 7293 | |
5b5c9bc7 | 7294 | def GetDefaultPyEncoding(*args, **kwargs): |
5cbf236d RD |
7295 | """ |
7296 | GetDefaultPyEncoding() -> string | |
7297 | ||
7298 | Gets the current encoding that wxPython will use when it needs to | |
7299 | convert a Python string or unicode object to or from a wxString. | |
7300 | """ | |
5b5c9bc7 | 7301 | return _core_.GetDefaultPyEncoding(*args, **kwargs) |
d55e5bfc RD |
7302 | #---------------------------------------------------------------------- |
7303 | ||
7304 | class PyOnDemandOutputWindow: | |
7305 | """ | |
7306 | A class that can be used for redirecting Python's stdout and | |
7307 | stderr streams. It will do nothing until something is wrriten to | |
7308 | the stream at which point it will create a Frame with a text area | |
7309 | and write the text there. | |
7310 | """ | |
7311 | def __init__(self, title = "wxPython: stdout/stderr"): | |
7312 | self.frame = None | |
7313 | self.title = title | |
412d302d RD |
7314 | self.pos = wx.DefaultPosition |
7315 | self.size = (450, 300) | |
d55e5bfc RD |
7316 | self.parent = None |
7317 | ||
7318 | def SetParent(self, parent): | |
7319 | """Set the window to be used as the popup Frame's parent.""" | |
7320 | self.parent = parent | |
7321 | ||
7322 | ||
7323 | def CreateOutputWindow(self, st): | |
412d302d RD |
7324 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7325 | style=wx.DEFAULT_FRAME_STYLE) | |
d55e5bfc | 7326 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7327 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d55e5bfc | 7328 | self.text.AppendText(st) |
d55e5bfc RD |
7329 | self.frame.Show(True) |
7330 | EVT_CLOSE(self.frame, self.OnCloseWindow) | |
7331 | ||
7332 | ||
7333 | def OnCloseWindow(self, event): | |
7334 | if self.frame is not None: | |
7335 | self.frame.Destroy() | |
7336 | self.frame = None | |
7337 | self.text = None | |
7338 | ||
7339 | ||
7340 | # These methods provide the file-like output behaviour. | |
7341 | def write(self, text): | |
7342 | """ | |
7343 | Create the output window if needed and write the string to it. | |
7344 | If not called in the context of the gui thread then uses | |
7345 | CallAfter to do the work there. | |
7346 | """ | |
7347 | if self.frame is None: | |
7348 | if not wx.Thread_IsMain(): | |
7349 | wx.CallAfter(self.CreateOutputWindow, text) | |
7350 | else: | |
7351 | self.CreateOutputWindow(text) | |
7352 | else: | |
7353 | if not wx.Thread_IsMain(): | |
7354 | wx.CallAfter(self.text.AppendText, text) | |
7355 | else: | |
7356 | self.text.AppendText(text) | |
7357 | ||
7358 | ||
7359 | def close(self): | |
7360 | if self.frame is not None: | |
7361 | wx.CallAfter(self.frame.Close) | |
7362 | ||
7363 | ||
bb4524c4 RD |
7364 | def flush(self): |
7365 | pass | |
7366 | ||
7367 | ||
d55e5bfc RD |
7368 | |
7369 | #---------------------------------------------------------------------- | |
7370 | ||
7371 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
7372 | ||
7373 | class App(wx.PyApp): | |
7374 | """ | |
d6c14a4c RD |
7375 | The ``wx.App`` class represents the application and is used to: |
7376 | ||
7377 | * bootstrap the wxPython system and initialize the underlying | |
7378 | gui toolkit | |
7379 | * set and get application-wide properties | |
7380 | * implement the windowing system main message or event loop, | |
7381 | and to dispatch events to window instances | |
7382 | * etc. | |
7383 | ||
7384 | Every application must have a ``wx.App`` instance, and all | |
7385 | creation of UI objects should be delayed until after the | |
7386 | ``wx.App`` object has been created in order to ensure that the gui | |
7387 | platform and wxWidgets have been fully initialized. | |
7388 | ||
7389 | Normally you would derive from this class and implement an | |
7390 | ``OnInit`` method that creates a frame and then calls | |
7391 | ``self.SetTopWindow(frame)``. | |
7392 | ||
7393 | :see: `wx.PySimpleApp` for a simpler app class that can be used | |
15817c7e | 7394 | directly. |
d55e5bfc | 7395 | """ |
d6c14a4c | 7396 | |
d55e5bfc RD |
7397 | outputWindowClass = PyOnDemandOutputWindow |
7398 | ||
d6c14a4c RD |
7399 | def __init__(self, redirect=_defRedirect, filename=None, |
7400 | useBestVisual=False, clearSigInt=True): | |
7401 | """ | |
7402 | Construct a ``wx.App`` object. | |
7403 | ||
7404 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be | |
7405 | redirected? Defaults to True on Windows and Mac, False | |
7406 | otherwise. If `filename` is None then output will be | |
7407 | redirected to a window that pops up as needed. (You can | |
7408 | control what kind of window is created for the output by | |
7409 | resetting the class variable ``outputWindowClass`` to a | |
7410 | class of your choosing.) | |
7411 | ||
7412 | :param filename: The name of a file to redirect output to, if | |
7413 | redirect is True. | |
7414 | ||
7415 | :param useBestVisual: Should the app try to use the best | |
7416 | available visual provided by the system (only relevant on | |
7417 | systems that have more than one visual.) This parameter | |
7418 | must be used instead of calling `SetUseBestVisual` later | |
7419 | on because it must be set before the underlying GUI | |
7420 | toolkit is initialized. | |
7421 | ||
7422 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7423 | app to terminate upon a Ctrl-C in the console like other | |
7424 | GUI apps will. | |
7425 | ||
7426 | :note: You should override OnInit to do applicaition | |
7427 | initialization to ensure that the system, toolkit and | |
7428 | wxWidgets are fully initialized. | |
7429 | """ | |
d55e5bfc RD |
7430 | wx.PyApp.__init__(self) |
7431 | ||
7432 | if wx.Platform == "__WXMAC__": | |
7433 | try: | |
7434 | import MacOS | |
7435 | if not MacOS.WMAvailable(): | |
7436 | print """\ | |
7437 | This program needs access to the screen. Please run with 'pythonw', | |
7438 | not 'python', and only when you are logged in on the main display of | |
7439 | your Mac.""" | |
7440 | _sys.exit(1) | |
0346c964 RD |
7441 | except SystemExit: |
7442 | raise | |
d55e5bfc RD |
7443 | except: |
7444 | pass | |
7445 | ||
7446 | # This has to be done before OnInit | |
7447 | self.SetUseBestVisual(useBestVisual) | |
7448 | ||
7449 | # Set the default handler for SIGINT. This fixes a problem | |
7450 | # where if Ctrl-C is pressed in the console that started this | |
7451 | # app then it will not appear to do anything, (not even send | |
7452 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7453 | # setting the default handler then the app will exit, as | |
7454 | # expected (depending on platform.) | |
d6c14a4c RD |
7455 | if clearSigInt: |
7456 | try: | |
7457 | import signal | |
7458 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7459 | except: | |
7460 | pass | |
d55e5bfc RD |
7461 | |
7462 | # Save and redirect the stdio to a window? | |
7463 | self.stdioWin = None | |
7464 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7465 | if redirect: | |
7466 | self.RedirectStdio(filename) | |
7467 | ||
8fb0e70a RD |
7468 | # Use Python's install prefix as the default |
7469 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7470 | ||
d55e5bfc RD |
7471 | # This finishes the initialization of wxWindows and then calls |
7472 | # the OnInit that should be present in the derived class | |
7473 | self._BootstrapApp() | |
7474 | ||
7475 | ||
66af7a75 RD |
7476 | def __del__(self, destroy=wx.PyApp.__del__): |
7477 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7478 | destroy(self) | |
d55e5bfc | 7479 | |
7993762b RD |
7480 | def Destroy(self): |
7481 | wx.PyApp.Destroy(self) | |
7482 | self.thisown = 0 | |
d55e5bfc RD |
7483 | |
7484 | def SetTopWindow(self, frame): | |
7485 | """Set the \"main\" top level window""" | |
7486 | if self.stdioWin: | |
7487 | self.stdioWin.SetParent(frame) | |
7488 | wx.PyApp.SetTopWindow(self, frame) | |
7489 | ||
7490 | ||
7491 | def MainLoop(self): | |
7492 | """Execute the main GUI event loop""" | |
7493 | wx.PyApp.MainLoop(self) | |
7494 | self.RestoreStdio() | |
7495 | ||
7496 | ||
7497 | def RedirectStdio(self, filename=None): | |
7498 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" | |
7499 | if filename: | |
7500 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7501 | else: | |
7502 | self.stdioWin = self.outputWindowClass() | |
7503 | _sys.stdout = _sys.stderr = self.stdioWin | |
7504 | ||
7505 | ||
7506 | def RestoreStdio(self): | |
66af7a75 RD |
7507 | try: |
7508 | _sys.stdout, _sys.stderr = self.saveStdio | |
7509 | except: | |
7510 | pass | |
d55e5bfc RD |
7511 | |
7512 | ||
412d302d RD |
7513 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7514 | """ | |
7515 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7516 | the stdio has been redirected. This should be called before |
7517 | any output would cause the output window to be created. | |
412d302d RD |
7518 | """ |
7519 | if self.stdioWin: | |
7520 | if title is not None: | |
7521 | self.stdioWin.title = title | |
7522 | if pos is not None: | |
7523 | self.stdioWin.pos = pos | |
7524 | if size is not None: | |
7525 | self.stdioWin.size = size | |
7526 | ||
7527 | ||
7528 | ||
d55e5bfc | 7529 | |
d6c14a4c | 7530 | # change from wx.PyApp_XX to wx.App_XX |
d55e5bfc RD |
7531 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7532 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7533 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7534 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7535 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7536 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7537 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7538 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7539 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7540 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7541 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
7542 | ||
7543 | #---------------------------------------------------------------------------- | |
7544 | ||
7545 | class PySimpleApp(wx.App): | |
7546 | """ | |
7547 | A simple application class. You can just create one of these and | |
7548 | then then make your top level windows later, and not have to worry | |
d6c14a4c | 7549 | about OnInit. For example:: |
d55e5bfc | 7550 | |
d6c14a4c RD |
7551 | app = wx.PySimpleApp() |
7552 | frame = wx.Frame(None, title='Hello World') | |
7553 | frame.Show() | |
7554 | app.MainLoop() | |
7555 | ||
7556 | :see: `wx.App` | |
7557 | """ | |
7558 | ||
7559 | def __init__(self, redirect=False, filename=None, | |
7560 | useBestVisual=False, clearSigInt=True): | |
7561 | """ | |
7562 | :see: `wx.App.__init__` | |
7563 | """ | |
7564 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) | |
d55e5bfc RD |
7565 | |
7566 | def OnInit(self): | |
d55e5bfc RD |
7567 | return True |
7568 | ||
7569 | ||
d6c14a4c | 7570 | |
d55e5bfc RD |
7571 | # Is anybody using this one? |
7572 | class PyWidgetTester(wx.App): | |
7573 | def __init__(self, size = (250, 100)): | |
7574 | self.size = size | |
7575 | wx.App.__init__(self, 0) | |
7576 | ||
7577 | def OnInit(self): | |
7578 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) | |
7579 | self.SetTopWindow(self.frame) | |
7580 | return True | |
7581 | ||
d6c14a4c RD |
7582 | def SetWidget(self, widgetClass, *args, **kwargs): |
7583 | w = widgetClass(self.frame, *args, **kwargs) | |
d55e5bfc RD |
7584 | self.frame.Show(True) |
7585 | ||
7586 | #---------------------------------------------------------------------------- | |
7587 | # DO NOT hold any other references to this object. This is how we | |
d6c14a4c | 7588 | # know when to cleanup system resources that wxWidgets is holding. When |
d55e5bfc | 7589 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
d6c14a4c | 7590 | # goes to zero and it calls the wx.App_CleanUp function. |
d55e5bfc RD |
7591 | |
7592 | class __wxPyCleanup: | |
7593 | def __init__(self): | |
7594 | self.cleanup = _core_.App_CleanUp | |
7595 | def __del__(self): | |
7596 | self.cleanup() | |
7597 | ||
7598 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7599 | ||
7600 | ## # another possible solution, but it gets called too early... | |
d6c14a4c RD |
7601 | ## import atexit |
7602 | ## atexit.register(_core_.wxApp_CleanUp) | |
d55e5bfc RD |
7603 | |
7604 | ||
7605 | #---------------------------------------------------------------------------- | |
7606 | ||
7607 | #--------------------------------------------------------------------------- | |
7608 | ||
5b5c9bc7 RD |
7609 | class EventLoop(object): |
7610 | """Proxy of C++ EventLoop class""" | |
b411df4a RD |
7611 | def __repr__(self): |
7612 | return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7613 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
7614 | """__init__(self) -> EventLoop""" |
7615 | newobj = _core_.new_EventLoop(*args, **kwargs) | |
b411df4a RD |
7616 | self.this = newobj.this |
7617 | self.thisown = 1 | |
7618 | del newobj.thisown | |
5b5c9bc7 | 7619 | def __del__(self, destroy=_core_.delete_EventLoop): |
b411df4a RD |
7620 | """__del__(self)""" |
7621 | try: | |
7622 | if self.thisown: destroy(self) | |
7623 | except: pass | |
7624 | ||
7625 | def Run(*args, **kwargs): | |
7626 | """Run(self) -> int""" | |
5b5c9bc7 | 7627 | return _core_.EventLoop_Run(*args, **kwargs) |
b411df4a RD |
7628 | |
7629 | def Exit(*args, **kwargs): | |
7630 | """Exit(self, int rc=0)""" | |
5b5c9bc7 | 7631 | return _core_.EventLoop_Exit(*args, **kwargs) |
b411df4a RD |
7632 | |
7633 | def Pending(*args, **kwargs): | |
7634 | """Pending(self) -> bool""" | |
5b5c9bc7 | 7635 | return _core_.EventLoop_Pending(*args, **kwargs) |
b411df4a RD |
7636 | |
7637 | def Dispatch(*args, **kwargs): | |
7638 | """Dispatch(self) -> bool""" | |
5b5c9bc7 | 7639 | return _core_.EventLoop_Dispatch(*args, **kwargs) |
b411df4a RD |
7640 | |
7641 | def IsRunning(*args, **kwargs): | |
7642 | """IsRunning(self) -> bool""" | |
5b5c9bc7 | 7643 | return _core_.EventLoop_IsRunning(*args, **kwargs) |
b411df4a RD |
7644 | |
7645 | def GetActive(*args, **kwargs): | |
5b5c9bc7 RD |
7646 | """GetActive() -> EventLoop""" |
7647 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
b411df4a RD |
7648 | |
7649 | GetActive = staticmethod(GetActive) | |
7650 | def SetActive(*args, **kwargs): | |
5b5c9bc7 RD |
7651 | """SetActive(EventLoop loop)""" |
7652 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
b411df4a RD |
7653 | |
7654 | SetActive = staticmethod(SetActive) | |
7655 | ||
5b5c9bc7 | 7656 | class EventLoopPtr(EventLoop): |
b411df4a RD |
7657 | def __init__(self, this): |
7658 | self.this = this | |
7659 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7660 | self.__class__ = EventLoop |
7661 | _core_.EventLoop_swigregister(EventLoopPtr) | |
b411df4a | 7662 | |
5b5c9bc7 RD |
7663 | def EventLoop_GetActive(*args, **kwargs): |
7664 | """EventLoop_GetActive() -> EventLoop""" | |
7665 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
b411df4a | 7666 | |
5b5c9bc7 RD |
7667 | def EventLoop_SetActive(*args, **kwargs): |
7668 | """EventLoop_SetActive(EventLoop loop)""" | |
7669 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
b411df4a RD |
7670 | |
7671 | #--------------------------------------------------------------------------- | |
7672 | ||
5b5c9bc7 | 7673 | class AcceleratorEntry(object): |
d6c14a4c RD |
7674 | """ |
7675 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7676 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7677 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
15817c7e | 7678 | as well. See `__init__` for of the tuple values. |
d6c14a4c RD |
7679 | |
7680 | :see: `wx.AcceleratorTable` | |
7681 | """ | |
d55e5bfc RD |
7682 | def __repr__(self): |
7683 | return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7684 | def __init__(self, *args, **kwargs): | |
d6c14a4c | 7685 | """ |
5b5c9bc7 | 7686 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry |
d6c14a4c RD |
7687 | |
7688 | Construct a wx.AcceleratorEntry. | |
d6c14a4c | 7689 | """ |
5b5c9bc7 | 7690 | newobj = _core_.new_AcceleratorEntry(*args, **kwargs) |
d55e5bfc RD |
7691 | self.this = newobj.this |
7692 | self.thisown = 1 | |
7693 | del newobj.thisown | |
5b5c9bc7 | 7694 | def __del__(self, destroy=_core_.delete_AcceleratorEntry): |
d55e5bfc RD |
7695 | """__del__(self)""" |
7696 | try: | |
7697 | if self.thisown: destroy(self) | |
7698 | except: pass | |
7699 | ||
7700 | def Set(*args, **kwargs): | |
d6c14a4c RD |
7701 | """ |
7702 | Set(self, int flags, int keyCode, int cmd) | |
d55e5bfc | 7703 | |
d6c14a4c RD |
7704 | (Re)set the attributes of a wx.AcceleratorEntry. |
7705 | :see `__init__` | |
7706 | """ | |
5b5c9bc7 | 7707 | return _core_.AcceleratorEntry_Set(*args, **kwargs) |
d55e5bfc RD |
7708 | |
7709 | def GetFlags(*args, **kwargs): | |
d6c14a4c RD |
7710 | """ |
7711 | GetFlags(self) -> int | |
7712 | ||
7713 | Get the AcceleratorEntry's flags. | |
7714 | """ | |
5b5c9bc7 | 7715 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
d55e5bfc RD |
7716 | |
7717 | def GetKeyCode(*args, **kwargs): | |
d6c14a4c RD |
7718 | """ |
7719 | GetKeyCode(self) -> int | |
7720 | ||
7721 | Get the AcceleratorEntry's keycode. | |
7722 | """ | |
5b5c9bc7 | 7723 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
d55e5bfc RD |
7724 | |
7725 | def GetCommand(*args, **kwargs): | |
d6c14a4c RD |
7726 | """ |
7727 | GetCommand(self) -> int | |
7728 | ||
7729 | Get the AcceleratorEntry's command ID. | |
7730 | """ | |
5b5c9bc7 | 7731 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
d55e5bfc RD |
7732 | |
7733 | ||
5b5c9bc7 | 7734 | class AcceleratorEntryPtr(AcceleratorEntry): |
d55e5bfc RD |
7735 | def __init__(self, this): |
7736 | self.this = this | |
7737 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7738 | self.__class__ = AcceleratorEntry |
7739 | _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr) | |
d55e5bfc | 7740 | |
5b5c9bc7 | 7741 | class AcceleratorTable(Object): |
d6c14a4c RD |
7742 | """ |
7743 | An accelerator table allows the application to specify a table of | |
7744 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7745 | button commands are supported; on GTK, only menu commands are | |
7746 | supported. | |
d6c14a4c | 7747 | """ |
d55e5bfc RD |
7748 | def __repr__(self): |
7749 | return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7750 | def __init__(self, *args, **kwargs): | |
7751 | """ | |
7752 | __init__(entries) -> AcceleratorTable | |
7753 | ||
d6c14a4c RD |
7754 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7755 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7756 | ||
7757 | :see: `wx.AcceleratorEntry` | |
d55e5bfc | 7758 | """ |
5b5c9bc7 | 7759 | newobj = _core_.new_AcceleratorTable(*args, **kwargs) |
d55e5bfc RD |
7760 | self.this = newobj.this |
7761 | self.thisown = 1 | |
7762 | del newobj.thisown | |
5b5c9bc7 | 7763 | def __del__(self, destroy=_core_.delete_AcceleratorTable): |
d55e5bfc RD |
7764 | """__del__(self)""" |
7765 | try: | |
7766 | if self.thisown: destroy(self) | |
7767 | except: pass | |
7768 | ||
7769 | def Ok(*args, **kwargs): | |
7770 | """Ok(self) -> bool""" | |
5b5c9bc7 | 7771 | return _core_.AcceleratorTable_Ok(*args, **kwargs) |
d55e5bfc RD |
7772 | |
7773 | ||
5b5c9bc7 | 7774 | class AcceleratorTablePtr(AcceleratorTable): |
d55e5bfc RD |
7775 | def __init__(self, this): |
7776 | self.this = this | |
7777 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7778 | self.__class__ = AcceleratorTable |
7779 | _core_.AcceleratorTable_swigregister(AcceleratorTablePtr) | |
d55e5bfc RD |
7780 | |
7781 | ||
5b5c9bc7 RD |
7782 | def GetAccelFromString(*args, **kwargs): |
7783 | """GetAccelFromString(String label) -> AcceleratorEntry""" | |
7784 | return _core_.GetAccelFromString(*args, **kwargs) | |
d55e5bfc RD |
7785 | #--------------------------------------------------------------------------- |
7786 | ||
5b5c9bc7 | 7787 | class VisualAttributes(object): |
d55e5bfc RD |
7788 | """struct containing all the visual attributes of a control""" |
7789 | def __repr__(self): | |
7790 | return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7791 | def __init__(self, *args, **kwargs): | |
7792 | """ | |
5b5c9bc7 | 7793 | __init__(self) -> VisualAttributes |
d55e5bfc RD |
7794 | |
7795 | struct containing all the visual attributes of a control | |
7796 | """ | |
5b5c9bc7 | 7797 | newobj = _core_.new_VisualAttributes(*args, **kwargs) |
d55e5bfc RD |
7798 | self.this = newobj.this |
7799 | self.thisown = 1 | |
7800 | del newobj.thisown | |
5b5c9bc7 | 7801 | def __del__(self, destroy=_core_.delete_VisualAttributes): |
d55e5bfc RD |
7802 | """__del__(self)""" |
7803 | try: | |
7804 | if self.thisown: destroy(self) | |
7805 | except: pass | |
7806 | ||
5b5c9bc7 RD |
7807 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) |
7808 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
7809 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
d55e5bfc | 7810 | |
5b5c9bc7 | 7811 | class VisualAttributesPtr(VisualAttributes): |
d55e5bfc RD |
7812 | def __init__(self, this): |
7813 | self.this = this | |
7814 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7815 | self.__class__ = VisualAttributes |
7816 | _core_.VisualAttributes_swigregister(VisualAttributesPtr) | |
7817 | NullAcceleratorTable = cvar.NullAcceleratorTable | |
d55e5bfc RD |
7818 | PanelNameStr = cvar.PanelNameStr |
7819 | ||
5b5c9bc7 RD |
7820 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
7821 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
7822 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
7823 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
7824 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
7825 | class Window(EvtHandler): | |
d55e5bfc RD |
7826 | """ |
7827 | wx.Window is the base class for all windows and represents any visible | |
7828 | object on the screen. All controls, top level windows and so on are | |
7829 | wx.Windows. Sizers and device contexts are not however, as they don't | |
7830 | appear on screen themselves. | |
7831 | ||
7832 | """ | |
7833 | def __repr__(self): | |
7834 | return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7835 | def __init__(self, *args, **kwargs): | |
7836 | """ | |
5b5c9bc7 RD |
7837 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
7838 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window | |
d55e5bfc RD |
7839 | |
7840 | Construct and show a generic Window. | |
7841 | """ | |
5b5c9bc7 | 7842 | newobj = _core_.new_Window(*args, **kwargs) |
d55e5bfc RD |
7843 | self.this = newobj.this |
7844 | self.thisown = 1 | |
7845 | del newobj.thisown | |
7846 | self._setOORInfo(self) | |
7847 | ||
7848 | def Create(*args, **kwargs): | |
7849 | """ | |
5b5c9bc7 RD |
7850 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
7851 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool | |
d55e5bfc RD |
7852 | |
7853 | Create the GUI part of the Window for 2-phase creation mode. | |
7854 | """ | |
5b5c9bc7 | 7855 | return _core_.Window_Create(*args, **kwargs) |
d55e5bfc RD |
7856 | |
7857 | def Close(*args, **kwargs): | |
7858 | """ | |
7859 | Close(self, bool force=False) -> bool | |
7860 | ||
7861 | This function simply generates a EVT_CLOSE event whose handler usually | |
7862 | tries to close the window. It doesn't close the window itself, | |
7863 | however. If force is False (the default) then the window's close | |
7864 | handler will be allowed to veto the destruction of the window. | |
d55e5bfc | 7865 | """ |
5b5c9bc7 | 7866 | return _core_.Window_Close(*args, **kwargs) |
d55e5bfc RD |
7867 | |
7868 | def Destroy(*args, **kwargs): | |
7869 | """ | |
7870 | Destroy(self) -> bool | |
7871 | ||
7872 | Destroys the window safely. Frames and dialogs are not destroyed | |
7873 | immediately when this function is called -- they are added to a list | |
7874 | of windows to be deleted on idle time, when all the window's events | |
7875 | have been processed. This prevents problems with events being sent to | |
7876 | non-existent windows. | |
7877 | ||
7878 | Returns True if the window has either been successfully deleted, or it | |
7879 | has been added to the list of windows pending real deletion. | |
7880 | """ | |
5b5c9bc7 | 7881 | return _core_.Window_Destroy(*args, **kwargs) |
d55e5bfc RD |
7882 | |
7883 | def DestroyChildren(*args, **kwargs): | |
7884 | """ | |
7885 | DestroyChildren(self) -> bool | |
7886 | ||
15817c7e RD |
7887 | Destroys all children of a window. Called automatically by the |
7888 | destructor. | |
d55e5bfc | 7889 | """ |
5b5c9bc7 | 7890 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d55e5bfc RD |
7891 | |
7892 | def IsBeingDeleted(*args, **kwargs): | |
7893 | """ | |
7894 | IsBeingDeleted(self) -> bool | |
7895 | ||
7896 | Is the window in the process of being deleted? | |
7897 | """ | |
5b5c9bc7 | 7898 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d55e5bfc RD |
7899 | |
7900 | def SetTitle(*args, **kwargs): | |
7901 | """ | |
5b5c9bc7 | 7902 | SetTitle(self, String title) |
d55e5bfc RD |
7903 | |
7904 | Sets the window's title. Applicable only to frames and dialogs. | |
7905 | """ | |
5b5c9bc7 | 7906 | return _core_.Window_SetTitle(*args, **kwargs) |
d55e5bfc RD |
7907 | |
7908 | def GetTitle(*args, **kwargs): | |
7909 | """ | |
5b5c9bc7 | 7910 | GetTitle(self) -> String |
d55e5bfc RD |
7911 | |
7912 | Gets the window's title. Applicable only to frames and dialogs. | |
7913 | """ | |
5b5c9bc7 | 7914 | return _core_.Window_GetTitle(*args, **kwargs) |
d55e5bfc RD |
7915 | |
7916 | def SetLabel(*args, **kwargs): | |
7917 | """ | |
5b5c9bc7 | 7918 | SetLabel(self, String label) |
d55e5bfc RD |
7919 | |
7920 | Set the text which the window shows in its label if applicable. | |
7921 | """ | |
5b5c9bc7 | 7922 | return _core_.Window_SetLabel(*args, **kwargs) |
d55e5bfc RD |
7923 | |
7924 | def GetLabel(*args, **kwargs): | |
7925 | """ | |
5b5c9bc7 | 7926 | GetLabel(self) -> String |
d55e5bfc | 7927 | |
15817c7e RD |
7928 | Generic way of getting a label from any window, for identification |
7929 | purposes. The interpretation of this function differs from class to | |
7930 | class. For frames and dialogs, the value returned is the title. For | |
7931 | buttons or static text controls, it is the button text. This function | |
7932 | can be useful for meta-programs such as testing tools or special-needs | |
7933 | access programs)which need to identify windows by name. | |
d55e5bfc | 7934 | """ |
5b5c9bc7 | 7935 | return _core_.Window_GetLabel(*args, **kwargs) |
d55e5bfc RD |
7936 | |
7937 | def SetName(*args, **kwargs): | |
7938 | """ | |
5b5c9bc7 | 7939 | SetName(self, String name) |
d55e5bfc | 7940 | |
15817c7e RD |
7941 | Sets the window's name. The window name is used for ressource setting |
7942 | in X, it is not the same as the window title/label | |
d55e5bfc | 7943 | """ |
5b5c9bc7 | 7944 | return _core_.Window_SetName(*args, **kwargs) |
d55e5bfc RD |
7945 | |
7946 | def GetName(*args, **kwargs): | |
7947 | """ | |
5b5c9bc7 | 7948 | GetName(self) -> String |
d55e5bfc | 7949 | |
15817c7e RD |
7950 | Returns the windows name. This name is not guaranteed to be unique; |
7951 | it is up to the programmer to supply an appropriate name in the window | |
7952 | constructor or via wx.Window.SetName. | |
d55e5bfc | 7953 | """ |
5b5c9bc7 | 7954 | return _core_.Window_GetName(*args, **kwargs) |
d55e5bfc RD |
7955 | |
7956 | def SetWindowVariant(*args, **kwargs): | |
7957 | """ | |
7958 | SetWindowVariant(self, int variant) | |
7959 | ||
15817c7e RD |
7960 | Sets the variant of the window/font size to use for this window, if |
7961 | the platform supports variants, for example, wxMac. | |
d55e5bfc | 7962 | """ |
5b5c9bc7 | 7963 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
d55e5bfc RD |
7964 | |
7965 | def GetWindowVariant(*args, **kwargs): | |
7966 | """GetWindowVariant(self) -> int""" | |
5b5c9bc7 | 7967 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
d55e5bfc RD |
7968 | |
7969 | def SetId(*args, **kwargs): | |
7970 | """ | |
7971 | SetId(self, int winid) | |
7972 | ||
7973 | Sets the identifier of the window. Each window has an integer | |
7974 | identifier. If the application has not provided one, an identifier | |
7975 | will be generated. Normally, the identifier should be provided on | |
7976 | creation and should not be modified subsequently. | |
7977 | """ | |
5b5c9bc7 | 7978 | return _core_.Window_SetId(*args, **kwargs) |
d55e5bfc RD |
7979 | |
7980 | def GetId(*args, **kwargs): | |
7981 | """ | |
7982 | GetId(self) -> int | |
7983 | ||
7984 | Returns the identifier of the window. Each window has an integer | |
7985 | identifier. If the application has not provided one (or the default Id | |
7986 | -1 is used) then an unique identifier with a negative value will be | |
7987 | generated. | |
7988 | """ | |
5b5c9bc7 | 7989 | return _core_.Window_GetId(*args, **kwargs) |
d55e5bfc RD |
7990 | |
7991 | def NewControlId(*args, **kwargs): | |
7992 | """ | |
d6c14a4c | 7993 | NewControlId() -> int |
d55e5bfc RD |
7994 | |
7995 | Generate a control id for the controls which were not given one. | |
7996 | """ | |
5b5c9bc7 | 7997 | return _core_.Window_NewControlId(*args, **kwargs) |
d55e5bfc RD |
7998 | |
7999 | NewControlId = staticmethod(NewControlId) | |
8000 | def NextControlId(*args, **kwargs): | |
8001 | """ | |
d6c14a4c | 8002 | NextControlId(int winid) -> int |
d55e5bfc RD |
8003 | |
8004 | Get the id of the control following the one with the given | |
15817c7e | 8005 | autogenerated) id |
d55e5bfc | 8006 | """ |
5b5c9bc7 | 8007 | return _core_.Window_NextControlId(*args, **kwargs) |
d55e5bfc RD |
8008 | |
8009 | NextControlId = staticmethod(NextControlId) | |
8010 | def PrevControlId(*args, **kwargs): | |
8011 | """ | |
d6c14a4c | 8012 | PrevControlId(int winid) -> int |
d55e5bfc RD |
8013 | |
8014 | Get the id of the control preceding the one with the given | |
15817c7e | 8015 | autogenerated) id |
d55e5bfc | 8016 | """ |
5b5c9bc7 | 8017 | return _core_.Window_PrevControlId(*args, **kwargs) |
d55e5bfc RD |
8018 | |
8019 | PrevControlId = staticmethod(PrevControlId) | |
8020 | def SetSize(*args, **kwargs): | |
8021 | """ | |
5b5c9bc7 | 8022 | SetSize(self, Size size) |
d55e5bfc RD |
8023 | |
8024 | Sets the size of the window in pixels. | |
8025 | """ | |
5b5c9bc7 | 8026 | return _core_.Window_SetSize(*args, **kwargs) |
d55e5bfc RD |
8027 | |
8028 | def SetDimensions(*args, **kwargs): | |
8029 | """ | |
5b5c9bc7 | 8030 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
d55e5bfc RD |
8031 | |
8032 | Sets the position and size of the window in pixels. The sizeFlags | |
8033 | parameter indicates the interpretation of the other params if they are | |
62d32a5f RD |
8034 | equal to -1. |
8035 | ||
8036 | ======================== ====================================== | |
8037 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
8038 | default should be used. | |
8039 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
8040 | -1 values are supplied. | |
8041 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
8042 | interpreted as real dimensions, not | |
8043 | default values. | |
8044 | ======================== ====================================== | |
8045 | ||
d55e5bfc | 8046 | """ |
5b5c9bc7 | 8047 | return _core_.Window_SetDimensions(*args, **kwargs) |
d55e5bfc RD |
8048 | |
8049 | def SetRect(*args, **kwargs): | |
8050 | """ | |
5b5c9bc7 | 8051 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
d55e5bfc RD |
8052 | |
8053 | Sets the position and size of the window in pixels using a wx.Rect. | |
8054 | """ | |
5b5c9bc7 | 8055 | return _core_.Window_SetRect(*args, **kwargs) |
d55e5bfc RD |
8056 | |
8057 | def SetSizeWH(*args, **kwargs): | |
8058 | """ | |
8059 | SetSizeWH(self, int width, int height) | |
8060 | ||
8061 | Sets the size of the window in pixels. | |
8062 | """ | |
5b5c9bc7 | 8063 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d55e5bfc RD |
8064 | |
8065 | def Move(*args, **kwargs): | |
8066 | """ | |
5b5c9bc7 | 8067 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
d55e5bfc RD |
8068 | |
8069 | Moves the window to the given position. | |
8070 | """ | |
5b5c9bc7 | 8071 | return _core_.Window_Move(*args, **kwargs) |
d55e5bfc RD |
8072 | |
8073 | SetPosition = Move | |
8074 | def MoveXY(*args, **kwargs): | |
8075 | """ | |
5b5c9bc7 | 8076 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
d55e5bfc RD |
8077 | |
8078 | Moves the window to the given position. | |
8079 | """ | |
5b5c9bc7 | 8080 | return _core_.Window_MoveXY(*args, **kwargs) |
d55e5bfc | 8081 | |
f8167d6e RD |
8082 | def SetBestFittingSize(*args, **kwargs): |
8083 | """ | |
5b5c9bc7 | 8084 | SetBestFittingSize(self, Size size=DefaultSize) |
f8167d6e RD |
8085 | |
8086 | A 'Smart' SetSize that will fill in default size components with the | |
8087 | window's *best size* values. Also set's the minsize for use with sizers. | |
8088 | """ | |
5b5c9bc7 | 8089 | return _core_.Window_SetBestFittingSize(*args, **kwargs) |
f8167d6e | 8090 | |
d55e5bfc RD |
8091 | def Raise(*args, **kwargs): |
8092 | """ | |
8093 | Raise(self) | |
8094 | ||
8095 | Raises the window to the top of the window hierarchy if it is a | |
8096 | managed window (dialog or frame). | |
8097 | """ | |
5b5c9bc7 | 8098 | return _core_.Window_Raise(*args, **kwargs) |
d55e5bfc RD |
8099 | |
8100 | def Lower(*args, **kwargs): | |
8101 | """ | |
8102 | Lower(self) | |
8103 | ||
8104 | Lowers the window to the bottom of the window hierarchy if it is a | |
8105 | managed window (dialog or frame). | |
8106 | """ | |
5b5c9bc7 | 8107 | return _core_.Window_Lower(*args, **kwargs) |
d55e5bfc RD |
8108 | |
8109 | def SetClientSize(*args, **kwargs): | |
8110 | """ | |
5b5c9bc7 | 8111 | SetClientSize(self, Size size) |
d55e5bfc RD |
8112 | |
8113 | This sets the size of the window client area in pixels. Using this | |
8114 | function to size a window tends to be more device-independent than | |
8115 | wx.Window.SetSize, since the application need not worry about what | |
8116 | dimensions the border or title bar have when trying to fit the window | |
8117 | around panel items, for example. | |
8118 | """ | |
5b5c9bc7 | 8119 | return _core_.Window_SetClientSize(*args, **kwargs) |
d55e5bfc RD |
8120 | |
8121 | def SetClientSizeWH(*args, **kwargs): | |
8122 | """ | |
8123 | SetClientSizeWH(self, int width, int height) | |
8124 | ||
8125 | This sets the size of the window client area in pixels. Using this | |
8126 | function to size a window tends to be more device-independent than | |
8127 | wx.Window.SetSize, since the application need not worry about what | |
8128 | dimensions the border or title bar have when trying to fit the window | |
8129 | around panel items, for example. | |
8130 | """ | |
5b5c9bc7 | 8131 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
d55e5bfc RD |
8132 | |
8133 | def SetClientRect(*args, **kwargs): | |
8134 | """ | |
5b5c9bc7 | 8135 | SetClientRect(self, Rect rect) |
d55e5bfc RD |
8136 | |
8137 | This sets the size of the window client area in pixels. Using this | |
8138 | function to size a window tends to be more device-independent than | |
8139 | wx.Window.SetSize, since the application need not worry about what | |
8140 | dimensions the border or title bar have when trying to fit the window | |
8141 | around panel items, for example. | |
8142 | """ | |
5b5c9bc7 | 8143 | return _core_.Window_SetClientRect(*args, **kwargs) |
d55e5bfc RD |
8144 | |
8145 | def GetPosition(*args, **kwargs): | |
8146 | """ | |
5b5c9bc7 | 8147 | GetPosition(self) -> Point |
d55e5bfc RD |
8148 | |
8149 | Get the window's position. | |
8150 | """ | |
5b5c9bc7 | 8151 | return _core_.Window_GetPosition(*args, **kwargs) |
d55e5bfc RD |
8152 | |
8153 | def GetPositionTuple(*args, **kwargs): | |
8154 | """ | |
8155 | GetPositionTuple() -> (x,y) | |
8156 | ||
8157 | Get the window's position. | |
8158 | """ | |
5b5c9bc7 | 8159 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
d55e5bfc RD |
8160 | |
8161 | def GetSize(*args, **kwargs): | |
8162 | """ | |
5b5c9bc7 | 8163 | GetSize(self) -> Size |
d55e5bfc RD |
8164 | |
8165 | Get the window size. | |
8166 | """ | |
5b5c9bc7 | 8167 | return _core_.Window_GetSize(*args, **kwargs) |
d55e5bfc RD |
8168 | |
8169 | def GetSizeTuple(*args, **kwargs): | |
8170 | """ | |
8171 | GetSizeTuple() -> (width, height) | |
8172 | ||
8173 | Get the window size. | |
8174 | """ | |
5b5c9bc7 | 8175 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
d55e5bfc RD |
8176 | |
8177 | def GetRect(*args, **kwargs): | |
8178 | """ | |
5b5c9bc7 | 8179 | GetRect(self) -> Rect |
d55e5bfc RD |
8180 | |
8181 | Returns the size and position of the window as a wx.Rect object. | |
8182 | """ | |
5b5c9bc7 | 8183 | return _core_.Window_GetRect(*args, **kwargs) |
d55e5bfc RD |
8184 | |
8185 | def GetClientSize(*args, **kwargs): | |
8186 | """ | |
5b5c9bc7 | 8187 | GetClientSize(self) -> Size |
d55e5bfc RD |
8188 | |
8189 | This gets the size of the window's 'client area' in pixels. The client | |
8190 | area is the area which may be drawn on by the programmer, excluding | |
8191 | title bar, border, scrollbars, etc. | |
8192 | """ | |
5b5c9bc7 | 8193 | return _core_.Window_GetClientSize(*args, **kwargs) |
d55e5bfc RD |
8194 | |
8195 | def GetClientSizeTuple(*args, **kwargs): | |
8196 | """ | |
8197 | GetClientSizeTuple() -> (width, height) | |
8198 | ||
8199 | This gets the size of the window's 'client area' in pixels. The client | |
8200 | area is the area which may be drawn on by the programmer, excluding | |
8201 | title bar, border, scrollbars, etc. | |
8202 | """ | |
5b5c9bc7 | 8203 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
d55e5bfc RD |
8204 | |
8205 | def GetClientAreaOrigin(*args, **kwargs): | |
8206 | """ | |
5b5c9bc7 | 8207 | GetClientAreaOrigin(self) -> Point |
d55e5bfc RD |
8208 | |
8209 | Get the origin of the client area of the window relative to the | |
8210 | window's top left corner (the client area may be shifted because of | |
8211 | the borders, scrollbars, other decorations...) | |
8212 | """ | |
5b5c9bc7 | 8213 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
d55e5bfc RD |
8214 | |
8215 | def GetClientRect(*args, **kwargs): | |
8216 | """ | |
5b5c9bc7 | 8217 | GetClientRect(self) -> Rect |
d55e5bfc | 8218 | |
0439c23b | 8219 | Get the client area position and size as a `wx.Rect` object. |
d55e5bfc | 8220 | """ |
5b5c9bc7 | 8221 | return _core_.Window_GetClientRect(*args, **kwargs) |
d55e5bfc RD |
8222 | |
8223 | def GetBestSize(*args, **kwargs): | |
8224 | """ | |
5b5c9bc7 | 8225 | GetBestSize(self) -> Size |
d55e5bfc | 8226 | |
bfddbb17 | 8227 | This function returns the best acceptable minimal size for the |
15817c7e RD |
8228 | window, if applicable. For example, for a static text control, it will |
8229 | be the minimal size such that the control label is not truncated. For | |
8230 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8231 | this function will be the same as the size the window would have had | |
8232 | after calling Fit. | |
d55e5bfc | 8233 | """ |
5b5c9bc7 | 8234 | return _core_.Window_GetBestSize(*args, **kwargs) |
d55e5bfc RD |
8235 | |
8236 | def GetBestSizeTuple(*args, **kwargs): | |
8237 | """ | |
8238 | GetBestSizeTuple() -> (width, height) | |
8239 | ||
bfddbb17 | 8240 | This function returns the best acceptable minimal size for the |
15817c7e RD |
8241 | window, if applicable. For example, for a static text control, it will |
8242 | be the minimal size such that the control label is not truncated. For | |
8243 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8244 | this function will be the same as the size the window would have had | |
8245 | after calling Fit. | |
d55e5bfc | 8246 | """ |
5b5c9bc7 | 8247 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
d55e5bfc | 8248 | |
a001823c RD |
8249 | def InvalidateBestSize(*args, **kwargs): |
8250 | """ | |
8251 | InvalidateBestSize(self) | |
8252 | ||
8253 | Reset the cached best size value so it will be recalculated the next | |
8254 | time it is needed. | |
8255 | """ | |
5b5c9bc7 | 8256 | return _core_.Window_InvalidateBestSize(*args, **kwargs) |
a001823c | 8257 | |
e2813725 RD |
8258 | def CacheBestSize(*args, **kwargs): |
8259 | """ | |
8260 | CacheBestSize(self, Size size) | |
8261 | ||
8262 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8263 | some properties of the window change.) | |
8264 | """ | |
8265 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8266 | ||
a001823c RD |
8267 | def GetBestFittingSize(*args, **kwargs): |
8268 | """ | |
5b5c9bc7 | 8269 | GetBestFittingSize(self) -> Size |
a001823c RD |
8270 | |
8271 | This function will merge the window's best size into the window's | |
8272 | minimum size, giving priority to the min size components, and returns | |
8273 | the results. | |
8274 | ||
8275 | """ | |
5b5c9bc7 | 8276 | return _core_.Window_GetBestFittingSize(*args, **kwargs) |
a001823c | 8277 | |
d55e5bfc RD |
8278 | def GetAdjustedBestSize(*args, **kwargs): |
8279 | """ | |
5b5c9bc7 | 8280 | GetAdjustedBestSize(self) -> Size |
d55e5bfc RD |
8281 | |
8282 | This method is similar to GetBestSize, except in one | |
8283 | thing. GetBestSize should return the minimum untruncated size of the | |
8284 | window, while this method will return the largest of BestSize and any | |
8285 | user specified minimum size. ie. it is the minimum size the window | |
8286 | should currently be drawn at, not the minimal size it can possibly | |
8287 | tolerate. | |
8288 | """ | |
5b5c9bc7 | 8289 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) |
d55e5bfc RD |
8290 | |
8291 | def Center(*args, **kwargs): | |
8292 | """ | |
5b5c9bc7 | 8293 | Center(self, int direction=BOTH) |
d55e5bfc RD |
8294 | |
8295 | Centers the window. The parameter specifies the direction for | |
8296 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8297 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8298 | on the entire screen and not on its parent window. If it is a | |
8299 | top-level window and has no parent then it will always be centered | |
8300 | relative to the screen. | |
8301 | """ | |
5b5c9bc7 | 8302 | return _core_.Window_Center(*args, **kwargs) |
d55e5bfc RD |
8303 | |
8304 | Centre = Center | |
8305 | def CenterOnScreen(*args, **kwargs): | |
8306 | """ | |
5b5c9bc7 | 8307 | CenterOnScreen(self, int dir=BOTH) |
d55e5bfc RD |
8308 | |
8309 | Center on screen (only works for top level windows) | |
8310 | """ | |
5b5c9bc7 | 8311 | return _core_.Window_CenterOnScreen(*args, **kwargs) |
d55e5bfc RD |
8312 | |
8313 | CentreOnScreen = CenterOnScreen | |
8314 | def CenterOnParent(*args, **kwargs): | |
8315 | """ | |
5b5c9bc7 | 8316 | CenterOnParent(self, int dir=BOTH) |
d55e5bfc RD |
8317 | |
8318 | Center with respect to the the parent window | |
8319 | """ | |
5b5c9bc7 | 8320 | return _core_.Window_CenterOnParent(*args, **kwargs) |
d55e5bfc RD |
8321 | |
8322 | CentreOnParent = CenterOnParent | |
8323 | def Fit(*args, **kwargs): | |
8324 | """ | |
8325 | Fit(self) | |
8326 | ||
8327 | Sizes the window so that it fits around its subwindows. This function | |
8328 | won't do anything if there are no subwindows and will only really work | |
8329 | correctly if sizers are used for the subwindows layout. Also, if the | |
8330 | window has exactly one subwindow it is better (faster and the result | |
8331 | is more precise as Fit adds some margin to account for fuzziness of | |
8332 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8333 | instead of calling Fit. | |
8334 | """ | |
5b5c9bc7 | 8335 | return _core_.Window_Fit(*args, **kwargs) |
d55e5bfc RD |
8336 | |
8337 | def FitInside(*args, **kwargs): | |
8338 | """ | |
8339 | FitInside(self) | |
8340 | ||
8341 | Similar to Fit, but sizes the interior (virtual) size of a | |
8342 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8343 | sizing changes that do not trigger a size event, and/or scrolled | |
8344 | windows without an interior sizer. This function similarly won't do | |
8345 | anything if there are no subwindows. | |
8346 | """ | |
5b5c9bc7 | 8347 | return _core_.Window_FitInside(*args, **kwargs) |
d55e5bfc | 8348 | |
03837c5c | 8349 | def SetSizeHints(*args, **kwargs): |
d55e5bfc RD |
8350 | """ |
8351 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, | |
8352 | int incH=-1) | |
d55e5bfc RD |
8353 | |
8354 | Allows specification of minimum and maximum window sizes, and window | |
8355 | size increments. If a pair of values is not set (or set to -1), the | |
8356 | default values will be used. If this function is called, the user | |
908b74cd RD |
8357 | will not be able to size the window outside the given bounds (if it is |
8358 | a top-level window.) Sizers will also inspect the minimum window size | |
8359 | and will use that value if set when calculating layout. | |
8360 | ||
8361 | The resizing increments are only significant under Motif or Xt. | |
d55e5bfc | 8362 | """ |
5b5c9bc7 | 8363 | return _core_.Window_SetSizeHints(*args, **kwargs) |
d55e5bfc | 8364 | |
03837c5c RD |
8365 | def SetSizeHintsSz(*args, **kwargs): |
8366 | """ | |
5b5c9bc7 | 8367 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) |
03837c5c RD |
8368 | |
8369 | Allows specification of minimum and maximum window sizes, and window | |
8370 | size increments. If a pair of values is not set (or set to -1), the | |
8371 | default values will be used. If this function is called, the user | |
8372 | will not be able to size the window outside the given bounds (if it is | |
8373 | a top-level window.) Sizers will also inspect the minimum window size | |
8374 | and will use that value if set when calculating layout. | |
8375 | ||
8376 | The resizing increments are only significant under Motif or Xt. | |
8377 | """ | |
5b5c9bc7 | 8378 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) |
03837c5c RD |
8379 | |
8380 | def SetVirtualSizeHints(*args, **kwargs): | |
d55e5bfc | 8381 | """ |
908b74cd | 8382 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
d55e5bfc RD |
8383 | |
8384 | Allows specification of minimum and maximum virtual window sizes. If a | |
8385 | pair of values is not set (or set to -1), the default values will be | |
8386 | used. If this function is called, the user will not be able to size | |
8387 | the virtual area of the window outside the given bounds. | |
8388 | """ | |
5b5c9bc7 | 8389 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
03837c5c RD |
8390 | |
8391 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8392 | """ | |
5b5c9bc7 | 8393 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) |
03837c5c RD |
8394 | |
8395 | Allows specification of minimum and maximum virtual window sizes. If a | |
8396 | pair of values is not set (or set to -1), the default values will be | |
8397 | used. If this function is called, the user will not be able to size | |
8398 | the virtual area of the window outside the given bounds. | |
8399 | """ | |
5b5c9bc7 | 8400 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) |
d55e5bfc | 8401 | |
908b74cd | 8402 | def GetMaxSize(*args, **kwargs): |
5b5c9bc7 RD |
8403 | """GetMaxSize(self) -> Size""" |
8404 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
908b74cd RD |
8405 | |
8406 | def GetMinSize(*args, **kwargs): | |
5b5c9bc7 RD |
8407 | """GetMinSize(self) -> Size""" |
8408 | return _core_.Window_GetMinSize(*args, **kwargs) | |
908b74cd RD |
8409 | |
8410 | def SetMinSize(*args, **kwargs): | |
8411 | """ | |
5b5c9bc7 | 8412 | SetMinSize(self, Size minSize) |
908b74cd RD |
8413 | |
8414 | A more convenient method than `SetSizeHints` for setting just the | |
8415 | min size. | |
8416 | """ | |
5b5c9bc7 | 8417 | return _core_.Window_SetMinSize(*args, **kwargs) |
908b74cd RD |
8418 | |
8419 | def SetMaxSize(*args, **kwargs): | |
8420 | """ | |
5b5c9bc7 | 8421 | SetMaxSize(self, Size maxSize) |
908b74cd RD |
8422 | |
8423 | A more convenient method than `SetSizeHints` for setting just the | |
8424 | max size. | |
8425 | """ | |
5b5c9bc7 | 8426 | return _core_.Window_SetMaxSize(*args, **kwargs) |
908b74cd | 8427 | |
d55e5bfc RD |
8428 | def GetMinWidth(*args, **kwargs): |
8429 | """GetMinWidth(self) -> int""" | |
5b5c9bc7 | 8430 | return _core_.Window_GetMinWidth(*args, **kwargs) |
d55e5bfc RD |
8431 | |
8432 | def GetMinHeight(*args, **kwargs): | |
8433 | """GetMinHeight(self) -> int""" | |
5b5c9bc7 | 8434 | return _core_.Window_GetMinHeight(*args, **kwargs) |
d55e5bfc RD |
8435 | |
8436 | def GetMaxWidth(*args, **kwargs): | |
8437 | """GetMaxWidth(self) -> int""" | |
5b5c9bc7 | 8438 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
d55e5bfc RD |
8439 | |
8440 | def GetMaxHeight(*args, **kwargs): | |
8441 | """GetMaxHeight(self) -> int""" | |
5b5c9bc7 | 8442 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
d55e5bfc | 8443 | |
d55e5bfc RD |
8444 | def SetVirtualSize(*args, **kwargs): |
8445 | """ | |
5b5c9bc7 | 8446 | SetVirtualSize(self, Size size) |
d55e5bfc RD |
8447 | |
8448 | Set the the virtual size of a window in pixels. For most windows this | |
8449 | is just the client area of the window, but for some like scrolled | |
8450 | windows it is more or less independent of the screen window size. | |
8451 | """ | |
5b5c9bc7 | 8452 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8453 | |
8454 | def SetVirtualSizeWH(*args, **kwargs): | |
8455 | """ | |
8456 | SetVirtualSizeWH(self, int w, int h) | |
8457 | ||
8458 | Set the the virtual size of a window in pixels. For most windows this | |
8459 | is just the client area of the window, but for some like scrolled | |
8460 | windows it is more or less independent of the screen window size. | |
8461 | """ | |
5b5c9bc7 | 8462 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
d55e5bfc RD |
8463 | |
8464 | def GetVirtualSize(*args, **kwargs): | |
8465 | """ | |
5b5c9bc7 | 8466 | GetVirtualSize(self) -> Size |
d55e5bfc RD |
8467 | |
8468 | Get the the virtual size of the window in pixels. For most windows | |
8469 | this is just the client area of the window, but for some like scrolled | |
8470 | windows it is more or less independent of the screen window size. | |
8471 | """ | |
5b5c9bc7 | 8472 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8473 | |
8474 | def GetVirtualSizeTuple(*args, **kwargs): | |
8475 | """ | |
8476 | GetVirtualSizeTuple() -> (width, height) | |
8477 | ||
8478 | Get the the virtual size of the window in pixels. For most windows | |
8479 | this is just the client area of the window, but for some like scrolled | |
8480 | windows it is more or less independent of the screen window size. | |
8481 | """ | |
5b5c9bc7 | 8482 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
d55e5bfc RD |
8483 | |
8484 | def GetBestVirtualSize(*args, **kwargs): | |
8485 | """ | |
5b5c9bc7 | 8486 | GetBestVirtualSize(self) -> Size |
d55e5bfc RD |
8487 | |
8488 | Return the largest of ClientSize and BestSize (as determined by a | |
8489 | sizer, interior children, or other means) | |
8490 | """ | |
5b5c9bc7 | 8491 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8492 | |
8493 | def Show(*args, **kwargs): | |
8494 | """ | |
8495 | Show(self, bool show=True) -> bool | |
8496 | ||
8497 | Shows or hides the window. You may need to call Raise for a top level | |
8498 | window if you want to bring it to top, although this is not needed if | |
8499 | Show is called immediately after the frame creation. Returns True if | |
8500 | the window has been shown or hidden or False if nothing was done | |
8501 | because it already was in the requested state. | |
8502 | """ | |
5b5c9bc7 | 8503 | return _core_.Window_Show(*args, **kwargs) |
d55e5bfc RD |
8504 | |
8505 | def Hide(*args, **kwargs): | |
8506 | """ | |
8507 | Hide(self) -> bool | |
8508 | ||
8509 | Equivalent to calling Show(False). | |
8510 | """ | |
5b5c9bc7 | 8511 | return _core_.Window_Hide(*args, **kwargs) |
d55e5bfc RD |
8512 | |
8513 | def Enable(*args, **kwargs): | |
8514 | """ | |
8515 | Enable(self, bool enable=True) -> bool | |
8516 | ||
8517 | Enable or disable the window for user input. Note that when a parent | |
8518 | window is disabled, all of its children are disabled as well and they | |
8519 | are reenabled again when the parent is. Returns true if the window | |
8520 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8521 | window had already been in the specified state. | |
8522 | """ | |
5b5c9bc7 | 8523 | return _core_.Window_Enable(*args, **kwargs) |
d55e5bfc RD |
8524 | |
8525 | def Disable(*args, **kwargs): | |
8526 | """ | |
8527 | Disable(self) -> bool | |
8528 | ||
8529 | Disables the window, same as Enable(false). | |
8530 | """ | |
5b5c9bc7 | 8531 | return _core_.Window_Disable(*args, **kwargs) |
d55e5bfc RD |
8532 | |
8533 | def IsShown(*args, **kwargs): | |
8534 | """ | |
8535 | IsShown(self) -> bool | |
8536 | ||
8537 | Returns true if the window is shown, false if it has been hidden. | |
8538 | """ | |
5b5c9bc7 | 8539 | return _core_.Window_IsShown(*args, **kwargs) |
d55e5bfc RD |
8540 | |
8541 | def IsEnabled(*args, **kwargs): | |
8542 | """ | |
8543 | IsEnabled(self) -> bool | |
8544 | ||
8545 | Returns true if the window is enabled for input, false otherwise. | |
8546 | """ | |
5b5c9bc7 | 8547 | return _core_.Window_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
8548 | |
8549 | def SetWindowStyleFlag(*args, **kwargs): | |
8550 | """ | |
8551 | SetWindowStyleFlag(self, long style) | |
8552 | ||
15817c7e RD |
8553 | Sets the style of the window. Please note that some styles cannot be |
8554 | changed after the window creation and that Refresh() might need to be | |
8555 | called after changing the others for the change to take place | |
8556 | immediately. | |
d55e5bfc | 8557 | """ |
5b5c9bc7 | 8558 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
d55e5bfc RD |
8559 | |
8560 | def GetWindowStyleFlag(*args, **kwargs): | |
8561 | """ | |
8562 | GetWindowStyleFlag(self) -> long | |
8563 | ||
8564 | Gets the window style that was passed to the constructor or Create | |
8565 | method. | |
8566 | """ | |
5b5c9bc7 | 8567 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
d55e5bfc RD |
8568 | |
8569 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag | |
8570 | def HasFlag(*args, **kwargs): | |
8571 | """ | |
8572 | HasFlag(self, int flag) -> bool | |
8573 | ||
8574 | Test if the given style is set for this window. | |
8575 | """ | |
5b5c9bc7 | 8576 | return _core_.Window_HasFlag(*args, **kwargs) |
d55e5bfc RD |
8577 | |
8578 | def IsRetained(*args, **kwargs): | |
8579 | """ | |
8580 | IsRetained(self) -> bool | |
8581 | ||
8582 | Returns true if the window is retained, false otherwise. Retained | |
8583 | windows are only available on X platforms. | |
8584 | """ | |
5b5c9bc7 | 8585 | return _core_.Window_IsRetained(*args, **kwargs) |
d55e5bfc RD |
8586 | |
8587 | def SetExtraStyle(*args, **kwargs): | |
8588 | """ | |
8589 | SetExtraStyle(self, long exStyle) | |
8590 | ||
8591 | Sets the extra style bits for the window. Extra styles are the less | |
8592 | often used style bits which can't be set with the constructor or with | |
8593 | SetWindowStyleFlag() | |
8594 | """ | |
5b5c9bc7 | 8595 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
d55e5bfc RD |
8596 | |
8597 | def GetExtraStyle(*args, **kwargs): | |
8598 | """ | |
8599 | GetExtraStyle(self) -> long | |
8600 | ||
8601 | Returns the extra style bits for the window. | |
8602 | """ | |
5b5c9bc7 | 8603 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
d55e5bfc RD |
8604 | |
8605 | def MakeModal(*args, **kwargs): | |
8606 | """ | |
8607 | MakeModal(self, bool modal=True) | |
8608 | ||
8609 | Disables all other windows in the application so that the user can | |
8610 | only interact with this window. Passing False will reverse this | |
8611 | effect. | |
8612 | """ | |
5b5c9bc7 | 8613 | return _core_.Window_MakeModal(*args, **kwargs) |
d55e5bfc RD |
8614 | |
8615 | def SetThemeEnabled(*args, **kwargs): | |
8616 | """ | |
8617 | SetThemeEnabled(self, bool enableTheme) | |
8618 | ||
8619 | This function tells a window if it should use the system's "theme" | |
8620 | code to draw the windows' background instead if its own background | |
8621 | drawing code. This will only have an effect on platforms that support | |
8622 | the notion of themes in user defined windows. One such platform is | |
8623 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8624 | user's selected theme. | |
8625 | ||
8626 | Dialogs, notebook pages and the status bar have this flag set to true | |
8627 | by default so that the default look and feel is simulated best. | |
8628 | """ | |
5b5c9bc7 | 8629 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
d55e5bfc RD |
8630 | |
8631 | def GetThemeEnabled(*args, **kwargs): | |
8632 | """ | |
8633 | GetThemeEnabled(self) -> bool | |
8634 | ||
8635 | Return the themeEnabled flag. | |
8636 | """ | |
5b5c9bc7 | 8637 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
d55e5bfc RD |
8638 | |
8639 | def SetFocus(*args, **kwargs): | |
8640 | """ | |
8641 | SetFocus(self) | |
8642 | ||
8643 | Set's the focus to this window, allowing it to receive keyboard input. | |
8644 | """ | |
5b5c9bc7 | 8645 | return _core_.Window_SetFocus(*args, **kwargs) |
d55e5bfc RD |
8646 | |
8647 | def SetFocusFromKbd(*args, **kwargs): | |
8648 | """ | |
8649 | SetFocusFromKbd(self) | |
8650 | ||
8651 | Set focus to this window as the result of a keyboard action. Normally | |
8652 | only called internally. | |
8653 | """ | |
5b5c9bc7 | 8654 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
d55e5bfc RD |
8655 | |
8656 | def FindFocus(*args, **kwargs): | |
8657 | """ | |
5b5c9bc7 | 8658 | FindFocus() -> Window |
d55e5bfc RD |
8659 | |
8660 | Returns the window or control that currently has the keyboard focus, | |
8661 | or None. | |
8662 | """ | |
5b5c9bc7 | 8663 | return _core_.Window_FindFocus(*args, **kwargs) |
d55e5bfc RD |
8664 | |
8665 | FindFocus = staticmethod(FindFocus) | |
8666 | def AcceptsFocus(*args, **kwargs): | |
8667 | """ | |
8668 | AcceptsFocus(self) -> bool | |
8669 | ||
8670 | Can this window have focus? | |
8671 | """ | |
5b5c9bc7 | 8672 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
d55e5bfc RD |
8673 | |
8674 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
8675 | """ | |
8676 | AcceptsFocusFromKeyboard(self) -> bool | |
8677 | ||
8678 | Can this window be given focus by keyboard navigation? if not, the | |
8679 | only way to give it focus (provided it accepts it at all) is to click | |
8680 | it. | |
8681 | """ | |
5b5c9bc7 | 8682 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
d55e5bfc RD |
8683 | |
8684 | def GetDefaultItem(*args, **kwargs): | |
8685 | """ | |
5b5c9bc7 | 8686 | GetDefaultItem(self) -> Window |
d55e5bfc RD |
8687 | |
8688 | Get the default child of this parent, i.e. the one which is activated | |
8689 | by pressing <Enter> such as the OK button on a wx.Dialog. | |
8690 | """ | |
5b5c9bc7 | 8691 | return _core_.Window_GetDefaultItem(*args, **kwargs) |
d55e5bfc RD |
8692 | |
8693 | def SetDefaultItem(*args, **kwargs): | |
8694 | """ | |
5b5c9bc7 | 8695 | SetDefaultItem(self, Window child) -> Window |
d55e5bfc RD |
8696 | |
8697 | Set this child as default, return the old default. | |
8698 | """ | |
5b5c9bc7 | 8699 | return _core_.Window_SetDefaultItem(*args, **kwargs) |
d55e5bfc RD |
8700 | |
8701 | def SetTmpDefaultItem(*args, **kwargs): | |
8702 | """ | |
5b5c9bc7 | 8703 | SetTmpDefaultItem(self, Window win) |
d55e5bfc RD |
8704 | |
8705 | Set this child as temporary default | |
8706 | """ | |
5b5c9bc7 | 8707 | return _core_.Window_SetTmpDefaultItem(*args, **kwargs) |
d55e5bfc | 8708 | |
908b74cd RD |
8709 | def Navigate(*args, **kwargs): |
8710 | """ | |
8711 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8712 | ||
fd2dc343 RD |
8713 | Does keyboard navigation from this window to another, by sending a |
8714 | `wx.NavigationKeyEvent`. | |
908b74cd | 8715 | """ |
5b5c9bc7 | 8716 | return _core_.Window_Navigate(*args, **kwargs) |
908b74cd | 8717 | |
bf26d883 RD |
8718 | def MoveAfterInTabOrder(*args, **kwargs): |
8719 | """ | |
5b5c9bc7 | 8720 | MoveAfterInTabOrder(self, Window win) |
bf26d883 RD |
8721 | |
8722 | Moves this window in the tab navigation order after the specified | |
8723 | sibling window. This means that when the user presses the TAB key on | |
8724 | that other window, the focus switches to this window. | |
8725 | ||
8726 | The default tab order is the same as creation order. This function | |
8727 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8728 | windows. | |
8729 | ||
8730 | """ | |
5b5c9bc7 | 8731 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) |
bf26d883 RD |
8732 | |
8733 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8734 | """ | |
5b5c9bc7 | 8735 | MoveBeforeInTabOrder(self, Window win) |
bf26d883 RD |
8736 | |
8737 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8738 | before win instead of putting it right after it. | |
8739 | """ | |
5b5c9bc7 | 8740 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) |
bf26d883 | 8741 | |
d55e5bfc RD |
8742 | def GetChildren(*args, **kwargs): |
8743 | """ | |
8744 | GetChildren(self) -> PyObject | |
8745 | ||
8746 | Returns a list of the window's children. NOTE: Currently this is a | |
8747 | copy of the child window list maintained by the window, so the return | |
8748 | value of this function is only valid as long as the window's children | |
8749 | do not change. | |
8750 | """ | |
5b5c9bc7 | 8751 | return _core_.Window_GetChildren(*args, **kwargs) |
d55e5bfc RD |
8752 | |
8753 | def GetParent(*args, **kwargs): | |
8754 | """ | |
5b5c9bc7 | 8755 | GetParent(self) -> Window |
d55e5bfc RD |
8756 | |
8757 | Returns the parent window of this window, or None if there isn't one. | |
8758 | """ | |
5b5c9bc7 | 8759 | return _core_.Window_GetParent(*args, **kwargs) |
d55e5bfc RD |
8760 | |
8761 | def GetGrandParent(*args, **kwargs): | |
8762 | """ | |
5b5c9bc7 | 8763 | GetGrandParent(self) -> Window |
d55e5bfc | 8764 | |
15817c7e RD |
8765 | Returns the parent of the parent of this window, or None if there |
8766 | isn't one. | |
d55e5bfc | 8767 | """ |
5b5c9bc7 | 8768 | return _core_.Window_GetGrandParent(*args, **kwargs) |
d55e5bfc RD |
8769 | |
8770 | def IsTopLevel(*args, **kwargs): | |
8771 | """ | |
8772 | IsTopLevel(self) -> bool | |
8773 | ||
8774 | Returns true if the given window is a top-level one. Currently all | |
8775 | frames and dialogs are always considered to be top-level windows (even | |
8776 | if they have a parent window). | |
8777 | """ | |
5b5c9bc7 | 8778 | return _core_.Window_IsTopLevel(*args, **kwargs) |
d55e5bfc RD |
8779 | |
8780 | def Reparent(*args, **kwargs): | |
8781 | """ | |
5b5c9bc7 | 8782 | Reparent(self, Window newParent) -> bool |
d55e5bfc RD |
8783 | |
8784 | Reparents the window, i.e the window will be removed from its current | |
8785 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
8786 | re-inserted into another. Available on Windows and GTK. Returns True | |
8787 | if the parent was changed, False otherwise (error or newParent == | |
8788 | oldParent) | |
8789 | """ | |
5b5c9bc7 | 8790 | return _core_.Window_Reparent(*args, **kwargs) |
d55e5bfc RD |
8791 | |
8792 | def AddChild(*args, **kwargs): | |
8793 | """ | |
5b5c9bc7 | 8794 | AddChild(self, Window child) |
d55e5bfc RD |
8795 | |
8796 | Adds a child window. This is called automatically by window creation | |
8797 | functions so should not be required by the application programmer. | |
8798 | """ | |
5b5c9bc7 | 8799 | return _core_.Window_AddChild(*args, **kwargs) |
d55e5bfc RD |
8800 | |
8801 | def RemoveChild(*args, **kwargs): | |
8802 | """ | |
5b5c9bc7 | 8803 | RemoveChild(self, Window child) |
d55e5bfc RD |
8804 | |
8805 | Removes a child window. This is called automatically by window | |
8806 | deletion functions so should not be required by the application | |
8807 | programmer. | |
8808 | """ | |
5b5c9bc7 | 8809 | return _core_.Window_RemoveChild(*args, **kwargs) |
d55e5bfc RD |
8810 | |
8811 | def FindWindowById(*args, **kwargs): | |
8812 | """ | |
5b5c9bc7 | 8813 | FindWindowById(self, long winid) -> Window |
d55e5bfc RD |
8814 | |
8815 | Find a chld of this window by window ID | |
8816 | """ | |
5b5c9bc7 | 8817 | return _core_.Window_FindWindowById(*args, **kwargs) |
d55e5bfc RD |
8818 | |
8819 | def FindWindowByName(*args, **kwargs): | |
8820 | """ | |
5b5c9bc7 | 8821 | FindWindowByName(self, String name) -> Window |
d55e5bfc RD |
8822 | |
8823 | Find a child of this window by name | |
8824 | """ | |
5b5c9bc7 | 8825 | return _core_.Window_FindWindowByName(*args, **kwargs) |
d55e5bfc RD |
8826 | |
8827 | def GetEventHandler(*args, **kwargs): | |
8828 | """ | |
5b5c9bc7 | 8829 | GetEventHandler(self) -> EvtHandler |
d55e5bfc RD |
8830 | |
8831 | Returns the event handler for this window. By default, the window is | |
8832 | its own event handler. | |
8833 | """ | |
5b5c9bc7 | 8834 | return _core_.Window_GetEventHandler(*args, **kwargs) |
d55e5bfc RD |
8835 | |
8836 | def SetEventHandler(*args, **kwargs): | |
8837 | """ | |
5b5c9bc7 | 8838 | SetEventHandler(self, EvtHandler handler) |
d55e5bfc RD |
8839 | |
8840 | Sets the event handler for this window. An event handler is an object | |
8841 | that is capable of processing the events sent to a window. By default, | |
8842 | the window is its own event handler, but an application may wish to | |
8843 | substitute another, for example to allow central implementation of | |
8844 | event-handling for a variety of different window classes. | |
8845 | ||
15817c7e | 8846 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
d55e5bfc RD |
8847 | up a chain of event handlers, where an event not handled by one event |
8848 | handler is handed to the next one in the chain. | |
8849 | """ | |
5b5c9bc7 | 8850 | return _core_.Window_SetEventHandler(*args, **kwargs) |
d55e5bfc RD |
8851 | |
8852 | def PushEventHandler(*args, **kwargs): | |
8853 | """ | |
5b5c9bc7 | 8854 | PushEventHandler(self, EvtHandler handler) |
d55e5bfc RD |
8855 | |
8856 | Pushes this event handler onto the event handler stack for the window. | |
8857 | An event handler is an object that is capable of processing the events | |
8858 | sent to a window. By default, the window is its own event handler, but | |
8859 | an application may wish to substitute another, for example to allow | |
8860 | central implementation of event-handling for a variety of different | |
8861 | window classes. | |
8862 | ||
8863 | wx.Window.PushEventHandler allows an application to set up a chain of | |
8864 | event handlers, where an event not handled by one event handler is | |
15817c7e | 8865 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` to |
d55e5bfc RD |
8866 | remove the event handler. |
8867 | """ | |
5b5c9bc7 | 8868 | return _core_.Window_PushEventHandler(*args, **kwargs) |
d55e5bfc RD |
8869 | |
8870 | def PopEventHandler(*args, **kwargs): | |
8871 | """ | |
5b5c9bc7 | 8872 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
d55e5bfc RD |
8873 | |
8874 | Removes and returns the top-most event handler on the event handler | |
8875 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
8876 | destroyed after it is popped. | |
8877 | """ | |
5b5c9bc7 | 8878 | return _core_.Window_PopEventHandler(*args, **kwargs) |
d55e5bfc RD |
8879 | |
8880 | def RemoveEventHandler(*args, **kwargs): | |
8881 | """ | |
5b5c9bc7 | 8882 | RemoveEventHandler(self, EvtHandler handler) -> bool |
d55e5bfc | 8883 | |
15817c7e RD |
8884 | Find the given handler in the event handler chain and remove (but not |
8885 | delete) it from the event handler chain, return True if it was found | |
8886 | and False otherwise (this also results in an assert failure so this | |
8887 | function should only be called when the handler is supposed to be | |
8888 | there.) | |
d55e5bfc | 8889 | """ |
5b5c9bc7 | 8890 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
d55e5bfc RD |
8891 | |
8892 | def SetValidator(*args, **kwargs): | |
8893 | """ | |
5b5c9bc7 | 8894 | SetValidator(self, Validator validator) |
d55e5bfc RD |
8895 | |
8896 | Deletes the current validator (if any) and sets the window validator, | |
8897 | having called wx.Validator.Clone to create a new validator of this | |
8898 | type. | |
8899 | """ | |
5b5c9bc7 | 8900 | return _core_.Window_SetValidator(*args, **kwargs) |
d55e5bfc RD |
8901 | |
8902 | def GetValidator(*args, **kwargs): | |
8903 | """ | |
5b5c9bc7 | 8904 | GetValidator(self) -> Validator |
d55e5bfc RD |
8905 | |
8906 | Returns a pointer to the current validator for the window, or None if | |
8907 | there is none. | |
8908 | """ | |
5b5c9bc7 | 8909 | return _core_.Window_GetValidator(*args, **kwargs) |
d55e5bfc RD |
8910 | |
8911 | def Validate(*args, **kwargs): | |
8912 | """ | |
8913 | Validate(self) -> bool | |
8914 | ||
8915 | Validates the current values of the child controls using their | |
15817c7e RD |
8916 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
8917 | style flag set, the method will also call Validate() of all child | |
8918 | windows. Returns false if any of the validations failed. | |
d55e5bfc | 8919 | """ |
5b5c9bc7 | 8920 | return _core_.Window_Validate(*args, **kwargs) |
d55e5bfc RD |
8921 | |
8922 | def TransferDataToWindow(*args, **kwargs): | |
8923 | """ | |
8924 | TransferDataToWindow(self) -> bool | |
8925 | ||
15817c7e RD |
8926 | Transfers values to child controls from data areas specified by their |
8927 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
8928 | style flag set, the method will also call TransferDataToWindow() of | |
8929 | all child windows. | |
d55e5bfc | 8930 | """ |
5b5c9bc7 | 8931 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
d55e5bfc RD |
8932 | |
8933 | def TransferDataFromWindow(*args, **kwargs): | |
8934 | """ | |
8935 | TransferDataFromWindow(self) -> bool | |
8936 | ||
15817c7e RD |
8937 | Transfers values from child controls to data areas specified by their |
8938 | validators. Returns false if a transfer failed. If the window has | |
8939 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
8940 | also call TransferDataFromWindow() of all child windows. | |
d55e5bfc | 8941 | """ |
5b5c9bc7 | 8942 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
d55e5bfc RD |
8943 | |
8944 | def InitDialog(*args, **kwargs): | |
8945 | """ | |
8946 | InitDialog(self) | |
8947 | ||
15817c7e RD |
8948 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
8949 | to the dialog via validators. | |
d55e5bfc | 8950 | """ |
5b5c9bc7 | 8951 | return _core_.Window_InitDialog(*args, **kwargs) |
d55e5bfc RD |
8952 | |
8953 | def SetAcceleratorTable(*args, **kwargs): | |
8954 | """ | |
5b5c9bc7 | 8955 | SetAcceleratorTable(self, AcceleratorTable accel) |
d55e5bfc RD |
8956 | |
8957 | Sets the accelerator table for this window. | |
8958 | """ | |
5b5c9bc7 | 8959 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
d55e5bfc RD |
8960 | |
8961 | def GetAcceleratorTable(*args, **kwargs): | |
8962 | """ | |
5b5c9bc7 | 8963 | GetAcceleratorTable(self) -> AcceleratorTable |
d55e5bfc RD |
8964 | |
8965 | Gets the accelerator table for this window. | |
8966 | """ | |
5b5c9bc7 | 8967 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
d55e5bfc RD |
8968 | |
8969 | def RegisterHotKey(*args, **kwargs): | |
8970 | """ | |
8971 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool | |
8972 | ||
8973 | Registers a system wide hotkey. Every time the user presses the hotkey | |
8974 | registered here, this window will receive a hotkey event. It will | |
8975 | receive the event even if the application is in the background and | |
8976 | does not have the input focus because the user is working with some | |
8977 | other application. To bind an event handler function to this hotkey | |
8978 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
8979 | hotkey was registered successfully. | |
8980 | """ | |
5b5c9bc7 | 8981 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
d55e5bfc RD |
8982 | |
8983 | def UnregisterHotKey(*args, **kwargs): | |
8984 | """ | |
8985 | UnregisterHotKey(self, int hotkeyId) -> bool | |
8986 | ||
8987 | Unregisters a system wide hotkey. | |
8988 | """ | |
5b5c9bc7 | 8989 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
d55e5bfc RD |
8990 | |
8991 | def ConvertDialogPointToPixels(*args, **kwargs): | |
8992 | """ | |
5b5c9bc7 | 8993 | ConvertDialogPointToPixels(self, Point pt) -> Point |
d55e5bfc RD |
8994 | |
8995 | Converts a point or size from dialog units to pixels. Dialog units | |
8996 | are used for maintaining a dialog's proportions even if the font | |
8997 | changes. For the x dimension, the dialog units are multiplied by the | |
8998 | average character width and then divided by 4. For the y dimension, | |
8999 | the dialog units are multiplied by the average character height and | |
9000 | then divided by 8. | |
9001 | """ | |
5b5c9bc7 | 9002 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
d55e5bfc RD |
9003 | |
9004 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
9005 | """ | |
5b5c9bc7 | 9006 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
d55e5bfc RD |
9007 | |
9008 | Converts a point or size from dialog units to pixels. Dialog units | |
9009 | are used for maintaining a dialog's proportions even if the font | |
9010 | changes. For the x dimension, the dialog units are multiplied by the | |
9011 | average character width and then divided by 4. For the y dimension, | |
9012 | the dialog units are multiplied by the average character height and | |
9013 | then divided by 8. | |
9014 | """ | |
5b5c9bc7 | 9015 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
d55e5bfc RD |
9016 | |
9017 | def DLG_PNT(*args, **kwargs): | |
9018 | """ | |
5b5c9bc7 | 9019 | DLG_PNT(self, Point pt) -> Point |
d55e5bfc RD |
9020 | |
9021 | Converts a point or size from dialog units to pixels. Dialog units | |
9022 | are used for maintaining a dialog's proportions even if the font | |
9023 | changes. For the x dimension, the dialog units are multiplied by the | |
9024 | average character width and then divided by 4. For the y dimension, | |
9025 | the dialog units are multiplied by the average character height and | |
9026 | then divided by 8. | |
9027 | """ | |
5b5c9bc7 | 9028 | return _core_.Window_DLG_PNT(*args, **kwargs) |
d55e5bfc RD |
9029 | |
9030 | def DLG_SZE(*args, **kwargs): | |
9031 | """ | |
5b5c9bc7 | 9032 | DLG_SZE(self, Size sz) -> Size |
d55e5bfc RD |
9033 | |
9034 | Converts a point or size from dialog units to pixels. Dialog units | |
9035 | are used for maintaining a dialog's proportions even if the font | |
9036 | changes. For the x dimension, the dialog units are multiplied by the | |
9037 | average character width and then divided by 4. For the y dimension, | |
9038 | the dialog units are multiplied by the average character height and | |
9039 | then divided by 8. | |
9040 | """ | |
5b5c9bc7 | 9041 | return _core_.Window_DLG_SZE(*args, **kwargs) |
d55e5bfc RD |
9042 | |
9043 | def ConvertPixelPointToDialog(*args, **kwargs): | |
5b5c9bc7 RD |
9044 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
9045 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) | |
d55e5bfc RD |
9046 | |
9047 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
5b5c9bc7 RD |
9048 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
9049 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) | |
d55e5bfc RD |
9050 | |
9051 | def WarpPointer(*args, **kwargs): | |
9052 | """ | |
9053 | WarpPointer(self, int x, int y) | |
9054 | ||
9055 | Moves the pointer to the given position on the window. | |
9056 | ||
9057 | NOTE: This function is not supported under Mac because Apple Human | |
9058 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
9059 | """ | |
5b5c9bc7 | 9060 | return _core_.Window_WarpPointer(*args, **kwargs) |
d55e5bfc RD |
9061 | |
9062 | def CaptureMouse(*args, **kwargs): | |
9063 | """ | |
9064 | CaptureMouse(self) | |
9065 | ||
9066 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
9067 | release the capture. | |
9068 | ||
9069 | Note that wxWindows maintains the stack of windows having captured the | |
9070 | mouse and when the mouse is released the capture returns to the window | |
9071 | which had had captured it previously and it is only really released if | |
9072 | there were no previous window. In particular, this means that you must | |
9073 | release the mouse as many times as you capture it. | |
9074 | """ | |
5b5c9bc7 | 9075 | return _core_.Window_CaptureMouse(*args, **kwargs) |
d55e5bfc RD |
9076 | |
9077 | def ReleaseMouse(*args, **kwargs): | |
9078 | """ | |
9079 | ReleaseMouse(self) | |
9080 | ||
9081 | Releases mouse input captured with wx.Window.CaptureMouse. | |
9082 | """ | |
5b5c9bc7 | 9083 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
d55e5bfc RD |
9084 | |
9085 | def GetCapture(*args, **kwargs): | |
9086 | """ | |
5b5c9bc7 | 9087 | GetCapture() -> Window |
d55e5bfc RD |
9088 | |
9089 | Returns the window which currently captures the mouse or None | |
9090 | """ | |
5b5c9bc7 | 9091 | return _core_.Window_GetCapture(*args, **kwargs) |
d55e5bfc RD |
9092 | |
9093 | GetCapture = staticmethod(GetCapture) | |
9094 | def HasCapture(*args, **kwargs): | |
9095 | """ | |
9096 | HasCapture(self) -> bool | |
9097 | ||
9098 | Returns true if this window has the current mouse capture. | |
9099 | """ | |
5b5c9bc7 | 9100 | return _core_.Window_HasCapture(*args, **kwargs) |
d55e5bfc RD |
9101 | |
9102 | def Refresh(*args, **kwargs): | |
9103 | """ | |
5b5c9bc7 | 9104 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
d55e5bfc RD |
9105 | |
9106 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
9107 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
9108 | to the window. | |
9109 | """ | |
5b5c9bc7 | 9110 | return _core_.Window_Refresh(*args, **kwargs) |
d55e5bfc RD |
9111 | |
9112 | def RefreshRect(*args, **kwargs): | |
9113 | """ | |
5b5c9bc7 | 9114 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
d55e5bfc RD |
9115 | |
9116 | Redraws the contents of the given rectangle: the area inside it will | |
9117 | be repainted. This is the same as Refresh but has a nicer syntax. | |
9118 | """ | |
5b5c9bc7 | 9119 | return _core_.Window_RefreshRect(*args, **kwargs) |
d55e5bfc RD |
9120 | |
9121 | def Update(*args, **kwargs): | |
9122 | """ | |
9123 | Update(self) | |
9124 | ||
9125 | Calling this method immediately repaints the invalidated area of the | |
9126 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
9127 | this would usually only happen when the flow of control returns to the | |
9128 | event loop.) Notice that this function doesn't refresh the window and | |
9129 | does nothing if the window has been already repainted. Use Refresh | |
9130 | first if you want to immediately redraw the window (or some portion of | |
9131 | it) unconditionally. | |
9132 | """ | |
5b5c9bc7 | 9133 | return _core_.Window_Update(*args, **kwargs) |
d55e5bfc RD |
9134 | |
9135 | def ClearBackground(*args, **kwargs): | |
9136 | """ | |
9137 | ClearBackground(self) | |
9138 | ||
9139 | Clears the window by filling it with the current background | |
9140 | colour. Does not cause an erase background event to be generated. | |
9141 | """ | |
5b5c9bc7 | 9142 | return _core_.Window_ClearBackground(*args, **kwargs) |
d55e5bfc RD |
9143 | |
9144 | def Freeze(*args, **kwargs): | |
9145 | """ | |
9146 | Freeze(self) | |
9147 | ||
15817c7e RD |
9148 | Freezes the window or, in other words, prevents any updates from |
9149 | taking place on screen, the window is not redrawn at all. Thaw must be | |
9150 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
9151 | nested, with the actual Thaw being delayed until all the nesting has | |
9152 | been undone. | |
d55e5bfc RD |
9153 | |
9154 | This method is useful for visual appearance optimization (for example, | |
9155 | it is a good idea to use it before inserting large amount of text into | |
9156 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
9157 | for all controls so it is mostly just a hint to wxWindows and not a | |
9158 | mandatory directive. | |
9159 | """ | |
5b5c9bc7 | 9160 | return _core_.Window_Freeze(*args, **kwargs) |
d55e5bfc RD |
9161 | |
9162 | def Thaw(*args, **kwargs): | |
9163 | """ | |
9164 | Thaw(self) | |
9165 | ||
9166 | Reenables window updating after a previous call to Freeze. Calls to | |
15817c7e RD |
9167 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
9168 | times that Freeze was before the window will be updated. | |
d55e5bfc | 9169 | """ |
5b5c9bc7 | 9170 | return _core_.Window_Thaw(*args, **kwargs) |
d55e5bfc RD |
9171 | |
9172 | def PrepareDC(*args, **kwargs): | |
9173 | """ | |
5b5c9bc7 | 9174 | PrepareDC(self, DC dc) |
d55e5bfc RD |
9175 | |
9176 | Call this function to prepare the device context for drawing a | |
9177 | scrolled image. It sets the device origin according to the current | |
9178 | scroll position. | |
9179 | """ | |
5b5c9bc7 | 9180 | return _core_.Window_PrepareDC(*args, **kwargs) |
d55e5bfc RD |
9181 | |
9182 | def GetUpdateRegion(*args, **kwargs): | |
9183 | """ | |
5b5c9bc7 | 9184 | GetUpdateRegion(self) -> Region |
d55e5bfc RD |
9185 | |
9186 | Returns the region specifying which parts of the window have been | |
9187 | damaged. Should only be called within an EVT_PAINT handler. | |
9188 | """ | |
5b5c9bc7 | 9189 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
d55e5bfc RD |
9190 | |
9191 | def GetUpdateClientRect(*args, **kwargs): | |
9192 | """ | |
5b5c9bc7 | 9193 | GetUpdateClientRect(self) -> Rect |
d55e5bfc RD |
9194 | |
9195 | Get the update rectangle region bounding box in client coords. | |
9196 | """ | |
5b5c9bc7 | 9197 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
d55e5bfc RD |
9198 | |
9199 | def IsExposed(*args, **kwargs): | |
9200 | """ | |
9201 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool | |
9202 | ||
9203 | Returns true if the given point or rectangle area has been exposed | |
9204 | since the last repaint. Call this in an paint event handler to | |
9205 | optimize redrawing by only redrawing those areas, which have been | |
9206 | exposed. | |
9207 | """ | |
5b5c9bc7 | 9208 | return _core_.Window_IsExposed(*args, **kwargs) |
d55e5bfc RD |
9209 | |
9210 | def IsExposedPoint(*args, **kwargs): | |
9211 | """ | |
5b5c9bc7 | 9212 | IsExposedPoint(self, Point pt) -> bool |
d55e5bfc RD |
9213 | |
9214 | Returns true if the given point or rectangle area has been exposed | |
9215 | since the last repaint. Call this in an paint event handler to | |
9216 | optimize redrawing by only redrawing those areas, which have been | |
9217 | exposed. | |
9218 | """ | |
5b5c9bc7 | 9219 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
d55e5bfc RD |
9220 | |
9221 | def IsExposedRect(*args, **kwargs): | |
9222 | """ | |
5b5c9bc7 | 9223 | IsExposedRect(self, Rect rect) -> bool |
d55e5bfc RD |
9224 | |
9225 | Returns true if the given point or rectangle area has been exposed | |
9226 | since the last repaint. Call this in an paint event handler to | |
9227 | optimize redrawing by only redrawing those areas, which have been | |
9228 | exposed. | |
9229 | """ | |
5b5c9bc7 | 9230 | return _core_.Window_IsExposedRect(*args, **kwargs) |
d55e5bfc RD |
9231 | |
9232 | def GetDefaultAttributes(*args, **kwargs): | |
9233 | """ | |
5b5c9bc7 | 9234 | GetDefaultAttributes(self) -> VisualAttributes |
d55e5bfc | 9235 | |
15817c7e RD |
9236 | Get the default attributes for an instance of this class. This is |
9237 | useful if you want to use the same font or colour in your own control | |
9238 | as in a standard control -- which is a much better idea than hard | |
9239 | coding specific colours or fonts which might look completely out of | |
a5ee0656 | 9240 | place on the user's system, especially if it uses themes. |
d55e5bfc | 9241 | """ |
5b5c9bc7 | 9242 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
9243 | |
9244 | def GetClassDefaultAttributes(*args, **kwargs): | |
9245 | """ | |
5b5c9bc7 | 9246 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
d55e5bfc | 9247 | |
15817c7e RD |
9248 | Get the default attributes for this class. This is useful if you want |
9249 | to use the same font or colour in your own control as in a standard | |
9250 | control -- which is a much better idea than hard coding specific | |
a5ee0656 RD |
9251 | colours or fonts which might look completely out of place on the |
9252 | user's system, especially if it uses themes. | |
d55e5bfc RD |
9253 | |
9254 | The variant parameter is only relevant under Mac currently and is | |
15817c7e | 9255 | ignore under other platforms. Under Mac, it will change the size of |
a5ee0656 RD |
9256 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9257 | this. | |
d55e5bfc | 9258 | """ |
5b5c9bc7 | 9259 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
9260 | |
9261 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
9262 | def SetBackgroundColour(*args, **kwargs): | |
9263 | """ | |
5b5c9bc7 | 9264 | SetBackgroundColour(self, Colour colour) -> bool |
d55e5bfc RD |
9265 | |
9266 | Sets the background colour of the window. Returns True if the colour | |
9267 | was changed. The background colour is usually painted by the default | |
9268 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9269 | automatically under GTK. Using `wx.NullColour` will reset the window |
9270 | to the default background colour. | |
d55e5bfc | 9271 | |
a5ee0656 | 9272 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9273 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
d55e5bfc RD |
9274 | calling this function. |
9275 | ||
f8167d6e RD |
9276 | Using this function will disable attempts to use themes for this |
9277 | window, if the system supports them. Use with care since usually the | |
9278 | themes represent the appearance chosen by the user to be used for all | |
9279 | applications on the system. | |
d55e5bfc | 9280 | """ |
5b5c9bc7 | 9281 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
d55e5bfc | 9282 | |
412d302d | 9283 | def SetOwnBackgroundColour(*args, **kwargs): |
5b5c9bc7 RD |
9284 | """SetOwnBackgroundColour(self, Colour colour)""" |
9285 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
d55e5bfc RD |
9286 | |
9287 | def SetForegroundColour(*args, **kwargs): | |
9288 | """ | |
5b5c9bc7 | 9289 | SetForegroundColour(self, Colour colour) -> bool |
d55e5bfc RD |
9290 | |
9291 | Sets the foreground colour of the window. Returns True is the colour | |
9292 | was changed. The interpretation of foreground colour is dependent on | |
9293 | the window class; it may be the text colour or other colour, or it may | |
9294 | not be used at all. | |
9295 | """ | |
5b5c9bc7 | 9296 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
d55e5bfc | 9297 | |
fa47d7a7 | 9298 | def SetOwnForegroundColour(*args, **kwargs): |
5b5c9bc7 RD |
9299 | """SetOwnForegroundColour(self, Colour colour)""" |
9300 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
d55e5bfc RD |
9301 | |
9302 | def GetBackgroundColour(*args, **kwargs): | |
9303 | """ | |
5b5c9bc7 | 9304 | GetBackgroundColour(self) -> Colour |
d55e5bfc RD |
9305 | |
9306 | Returns the background colour of the window. | |
9307 | """ | |
5b5c9bc7 | 9308 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
d55e5bfc RD |
9309 | |
9310 | def GetForegroundColour(*args, **kwargs): | |
9311 | """ | |
5b5c9bc7 | 9312 | GetForegroundColour(self) -> Colour |
d55e5bfc RD |
9313 | |
9314 | Returns the foreground colour of the window. The interpretation of | |
9315 | foreground colour is dependent on the window class; it may be the text | |
9316 | colour or other colour, or it may not be used at all. | |
9317 | """ | |
5b5c9bc7 | 9318 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
d55e5bfc | 9319 | |
dcb8fc74 RD |
9320 | def InheritsBackgroundColour(*args, **kwargs): |
9321 | """InheritsBackgroundColour(self) -> bool""" | |
5b5c9bc7 | 9322 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) |
dcb8fc74 RD |
9323 | |
9324 | def UseBgCol(*args, **kwargs): | |
9325 | """UseBgCol(self) -> bool""" | |
5b5c9bc7 | 9326 | return _core_.Window_UseBgCol(*args, **kwargs) |
dcb8fc74 | 9327 | |
0f63ec68 RD |
9328 | def SetBackgroundStyle(*args, **kwargs): |
9329 | """ | |
9330 | SetBackgroundStyle(self, int style) -> bool | |
9331 | ||
9332 | Returns the background style of the window. The background style | |
9333 | indicates how the background of the window is drawn. | |
9334 | ||
9335 | ====================== ======================================== | |
9336 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9337 | be determined by the system | |
9338 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9339 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9340 | application. | |
9341 | ====================== ======================================== | |
9342 | ||
9343 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9344 | a custom background, such as a tiled bitmap. Currently the style has | |
9345 | no effect on other platforms. | |
9346 | ||
9347 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9348 | """ | |
5b5c9bc7 | 9349 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) |
0f63ec68 RD |
9350 | |
9351 | def GetBackgroundStyle(*args, **kwargs): | |
9352 | """ | |
9353 | GetBackgroundStyle(self) -> int | |
9354 | ||
9355 | Returns the background style of the window. | |
9356 | ||
9357 | :see: `SetBackgroundStyle` | |
9358 | """ | |
5b5c9bc7 | 9359 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) |
0f63ec68 | 9360 | |
51b83b37 RD |
9361 | def HasTransparentBackground(*args, **kwargs): |
9362 | """ | |
9363 | HasTransparentBackground(self) -> bool | |
9364 | ||
9365 | Returns True if this window's background is transparent (as, for | |
9366 | example, for `wx.StaticText`) and should show the parent window's | |
9367 | background. | |
9368 | ||
9369 | This method is mostly used internally by the library itself and you | |
9370 | normally shouldn't have to call it. You may, however, have to override | |
9371 | it in your custom control classes to ensure that background is painted | |
9372 | correctly. | |
9373 | """ | |
5b5c9bc7 | 9374 | return _core_.Window_HasTransparentBackground(*args, **kwargs) |
51b83b37 | 9375 | |
d55e5bfc RD |
9376 | def SetCursor(*args, **kwargs): |
9377 | """ | |
5b5c9bc7 | 9378 | SetCursor(self, Cursor cursor) -> bool |
d55e5bfc RD |
9379 | |
9380 | Sets the window's cursor. Notice that the window cursor also sets it | |
9381 | for the children of the window implicitly. | |
9382 | ||
9383 | The cursor may be wx.NullCursor in which case the window cursor will | |
9384 | be reset back to default. | |
9385 | """ | |
5b5c9bc7 | 9386 | return _core_.Window_SetCursor(*args, **kwargs) |
d55e5bfc RD |
9387 | |
9388 | def GetCursor(*args, **kwargs): | |
9389 | """ | |
5b5c9bc7 | 9390 | GetCursor(self) -> Cursor |
d55e5bfc RD |
9391 | |
9392 | Return the cursor associated with this window. | |
9393 | """ | |
5b5c9bc7 | 9394 | return _core_.Window_GetCursor(*args, **kwargs) |
d55e5bfc RD |
9395 | |
9396 | def SetFont(*args, **kwargs): | |
9397 | """ | |
5b5c9bc7 | 9398 | SetFont(self, Font font) -> bool |
d55e5bfc RD |
9399 | |
9400 | Sets the font for this window. | |
9401 | """ | |
5b5c9bc7 | 9402 | return _core_.Window_SetFont(*args, **kwargs) |
d55e5bfc | 9403 | |
fa47d7a7 | 9404 | def SetOwnFont(*args, **kwargs): |
5b5c9bc7 RD |
9405 | """SetOwnFont(self, Font font)""" |
9406 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
d55e5bfc RD |
9407 | |
9408 | def GetFont(*args, **kwargs): | |
9409 | """ | |
5b5c9bc7 | 9410 | GetFont(self) -> Font |
d55e5bfc RD |
9411 | |
9412 | Returns the default font used for this window. | |
9413 | """ | |
5b5c9bc7 | 9414 | return _core_.Window_GetFont(*args, **kwargs) |
d55e5bfc RD |
9415 | |
9416 | def SetCaret(*args, **kwargs): | |
9417 | """ | |
5b5c9bc7 | 9418 | SetCaret(self, Caret caret) |
d55e5bfc RD |
9419 | |
9420 | Sets the caret associated with the window. | |
9421 | """ | |
5b5c9bc7 | 9422 | return _core_.Window_SetCaret(*args, **kwargs) |
d55e5bfc RD |
9423 | |
9424 | def GetCaret(*args, **kwargs): | |
9425 | """ | |
5b5c9bc7 | 9426 | GetCaret(self) -> Caret |
d55e5bfc RD |
9427 | |
9428 | Returns the caret associated with the window. | |
9429 | """ | |
5b5c9bc7 | 9430 | return _core_.Window_GetCaret(*args, **kwargs) |
d55e5bfc RD |
9431 | |
9432 | def GetCharHeight(*args, **kwargs): | |
9433 | """ | |
9434 | GetCharHeight(self) -> int | |
9435 | ||
9436 | Get the (average) character size for the current font. | |
9437 | """ | |
5b5c9bc7 | 9438 | return _core_.Window_GetCharHeight(*args, **kwargs) |
d55e5bfc RD |
9439 | |
9440 | def GetCharWidth(*args, **kwargs): | |
9441 | """ | |
9442 | GetCharWidth(self) -> int | |
9443 | ||
9444 | Get the (average) character size for the current font. | |
9445 | """ | |
5b5c9bc7 | 9446 | return _core_.Window_GetCharWidth(*args, **kwargs) |
d55e5bfc RD |
9447 | |
9448 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9449 | """ |
9450 | GetTextExtent(String string) -> (width, height) | |
9451 | ||
9452 | Get the width and height of the text using the current font. | |
9453 | """ | |
5b5c9bc7 | 9454 | return _core_.Window_GetTextExtent(*args, **kwargs) |
d55e5bfc RD |
9455 | |
9456 | def GetFullTextExtent(*args, **kwargs): | |
9457 | """ | |
9458 | GetFullTextExtent(String string, Font font=None) -> | |
9459 | (width, height, descent, externalLeading) | |
9460 | ||
9461 | Get the width, height, decent and leading of the text using the | |
9462 | current or specified font. | |
9463 | """ | |
5b5c9bc7 | 9464 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
d55e5bfc RD |
9465 | |
9466 | def ClientToScreenXY(*args, **kwargs): | |
9467 | """ | |
9468 | ClientToScreenXY(int x, int y) -> (x,y) | |
9469 | ||
9470 | Converts to screen coordinates from coordinates relative to this window. | |
9471 | """ | |
5b5c9bc7 | 9472 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
d55e5bfc RD |
9473 | |
9474 | def ScreenToClientXY(*args, **kwargs): | |
9475 | """ | |
9476 | ScreenToClientXY(int x, int y) -> (x,y) | |
9477 | ||
9478 | Converts from screen to client window coordinates. | |
9479 | """ | |
5b5c9bc7 | 9480 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
d55e5bfc RD |
9481 | |
9482 | def ClientToScreen(*args, **kwargs): | |
9483 | """ | |
5b5c9bc7 | 9484 | ClientToScreen(self, Point pt) -> Point |
d55e5bfc RD |
9485 | |
9486 | Converts to screen coordinates from coordinates relative to this window. | |
9487 | """ | |
5b5c9bc7 | 9488 | return _core_.Window_ClientToScreen(*args, **kwargs) |
d55e5bfc RD |
9489 | |
9490 | def ScreenToClient(*args, **kwargs): | |
9491 | """ | |
5b5c9bc7 | 9492 | ScreenToClient(self, Point pt) -> Point |
d55e5bfc RD |
9493 | |
9494 | Converts from screen to client window coordinates. | |
9495 | """ | |
5b5c9bc7 | 9496 | return _core_.Window_ScreenToClient(*args, **kwargs) |
d55e5bfc RD |
9497 | |
9498 | def HitTestXY(*args, **kwargs): | |
9499 | """ | |
9500 | HitTestXY(self, int x, int y) -> int | |
9501 | ||
9502 | Test where the given (in client coords) point lies | |
9503 | """ | |
5b5c9bc7 | 9504 | return _core_.Window_HitTestXY(*args, **kwargs) |
d55e5bfc RD |
9505 | |
9506 | def HitTest(*args, **kwargs): | |
9507 | """ | |
5b5c9bc7 | 9508 | HitTest(self, Point pt) -> int |
d55e5bfc RD |
9509 | |
9510 | Test where the given (in client coords) point lies | |
9511 | """ | |
5b5c9bc7 | 9512 | return _core_.Window_HitTest(*args, **kwargs) |
d55e5bfc RD |
9513 | |
9514 | def GetBorder(*args): | |
9515 | """ | |
9516 | GetBorder(self, long flags) -> int | |
9517 | GetBorder(self) -> int | |
9518 | ||
9519 | Get border for the flags of this window | |
9520 | """ | |
5b5c9bc7 | 9521 | return _core_.Window_GetBorder(*args) |
d55e5bfc RD |
9522 | |
9523 | def UpdateWindowUI(*args, **kwargs): | |
9524 | """ | |
5b5c9bc7 | 9525 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
d55e5bfc RD |
9526 | |
9527 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9528 | implementation depends on the window; for example a wx.ToolBar will | |
9529 | send an update UI event for each toolbar button, and a wx.Frame will | |
9530 | send an update UI event for each menubar menu item. You can call this | |
9531 | function from your application to ensure that your UI is up-to-date at | |
9532 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9533 | concerned). This may be necessary if you have called | |
5ba5649b | 9534 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
d55e5bfc RD |
9535 | limit the overhead that wxWindows incurs by sending update UI events |
9536 | in idle time. | |
d55e5bfc | 9537 | """ |
5b5c9bc7 | 9538 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
d55e5bfc RD |
9539 | |
9540 | def PopupMenuXY(*args, **kwargs): | |
9541 | """ | |
5b5c9bc7 | 9542 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
d55e5bfc | 9543 | |
b0503257 RD |
9544 | Pops up the given menu at the specified coordinates, relative to this window, |
9545 | and returns control when the user has dismissed the menu. If a menu item is | |
9546 | selected, the corresponding menu event is generated and will be processed as | |
9547 | usual. If the default position is given then the current position of the | |
9548 | mouse cursor will be used. | |
d55e5bfc | 9549 | """ |
5b5c9bc7 | 9550 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
d55e5bfc RD |
9551 | |
9552 | def PopupMenu(*args, **kwargs): | |
9553 | """ | |
5b5c9bc7 | 9554 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
d55e5bfc | 9555 | |
b0503257 RD |
9556 | Pops up the given menu at the specified coordinates, relative to this window, |
9557 | and returns control when the user has dismissed the menu. If a menu item is | |
9558 | selected, the corresponding menu event is generated and will be processed as | |
9559 | usual. If the default position is given then the current position of the | |
9560 | mouse cursor will be used. | |
d55e5bfc | 9561 | """ |
5b5c9bc7 | 9562 | return _core_.Window_PopupMenu(*args, **kwargs) |
d55e5bfc RD |
9563 | |
9564 | def GetHandle(*args, **kwargs): | |
9565 | """ | |
9566 | GetHandle(self) -> long | |
9567 | ||
9568 | Returns the platform-specific handle (as a long integer) of the | |
9569 | physical window. Currently on wxMac it returns the handle of the | |
9570 | toplevel parent of the window. | |
9571 | """ | |
5b5c9bc7 | 9572 | return _core_.Window_GetHandle(*args, **kwargs) |
d55e5bfc | 9573 | |
629e65c2 RD |
9574 | def AssociateHandle(*args, **kwargs): |
9575 | """ | |
9576 | AssociateHandle(self, long handle) | |
9577 | ||
9578 | Associate the window with a new native handle | |
9579 | """ | |
5b5c9bc7 | 9580 | return _core_.Window_AssociateHandle(*args, **kwargs) |
629e65c2 RD |
9581 | |
9582 | def DissociateHandle(*args, **kwargs): | |
9583 | """ | |
9584 | DissociateHandle(self) | |
9585 | ||
9586 | Dissociate the current native handle from the window | |
9587 | """ | |
5b5c9bc7 | 9588 | return _core_.Window_DissociateHandle(*args, **kwargs) |
629e65c2 | 9589 | |
d55e5bfc RD |
9590 | def HasScrollbar(*args, **kwargs): |
9591 | """ | |
9592 | HasScrollbar(self, int orient) -> bool | |
9593 | ||
9594 | Does the window have the scrollbar for this orientation? | |
9595 | """ | |
5b5c9bc7 | 9596 | return _core_.Window_HasScrollbar(*args, **kwargs) |
d55e5bfc RD |
9597 | |
9598 | def SetScrollbar(*args, **kwargs): | |
9599 | """ | |
15817c7e | 9600 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
d55e5bfc RD |
9601 | bool refresh=True) |
9602 | ||
9603 | Sets the scrollbar properties of a built-in scrollbar. | |
d55e5bfc | 9604 | """ |
5b5c9bc7 | 9605 | return _core_.Window_SetScrollbar(*args, **kwargs) |
d55e5bfc RD |
9606 | |
9607 | def SetScrollPos(*args, **kwargs): | |
9608 | """ | |
9609 | SetScrollPos(self, int orientation, int pos, bool refresh=True) | |
9610 | ||
9611 | Sets the position of one of the built-in scrollbars. | |
9612 | """ | |
5b5c9bc7 | 9613 | return _core_.Window_SetScrollPos(*args, **kwargs) |
d55e5bfc RD |
9614 | |
9615 | def GetScrollPos(*args, **kwargs): | |
9616 | """ | |
9617 | GetScrollPos(self, int orientation) -> int | |
9618 | ||
9619 | Returns the built-in scrollbar position. | |
9620 | """ | |
5b5c9bc7 | 9621 | return _core_.Window_GetScrollPos(*args, **kwargs) |
d55e5bfc RD |
9622 | |
9623 | def GetScrollThumb(*args, **kwargs): | |
9624 | """ | |
9625 | GetScrollThumb(self, int orientation) -> int | |
9626 | ||
9627 | Returns the built-in scrollbar thumb size. | |
9628 | """ | |
5b5c9bc7 | 9629 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
d55e5bfc RD |
9630 | |
9631 | def GetScrollRange(*args, **kwargs): | |
9632 | """ | |
9633 | GetScrollRange(self, int orientation) -> int | |
9634 | ||
9635 | Returns the built-in scrollbar range. | |
9636 | """ | |
5b5c9bc7 | 9637 | return _core_.Window_GetScrollRange(*args, **kwargs) |
d55e5bfc RD |
9638 | |
9639 | def ScrollWindow(*args, **kwargs): | |
9640 | """ | |
5b5c9bc7 | 9641 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
d55e5bfc RD |
9642 | |
9643 | Physically scrolls the pixels in the window and move child windows | |
9644 | accordingly. Use this function to optimise your scrolling | |
9645 | implementations, to minimise the area that must be redrawn. Note that | |
9646 | it is rarely required to call this function from a user program. | |
d55e5bfc | 9647 | """ |
5b5c9bc7 | 9648 | return _core_.Window_ScrollWindow(*args, **kwargs) |
d55e5bfc RD |
9649 | |
9650 | def ScrollLines(*args, **kwargs): | |
9651 | """ | |
9652 | ScrollLines(self, int lines) -> bool | |
9653 | ||
9654 | If the platform and window class supports it, scrolls the window by | |
9655 | the given number of lines down, if lines is positive, or up if lines | |
9656 | is negative. Returns True if the window was scrolled, False if it was | |
9657 | already on top/bottom and nothing was done. | |
9658 | """ | |
5b5c9bc7 | 9659 | return _core_.Window_ScrollLines(*args, **kwargs) |
d55e5bfc RD |
9660 | |
9661 | def ScrollPages(*args, **kwargs): | |
9662 | """ | |
9663 | ScrollPages(self, int pages) -> bool | |
9664 | ||
15817c7e | 9665 | If the platform and window class supports it, scrolls the window by |
d55e5bfc RD |
9666 | the given number of pages down, if pages is positive, or up if pages |
9667 | is negative. Returns True if the window was scrolled, False if it was | |
9668 | already on top/bottom and nothing was done. | |
9669 | """ | |
5b5c9bc7 | 9670 | return _core_.Window_ScrollPages(*args, **kwargs) |
d55e5bfc RD |
9671 | |
9672 | def LineUp(*args, **kwargs): | |
9673 | """ | |
9674 | LineUp(self) -> bool | |
9675 | ||
9676 | This is just a wrapper for ScrollLines(-1). | |
9677 | """ | |
5b5c9bc7 | 9678 | return _core_.Window_LineUp(*args, **kwargs) |
d55e5bfc RD |
9679 | |
9680 | def LineDown(*args, **kwargs): | |
9681 | """ | |
9682 | LineDown(self) -> bool | |
9683 | ||
9684 | This is just a wrapper for ScrollLines(1). | |
9685 | """ | |
5b5c9bc7 | 9686 | return _core_.Window_LineDown(*args, **kwargs) |
d55e5bfc RD |
9687 | |
9688 | def PageUp(*args, **kwargs): | |
9689 | """ | |
9690 | PageUp(self) -> bool | |
9691 | ||
9692 | This is just a wrapper for ScrollPages(-1). | |
9693 | """ | |
5b5c9bc7 | 9694 | return _core_.Window_PageUp(*args, **kwargs) |
d55e5bfc RD |
9695 | |
9696 | def PageDown(*args, **kwargs): | |
9697 | """ | |
9698 | PageDown(self) -> bool | |
9699 | ||
9700 | This is just a wrapper for ScrollPages(1). | |
9701 | """ | |
5b5c9bc7 | 9702 | return _core_.Window_PageDown(*args, **kwargs) |
d55e5bfc RD |
9703 | |
9704 | def SetHelpText(*args, **kwargs): | |
9705 | """ | |
5b5c9bc7 | 9706 | SetHelpText(self, String text) |
d55e5bfc RD |
9707 | |
9708 | Sets the help text to be used as context-sensitive help for this | |
9709 | window. Note that the text is actually stored by the current | |
9710 | wxHelpProvider implementation, and not in the window object itself. | |
9711 | """ | |
5b5c9bc7 | 9712 | return _core_.Window_SetHelpText(*args, **kwargs) |
d55e5bfc RD |
9713 | |
9714 | def SetHelpTextForId(*args, **kwargs): | |
9715 | """ | |
5b5c9bc7 | 9716 | SetHelpTextForId(self, String text) |
d55e5bfc RD |
9717 | |
9718 | Associate this help text with all windows with the same id as this | |
9719 | one. | |
9720 | """ | |
5b5c9bc7 | 9721 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
d55e5bfc RD |
9722 | |
9723 | def GetHelpText(*args, **kwargs): | |
9724 | """ | |
5b5c9bc7 | 9725 | GetHelpText(self) -> String |
d55e5bfc RD |
9726 | |
9727 | Gets the help text to be used as context-sensitive help for this | |
9728 | window. Note that the text is actually stored by the current | |
9729 | wxHelpProvider implementation, and not in the window object itself. | |
9730 | """ | |
5b5c9bc7 | 9731 | return _core_.Window_GetHelpText(*args, **kwargs) |
d55e5bfc RD |
9732 | |
9733 | def SetToolTipString(*args, **kwargs): | |
9734 | """ | |
5b5c9bc7 | 9735 | SetToolTipString(self, String tip) |
d55e5bfc RD |
9736 | |
9737 | Attach a tooltip to the window. | |
9738 | """ | |
5b5c9bc7 | 9739 | return _core_.Window_SetToolTipString(*args, **kwargs) |
d55e5bfc RD |
9740 | |
9741 | def SetToolTip(*args, **kwargs): | |
9742 | """ | |
5b5c9bc7 | 9743 | SetToolTip(self, ToolTip tip) |
d55e5bfc RD |
9744 | |
9745 | Attach a tooltip to the window. | |
9746 | """ | |
5b5c9bc7 | 9747 | return _core_.Window_SetToolTip(*args, **kwargs) |
d55e5bfc RD |
9748 | |
9749 | def GetToolTip(*args, **kwargs): | |
9750 | """ | |
5b5c9bc7 | 9751 | GetToolTip(self) -> ToolTip |
d55e5bfc RD |
9752 | |
9753 | get the associated tooltip or None if none | |
9754 | """ | |
5b5c9bc7 | 9755 | return _core_.Window_GetToolTip(*args, **kwargs) |
d55e5bfc RD |
9756 | |
9757 | def SetDropTarget(*args, **kwargs): | |
9758 | """ | |
5b5c9bc7 | 9759 | SetDropTarget(self, DropTarget dropTarget) |
d55e5bfc RD |
9760 | |
9761 | Associates a drop target with this window. If the window already has | |
9762 | a drop target, it is deleted. | |
9763 | """ | |
5b5c9bc7 | 9764 | return _core_.Window_SetDropTarget(*args, **kwargs) |
d55e5bfc RD |
9765 | |
9766 | def GetDropTarget(*args, **kwargs): | |
9767 | """ | |
5b5c9bc7 | 9768 | GetDropTarget(self) -> DropTarget |
d55e5bfc RD |
9769 | |
9770 | Returns the associated drop target, which may be None. | |
9771 | """ | |
5b5c9bc7 | 9772 | return _core_.Window_GetDropTarget(*args, **kwargs) |
d55e5bfc | 9773 | |
5ba5649b RD |
9774 | def DragAcceptFiles(*args, **kwargs): |
9775 | """ | |
9776 | DragAcceptFiles(self, bool accept) | |
9777 | ||
9778 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
9779 | Only functional on Windows. | |
9780 | """ | |
9781 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
9782 | ||
d55e5bfc RD |
9783 | def SetConstraints(*args, **kwargs): |
9784 | """ | |
5b5c9bc7 | 9785 | SetConstraints(self, LayoutConstraints constraints) |
d55e5bfc RD |
9786 | |
9787 | Sets the window to have the given layout constraints. If an existing | |
9788 | layout constraints object is already owned by the window, it will be | |
9789 | deleted. Pass None to disassociate and delete the window's current | |
9790 | constraints. | |
9791 | ||
9792 | You must call SetAutoLayout to tell a window to use the constraints | |
9793 | automatically in its default EVT_SIZE handler; otherwise, you must | |
9794 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
9795 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
9796 | effect. | |
9797 | """ | |
5b5c9bc7 | 9798 | return _core_.Window_SetConstraints(*args, **kwargs) |
d55e5bfc RD |
9799 | |
9800 | def GetConstraints(*args, **kwargs): | |
9801 | """ | |
5b5c9bc7 | 9802 | GetConstraints(self) -> LayoutConstraints |
d55e5bfc RD |
9803 | |
9804 | Returns a pointer to the window's layout constraints, or None if there | |
9805 | are none. | |
9806 | """ | |
5b5c9bc7 | 9807 | return _core_.Window_GetConstraints(*args, **kwargs) |
d55e5bfc RD |
9808 | |
9809 | def SetAutoLayout(*args, **kwargs): | |
9810 | """ | |
9811 | SetAutoLayout(self, bool autoLayout) | |
9812 | ||
9813 | Determines whether the Layout function will be called automatically | |
9814 | when the window is resized. It is called implicitly by SetSizer but | |
9815 | if you use SetConstraints you should call it manually or otherwise the | |
9816 | window layout won't be correctly updated when its size changes. | |
9817 | """ | |
5b5c9bc7 | 9818 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
d55e5bfc RD |
9819 | |
9820 | def GetAutoLayout(*args, **kwargs): | |
9821 | """ | |
9822 | GetAutoLayout(self) -> bool | |
9823 | ||
9824 | Returns the current autoLayout setting | |
9825 | """ | |
5b5c9bc7 | 9826 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
d55e5bfc RD |
9827 | |
9828 | def Layout(*args, **kwargs): | |
9829 | """ | |
9830 | Layout(self) -> bool | |
9831 | ||
9832 | Invokes the constraint-based layout algorithm or the sizer-based | |
9833 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
9834 | this function gets called automatically by the default EVT_SIZE | |
9835 | handler when the window is resized. | |
9836 | """ | |
5b5c9bc7 | 9837 | return _core_.Window_Layout(*args, **kwargs) |
d55e5bfc RD |
9838 | |
9839 | def SetSizer(*args, **kwargs): | |
9840 | """ | |
5b5c9bc7 | 9841 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
d55e5bfc RD |
9842 | |
9843 | Sets the window to have the given layout sizer. The window will then | |
9844 | own the object, and will take care of its deletion. If an existing | |
9845 | layout sizer object is already owned by the window, it will be deleted | |
9846 | if the deleteOld parameter is true. Note that this function will also | |
9847 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
b411df4a | 9848 | non-None, and False otherwise. |
d55e5bfc | 9849 | """ |
5b5c9bc7 | 9850 | return _core_.Window_SetSizer(*args, **kwargs) |
d55e5bfc RD |
9851 | |
9852 | def SetSizerAndFit(*args, **kwargs): | |
9853 | """ | |
5b5c9bc7 | 9854 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
d55e5bfc RD |
9855 | |
9856 | The same as SetSizer, except it also sets the size hints for the | |
9857 | window based on the sizer's minimum size. | |
9858 | """ | |
5b5c9bc7 | 9859 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
d55e5bfc RD |
9860 | |
9861 | def GetSizer(*args, **kwargs): | |
9862 | """ | |
5b5c9bc7 | 9863 | GetSizer(self) -> Sizer |
d55e5bfc RD |
9864 | |
9865 | Return the sizer associated with the window by a previous call to | |
9866 | SetSizer or None if there isn't one. | |
9867 | """ | |
5b5c9bc7 | 9868 | return _core_.Window_GetSizer(*args, **kwargs) |
d55e5bfc RD |
9869 | |
9870 | def SetContainingSizer(*args, **kwargs): | |
9871 | """ | |
5b5c9bc7 | 9872 | SetContainingSizer(self, Sizer sizer) |
d55e5bfc RD |
9873 | |
9874 | This normally does not need to be called by application code. It is | |
9875 | called internally when a window is added to a sizer, and is used so | |
9876 | the window can remove itself from the sizer when it is destroyed. | |
9877 | """ | |
5b5c9bc7 | 9878 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
d55e5bfc RD |
9879 | |
9880 | def GetContainingSizer(*args, **kwargs): | |
9881 | """ | |
5b5c9bc7 | 9882 | GetContainingSizer(self) -> Sizer |
d55e5bfc RD |
9883 | |
9884 | Return the sizer that this window is a member of, if any, otherwise None. | |
9885 | """ | |
5b5c9bc7 | 9886 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
d55e5bfc RD |
9887 | |
9888 | def InheritAttributes(*args, **kwargs): | |
9889 | """ | |
9890 | InheritAttributes(self) | |
9891 | ||
15817c7e RD |
9892 | This function is (or should be, in case of custom controls) called |
9893 | during window creation to intelligently set up the window visual | |
9894 | attributes, that is the font and the foreground and background | |
9895 | colours. | |
9896 | ||
9897 | By 'intelligently' the following is meant: by default, all windows use | |
9898 | their own default attributes. However if some of the parent's | |
9899 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 9900 | SetOwnFont) and if the corresponding attribute hadn't been |
15817c7e RD |
9901 | explicitly set for this window itself, then this window takes the same |
9902 | value as used by the parent. In addition, if the window overrides | |
9903 | ShouldInheritColours to return false, the colours will not be changed | |
9904 | no matter what and only the font might. | |
9905 | ||
a7bb0a9d RD |
9906 | This rather complicated logic is necessary in order to accommodate the |
9907 | different usage scenarios. The most common one is when all default | |
15817c7e RD |
9908 | attributes are used and in this case, nothing should be inherited as |
9909 | in modern GUIs different controls use different fonts (and colours) | |
9910 | than their siblings so they can't inherit the same value from the | |
9911 | parent. However it was also deemed desirable to allow to simply change | |
9912 | the attributes of all children at once by just changing the font or | |
9913 | colour of their common parent, hence in this case we do inherit the | |
9914 | parents attributes. | |
9915 | ||
d55e5bfc | 9916 | """ |
5b5c9bc7 | 9917 | return _core_.Window_InheritAttributes(*args, **kwargs) |
d55e5bfc RD |
9918 | |
9919 | def ShouldInheritColours(*args, **kwargs): | |
9920 | """ | |
9921 | ShouldInheritColours(self) -> bool | |
9922 | ||
9923 | Return true from here to allow the colours of this window to be | |
15817c7e RD |
9924 | changed by InheritAttributes, returning false forbids inheriting them |
9925 | from the parent window. | |
d55e5bfc | 9926 | |
15817c7e RD |
9927 | The base class version returns false, but this method is overridden in |
9928 | wxControl where it returns true. | |
d55e5bfc | 9929 | """ |
5b5c9bc7 | 9930 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
d55e5bfc RD |
9931 | |
9932 | def PostCreate(self, pre): | |
9933 | """ | |
9934 | Phase 3 of the 2-phase create <wink!> | |
9935 | Call this method after precreating the window with the 2-phase create method. | |
9936 | """ | |
9937 | self.this = pre.this | |
9938 | self.thisown = pre.thisown | |
9939 | pre.thisown = 0 | |
9940 | if hasattr(self, '_setOORInfo'): | |
9941 | self._setOORInfo(self) | |
9942 | if hasattr(self, '_setCallbackInfo'): | |
9943 | self._setCallbackInfo(self, self.__class__) | |
9944 | ||
9945 | ||
5b5c9bc7 | 9946 | class WindowPtr(Window): |
d55e5bfc RD |
9947 | def __init__(self, this): |
9948 | self.this = this | |
9949 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
9950 | self.__class__ = Window |
9951 | _core_.Window_swigregister(WindowPtr) | |
d55e5bfc RD |
9952 | |
9953 | def PreWindow(*args, **kwargs): | |
9954 | """ | |
5b5c9bc7 | 9955 | PreWindow() -> Window |
d55e5bfc RD |
9956 | |
9957 | Precreate a Window for 2-phase creation. | |
9958 | """ | |
5b5c9bc7 | 9959 | val = _core_.new_PreWindow(*args, **kwargs) |
d55e5bfc RD |
9960 | val.thisown = 1 |
9961 | return val | |
9962 | ||
5b5c9bc7 | 9963 | def Window_NewControlId(*args, **kwargs): |
d55e5bfc | 9964 | """ |
5b5c9bc7 | 9965 | Window_NewControlId() -> int |
d55e5bfc RD |
9966 | |
9967 | Generate a control id for the controls which were not given one. | |
9968 | """ | |
5b5c9bc7 | 9969 | return _core_.Window_NewControlId(*args, **kwargs) |
d55e5bfc | 9970 | |
5b5c9bc7 | 9971 | def Window_NextControlId(*args, **kwargs): |
d55e5bfc | 9972 | """ |
5b5c9bc7 | 9973 | Window_NextControlId(int winid) -> int |
d55e5bfc RD |
9974 | |
9975 | Get the id of the control following the one with the given | |
15817c7e | 9976 | autogenerated) id |
d55e5bfc | 9977 | """ |
5b5c9bc7 | 9978 | return _core_.Window_NextControlId(*args, **kwargs) |
d55e5bfc | 9979 | |
5b5c9bc7 | 9980 | def Window_PrevControlId(*args, **kwargs): |
d55e5bfc | 9981 | """ |
5b5c9bc7 | 9982 | Window_PrevControlId(int winid) -> int |
d55e5bfc RD |
9983 | |
9984 | Get the id of the control preceding the one with the given | |
15817c7e | 9985 | autogenerated) id |
d55e5bfc | 9986 | """ |
5b5c9bc7 | 9987 | return _core_.Window_PrevControlId(*args, **kwargs) |
d55e5bfc | 9988 | |
5b5c9bc7 | 9989 | def Window_FindFocus(*args, **kwargs): |
d55e5bfc | 9990 | """ |
5b5c9bc7 | 9991 | Window_FindFocus() -> Window |
d55e5bfc RD |
9992 | |
9993 | Returns the window or control that currently has the keyboard focus, | |
9994 | or None. | |
9995 | """ | |
5b5c9bc7 | 9996 | return _core_.Window_FindFocus(*args, **kwargs) |
d55e5bfc | 9997 | |
5b5c9bc7 | 9998 | def Window_GetCapture(*args, **kwargs): |
d55e5bfc | 9999 | """ |
5b5c9bc7 | 10000 | Window_GetCapture() -> Window |
d55e5bfc RD |
10001 | |
10002 | Returns the window which currently captures the mouse or None | |
10003 | """ | |
5b5c9bc7 | 10004 | return _core_.Window_GetCapture(*args, **kwargs) |
d55e5bfc | 10005 | |
5b5c9bc7 | 10006 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
d55e5bfc | 10007 | """ |
5b5c9bc7 | 10008 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
d55e5bfc | 10009 | |
15817c7e RD |
10010 | Get the default attributes for this class. This is useful if you want |
10011 | to use the same font or colour in your own control as in a standard | |
10012 | control -- which is a much better idea than hard coding specific | |
a5ee0656 RD |
10013 | colours or fonts which might look completely out of place on the |
10014 | user's system, especially if it uses themes. | |
d55e5bfc RD |
10015 | |
10016 | The variant parameter is only relevant under Mac currently and is | |
15817c7e | 10017 | ignore under other platforms. Under Mac, it will change the size of |
a5ee0656 RD |
10018 | the returned font. See `wx.Window.SetWindowVariant` for more about |
10019 | this. | |
d55e5bfc | 10020 | """ |
5b5c9bc7 | 10021 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
10022 | |
10023 | def DLG_PNT(win, point_or_x, y=None): | |
10024 | """ | |
10025 | Convenience function for converting a Point or (x,y) in | |
10026 | dialog units to pixel units. | |
10027 | """ | |
10028 | if y is None: | |
10029 | return win.ConvertDialogPointToPixels(point_or_x) | |
10030 | else: | |
10031 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) | |
10032 | ||
10033 | def DLG_SZE(win, size_width, height=None): | |
10034 | """ | |
10035 | Convenience function for converting a Size or (w,h) in | |
10036 | dialog units to pixel units. | |
10037 | """ | |
10038 | if height is None: | |
10039 | return win.ConvertDialogSizeToPixels(size_width) | |
10040 | else: | |
10041 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) | |
10042 | ||
10043 | ||
5b5c9bc7 | 10044 | def FindWindowById(*args, **kwargs): |
d55e5bfc | 10045 | """ |
5b5c9bc7 | 10046 | FindWindowById(long id, Window parent=None) -> Window |
d55e5bfc RD |
10047 | |
10048 | Find the first window in the application with the given id. If parent | |
10049 | is None, the search will start from all top-level frames and dialog | |
10050 | boxes; if non-None, the search will be limited to the given window | |
10051 | hierarchy. The search is recursive in both cases. | |
10052 | """ | |
5b5c9bc7 | 10053 | return _core_.FindWindowById(*args, **kwargs) |
d55e5bfc | 10054 | |
5b5c9bc7 | 10055 | def FindWindowByName(*args, **kwargs): |
d55e5bfc | 10056 | """ |
5b5c9bc7 | 10057 | FindWindowByName(String name, Window parent=None) -> Window |
d55e5bfc RD |
10058 | |
10059 | Find a window by its name (as given in a window constructor or Create | |
10060 | function call). If parent is None, the search will start from all | |
10061 | top-level frames and dialog boxes; if non-None, the search will be | |
10062 | limited to the given window hierarchy. The search is recursive in both | |
10063 | cases. | |
10064 | ||
10065 | If no window with such name is found, wx.FindWindowByLabel is called. | |
10066 | """ | |
5b5c9bc7 | 10067 | return _core_.FindWindowByName(*args, **kwargs) |
d55e5bfc | 10068 | |
5b5c9bc7 | 10069 | def FindWindowByLabel(*args, **kwargs): |
d55e5bfc | 10070 | """ |
5b5c9bc7 | 10071 | FindWindowByLabel(String label, Window parent=None) -> Window |
d55e5bfc RD |
10072 | |
10073 | Find a window by its label. Depending on the type of window, the label | |
10074 | may be a window title or panel item label. If parent is None, the | |
10075 | search will start from all top-level frames and dialog boxes; if | |
10076 | non-None, the search will be limited to the given window | |
10077 | hierarchy. The search is recursive in both cases. | |
10078 | """ | |
5b5c9bc7 | 10079 | return _core_.FindWindowByLabel(*args, **kwargs) |
d55e5bfc | 10080 | |
5b5c9bc7 RD |
10081 | def Window_FromHWND(*args, **kwargs): |
10082 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" | |
10083 | return _core_.Window_FromHWND(*args, **kwargs) | |
3215336e RD |
10084 | |
10085 | def GetTopLevelWindows(*args, **kwargs): | |
10086 | """ | |
10087 | GetTopLevelWindows() -> PyObject | |
10088 | ||
10089 | Returns a list of the the application's top-level windows, (frames, | |
10090 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
10091 | by wxWidgets, and so it is only valid as long as no top-level windows | |
10092 | are closed or new top-level windows are created. | |
10093 | ||
10094 | """ | |
10095 | return _core_.GetTopLevelWindows(*args, **kwargs) | |
d55e5bfc RD |
10096 | #--------------------------------------------------------------------------- |
10097 | ||
5b5c9bc7 RD |
10098 | class Validator(EvtHandler): |
10099 | """Proxy of C++ Validator class""" | |
d55e5bfc RD |
10100 | def __repr__(self): |
10101 | return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10102 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
10103 | """__init__(self) -> Validator""" |
10104 | newobj = _core_.new_Validator(*args, **kwargs) | |
d55e5bfc RD |
10105 | self.this = newobj.this |
10106 | self.thisown = 1 | |
10107 | del newobj.thisown | |
10108 | self._setOORInfo(self) | |
10109 | ||
10110 | def Clone(*args, **kwargs): | |
5b5c9bc7 RD |
10111 | """Clone(self) -> Validator""" |
10112 | return _core_.Validator_Clone(*args, **kwargs) | |
d55e5bfc RD |
10113 | |
10114 | def Validate(*args, **kwargs): | |
5b5c9bc7 RD |
10115 | """Validate(self, Window parent) -> bool""" |
10116 | return _core_.Validator_Validate(*args, **kwargs) | |
d55e5bfc RD |
10117 | |
10118 | def TransferToWindow(*args, **kwargs): | |
10119 | """TransferToWindow(self) -> bool""" | |
5b5c9bc7 | 10120 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
d55e5bfc RD |
10121 | |
10122 | def TransferFromWindow(*args, **kwargs): | |
10123 | """TransferFromWindow(self) -> bool""" | |
5b5c9bc7 | 10124 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
d55e5bfc RD |
10125 | |
10126 | def GetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10127 | """GetWindow(self) -> Window""" |
10128 | return _core_.Validator_GetWindow(*args, **kwargs) | |
d55e5bfc RD |
10129 | |
10130 | def SetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10131 | """SetWindow(self, Window window)""" |
10132 | return _core_.Validator_SetWindow(*args, **kwargs) | |
d55e5bfc RD |
10133 | |
10134 | def IsSilent(*args, **kwargs): | |
d6c14a4c | 10135 | """IsSilent() -> bool""" |
5b5c9bc7 | 10136 | return _core_.Validator_IsSilent(*args, **kwargs) |
d55e5bfc RD |
10137 | |
10138 | IsSilent = staticmethod(IsSilent) | |
10139 | def SetBellOnError(*args, **kwargs): | |
d6c14a4c | 10140 | """SetBellOnError(int doIt=True)""" |
5b5c9bc7 | 10141 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
d55e5bfc RD |
10142 | |
10143 | SetBellOnError = staticmethod(SetBellOnError) | |
10144 | ||
5b5c9bc7 | 10145 | class ValidatorPtr(Validator): |
d55e5bfc RD |
10146 | def __init__(self, this): |
10147 | self.this = this | |
10148 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10149 | self.__class__ = Validator |
10150 | _core_.Validator_swigregister(ValidatorPtr) | |
d55e5bfc | 10151 | |
5b5c9bc7 RD |
10152 | def Validator_IsSilent(*args, **kwargs): |
10153 | """Validator_IsSilent() -> bool""" | |
10154 | return _core_.Validator_IsSilent(*args, **kwargs) | |
d55e5bfc | 10155 | |
5b5c9bc7 RD |
10156 | def Validator_SetBellOnError(*args, **kwargs): |
10157 | """Validator_SetBellOnError(int doIt=True)""" | |
10158 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
d55e5bfc | 10159 | |
5b5c9bc7 RD |
10160 | class PyValidator(Validator): |
10161 | """Proxy of C++ PyValidator class""" | |
d55e5bfc RD |
10162 | def __repr__(self): |
10163 | return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10164 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
10165 | """__init__(self) -> PyValidator""" |
10166 | newobj = _core_.new_PyValidator(*args, **kwargs) | |
d55e5bfc RD |
10167 | self.this = newobj.this |
10168 | self.thisown = 1 | |
10169 | del newobj.thisown | |
10170 | ||
10171 | self._setCallbackInfo(self, PyValidator, 1) | |
10172 | self._setOORInfo(self) | |
10173 | ||
10174 | def _setCallbackInfo(*args, **kwargs): | |
10175 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" | |
5b5c9bc7 | 10176 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
10177 | |
10178 | ||
5b5c9bc7 | 10179 | class PyValidatorPtr(PyValidator): |
d55e5bfc RD |
10180 | def __init__(self, this): |
10181 | self.this = this | |
10182 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10183 | self.__class__ = PyValidator |
10184 | _core_.PyValidator_swigregister(PyValidatorPtr) | |
d55e5bfc RD |
10185 | |
10186 | #--------------------------------------------------------------------------- | |
10187 | ||
5b5c9bc7 RD |
10188 | class Menu(EvtHandler): |
10189 | """Proxy of C++ Menu class""" | |
d55e5bfc RD |
10190 | def __repr__(self): |
10191 | return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10192 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
10193 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
10194 | newobj = _core_.new_Menu(*args, **kwargs) | |
d55e5bfc RD |
10195 | self.this = newobj.this |
10196 | self.thisown = 1 | |
10197 | del newobj.thisown | |
10198 | self._setOORInfo(self) | |
10199 | ||
10200 | def Append(*args, **kwargs): | |
5b5c9bc7 RD |
10201 | """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
10202 | return _core_.Menu_Append(*args, **kwargs) | |
d55e5bfc RD |
10203 | |
10204 | def AppendSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
10205 | """AppendSeparator(self) -> MenuItem""" |
10206 | return _core_.Menu_AppendSeparator(*args, **kwargs) | |
d55e5bfc RD |
10207 | |
10208 | def AppendCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
10209 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10210 | return _core_.Menu_AppendCheckItem(*args, **kwargs) | |
d55e5bfc RD |
10211 | |
10212 | def AppendRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
10213 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10214 | return _core_.Menu_AppendRadioItem(*args, **kwargs) | |
d55e5bfc RD |
10215 | |
10216 | def AppendMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10217 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
10218 | return _core_.Menu_AppendMenu(*args, **kwargs) | |
d55e5bfc RD |
10219 | |
10220 | def AppendItem(*args, **kwargs): | |
5b5c9bc7 RD |
10221 | """AppendItem(self, MenuItem item) -> MenuItem""" |
10222 | return _core_.Menu_AppendItem(*args, **kwargs) | |
d55e5bfc RD |
10223 | |
10224 | def Break(*args, **kwargs): | |
10225 | """Break(self)""" | |
5b5c9bc7 | 10226 | return _core_.Menu_Break(*args, **kwargs) |
d55e5bfc RD |
10227 | |
10228 | def InsertItem(*args, **kwargs): | |
5b5c9bc7 RD |
10229 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
10230 | return _core_.Menu_InsertItem(*args, **kwargs) | |
d55e5bfc RD |
10231 | |
10232 | def Insert(*args, **kwargs): | |
10233 | """ | |
5b5c9bc7 RD |
10234 | Insert(self, size_t pos, int id, String text, String help=EmptyString, |
10235 | int kind=ITEM_NORMAL) -> MenuItem | |
d55e5bfc | 10236 | """ |
5b5c9bc7 | 10237 | return _core_.Menu_Insert(*args, **kwargs) |
d55e5bfc RD |
10238 | |
10239 | def InsertSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
10240 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
10241 | return _core_.Menu_InsertSeparator(*args, **kwargs) | |
d55e5bfc RD |
10242 | |
10243 | def InsertCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
10244 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
10245 | return _core_.Menu_InsertCheckItem(*args, **kwargs) | |
d55e5bfc RD |
10246 | |
10247 | def InsertRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
10248 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
10249 | return _core_.Menu_InsertRadioItem(*args, **kwargs) | |
d55e5bfc RD |
10250 | |
10251 | def InsertMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10252 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
10253 | return _core_.Menu_InsertMenu(*args, **kwargs) | |
d55e5bfc RD |
10254 | |
10255 | def PrependItem(*args, **kwargs): | |
5b5c9bc7 RD |
10256 | """PrependItem(self, MenuItem item) -> MenuItem""" |
10257 | return _core_.Menu_PrependItem(*args, **kwargs) | |
d55e5bfc RD |
10258 | |
10259 | def Prepend(*args, **kwargs): | |
5b5c9bc7 RD |
10260 | """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
10261 | return _core_.Menu_Prepend(*args, **kwargs) | |
d55e5bfc RD |
10262 | |
10263 | def PrependSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
10264 | """PrependSeparator(self) -> MenuItem""" |
10265 | return _core_.Menu_PrependSeparator(*args, **kwargs) | |
d55e5bfc RD |
10266 | |
10267 | def PrependCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
10268 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10269 | return _core_.Menu_PrependCheckItem(*args, **kwargs) | |
d55e5bfc RD |
10270 | |
10271 | def PrependRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
10272 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10273 | return _core_.Menu_PrependRadioItem(*args, **kwargs) | |
d55e5bfc RD |
10274 | |
10275 | def PrependMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10276 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
10277 | return _core_.Menu_PrependMenu(*args, **kwargs) | |
d55e5bfc RD |
10278 | |
10279 | def Remove(*args, **kwargs): | |
5b5c9bc7 RD |
10280 | """Remove(self, int id) -> MenuItem""" |
10281 | return _core_.Menu_Remove(*args, **kwargs) | |
d55e5bfc RD |
10282 | |
10283 | def RemoveItem(*args, **kwargs): | |
5b5c9bc7 RD |
10284 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
10285 | return _core_.Menu_RemoveItem(*args, **kwargs) | |
d55e5bfc RD |
10286 | |
10287 | def Delete(*args, **kwargs): | |
10288 | """Delete(self, int id) -> bool""" | |
5b5c9bc7 | 10289 | return _core_.Menu_Delete(*args, **kwargs) |
d55e5bfc RD |
10290 | |
10291 | def DeleteItem(*args, **kwargs): | |
5b5c9bc7 RD |
10292 | """DeleteItem(self, MenuItem item) -> bool""" |
10293 | return _core_.Menu_DeleteItem(*args, **kwargs) | |
d55e5bfc RD |
10294 | |
10295 | def Destroy(*args, **kwargs): | |
10296 | """ | |
10297 | Destroy(self) | |
10298 | ||
10299 | Deletes the C++ object this Python object is a proxy for. | |
10300 | """ | |
5b5c9bc7 | 10301 | return _core_.Menu_Destroy(*args, **kwargs) |
d55e5bfc RD |
10302 | |
10303 | def DestroyId(*args, **kwargs): | |
10304 | """ | |
10305 | DestroyId(self, int id) -> bool | |
10306 | ||
10307 | Deletes the C++ object this Python object is a proxy for. | |
10308 | """ | |
5b5c9bc7 | 10309 | return _core_.Menu_DestroyId(*args, **kwargs) |
d55e5bfc RD |
10310 | |
10311 | def DestroyItem(*args, **kwargs): | |
10312 | """ | |
5b5c9bc7 | 10313 | DestroyItem(self, MenuItem item) -> bool |
d55e5bfc RD |
10314 | |
10315 | Deletes the C++ object this Python object is a proxy for. | |
10316 | """ | |
5b5c9bc7 | 10317 | return _core_.Menu_DestroyItem(*args, **kwargs) |
d55e5bfc RD |
10318 | |
10319 | def GetMenuItemCount(*args, **kwargs): | |
10320 | """GetMenuItemCount(self) -> size_t""" | |
5b5c9bc7 | 10321 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
d55e5bfc RD |
10322 | |
10323 | def GetMenuItems(*args, **kwargs): | |
10324 | """GetMenuItems(self) -> PyObject""" | |
5b5c9bc7 | 10325 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
d55e5bfc RD |
10326 | |
10327 | def FindItem(*args, **kwargs): | |
5b5c9bc7 RD |
10328 | """FindItem(self, String item) -> int""" |
10329 | return _core_.Menu_FindItem(*args, **kwargs) | |
d55e5bfc RD |
10330 | |
10331 | def FindItemById(*args, **kwargs): | |
5b5c9bc7 RD |
10332 | """FindItemById(self, int id) -> MenuItem""" |
10333 | return _core_.Menu_FindItemById(*args, **kwargs) | |
d55e5bfc RD |
10334 | |
10335 | def FindItemByPosition(*args, **kwargs): | |
5b5c9bc7 RD |
10336 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
10337 | return _core_.Menu_FindItemByPosition(*args, **kwargs) | |
d55e5bfc RD |
10338 | |
10339 | def Enable(*args, **kwargs): | |
10340 | """Enable(self, int id, bool enable)""" | |
5b5c9bc7 | 10341 | return _core_.Menu_Enable(*args, **kwargs) |
d55e5bfc RD |
10342 | |
10343 | def IsEnabled(*args, **kwargs): | |
10344 | """IsEnabled(self, int id) -> bool""" | |
5b5c9bc7 | 10345 | return _core_.Menu_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10346 | |
10347 | def Check(*args, **kwargs): | |
10348 | """Check(self, int id, bool check)""" | |
5b5c9bc7 | 10349 | return _core_.Menu_Check(*args, **kwargs) |
d55e5bfc RD |
10350 | |
10351 | def IsChecked(*args, **kwargs): | |
10352 | """IsChecked(self, int id) -> bool""" | |
5b5c9bc7 | 10353 | return _core_.Menu_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10354 | |
10355 | def SetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10356 | """SetLabel(self, int id, String label)""" |
10357 | return _core_.Menu_SetLabel(*args, **kwargs) | |
d55e5bfc RD |
10358 | |
10359 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10360 | """GetLabel(self, int id) -> String""" |
10361 | return _core_.Menu_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10362 | |
10363 | def SetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10364 | """SetHelpString(self, int id, String helpString)""" |
10365 | return _core_.Menu_SetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10366 | |
10367 | def GetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10368 | """GetHelpString(self, int id) -> String""" |
10369 | return _core_.Menu_GetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10370 | |
10371 | def SetTitle(*args, **kwargs): | |
5b5c9bc7 RD |
10372 | """SetTitle(self, String title)""" |
10373 | return _core_.Menu_SetTitle(*args, **kwargs) | |
d55e5bfc RD |
10374 | |
10375 | def GetTitle(*args, **kwargs): | |
5b5c9bc7 RD |
10376 | """GetTitle(self) -> String""" |
10377 | return _core_.Menu_GetTitle(*args, **kwargs) | |
d55e5bfc RD |
10378 | |
10379 | def SetEventHandler(*args, **kwargs): | |
5b5c9bc7 RD |
10380 | """SetEventHandler(self, EvtHandler handler)""" |
10381 | return _core_.Menu_SetEventHandler(*args, **kwargs) | |
d55e5bfc RD |
10382 | |
10383 | def GetEventHandler(*args, **kwargs): | |
5b5c9bc7 RD |
10384 | """GetEventHandler(self) -> EvtHandler""" |
10385 | return _core_.Menu_GetEventHandler(*args, **kwargs) | |
d55e5bfc RD |
10386 | |
10387 | def SetInvokingWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10388 | """SetInvokingWindow(self, Window win)""" |
10389 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) | |
d55e5bfc RD |
10390 | |
10391 | def GetInvokingWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10392 | """GetInvokingWindow(self) -> Window""" |
10393 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) | |
d55e5bfc RD |
10394 | |
10395 | def GetStyle(*args, **kwargs): | |
10396 | """GetStyle(self) -> long""" | |
5b5c9bc7 | 10397 | return _core_.Menu_GetStyle(*args, **kwargs) |
d55e5bfc RD |
10398 | |
10399 | def UpdateUI(*args, **kwargs): | |
5b5c9bc7 RD |
10400 | """UpdateUI(self, EvtHandler source=None)""" |
10401 | return _core_.Menu_UpdateUI(*args, **kwargs) | |
d55e5bfc RD |
10402 | |
10403 | def GetMenuBar(*args, **kwargs): | |
5b5c9bc7 RD |
10404 | """GetMenuBar(self) -> MenuBar""" |
10405 | return _core_.Menu_GetMenuBar(*args, **kwargs) | |
d55e5bfc RD |
10406 | |
10407 | def Attach(*args, **kwargs): | |
10408 | """Attach(self, wxMenuBarBase menubar)""" | |
5b5c9bc7 | 10409 | return _core_.Menu_Attach(*args, **kwargs) |
d55e5bfc RD |
10410 | |
10411 | def Detach(*args, **kwargs): | |
10412 | """Detach(self)""" | |
5b5c9bc7 | 10413 | return _core_.Menu_Detach(*args, **kwargs) |
d55e5bfc RD |
10414 | |
10415 | def IsAttached(*args, **kwargs): | |
10416 | """IsAttached(self) -> bool""" | |
5b5c9bc7 | 10417 | return _core_.Menu_IsAttached(*args, **kwargs) |
d55e5bfc RD |
10418 | |
10419 | def SetParent(*args, **kwargs): | |
5b5c9bc7 RD |
10420 | """SetParent(self, Menu parent)""" |
10421 | return _core_.Menu_SetParent(*args, **kwargs) | |
d55e5bfc RD |
10422 | |
10423 | def GetParent(*args, **kwargs): | |
5b5c9bc7 RD |
10424 | """GetParent(self) -> Menu""" |
10425 | return _core_.Menu_GetParent(*args, **kwargs) | |
d55e5bfc RD |
10426 | |
10427 | ||
5b5c9bc7 | 10428 | class MenuPtr(Menu): |
d55e5bfc RD |
10429 | def __init__(self, this): |
10430 | self.this = this | |
10431 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10432 | self.__class__ = Menu |
10433 | _core_.Menu_swigregister(MenuPtr) | |
10434 | DefaultValidator = cvar.DefaultValidator | |
d55e5bfc RD |
10435 | |
10436 | #--------------------------------------------------------------------------- | |
10437 | ||
5b5c9bc7 RD |
10438 | class MenuBar(Window): |
10439 | """Proxy of C++ MenuBar class""" | |
d55e5bfc RD |
10440 | def __repr__(self): |
10441 | return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10442 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
10443 | """__init__(self, long style=0) -> MenuBar""" |
10444 | newobj = _core_.new_MenuBar(*args, **kwargs) | |
d55e5bfc RD |
10445 | self.this = newobj.this |
10446 | self.thisown = 1 | |
10447 | del newobj.thisown | |
10448 | self._setOORInfo(self) | |
10449 | ||
10450 | def Append(*args, **kwargs): | |
5b5c9bc7 RD |
10451 | """Append(self, Menu menu, String title) -> bool""" |
10452 | return _core_.MenuBar_Append(*args, **kwargs) | |
d55e5bfc RD |
10453 | |
10454 | def Insert(*args, **kwargs): | |
5b5c9bc7 RD |
10455 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
10456 | return _core_.MenuBar_Insert(*args, **kwargs) | |
d55e5bfc RD |
10457 | |
10458 | def GetMenuCount(*args, **kwargs): | |
10459 | """GetMenuCount(self) -> size_t""" | |
5b5c9bc7 | 10460 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
d55e5bfc RD |
10461 | |
10462 | def GetMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10463 | """GetMenu(self, size_t pos) -> Menu""" |
10464 | return _core_.MenuBar_GetMenu(*args, **kwargs) | |
d55e5bfc RD |
10465 | |
10466 | def Replace(*args, **kwargs): | |
5b5c9bc7 RD |
10467 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
10468 | return _core_.MenuBar_Replace(*args, **kwargs) | |
d55e5bfc RD |
10469 | |
10470 | def Remove(*args, **kwargs): | |
5b5c9bc7 RD |
10471 | """Remove(self, size_t pos) -> Menu""" |
10472 | return _core_.MenuBar_Remove(*args, **kwargs) | |
d55e5bfc RD |
10473 | |
10474 | def EnableTop(*args, **kwargs): | |
10475 | """EnableTop(self, size_t pos, bool enable)""" | |
5b5c9bc7 | 10476 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
d55e5bfc RD |
10477 | |
10478 | def IsEnabledTop(*args, **kwargs): | |
10479 | """IsEnabledTop(self, size_t pos) -> bool""" | |
5b5c9bc7 | 10480 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
d55e5bfc RD |
10481 | |
10482 | def SetLabelTop(*args, **kwargs): | |
5b5c9bc7 RD |
10483 | """SetLabelTop(self, size_t pos, String label)""" |
10484 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) | |
d55e5bfc RD |
10485 | |
10486 | def GetLabelTop(*args, **kwargs): | |
5b5c9bc7 RD |
10487 | """GetLabelTop(self, size_t pos) -> String""" |
10488 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) | |
d55e5bfc RD |
10489 | |
10490 | def FindMenuItem(*args, **kwargs): | |
5b5c9bc7 RD |
10491 | """FindMenuItem(self, String menu, String item) -> int""" |
10492 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) | |
d55e5bfc RD |
10493 | |
10494 | def FindItemById(*args, **kwargs): | |
5b5c9bc7 RD |
10495 | """FindItemById(self, int id) -> MenuItem""" |
10496 | return _core_.MenuBar_FindItemById(*args, **kwargs) | |
d55e5bfc RD |
10497 | |
10498 | def FindMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10499 | """FindMenu(self, String title) -> int""" |
10500 | return _core_.MenuBar_FindMenu(*args, **kwargs) | |
d55e5bfc RD |
10501 | |
10502 | def Enable(*args, **kwargs): | |
10503 | """Enable(self, int id, bool enable)""" | |
5b5c9bc7 | 10504 | return _core_.MenuBar_Enable(*args, **kwargs) |
d55e5bfc RD |
10505 | |
10506 | def Check(*args, **kwargs): | |
10507 | """Check(self, int id, bool check)""" | |
5b5c9bc7 | 10508 | return _core_.MenuBar_Check(*args, **kwargs) |
d55e5bfc RD |
10509 | |
10510 | def IsChecked(*args, **kwargs): | |
10511 | """IsChecked(self, int id) -> bool""" | |
5b5c9bc7 | 10512 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10513 | |
10514 | def IsEnabled(*args, **kwargs): | |
10515 | """IsEnabled(self, int id) -> bool""" | |
5b5c9bc7 | 10516 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10517 | |
10518 | def SetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10519 | """SetLabel(self, int id, String label)""" |
10520 | return _core_.MenuBar_SetLabel(*args, **kwargs) | |
d55e5bfc RD |
10521 | |
10522 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10523 | """GetLabel(self, int id) -> String""" |
10524 | return _core_.MenuBar_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10525 | |
10526 | def SetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10527 | """SetHelpString(self, int id, String helpString)""" |
10528 | return _core_.MenuBar_SetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10529 | |
10530 | def GetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10531 | """GetHelpString(self, int id) -> String""" |
10532 | return _core_.MenuBar_GetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10533 | |
10534 | def GetFrame(*args, **kwargs): | |
10535 | """GetFrame(self) -> wxFrame""" | |
5b5c9bc7 | 10536 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
d55e5bfc RD |
10537 | |
10538 | def IsAttached(*args, **kwargs): | |
10539 | """IsAttached(self) -> bool""" | |
5b5c9bc7 | 10540 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
d55e5bfc RD |
10541 | |
10542 | def Attach(*args, **kwargs): | |
10543 | """Attach(self, wxFrame frame)""" | |
5b5c9bc7 | 10544 | return _core_.MenuBar_Attach(*args, **kwargs) |
d55e5bfc RD |
10545 | |
10546 | def Detach(*args, **kwargs): | |
10547 | """Detach(self)""" | |
5b5c9bc7 | 10548 | return _core_.MenuBar_Detach(*args, **kwargs) |
d55e5bfc | 10549 | |
4f433fef RD |
10550 | def SetAutoWindowMenu(*args, **kwargs): |
10551 | """SetAutoWindowMenu(bool enable)""" | |
10552 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10553 | ||
10554 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
10555 | def GetAutoWindowMenu(*args, **kwargs): | |
10556 | """GetAutoWindowMenu() -> bool""" | |
10557 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10558 | ||
10559 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
d55e5bfc | 10560 | |
5b5c9bc7 | 10561 | class MenuBarPtr(MenuBar): |
d55e5bfc RD |
10562 | def __init__(self, this): |
10563 | self.this = this | |
10564 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10565 | self.__class__ = MenuBar |
10566 | _core_.MenuBar_swigregister(MenuBarPtr) | |
d55e5bfc | 10567 | |
4f433fef RD |
10568 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
10569 | """MenuBar_SetAutoWindowMenu(bool enable)""" | |
10570 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10571 | ||
10572 | def MenuBar_GetAutoWindowMenu(*args, **kwargs): | |
10573 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
10574 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10575 | ||
d55e5bfc RD |
10576 | #--------------------------------------------------------------------------- |
10577 | ||
5b5c9bc7 RD |
10578 | class MenuItem(Object): |
10579 | """Proxy of C++ MenuItem class""" | |
d55e5bfc RD |
10580 | def __repr__(self): |
10581 | return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10582 | def __init__(self, *args, **kwargs): | |
10583 | """ | |
5b5c9bc7 RD |
10584 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, |
10585 | String help=EmptyString, int kind=ITEM_NORMAL, | |
10586 | Menu subMenu=None) -> MenuItem | |
d55e5bfc | 10587 | """ |
5b5c9bc7 | 10588 | newobj = _core_.new_MenuItem(*args, **kwargs) |
d55e5bfc RD |
10589 | self.this = newobj.this |
10590 | self.thisown = 1 | |
10591 | del newobj.thisown | |
10592 | def GetMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10593 | """GetMenu(self) -> Menu""" |
10594 | return _core_.MenuItem_GetMenu(*args, **kwargs) | |
d55e5bfc RD |
10595 | |
10596 | def SetMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10597 | """SetMenu(self, Menu menu)""" |
10598 | return _core_.MenuItem_SetMenu(*args, **kwargs) | |
d55e5bfc RD |
10599 | |
10600 | def SetId(*args, **kwargs): | |
10601 | """SetId(self, int id)""" | |
5b5c9bc7 | 10602 | return _core_.MenuItem_SetId(*args, **kwargs) |
d55e5bfc RD |
10603 | |
10604 | def GetId(*args, **kwargs): | |
10605 | """GetId(self) -> int""" | |
5b5c9bc7 | 10606 | return _core_.MenuItem_GetId(*args, **kwargs) |
d55e5bfc RD |
10607 | |
10608 | def IsSeparator(*args, **kwargs): | |
10609 | """IsSeparator(self) -> bool""" | |
5b5c9bc7 | 10610 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
d55e5bfc RD |
10611 | |
10612 | def SetText(*args, **kwargs): | |
5b5c9bc7 RD |
10613 | """SetText(self, String str)""" |
10614 | return _core_.MenuItem_SetText(*args, **kwargs) | |
d55e5bfc RD |
10615 | |
10616 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10617 | """GetLabel(self) -> String""" |
10618 | return _core_.MenuItem_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10619 | |
10620 | def GetText(*args, **kwargs): | |
5b5c9bc7 RD |
10621 | """GetText(self) -> String""" |
10622 | return _core_.MenuItem_GetText(*args, **kwargs) | |
d55e5bfc RD |
10623 | |
10624 | def GetLabelFromText(*args, **kwargs): | |
5b5c9bc7 RD |
10625 | """GetLabelFromText(String text) -> String""" |
10626 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d55e5bfc RD |
10627 | |
10628 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10629 | def GetKind(*args, **kwargs): | |
10630 | """GetKind(self) -> int""" | |
5b5c9bc7 | 10631 | return _core_.MenuItem_GetKind(*args, **kwargs) |
d55e5bfc RD |
10632 | |
10633 | def SetKind(*args, **kwargs): | |
10634 | """SetKind(self, int kind)""" | |
5b5c9bc7 | 10635 | return _core_.MenuItem_SetKind(*args, **kwargs) |
d55e5bfc RD |
10636 | |
10637 | def SetCheckable(*args, **kwargs): | |
10638 | """SetCheckable(self, bool checkable)""" | |
5b5c9bc7 | 10639 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
d55e5bfc RD |
10640 | |
10641 | def IsCheckable(*args, **kwargs): | |
10642 | """IsCheckable(self) -> bool""" | |
5b5c9bc7 | 10643 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
d55e5bfc RD |
10644 | |
10645 | def IsSubMenu(*args, **kwargs): | |
10646 | """IsSubMenu(self) -> bool""" | |
5b5c9bc7 | 10647 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
d55e5bfc RD |
10648 | |
10649 | def SetSubMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10650 | """SetSubMenu(self, Menu menu)""" |
10651 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) | |
d55e5bfc RD |
10652 | |
10653 | def GetSubMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10654 | """GetSubMenu(self) -> Menu""" |
10655 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) | |
d55e5bfc RD |
10656 | |
10657 | def Enable(*args, **kwargs): | |
10658 | """Enable(self, bool enable=True)""" | |
5b5c9bc7 | 10659 | return _core_.MenuItem_Enable(*args, **kwargs) |
d55e5bfc RD |
10660 | |
10661 | def IsEnabled(*args, **kwargs): | |
10662 | """IsEnabled(self) -> bool""" | |
5b5c9bc7 | 10663 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10664 | |
10665 | def Check(*args, **kwargs): | |
10666 | """Check(self, bool check=True)""" | |
5b5c9bc7 | 10667 | return _core_.MenuItem_Check(*args, **kwargs) |
d55e5bfc RD |
10668 | |
10669 | def IsChecked(*args, **kwargs): | |
10670 | """IsChecked(self) -> bool""" | |
5b5c9bc7 | 10671 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10672 | |
10673 | def Toggle(*args, **kwargs): | |
10674 | """Toggle(self)""" | |
5b5c9bc7 | 10675 | return _core_.MenuItem_Toggle(*args, **kwargs) |
d55e5bfc RD |
10676 | |
10677 | def SetHelp(*args, **kwargs): | |
5b5c9bc7 RD |
10678 | """SetHelp(self, String str)""" |
10679 | return _core_.MenuItem_SetHelp(*args, **kwargs) | |
d55e5bfc RD |
10680 | |
10681 | def GetHelp(*args, **kwargs): | |
5b5c9bc7 RD |
10682 | """GetHelp(self) -> String""" |
10683 | return _core_.MenuItem_GetHelp(*args, **kwargs) | |
d55e5bfc RD |
10684 | |
10685 | def GetAccel(*args, **kwargs): | |
5b5c9bc7 RD |
10686 | """GetAccel(self) -> AcceleratorEntry""" |
10687 | return _core_.MenuItem_GetAccel(*args, **kwargs) | |
d55e5bfc RD |
10688 | |
10689 | def SetAccel(*args, **kwargs): | |
5b5c9bc7 RD |
10690 | """SetAccel(self, AcceleratorEntry accel)""" |
10691 | return _core_.MenuItem_SetAccel(*args, **kwargs) | |
d55e5bfc | 10692 | |
c1280d1e | 10693 | def SetFont(*args, **kwargs): |
5b5c9bc7 RD |
10694 | """SetFont(self, Font font)""" |
10695 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
c1280d1e RD |
10696 | |
10697 | def GetFont(*args, **kwargs): | |
5b5c9bc7 RD |
10698 | """GetFont(self) -> Font""" |
10699 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
c1280d1e RD |
10700 | |
10701 | def SetTextColour(*args, **kwargs): | |
5b5c9bc7 RD |
10702 | """SetTextColour(self, Colour colText)""" |
10703 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
c1280d1e RD |
10704 | |
10705 | def GetTextColour(*args, **kwargs): | |
5b5c9bc7 RD |
10706 | """GetTextColour(self) -> Colour""" |
10707 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
c1280d1e RD |
10708 | |
10709 | def SetBackgroundColour(*args, **kwargs): | |
5b5c9bc7 RD |
10710 | """SetBackgroundColour(self, Colour colBack)""" |
10711 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
c1280d1e RD |
10712 | |
10713 | def GetBackgroundColour(*args, **kwargs): | |
5b5c9bc7 RD |
10714 | """GetBackgroundColour(self) -> Colour""" |
10715 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
c1280d1e RD |
10716 | |
10717 | def SetBitmaps(*args, **kwargs): | |
5b5c9bc7 RD |
10718 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" |
10719 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
c1280d1e RD |
10720 | |
10721 | def SetDisabledBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
10722 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" |
10723 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
c1280d1e RD |
10724 | |
10725 | def GetDisabledBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
10726 | """GetDisabledBitmap(self) -> Bitmap""" |
10727 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
c1280d1e RD |
10728 | |
10729 | def SetMarginWidth(*args, **kwargs): | |
10730 | """SetMarginWidth(self, int nWidth)""" | |
5b5c9bc7 | 10731 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) |
c1280d1e RD |
10732 | |
10733 | def GetMarginWidth(*args, **kwargs): | |
10734 | """GetMarginWidth(self) -> int""" | |
5b5c9bc7 | 10735 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) |
c1280d1e | 10736 | |
d55e5bfc | 10737 | def GetDefaultMarginWidth(*args, **kwargs): |
d6c14a4c | 10738 | """GetDefaultMarginWidth() -> int""" |
5b5c9bc7 | 10739 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
d55e5bfc RD |
10740 | |
10741 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
10742 | def IsOwnerDrawn(*args, **kwargs): |
10743 | """IsOwnerDrawn(self) -> bool""" | |
5b5c9bc7 | 10744 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) |
c1280d1e RD |
10745 | |
10746 | def SetOwnerDrawn(*args, **kwargs): | |
10747 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
5b5c9bc7 | 10748 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) |
c1280d1e RD |
10749 | |
10750 | def ResetOwnerDrawn(*args, **kwargs): | |
10751 | """ResetOwnerDrawn(self)""" | |
5b5c9bc7 | 10752 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) |
c1280d1e | 10753 | |
d55e5bfc | 10754 | def SetBitmap(*args, **kwargs): |
5b5c9bc7 RD |
10755 | """SetBitmap(self, Bitmap bitmap)""" |
10756 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
d55e5bfc RD |
10757 | |
10758 | def GetBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
10759 | """GetBitmap(self) -> Bitmap""" |
10760 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
d55e5bfc RD |
10761 | |
10762 | ||
5b5c9bc7 | 10763 | class MenuItemPtr(MenuItem): |
d55e5bfc RD |
10764 | def __init__(self, this): |
10765 | self.this = this | |
10766 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10767 | self.__class__ = MenuItem |
10768 | _core_.MenuItem_swigregister(MenuItemPtr) | |
d55e5bfc | 10769 | |
5b5c9bc7 RD |
10770 | def MenuItem_GetLabelFromText(*args, **kwargs): |
10771 | """MenuItem_GetLabelFromText(String text) -> String""" | |
10772 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d55e5bfc | 10773 | |
5b5c9bc7 RD |
10774 | def MenuItem_GetDefaultMarginWidth(*args, **kwargs): |
10775 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
10776 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) | |
d55e5bfc RD |
10777 | |
10778 | #--------------------------------------------------------------------------- | |
10779 | ||
5b5c9bc7 | 10780 | class Control(Window): |
d55e5bfc RD |
10781 | """ |
10782 | This is the base class for a control or 'widget'. | |
10783 | ||
15817c7e RD |
10784 | A control is generally a small window which processes user input |
10785 | and/or displays one or more item of data. | |
d55e5bfc RD |
10786 | """ |
10787 | def __repr__(self): | |
10788 | return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10789 | def __init__(self, *args, **kwargs): | |
10790 | """ | |
5b5c9bc7 RD |
10791 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10792 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
10793 | String name=ControlNameStr) -> Control | |
d55e5bfc | 10794 | |
15817c7e RD |
10795 | Create a Control. Normally you should only call this from a subclass' |
10796 | __init__ as a plain old wx.Control is not very useful. | |
d55e5bfc | 10797 | """ |
5b5c9bc7 | 10798 | newobj = _core_.new_Control(*args, **kwargs) |
d55e5bfc RD |
10799 | self.this = newobj.this |
10800 | self.thisown = 1 | |
10801 | del newobj.thisown | |
10802 | self._setOORInfo(self) | |
10803 | ||
10804 | def Create(*args, **kwargs): | |
10805 | """ | |
5b5c9bc7 RD |
10806 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10807 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
10808 | String name=ControlNameStr) -> bool | |
d55e5bfc RD |
10809 | |
10810 | Do the 2nd phase and create the GUI control. | |
10811 | """ | |
5b5c9bc7 | 10812 | return _core_.Control_Create(*args, **kwargs) |
d55e5bfc RD |
10813 | |
10814 | def Command(*args, **kwargs): | |
10815 | """ | |
5b5c9bc7 | 10816 | Command(self, CommandEvent event) |
d55e5bfc | 10817 | |
15817c7e RD |
10818 | Simulates the effect of the user issuing a command to the item. |
10819 | ||
10820 | :see: `wx.CommandEvent` | |
10821 | ||
d55e5bfc | 10822 | """ |
5b5c9bc7 | 10823 | return _core_.Control_Command(*args, **kwargs) |
d55e5bfc RD |
10824 | |
10825 | def GetLabel(*args, **kwargs): | |
10826 | """ | |
5b5c9bc7 | 10827 | GetLabel(self) -> String |
d55e5bfc RD |
10828 | |
10829 | Return a control's text. | |
10830 | """ | |
5b5c9bc7 | 10831 | return _core_.Control_GetLabel(*args, **kwargs) |
d55e5bfc RD |
10832 | |
10833 | def SetLabel(*args, **kwargs): | |
10834 | """ | |
5b5c9bc7 | 10835 | SetLabel(self, String label) |
d55e5bfc RD |
10836 | |
10837 | Sets the item's text. | |
10838 | """ | |
5b5c9bc7 | 10839 | return _core_.Control_SetLabel(*args, **kwargs) |
d55e5bfc RD |
10840 | |
10841 | def GetClassDefaultAttributes(*args, **kwargs): | |
110da5b0 | 10842 | """ |
5b5c9bc7 | 10843 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
110da5b0 RD |
10844 | |
10845 | Get the default attributes for this class. This is useful if you want | |
10846 | to use the same font or colour in your own control as in a standard | |
10847 | control -- which is a much better idea than hard coding specific | |
10848 | colours or fonts which might look completely out of place on the | |
10849 | user's system, especially if it uses themes. | |
10850 | ||
10851 | The variant parameter is only relevant under Mac currently and is | |
10852 | ignore under other platforms. Under Mac, it will change the size of | |
10853 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10854 | this. | |
10855 | """ | |
5b5c9bc7 | 10856 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
10857 | |
10858 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
10859 | ||
5b5c9bc7 | 10860 | class ControlPtr(Control): |
d55e5bfc RD |
10861 | def __init__(self, this): |
10862 | self.this = this | |
10863 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10864 | self.__class__ = Control |
10865 | _core_.Control_swigregister(ControlPtr) | |
d55e5bfc RD |
10866 | ControlNameStr = cvar.ControlNameStr |
10867 | ||
10868 | def PreControl(*args, **kwargs): | |
10869 | """ | |
5b5c9bc7 | 10870 | PreControl() -> Control |
d55e5bfc RD |
10871 | |
10872 | Precreate a Control control for 2-phase creation | |
10873 | """ | |
5b5c9bc7 | 10874 | val = _core_.new_PreControl(*args, **kwargs) |
d55e5bfc RD |
10875 | val.thisown = 1 |
10876 | return val | |
10877 | ||
5b5c9bc7 | 10878 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 | 10879 | """ |
5b5c9bc7 | 10880 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
110da5b0 RD |
10881 | |
10882 | Get the default attributes for this class. This is useful if you want | |
10883 | to use the same font or colour in your own control as in a standard | |
10884 | control -- which is a much better idea than hard coding specific | |
10885 | colours or fonts which might look completely out of place on the | |
10886 | user's system, especially if it uses themes. | |
10887 | ||
10888 | The variant parameter is only relevant under Mac currently and is | |
10889 | ignore under other platforms. Under Mac, it will change the size of | |
10890 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10891 | this. | |
10892 | """ | |
5b5c9bc7 | 10893 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
10894 | |
10895 | #--------------------------------------------------------------------------- | |
10896 | ||
5b5c9bc7 | 10897 | class ItemContainer(object): |
d55e5bfc | 10898 | """ |
53aa7709 RD |
10899 | The wx.ItemContainer class defines an interface which is implemented |
10900 | by all controls which have string subitems, each of which may be | |
10901 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
10902 | as `wx.ComboBox` which implements an extended interface deriving from | |
15817c7e | 10903 | this one. |
d55e5bfc | 10904 | |
15817c7e RD |
10905 | It defines the methods for accessing the control's items and although |
10906 | each of the derived classes implements them differently, they still | |
10907 | all conform to the same interface. | |
d55e5bfc | 10908 | |
15817c7e RD |
10909 | The items in a wx.ItemContainer have (non empty) string labels and, |
10910 | optionally, client data associated with them. | |
d55e5bfc RD |
10911 | |
10912 | """ | |
10913 | def __init__(self): raise RuntimeError, "No constructor defined" | |
10914 | def __repr__(self): | |
10915 | return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10916 | def Append(*args, **kwargs): | |
10917 | """ | |
5b5c9bc7 | 10918 | Append(self, String item, PyObject clientData=None) -> int |
d55e5bfc | 10919 | |
15817c7e RD |
10920 | Adds the item to the control, associating the given data with the item |
10921 | if not None. The return value is the index of the newly added item | |
10922 | which may be different from the last one if the control is sorted (e.g. | |
10923 | has wx.LB_SORT or wx.CB_SORT style). | |
d55e5bfc | 10924 | """ |
5b5c9bc7 | 10925 | return _core_.ItemContainer_Append(*args, **kwargs) |
d55e5bfc RD |
10926 | |
10927 | def AppendItems(*args, **kwargs): | |
10928 | """ | |
f5b96ee1 | 10929 | AppendItems(self, List strings) |
d55e5bfc | 10930 | |
15817c7e RD |
10931 | Apend several items at once to the control. Notice that calling this |
10932 | method may be much faster than appending the items one by one if you | |
10933 | need to add a lot of items. | |
d55e5bfc | 10934 | """ |
5b5c9bc7 | 10935 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
d55e5bfc RD |
10936 | |
10937 | def Insert(*args, **kwargs): | |
10938 | """ | |
5b5c9bc7 | 10939 | Insert(self, String item, int pos, PyObject clientData=None) -> int |
d55e5bfc | 10940 | |
15817c7e | 10941 | Insert an item into the control before the item at the ``pos`` index, |
d55e5bfc RD |
10942 | optionally associating some data object with the item. |
10943 | """ | |
5b5c9bc7 | 10944 | return _core_.ItemContainer_Insert(*args, **kwargs) |
d55e5bfc RD |
10945 | |
10946 | def Clear(*args, **kwargs): | |
10947 | """ | |
10948 | Clear(self) | |
10949 | ||
10950 | Removes all items from the control. | |
10951 | """ | |
5b5c9bc7 | 10952 | return _core_.ItemContainer_Clear(*args, **kwargs) |
d55e5bfc RD |
10953 | |
10954 | def Delete(*args, **kwargs): | |
10955 | """ | |
10956 | Delete(self, int n) | |
10957 | ||
15817c7e RD |
10958 | Deletes the item at the zero-based index 'n' from the control. Note |
10959 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
10960 | enabled) to remove an item with the index negative or greater or equal | |
10961 | than the number of items in the control. | |
d55e5bfc | 10962 | """ |
5b5c9bc7 | 10963 | return _core_.ItemContainer_Delete(*args, **kwargs) |
d55e5bfc | 10964 | |
53aa7709 RD |
10965 | def GetClientData(*args, **kwargs): |
10966 | """ | |
10967 | GetClientData(self, int n) -> PyObject | |
10968 | ||
10969 | Returns the client data associated with the given item, (if any.) | |
10970 | """ | |
5b5c9bc7 | 10971 | return _core_.ItemContainer_GetClientData(*args, **kwargs) |
53aa7709 RD |
10972 | |
10973 | def SetClientData(*args, **kwargs): | |
10974 | """ | |
10975 | SetClientData(self, int n, PyObject clientData) | |
10976 | ||
10977 | Associate the given client data with the item at position n. | |
10978 | """ | |
5b5c9bc7 | 10979 | return _core_.ItemContainer_SetClientData(*args, **kwargs) |
53aa7709 | 10980 | |
d55e5bfc RD |
10981 | def GetCount(*args, **kwargs): |
10982 | """ | |
10983 | GetCount(self) -> int | |
10984 | ||
10985 | Returns the number of items in the control. | |
10986 | """ | |
5b5c9bc7 | 10987 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
d55e5bfc RD |
10988 | |
10989 | def IsEmpty(*args, **kwargs): | |
10990 | """ | |
10991 | IsEmpty(self) -> bool | |
10992 | ||
10993 | Returns True if the control is empty or False if it has some items. | |
10994 | """ | |
5b5c9bc7 | 10995 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
d55e5bfc RD |
10996 | |
10997 | def GetString(*args, **kwargs): | |
10998 | """ | |
5b5c9bc7 | 10999 | GetString(self, int n) -> String |
d55e5bfc RD |
11000 | |
11001 | Returns the label of the item with the given index. | |
11002 | """ | |
5b5c9bc7 | 11003 | return _core_.ItemContainer_GetString(*args, **kwargs) |
d55e5bfc RD |
11004 | |
11005 | def GetStrings(*args, **kwargs): | |
11006 | """GetStrings(self) -> wxArrayString""" | |
5b5c9bc7 | 11007 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
d55e5bfc RD |
11008 | |
11009 | def SetString(*args, **kwargs): | |
11010 | """ | |
5b5c9bc7 | 11011 | SetString(self, int n, String s) |
d55e5bfc RD |
11012 | |
11013 | Sets the label for the given item. | |
11014 | """ | |
5b5c9bc7 | 11015 | return _core_.ItemContainer_SetString(*args, **kwargs) |
d55e5bfc RD |
11016 | |
11017 | def FindString(*args, **kwargs): | |
11018 | """ | |
5b5c9bc7 | 11019 | FindString(self, String s) -> int |
d55e5bfc RD |
11020 | |
11021 | Finds an item whose label matches the given string. Returns the | |
15817c7e RD |
11022 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
11023 | found. | |
d55e5bfc | 11024 | """ |
5b5c9bc7 | 11025 | return _core_.ItemContainer_FindString(*args, **kwargs) |
d55e5bfc | 11026 | |
53aa7709 | 11027 | def SetSelection(*args, **kwargs): |
d55e5bfc | 11028 | """ |
53aa7709 | 11029 | SetSelection(self, int n) |
d55e5bfc RD |
11030 | |
11031 | Sets the item at index 'n' to be the selected item. | |
11032 | """ | |
5b5c9bc7 | 11033 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
d55e5bfc | 11034 | |
d55e5bfc RD |
11035 | def GetSelection(*args, **kwargs): |
11036 | """ | |
11037 | GetSelection(self) -> int | |
11038 | ||
15817c7e RD |
11039 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
11040 | is selected. | |
d55e5bfc | 11041 | """ |
5b5c9bc7 | 11042 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
d55e5bfc | 11043 | |
53aa7709 | 11044 | def SetStringSelection(*args, **kwargs): |
5b5c9bc7 RD |
11045 | """SetStringSelection(self, String s) -> bool""" |
11046 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
53aa7709 | 11047 | |
d55e5bfc RD |
11048 | def GetStringSelection(*args, **kwargs): |
11049 | """ | |
5b5c9bc7 | 11050 | GetStringSelection(self) -> String |
d55e5bfc | 11051 | |
15817c7e RD |
11052 | Returns the label of the selected item or an empty string if no item |
11053 | is selected. | |
d55e5bfc | 11054 | """ |
5b5c9bc7 | 11055 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
d55e5bfc | 11056 | |
53aa7709 | 11057 | def Select(*args, **kwargs): |
d55e5bfc | 11058 | """ |
53aa7709 | 11059 | Select(self, int n) |
d55e5bfc | 11060 | |
53aa7709 RD |
11061 | This is the same as `SetSelection` and exists only because it is |
11062 | slightly more natural for controls which support multiple selection. | |
d55e5bfc | 11063 | """ |
5b5c9bc7 | 11064 | return _core_.ItemContainer_Select(*args, **kwargs) |
d55e5bfc RD |
11065 | |
11066 | ||
5b5c9bc7 | 11067 | class ItemContainerPtr(ItemContainer): |
d55e5bfc RD |
11068 | def __init__(self, this): |
11069 | self.this = this | |
11070 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11071 | self.__class__ = ItemContainer |
11072 | _core_.ItemContainer_swigregister(ItemContainerPtr) | |
d55e5bfc RD |
11073 | |
11074 | #--------------------------------------------------------------------------- | |
11075 | ||
5b5c9bc7 | 11076 | class ControlWithItems(Control,ItemContainer): |
d55e5bfc | 11077 | """ |
15817c7e RD |
11078 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
11079 | wx.Control class, and is used for the base class of various controls | |
11080 | that have items. | |
d55e5bfc RD |
11081 | """ |
11082 | def __init__(self): raise RuntimeError, "No constructor defined" | |
11083 | def __repr__(self): | |
11084 | return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11085 | ||
5b5c9bc7 | 11086 | class ControlWithItemsPtr(ControlWithItems): |
d55e5bfc RD |
11087 | def __init__(self, this): |
11088 | self.this = this | |
11089 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11090 | self.__class__ = ControlWithItems |
11091 | _core_.ControlWithItems_swigregister(ControlWithItemsPtr) | |
d55e5bfc RD |
11092 | |
11093 | #--------------------------------------------------------------------------- | |
11094 | ||
5b5c9bc7 | 11095 | class SizerItem(Object): |
bfddbb17 RD |
11096 | """ |
11097 | The wx.SizerItem class is used to track the position, size and other | |
11098 | attributes of each item managed by a `wx.Sizer`. In normal usage user | |
11099 | code should never need to deal directly with a wx.SizerItem, but | |
11100 | custom classes derived from `wx.PySizer` will probably need to use the | |
11101 | collection of wx.SizerItems held by wx.Sizer when calculating layout. | |
11102 | ||
11103 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
11104 | """ | |
d55e5bfc RD |
11105 | def __repr__(self): |
11106 | return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11107 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11108 | """ |
5b5c9bc7 | 11109 | __init__(self) -> SizerItem |
bfddbb17 RD |
11110 | |
11111 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
11112 | size will need to be set before this item can be used in a Sizer. | |
11113 | ||
11114 | You will probably never need to create a wx.SizerItem directly as they | |
11115 | are created automatically when the sizer's Add, Insert or Prepend | |
11116 | methods are called. | |
11117 | ||
11118 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
11119 | """ | |
5b5c9bc7 | 11120 | newobj = _core_.new_SizerItem(*args, **kwargs) |
d55e5bfc RD |
11121 | self.this = newobj.this |
11122 | self.thisown = 1 | |
11123 | del newobj.thisown | |
11124 | def DeleteWindows(*args, **kwargs): | |
bfddbb17 RD |
11125 | """ |
11126 | DeleteWindows(self) | |
11127 | ||
11128 | Destroy the window or the windows in a subsizer, depending on the type | |
11129 | of item. | |
11130 | """ | |
5b5c9bc7 | 11131 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
d55e5bfc RD |
11132 | |
11133 | def DetachSizer(*args, **kwargs): | |
bfddbb17 RD |
11134 | """ |
11135 | DetachSizer(self) | |
11136 | ||
11137 | Enable deleting the SizerItem without destroying the contained sizer. | |
11138 | """ | |
5b5c9bc7 | 11139 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
d55e5bfc RD |
11140 | |
11141 | def GetSize(*args, **kwargs): | |
bfddbb17 | 11142 | """ |
5b5c9bc7 | 11143 | GetSize(self) -> Size |
bfddbb17 RD |
11144 | |
11145 | Get the current size of the item, as set in the last Layout. | |
11146 | """ | |
5b5c9bc7 | 11147 | return _core_.SizerItem_GetSize(*args, **kwargs) |
d55e5bfc RD |
11148 | |
11149 | def CalcMin(*args, **kwargs): | |
bfddbb17 | 11150 | """ |
5b5c9bc7 | 11151 | CalcMin(self) -> Size |
bfddbb17 RD |
11152 | |
11153 | Calculates the minimum desired size for the item, including any space | |
11154 | needed by borders. | |
11155 | """ | |
5b5c9bc7 | 11156 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
d55e5bfc RD |
11157 | |
11158 | def SetDimension(*args, **kwargs): | |
bfddbb17 | 11159 | """ |
5b5c9bc7 | 11160 | SetDimension(self, Point pos, Size size) |
bfddbb17 RD |
11161 | |
11162 | Set the position and size of the space allocated for this item by the | |
11163 | sizer, and adjust the position and size of the item (window or | |
11164 | subsizer) to be within that space taking alignment and borders into | |
11165 | account. | |
11166 | """ | |
5b5c9bc7 | 11167 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
d55e5bfc RD |
11168 | |
11169 | def GetMinSize(*args, **kwargs): | |
bfddbb17 | 11170 | """ |
5b5c9bc7 | 11171 | GetMinSize(self) -> Size |
bfddbb17 RD |
11172 | |
11173 | Get the minimum size needed for the item. | |
11174 | """ | |
5b5c9bc7 | 11175 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
d55e5bfc | 11176 | |
a001823c RD |
11177 | def GetMinSizeWithBorder(*args, **kwargs): |
11178 | """ | |
5b5c9bc7 | 11179 | GetMinSizeWithBorder(self) -> Size |
a001823c RD |
11180 | |
11181 | Get the minimum size needed for the item with space for the borders | |
11182 | added, if needed. | |
11183 | """ | |
5b5c9bc7 | 11184 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) |
a001823c | 11185 | |
d55e5bfc RD |
11186 | def SetInitSize(*args, **kwargs): |
11187 | """SetInitSize(self, int x, int y)""" | |
5b5c9bc7 | 11188 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
d55e5bfc RD |
11189 | |
11190 | def SetRatioWH(*args, **kwargs): | |
bfddbb17 RD |
11191 | """ |
11192 | SetRatioWH(self, int width, int height) | |
11193 | ||
11194 | Set the ratio item attribute. | |
11195 | """ | |
5b5c9bc7 | 11196 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
d55e5bfc RD |
11197 | |
11198 | def SetRatioSize(*args, **kwargs): | |
bfddbb17 | 11199 | """ |
5b5c9bc7 | 11200 | SetRatioSize(self, Size size) |
bfddbb17 RD |
11201 | |
11202 | Set the ratio item attribute. | |
11203 | """ | |
5b5c9bc7 | 11204 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
d55e5bfc RD |
11205 | |
11206 | def SetRatio(*args, **kwargs): | |
bfddbb17 RD |
11207 | """ |
11208 | SetRatio(self, float ratio) | |
11209 | ||
11210 | Set the ratio item attribute. | |
11211 | """ | |
5b5c9bc7 | 11212 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
d55e5bfc RD |
11213 | |
11214 | def GetRatio(*args, **kwargs): | |
bfddbb17 RD |
11215 | """ |
11216 | GetRatio(self) -> float | |
11217 | ||
11218 | Set the ratio item attribute. | |
11219 | """ | |
5b5c9bc7 | 11220 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
d55e5bfc | 11221 | |
070c48b4 RD |
11222 | def GetRect(*args, **kwargs): |
11223 | """ | |
5b5c9bc7 | 11224 | GetRect(self) -> Rect |
070c48b4 RD |
11225 | |
11226 | Returns the rectangle that the sizer item should occupy | |
11227 | """ | |
5b5c9bc7 | 11228 | return _core_.SizerItem_GetRect(*args, **kwargs) |
070c48b4 | 11229 | |
d55e5bfc | 11230 | def IsWindow(*args, **kwargs): |
bfddbb17 RD |
11231 | """ |
11232 | IsWindow(self) -> bool | |
11233 | ||
11234 | Is this sizer item a window? | |
11235 | """ | |
5b5c9bc7 | 11236 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
d55e5bfc RD |
11237 | |
11238 | def IsSizer(*args, **kwargs): | |
bfddbb17 RD |
11239 | """ |
11240 | IsSizer(self) -> bool | |
11241 | ||
11242 | Is this sizer item a subsizer? | |
11243 | """ | |
5b5c9bc7 | 11244 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
d55e5bfc RD |
11245 | |
11246 | def IsSpacer(*args, **kwargs): | |
bfddbb17 RD |
11247 | """ |
11248 | IsSpacer(self) -> bool | |
11249 | ||
11250 | Is this sizer item a spacer? | |
11251 | """ | |
5b5c9bc7 | 11252 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
d55e5bfc RD |
11253 | |
11254 | def SetProportion(*args, **kwargs): | |
bfddbb17 RD |
11255 | """ |
11256 | SetProportion(self, int proportion) | |
11257 | ||
11258 | Set the proportion value for this item. | |
11259 | """ | |
5b5c9bc7 | 11260 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
d55e5bfc RD |
11261 | |
11262 | def GetProportion(*args, **kwargs): | |
bfddbb17 RD |
11263 | """ |
11264 | GetProportion(self) -> int | |
11265 | ||
11266 | Get the proportion value for this item. | |
11267 | """ | |
5b5c9bc7 | 11268 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
d55e5bfc | 11269 | |
bfddbb17 RD |
11270 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
11271 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
d55e5bfc | 11272 | def SetFlag(*args, **kwargs): |
bfddbb17 RD |
11273 | """ |
11274 | SetFlag(self, int flag) | |
11275 | ||
11276 | Set the flag value for this item. | |
11277 | """ | |
5b5c9bc7 | 11278 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
d55e5bfc RD |
11279 | |
11280 | def GetFlag(*args, **kwargs): | |
bfddbb17 RD |
11281 | """ |
11282 | GetFlag(self) -> int | |
11283 | ||
11284 | Get the flag value for this item. | |
11285 | """ | |
5b5c9bc7 | 11286 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
d55e5bfc RD |
11287 | |
11288 | def SetBorder(*args, **kwargs): | |
bfddbb17 RD |
11289 | """ |
11290 | SetBorder(self, int border) | |
11291 | ||
11292 | Set the border value for this item. | |
11293 | """ | |
5b5c9bc7 | 11294 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
d55e5bfc RD |
11295 | |
11296 | def GetBorder(*args, **kwargs): | |
bfddbb17 RD |
11297 | """ |
11298 | GetBorder(self) -> int | |
11299 | ||
11300 | Get the border value for this item. | |
11301 | """ | |
5b5c9bc7 | 11302 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
d55e5bfc RD |
11303 | |
11304 | def GetWindow(*args, **kwargs): | |
bfddbb17 | 11305 | """ |
5b5c9bc7 | 11306 | GetWindow(self) -> Window |
bfddbb17 RD |
11307 | |
11308 | Get the window (if any) that is managed by this sizer item. | |
11309 | """ | |
5b5c9bc7 | 11310 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
d55e5bfc RD |
11311 | |
11312 | def SetWindow(*args, **kwargs): | |
bfddbb17 | 11313 | """ |
5b5c9bc7 | 11314 | SetWindow(self, Window window) |
bfddbb17 RD |
11315 | |
11316 | Set the window to be managed by this sizer item. | |
11317 | """ | |
5b5c9bc7 | 11318 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
d55e5bfc RD |
11319 | |
11320 | def GetSizer(*args, **kwargs): | |
bfddbb17 | 11321 | """ |
5b5c9bc7 | 11322 | GetSizer(self) -> Sizer |
bfddbb17 RD |
11323 | |
11324 | Get the subsizer (if any) that is managed by this sizer item. | |
11325 | """ | |
5b5c9bc7 | 11326 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
d55e5bfc RD |
11327 | |
11328 | def SetSizer(*args, **kwargs): | |
bfddbb17 | 11329 | """ |
5b5c9bc7 | 11330 | SetSizer(self, Sizer sizer) |
bfddbb17 RD |
11331 | |
11332 | Set the subsizer to be managed by this sizer item. | |
11333 | """ | |
5b5c9bc7 | 11334 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
d55e5bfc RD |
11335 | |
11336 | def GetSpacer(*args, **kwargs): | |
bfddbb17 | 11337 | """ |
5b5c9bc7 | 11338 | GetSpacer(self) -> Size |
bfddbb17 RD |
11339 | |
11340 | Get the size of the spacer managed by this sizer item. | |
11341 | """ | |
5b5c9bc7 | 11342 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
d55e5bfc RD |
11343 | |
11344 | def SetSpacer(*args, **kwargs): | |
bfddbb17 | 11345 | """ |
5b5c9bc7 | 11346 | SetSpacer(self, Size size) |
bfddbb17 RD |
11347 | |
11348 | Set the size of the spacer to be managed by this sizer item. | |
11349 | """ | |
5b5c9bc7 | 11350 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
d55e5bfc RD |
11351 | |
11352 | def Show(*args, **kwargs): | |
bfddbb17 RD |
11353 | """ |
11354 | Show(self, bool show) | |
11355 | ||
11356 | Set the show item attribute, which sizers use to determine if the item | |
11357 | is to be made part of the layout or not. If the item is tracking a | |
11358 | window then it is shown or hidden as needed. | |
11359 | """ | |
5b5c9bc7 | 11360 | return _core_.SizerItem_Show(*args, **kwargs) |
d55e5bfc RD |
11361 | |
11362 | def IsShown(*args, **kwargs): | |
bfddbb17 RD |
11363 | """ |
11364 | IsShown(self) -> bool | |
11365 | ||
11366 | Is the item to be shown in the layout? | |
11367 | """ | |
5b5c9bc7 | 11368 | return _core_.SizerItem_IsShown(*args, **kwargs) |
d55e5bfc RD |
11369 | |
11370 | def GetPosition(*args, **kwargs): | |
bfddbb17 | 11371 | """ |
5b5c9bc7 | 11372 | GetPosition(self) -> Point |
bfddbb17 RD |
11373 | |
11374 | Returns the current position of the item, as set in the last Layout. | |
11375 | """ | |
5b5c9bc7 | 11376 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
d55e5bfc RD |
11377 | |
11378 | def GetUserData(*args, **kwargs): | |
bfddbb17 RD |
11379 | """ |
11380 | GetUserData(self) -> PyObject | |
11381 | ||
11382 | Returns the userData associated with this sizer item, or None if there | |
11383 | isn't any. | |
11384 | """ | |
5b5c9bc7 | 11385 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
d55e5bfc RD |
11386 | |
11387 | ||
5b5c9bc7 | 11388 | class SizerItemPtr(SizerItem): |
d55e5bfc RD |
11389 | def __init__(self, this): |
11390 | self.this = this | |
11391 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11392 | self.__class__ = SizerItem |
11393 | _core_.SizerItem_swigregister(SizerItemPtr) | |
d55e5bfc | 11394 | |
bfddbb17 | 11395 | def SizerItemWindow(*args, **kwargs): |
d55e5bfc | 11396 | """ |
5b5c9bc7 RD |
11397 | SizerItemWindow(Window window, int proportion, int flag, int border, |
11398 | PyObject userData=None) -> SizerItem | |
bfddbb17 RD |
11399 | |
11400 | Constructs a `wx.SizerItem` for tracking a window. | |
d55e5bfc | 11401 | """ |
5b5c9bc7 | 11402 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d55e5bfc RD |
11403 | val.thisown = 1 |
11404 | return val | |
11405 | ||
bfddbb17 | 11406 | def SizerItemSpacer(*args, **kwargs): |
d55e5bfc | 11407 | """ |
bfddbb17 | 11408 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
5b5c9bc7 | 11409 | PyObject userData=None) -> SizerItem |
bfddbb17 RD |
11410 | |
11411 | Constructs a `wx.SizerItem` for tracking a spacer. | |
d55e5bfc | 11412 | """ |
5b5c9bc7 | 11413 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d55e5bfc RD |
11414 | val.thisown = 1 |
11415 | return val | |
11416 | ||
11417 | def SizerItemSizer(*args, **kwargs): | |
11418 | """ | |
5b5c9bc7 RD |
11419 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, |
11420 | PyObject userData=None) -> SizerItem | |
bfddbb17 RD |
11421 | |
11422 | Constructs a `wx.SizerItem` for tracking a subsizer | |
d55e5bfc | 11423 | """ |
5b5c9bc7 | 11424 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d55e5bfc RD |
11425 | val.thisown = 1 |
11426 | return val | |
11427 | ||
5b5c9bc7 | 11428 | class Sizer(Object): |
bfddbb17 RD |
11429 | """ |
11430 | wx.Sizer is the abstract base class used for laying out subwindows in | |
11431 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
11432 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
11433 | `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer` | |
11434 | and `wx.GridBagSizer`. | |
11435 | ||
11436 | The concept implemented by sizers in wxWidgets is closely related to | |
11437 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
11438 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
11439 | subwindows reporting their minimal required size and their ability to | |
11440 | get stretched if the size of the parent window has changed. This will | |
11441 | most often mean that the programmer does not set the original size of | |
11442 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
11443 | this sizer will be queried about the recommended size. The sizer in | |
11444 | turn will query its children, which can be normal windows or contorls, | |
11445 | empty space or other sizers, so that a hierarchy of sizers can be | |
11446 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
11447 | do not interfere with tab ordering and requires very little resources | |
11448 | compared to a real window on screen. | |
11449 | ||
11450 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
11451 | every control reports its own minimal size and the algorithm can | |
11452 | handle differences in font sizes or different window (dialog item) | |
11453 | sizes on different platforms without problems. If for example the | |
11454 | standard font as well as the overall design of Mac widgets requires | |
11455 | more space than on Windows, then the initial size of a dialog using a | |
11456 | sizer will automatically be bigger on Mac than on Windows. | |
11457 | """ | |
d55e5bfc RD |
11458 | def __init__(self): raise RuntimeError, "No constructor defined" |
11459 | def __repr__(self): | |
11460 | return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11461 | def _setOORInfo(*args, **kwargs): | |
11462 | """_setOORInfo(self, PyObject _self)""" | |
5b5c9bc7 | 11463 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
d55e5bfc RD |
11464 | |
11465 | def Add(*args, **kwargs): | |
11466 | """ | |
bfddbb17 | 11467 | Add(self, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11468 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11469 | |
11470 | Appends a child item to the sizer. | |
d55e5bfc | 11471 | """ |
5b5c9bc7 | 11472 | return _core_.Sizer_Add(*args, **kwargs) |
d55e5bfc RD |
11473 | |
11474 | def Insert(*args, **kwargs): | |
11475 | """ | |
bfddbb17 | 11476 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11477 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11478 | |
11479 | Inserts a new item into the list of items managed by this sizer before | |
11480 | the item at index *before*. See `Add` for a description of the parameters. | |
d55e5bfc | 11481 | """ |
5b5c9bc7 | 11482 | return _core_.Sizer_Insert(*args, **kwargs) |
d55e5bfc RD |
11483 | |
11484 | def Prepend(*args, **kwargs): | |
11485 | """ | |
bfddbb17 | 11486 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11487 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11488 | |
11489 | Adds a new item to the begining of the list of sizer items managed by | |
11490 | this sizer. See `Add` for a description of the parameters. | |
d55e5bfc | 11491 | """ |
5b5c9bc7 | 11492 | return _core_.Sizer_Prepend(*args, **kwargs) |
d55e5bfc RD |
11493 | |
11494 | def Remove(*args, **kwargs): | |
bfddbb17 RD |
11495 | """ |
11496 | Remove(self, item) -> bool | |
11497 | ||
11498 | Removes an item from the sizer and destroys it. This method does not | |
11499 | cause any layout or resizing to take place, call `Layout` to update | |
11500 | the layout on screen after removing a child from the sizer. The | |
11501 | *item* parameter can be either a window, a sizer, or the zero-based | |
11502 | index of an item to remove. Returns True if the child item was found | |
11503 | and removed. | |
11504 | """ | |
5b5c9bc7 | 11505 | return _core_.Sizer_Remove(*args, **kwargs) |
d55e5bfc | 11506 | |
1a6bba1e | 11507 | def Detach(*args, **kwargs): |
bfddbb17 RD |
11508 | """ |
11509 | Detach(self, item) -> bool | |
11510 | ||
11511 | Detaches an item from the sizer without destroying it. This method | |
11512 | does not cause any layout or resizing to take place, call `Layout` to | |
11513 | do so. The *item* parameter can be either a window, a sizer, or the | |
11514 | zero-based index of the item to be detached. Returns True if the child item | |
11515 | was found and detached. | |
11516 | """ | |
5b5c9bc7 | 11517 | return _core_.Sizer_Detach(*args, **kwargs) |
1a6bba1e | 11518 | |
070c48b4 RD |
11519 | def GetItem(*args, **kwargs): |
11520 | """ | |
11521 | GetItem(self, item) -> wx.SizerItem | |
11522 | ||
11523 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11524 | parameter can be either a window, a sizer, or the zero-based index of | |
11525 | the item to be detached. | |
11526 | """ | |
5b5c9bc7 | 11527 | return _core_.Sizer_GetItem(*args, **kwargs) |
070c48b4 | 11528 | |
d55e5bfc | 11529 | def _SetItemMinSize(*args, **kwargs): |
5b5c9bc7 RD |
11530 | """_SetItemMinSize(self, PyObject item, Size size)""" |
11531 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) | |
d55e5bfc | 11532 | |
bfddbb17 RD |
11533 | def SetItemMinSize(self, item, *args): |
11534 | """ | |
11535 | SetItemMinSize(self, item, Size size) | |
11536 | ||
11537 | Sets the minimum size that will be allocated for an item in the sizer. | |
11538 | The *item* parameter can be either a window, a sizer, or the | |
11539 | zero-based index of the item. If a window or sizer is given then it | |
11540 | will be searched for recursivly in subsizers if neccessary. | |
11541 | """ | |
11542 | if len(args) == 2: | |
11543 | # for backward compatibility accept separate width,height args too | |
11544 | return self._SetItemMinSize(item, args) | |
11545 | else: | |
11546 | return self._SetItemMinSize(item, args[0]) | |
11547 | ||
d55e5bfc | 11548 | def AddItem(*args, **kwargs): |
bfddbb17 RD |
11549 | """ |
11550 | AddItem(self, SizerItem item) | |
11551 | ||
11552 | Adds a `wx.SizerItem` to the sizer. | |
11553 | """ | |
5b5c9bc7 | 11554 | return _core_.Sizer_AddItem(*args, **kwargs) |
d55e5bfc RD |
11555 | |
11556 | def InsertItem(*args, **kwargs): | |
bfddbb17 RD |
11557 | """ |
11558 | InsertItem(self, int index, SizerItem item) | |
11559 | ||
11560 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11561 | """ | |
5b5c9bc7 | 11562 | return _core_.Sizer_InsertItem(*args, **kwargs) |
d55e5bfc RD |
11563 | |
11564 | def PrependItem(*args, **kwargs): | |
bfddbb17 RD |
11565 | """ |
11566 | PrependItem(self, SizerItem item) | |
11567 | ||
11568 | Prepends a `wx.SizerItem` to the sizer. | |
11569 | """ | |
5b5c9bc7 | 11570 | return _core_.Sizer_PrependItem(*args, **kwargs) |
d55e5bfc | 11571 | |
bfddbb17 | 11572 | def AddMany(self, items): |
d6c14a4c RD |
11573 | """ |
11574 | AddMany is a convenience method for adding several items | |
11575 | to a sizer at one time. Simply pass it a list of tuples, | |
11576 | where each tuple consists of the parameters that you | |
11577 | would normally pass to the `Add` method. | |
11578 | """ | |
bfddbb17 RD |
11579 | for item in items: |
11580 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11581 | item = (item, ) | |
11582 | self.Add(*item) | |
d55e5bfc RD |
11583 | |
11584 | # for backwards compatibility only, please do not use in new code | |
7fbf8399 RD |
11585 | def AddWindow(self, *args, **kw): |
11586 | """Compatibility alias for `Add`.""" | |
11587 | return self.Add(*args, **kw) | |
11588 | def AddSizer(self, *args, **kw): | |
11589 | """Compatibility alias for `Add`.""" | |
11590 | return self.Add(*args, **kw) | |
11591 | def AddSpacer(self, *args, **kw): | |
11592 | """Compatibility alias for `Add`.""" | |
11593 | return self.Add(*args, **kw) | |
11594 | ||
11595 | def PrependWindow(self, *args, **kw): | |
11596 | """Compatibility alias for `Prepend`.""" | |
11597 | return self.Prepend(*args, **kw) | |
11598 | def PrependSizer(self, *args, **kw): | |
11599 | """Compatibility alias for `Prepend`.""" | |
11600 | return self.Prepend(*args, **kw) | |
11601 | def PrependSpacer(self, *args, **kw): | |
11602 | """Compatibility alias for `Prepend`.""" | |
11603 | return self.Prepend(*args, **kw) | |
11604 | ||
11605 | def InsertWindow(self, *args, **kw): | |
11606 | """Compatibility alias for `Insert`.""" | |
11607 | return self.Insert(*args, **kw) | |
11608 | def InsertSizer(self, *args, **kw): | |
11609 | """Compatibility alias for `Insert`.""" | |
11610 | return self.Insert(*args, **kw) | |
11611 | def InsertSpacer(self, *args, **kw): | |
11612 | """Compatibility alias for `Insert`.""" | |
11613 | return self.Insert(*args, **kw) | |
11614 | ||
11615 | def RemoveWindow(self, *args, **kw): | |
11616 | """Compatibility alias for `Remove`.""" | |
11617 | return self.Remove(*args, **kw) | |
11618 | def RemoveSizer(self, *args, **kw): | |
11619 | """Compatibility alias for `Remove`.""" | |
11620 | return self.Remove(*args, **kw) | |
11621 | def RemovePos(self, *args, **kw): | |
11622 | """Compatibility alias for `Remove`.""" | |
11623 | return self.Remove(*args, **kw) | |
d55e5bfc RD |
11624 | |
11625 | ||
d55e5bfc | 11626 | def SetDimension(*args, **kwargs): |
bfddbb17 RD |
11627 | """ |
11628 | SetDimension(self, int x, int y, int width, int height) | |
11629 | ||
11630 | Call this to force the sizer to take the given dimension and thus | |
11631 | force the items owned by the sizer to resize themselves according to | |
11632 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11633 | methods. | |
11634 | """ | |
5b5c9bc7 | 11635 | return _core_.Sizer_SetDimension(*args, **kwargs) |
d55e5bfc RD |
11636 | |
11637 | def SetMinSize(*args, **kwargs): | |
bfddbb17 | 11638 | """ |
5b5c9bc7 | 11639 | SetMinSize(self, Size size) |
bfddbb17 RD |
11640 | |
11641 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11642 | calculate its minimal size based purely on how much space its children | |
11643 | need. After calling this method `GetMinSize` will return either the | |
11644 | minimal size as requested by its children or the minimal size set | |
11645 | here, depending on which is bigger. | |
11646 | """ | |
5b5c9bc7 | 11647 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
d55e5bfc RD |
11648 | |
11649 | def GetSize(*args, **kwargs): | |
bfddbb17 | 11650 | """ |
5b5c9bc7 | 11651 | GetSize(self) -> Size |
bfddbb17 RD |
11652 | |
11653 | Returns the current size of the space managed by the sizer. | |
11654 | """ | |
5b5c9bc7 | 11655 | return _core_.Sizer_GetSize(*args, **kwargs) |
d55e5bfc RD |
11656 | |
11657 | def GetPosition(*args, **kwargs): | |
bfddbb17 | 11658 | """ |
5b5c9bc7 | 11659 | GetPosition(self) -> Point |
bfddbb17 RD |
11660 | |
11661 | Returns the current position of the sizer's managed space. | |
11662 | """ | |
5b5c9bc7 | 11663 | return _core_.Sizer_GetPosition(*args, **kwargs) |
d55e5bfc RD |
11664 | |
11665 | def GetMinSize(*args, **kwargs): | |
bfddbb17 | 11666 | """ |
5b5c9bc7 | 11667 | GetMinSize(self) -> Size |
bfddbb17 RD |
11668 | |
11669 | Returns the minimal size of the sizer. This is either the combined | |
11670 | minimal size of all the children and their borders or the minimal size | |
11671 | set by SetMinSize, depending on which is bigger. | |
11672 | """ | |
5b5c9bc7 | 11673 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
d55e5bfc RD |
11674 | |
11675 | def GetSizeTuple(self): | |
1a6bba1e | 11676 | return self.GetSize().Get() |
d55e5bfc | 11677 | def GetPositionTuple(self): |
1a6bba1e | 11678 | return self.GetPosition().Get() |
d55e5bfc | 11679 | def GetMinSizeTuple(self): |
1a6bba1e | 11680 | return self.GetMinSize().Get() |
d55e5bfc RD |
11681 | |
11682 | def RecalcSizes(*args, **kwargs): | |
bfddbb17 RD |
11683 | """ |
11684 | RecalcSizes(self) | |
11685 | ||
11686 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11687 | items managed by this sizer. You should not need to call this directly as | |
11688 | it is called by `Layout`. | |
11689 | """ | |
5b5c9bc7 | 11690 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
d55e5bfc RD |
11691 | |
11692 | def CalcMin(*args, **kwargs): | |
bfddbb17 | 11693 | """ |
5b5c9bc7 | 11694 | CalcMin(self) -> Size |
bfddbb17 RD |
11695 | |
11696 | This method is where the sizer will do the actual calculation of its | |
11697 | children's minimal sizes. You should not need to call this directly as | |
11698 | it is called by `Layout`. | |
11699 | """ | |
5b5c9bc7 | 11700 | return _core_.Sizer_CalcMin(*args, **kwargs) |
d55e5bfc RD |
11701 | |
11702 | def Layout(*args, **kwargs): | |
bfddbb17 RD |
11703 | """ |
11704 | Layout(self) | |
11705 | ||
11706 | This method will force the recalculation and layout of the items | |
11707 | controlled by the sizer using the current space allocated to the | |
11708 | sizer. Normally this is called automatically from the owning window's | |
11709 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11710 | one of the items in a sizer change size, or items are added or | |
11711 | removed. | |
11712 | """ | |
5b5c9bc7 | 11713 | return _core_.Sizer_Layout(*args, **kwargs) |
d55e5bfc RD |
11714 | |
11715 | def Fit(*args, **kwargs): | |
bfddbb17 | 11716 | """ |
5b5c9bc7 | 11717 | Fit(self, Window window) -> Size |
bfddbb17 RD |
11718 | |
11719 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11720 | size. This is commonly done in the constructor of the window itself in | |
11721 | order to set its initial size to match the needs of the children as | |
11722 | determined by the sizer. Returns the new size. | |
11723 | ||
11724 | For a top level window this is the total window size, not the client size. | |
11725 | """ | |
5b5c9bc7 | 11726 | return _core_.Sizer_Fit(*args, **kwargs) |
d55e5bfc RD |
11727 | |
11728 | def FitInside(*args, **kwargs): | |
bfddbb17 | 11729 | """ |
5b5c9bc7 | 11730 | FitInside(self, Window window) |
bfddbb17 RD |
11731 | |
11732 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
11733 | sizer's minimal size. This will not alter the on screen size of the | |
11734 | window, but may cause the addition/removal/alteration of scrollbars | |
11735 | required to view the virtual area in windows which manage it. | |
11736 | ||
11737 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
11738 | ||
11739 | """ | |
5b5c9bc7 | 11740 | return _core_.Sizer_FitInside(*args, **kwargs) |
d55e5bfc RD |
11741 | |
11742 | def SetSizeHints(*args, **kwargs): | |
bfddbb17 | 11743 | """ |
5b5c9bc7 | 11744 | SetSizeHints(self, Window window) |
bfddbb17 RD |
11745 | |
11746 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
11747 | match the sizer's minimal size. This is commonly done in the | |
11748 | constructor of the window itself if the window is resizable (as are | |
11749 | many dialogs under Unix and frames on probably all platforms) in order | |
11750 | to prevent the window from being sized smaller than the minimal size | |
11751 | required by the sizer. | |
11752 | """ | |
5b5c9bc7 | 11753 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
d55e5bfc RD |
11754 | |
11755 | def SetVirtualSizeHints(*args, **kwargs): | |
bfddbb17 | 11756 | """ |
5b5c9bc7 | 11757 | SetVirtualSizeHints(self, Window window) |
bfddbb17 RD |
11758 | |
11759 | Tell the sizer to set the minimal size of the window virtual area to | |
11760 | match the sizer's minimal size. For windows with managed scrollbars | |
11761 | this will set them appropriately. | |
11762 | ||
11763 | :see: `wx.ScrolledWindow.SetScrollbars` | |
11764 | ||
11765 | """ | |
5b5c9bc7 | 11766 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
d55e5bfc RD |
11767 | |
11768 | def Clear(*args, **kwargs): | |
bfddbb17 RD |
11769 | """ |
11770 | Clear(self, bool deleteWindows=False) | |
11771 | ||
11772 | Clear all items from the sizer, optionally destroying the window items | |
11773 | as well. | |
11774 | """ | |
5b5c9bc7 | 11775 | return _core_.Sizer_Clear(*args, **kwargs) |
d55e5bfc RD |
11776 | |
11777 | def DeleteWindows(*args, **kwargs): | |
bfddbb17 RD |
11778 | """ |
11779 | DeleteWindows(self) | |
11780 | ||
11781 | Destroy all windows managed by the sizer. | |
11782 | """ | |
5b5c9bc7 | 11783 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
d55e5bfc RD |
11784 | |
11785 | def GetChildren(*args, **kwargs): | |
bfddbb17 | 11786 | """ |
51b83b37 | 11787 | GetChildren(self) -> list |
bfddbb17 RD |
11788 | |
11789 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
11790 | """ | |
5b5c9bc7 | 11791 | return _core_.Sizer_GetChildren(*args, **kwargs) |
d55e5bfc RD |
11792 | |
11793 | def Show(*args, **kwargs): | |
bfddbb17 | 11794 | """ |
b411df4a | 11795 | Show(self, item, bool show=True, bool recursive=false) -> bool |
d55e5bfc | 11796 | |
bfddbb17 RD |
11797 | Shows or hides an item managed by the sizer. To make a sizer item |
11798 | disappear or reappear, use Show followed by `Layout`. The *item* | |
11799 | parameter can be either a window, a sizer, or the zero-based index of | |
629e65c2 RD |
11800 | the item. Use the recursive parameter to show or hide an item in a |
11801 | subsizer. Returns True if the item was found. | |
bfddbb17 | 11802 | """ |
5b5c9bc7 | 11803 | return _core_.Sizer_Show(*args, **kwargs) |
d55e5bfc RD |
11804 | |
11805 | def IsShown(*args, **kwargs): | |
bfddbb17 RD |
11806 | """ |
11807 | IsShown(self, item) | |
11808 | ||
11809 | Determines if the item is currently shown. sizer. To make a sizer | |
11810 | item disappear or reappear, use Show followed by `Layout`. The *item* | |
11811 | parameter can be either a window, a sizer, or the zero-based index of | |
11812 | the item. | |
11813 | """ | |
5b5c9bc7 | 11814 | return _core_.Sizer_IsShown(*args, **kwargs) |
d55e5bfc | 11815 | |
629e65c2 | 11816 | def Hide(self, item, recursive=False): |
bfddbb17 | 11817 | """ |
27fb7603 | 11818 | A convenience method for `Show` (item, False, recursive). |
bfddbb17 | 11819 | """ |
06759a38 | 11820 | return self.Show(item, False, recursive) |
bfddbb17 | 11821 | |
d55e5bfc | 11822 | def ShowItems(*args, **kwargs): |
bfddbb17 RD |
11823 | """ |
11824 | ShowItems(self, bool show) | |
11825 | ||
84f85550 | 11826 | Recursively call `wx.SizerItem.Show` on all sizer items. |
bfddbb17 | 11827 | """ |
5b5c9bc7 | 11828 | return _core_.Sizer_ShowItems(*args, **kwargs) |
d55e5bfc RD |
11829 | |
11830 | ||
5b5c9bc7 | 11831 | class SizerPtr(Sizer): |
d55e5bfc RD |
11832 | def __init__(self, this): |
11833 | self.this = this | |
11834 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11835 | self.__class__ = Sizer |
11836 | _core_.Sizer_swigregister(SizerPtr) | |
d55e5bfc | 11837 | |
5b5c9bc7 | 11838 | class PySizer(Sizer): |
bfddbb17 RD |
11839 | """ |
11840 | wx.PySizer is a special version of `wx.Sizer` that has been | |
11841 | instrumented to allow the C++ virtual methods to be overloaded in | |
11842 | Python derived classes. You would derive from this class if you are | |
11843 | wanting to implement a custom sizer in Python code. Simply implement | |
11844 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
11845 | For example:: | |
11846 | ||
11847 | class MySizer(wx.PySizer): | |
11848 | def __init__(self): | |
11849 | wx.PySizer.__init__(self) | |
11850 | ||
11851 | def CalcMin(self): | |
11852 | for item in self.GetChildren(): | |
11853 | # calculate the total minimum width and height needed | |
11854 | # by all items in the sizer according to this sizer's | |
11855 | # layout algorithm. | |
11856 | ... | |
11857 | return wx.Size(width, height) | |
11858 | ||
11859 | def RecalcSizes(self): | |
11860 | # find the space allotted to this sizer | |
11861 | pos = self.GetPosition() | |
11862 | size = self.GetSize() | |
11863 | for item in self.GetChildren(): | |
11864 | # Recalculate (if necessary) the position and size of | |
11865 | # each item and then call item.SetDimension to do the | |
11866 | # actual positioning and sizing of the items within the | |
11867 | # space alloted to this sizer. | |
11868 | ... | |
11869 | item.SetDimension(itemPos, itemSize) | |
11870 | ||
11871 | ||
11872 | When `Layout` is called it first calls `CalcMin` followed by | |
11873 | `RecalcSizes` so you can optimize a bit by saving the results of | |
62d32a5f | 11874 | `CalcMin` and reusing them in `RecalcSizes`. |
bfddbb17 RD |
11875 | |
11876 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
11877 | ||
11878 | ||
11879 | """ | |
d55e5bfc RD |
11880 | def __repr__(self): |
11881 | return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11882 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11883 | """ |
5b5c9bc7 | 11884 | __init__(self) -> PySizer |
bfddbb17 RD |
11885 | |
11886 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
11887 | class. | |
11888 | """ | |
5b5c9bc7 | 11889 | newobj = _core_.new_PySizer(*args, **kwargs) |
d55e5bfc RD |
11890 | self.this = newobj.this |
11891 | self.thisown = 1 | |
11892 | del newobj.thisown | |
11893 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) | |
11894 | ||
11895 | def _setCallbackInfo(*args, **kwargs): | |
11896 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
5b5c9bc7 | 11897 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
11898 | |
11899 | ||
5b5c9bc7 | 11900 | class PySizerPtr(PySizer): |
d55e5bfc RD |
11901 | def __init__(self, this): |
11902 | self.this = this | |
11903 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11904 | self.__class__ = PySizer |
11905 | _core_.PySizer_swigregister(PySizerPtr) | |
d55e5bfc RD |
11906 | |
11907 | #--------------------------------------------------------------------------- | |
11908 | ||
5b5c9bc7 | 11909 | class BoxSizer(Sizer): |
bfddbb17 RD |
11910 | """ |
11911 | The basic idea behind a box sizer is that windows will most often be | |
11912 | laid out in rather simple basic geometry, typically in a row or a | |
11913 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
11914 | its items in a simple row or column, depending on the orientation | |
11915 | parameter passed to the constructor. | |
11916 | """ | |
d55e5bfc RD |
11917 | def __repr__(self): |
11918 | return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11919 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11920 | """ |
5b5c9bc7 | 11921 | __init__(self, int orient=HORIZONTAL) -> BoxSizer |
bfddbb17 RD |
11922 | |
11923 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
11924 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
11925 | sizer. | |
11926 | """ | |
5b5c9bc7 | 11927 | newobj = _core_.new_BoxSizer(*args, **kwargs) |
d55e5bfc RD |
11928 | self.this = newobj.this |
11929 | self.thisown = 1 | |
11930 | del newobj.thisown | |
11931 | self._setOORInfo(self) | |
11932 | ||
11933 | def GetOrientation(*args, **kwargs): | |
bfddbb17 RD |
11934 | """ |
11935 | GetOrientation(self) -> int | |
11936 | ||
11937 | Returns the current orientation of the sizer. | |
11938 | """ | |
5b5c9bc7 | 11939 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
11940 | |
11941 | def SetOrientation(*args, **kwargs): | |
bfddbb17 RD |
11942 | """ |
11943 | SetOrientation(self, int orient) | |
d55e5bfc | 11944 | |
bfddbb17 RD |
11945 | Resets the orientation of the sizer. |
11946 | """ | |
5b5c9bc7 | 11947 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) |
d55e5bfc RD |
11948 | |
11949 | ||
5b5c9bc7 | 11950 | class BoxSizerPtr(BoxSizer): |
d55e5bfc RD |
11951 | def __init__(self, this): |
11952 | self.this = this | |
11953 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11954 | self.__class__ = BoxSizer |
11955 | _core_.BoxSizer_swigregister(BoxSizerPtr) | |
d55e5bfc RD |
11956 | |
11957 | #--------------------------------------------------------------------------- | |
11958 | ||
5b5c9bc7 | 11959 | class StaticBoxSizer(BoxSizer): |
bfddbb17 RD |
11960 | """ |
11961 | wx.StaticBoxSizer derives from and functions identically to the | |
11962 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
11963 | manages. Note that this static box must be created separately and | |
11964 | passed to the sizer constructor. | |
11965 | """ | |
d55e5bfc RD |
11966 | def __repr__(self): |
11967 | return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11968 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11969 | """ |
5b5c9bc7 | 11970 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer |
bfddbb17 RD |
11971 | |
11972 | Constructor. It takes an associated static box and the orientation | |
11973 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
11974 | ``wx.HORIZONTAL``. | |
11975 | """ | |
5b5c9bc7 | 11976 | newobj = _core_.new_StaticBoxSizer(*args, **kwargs) |
d55e5bfc RD |
11977 | self.this = newobj.this |
11978 | self.thisown = 1 | |
11979 | del newobj.thisown | |
11980 | self._setOORInfo(self) | |
11981 | ||
11982 | def GetStaticBox(*args, **kwargs): | |
bfddbb17 | 11983 | """ |
5b5c9bc7 | 11984 | GetStaticBox(self) -> StaticBox |
d55e5bfc | 11985 | |
bfddbb17 RD |
11986 | Returns the static box associated with this sizer. |
11987 | """ | |
5b5c9bc7 | 11988 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) |
d55e5bfc RD |
11989 | |
11990 | ||
5b5c9bc7 | 11991 | class StaticBoxSizerPtr(StaticBoxSizer): |
d55e5bfc RD |
11992 | def __init__(self, this): |
11993 | self.this = this | |
11994 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11995 | self.__class__ = StaticBoxSizer |
11996 | _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr) | |
d55e5bfc RD |
11997 | |
11998 | #--------------------------------------------------------------------------- | |
11999 | ||
5b5c9bc7 | 12000 | class GridSizer(Sizer): |
bfddbb17 RD |
12001 | """ |
12002 | A grid sizer is a sizer which lays out its children in a | |
12003 | two-dimensional table with all cells having the same size. In other | |
12004 | words, the width of each cell within the grid is the width of the | |
12005 | widest item added to the sizer and the height of each grid cell is the | |
12006 | height of the tallest item. An optional vertical and/or horizontal | |
12007 | gap between items can also be specified (in pixels.) | |
12008 | ||
12009 | Items are placed in the cells of the grid in the order they are added, | |
12010 | in row-major order. In other words, the first row is filled first, | |
12011 | then the second, and so on until all items have been added. (If | |
12012 | neccessary, additional rows will be added as items are added.) If you | |
12013 | need to have greater control over the cells that items are placed in | |
12014 | then use the `wx.GridBagSizer`. | |
12015 | ||
12016 | """ | |
d55e5bfc RD |
12017 | def __repr__(self): |
12018 | return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12019 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12020 | """ |
5b5c9bc7 | 12021 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer |
bfddbb17 RD |
12022 | |
12023 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
12024 | of columns and rows in the sizer - if either of the parameters is | |
12025 | zero, it will be calculated to from the total number of children in | |
12026 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12027 | define extra space between all children. | |
12028 | """ | |
5b5c9bc7 | 12029 | newobj = _core_.new_GridSizer(*args, **kwargs) |
d55e5bfc RD |
12030 | self.this = newobj.this |
12031 | self.thisown = 1 | |
12032 | del newobj.thisown | |
12033 | self._setOORInfo(self) | |
12034 | ||
d55e5bfc | 12035 | def SetCols(*args, **kwargs): |
bfddbb17 RD |
12036 | """ |
12037 | SetCols(self, int cols) | |
12038 | ||
12039 | Sets the number of columns in the sizer. | |
12040 | """ | |
5b5c9bc7 | 12041 | return _core_.GridSizer_SetCols(*args, **kwargs) |
d55e5bfc RD |
12042 | |
12043 | def SetRows(*args, **kwargs): | |
bfddbb17 RD |
12044 | """ |
12045 | SetRows(self, int rows) | |
12046 | ||
12047 | Sets the number of rows in the sizer. | |
12048 | """ | |
5b5c9bc7 | 12049 | return _core_.GridSizer_SetRows(*args, **kwargs) |
d55e5bfc RD |
12050 | |
12051 | def SetVGap(*args, **kwargs): | |
bfddbb17 RD |
12052 | """ |
12053 | SetVGap(self, int gap) | |
12054 | ||
12055 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
12056 | """ | |
5b5c9bc7 | 12057 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
d55e5bfc RD |
12058 | |
12059 | def SetHGap(*args, **kwargs): | |
bfddbb17 RD |
12060 | """ |
12061 | SetHGap(self, int gap) | |
12062 | ||
12063 | Sets the horizontal gap (in pixels) between cells in the sizer | |
12064 | """ | |
5b5c9bc7 | 12065 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
d55e5bfc RD |
12066 | |
12067 | def GetCols(*args, **kwargs): | |
bfddbb17 RD |
12068 | """ |
12069 | GetCols(self) -> int | |
12070 | ||
12071 | Returns the number of columns in the sizer. | |
12072 | """ | |
5b5c9bc7 | 12073 | return _core_.GridSizer_GetCols(*args, **kwargs) |
d55e5bfc RD |
12074 | |
12075 | def GetRows(*args, **kwargs): | |
bfddbb17 RD |
12076 | """ |
12077 | GetRows(self) -> int | |
12078 | ||
12079 | Returns the number of rows in the sizer. | |
12080 | """ | |
5b5c9bc7 | 12081 | return _core_.GridSizer_GetRows(*args, **kwargs) |
d55e5bfc RD |
12082 | |
12083 | def GetVGap(*args, **kwargs): | |
bfddbb17 RD |
12084 | """ |
12085 | GetVGap(self) -> int | |
12086 | ||
12087 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
12088 | """ | |
5b5c9bc7 | 12089 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
d55e5bfc RD |
12090 | |
12091 | def GetHGap(*args, **kwargs): | |
bfddbb17 RD |
12092 | """ |
12093 | GetHGap(self) -> int | |
12094 | ||
12095 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
12096 | """ | |
5b5c9bc7 | 12097 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
d55e5bfc RD |
12098 | |
12099 | ||
5b5c9bc7 | 12100 | class GridSizerPtr(GridSizer): |
d55e5bfc RD |
12101 | def __init__(self, this): |
12102 | self.this = this | |
12103 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12104 | self.__class__ = GridSizer |
12105 | _core_.GridSizer_swigregister(GridSizerPtr) | |
d55e5bfc RD |
12106 | |
12107 | #--------------------------------------------------------------------------- | |
12108 | ||
5b5c9bc7 RD |
12109 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
12110 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
12111 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
12112 | class FlexGridSizer(GridSizer): | |
bfddbb17 RD |
12113 | """ |
12114 | A flex grid sizer is a sizer which lays out its children in a | |
12115 | two-dimensional table with all table cells in one row having the same | |
12116 | height and all cells in one column having the same width, but all | |
12117 | rows or all columns are not necessarily the same height or width as in | |
12118 | the `wx.GridSizer`. | |
12119 | ||
12120 | wx.FlexGridSizer can also size items equally in one direction but | |
12121 | unequally ("flexibly") in the other. If the sizer is only flexible | |
12122 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
12123 | needs to be decided how the sizer should grow in the other ("non | |
12124 | flexible") direction in order to fill the available space. The | |
12125 | `SetNonFlexibleGrowMode` method serves this purpose. | |
12126 | ||
12127 | ||
12128 | """ | |
d55e5bfc RD |
12129 | def __repr__(self): |
12130 | return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12131 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12132 | """ |
5b5c9bc7 | 12133 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer |
bfddbb17 RD |
12134 | |
12135 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
12136 | number of columns and rows in the sizer - if either of the parameters | |
12137 | is zero, it will be calculated to from the total number of children in | |
12138 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12139 | define extra space between all children. | |
12140 | """ | |
5b5c9bc7 | 12141 | newobj = _core_.new_FlexGridSizer(*args, **kwargs) |
d55e5bfc RD |
12142 | self.this = newobj.this |
12143 | self.thisown = 1 | |
12144 | del newobj.thisown | |
12145 | self._setOORInfo(self) | |
12146 | ||
bfddbb17 RD |
12147 | def AddGrowableRow(*args, **kwargs): |
12148 | """ | |
12149 | AddGrowableRow(self, size_t idx, int proportion=0) | |
d55e5bfc | 12150 | |
bfddbb17 RD |
12151 | Specifies that row *idx* (starting from zero) should be grown if there |
12152 | is extra space available to the sizer. | |
d55e5bfc | 12153 | |
bfddbb17 RD |
12154 | The *proportion* parameter has the same meaning as the stretch factor |
12155 | for the box sizers except that if all proportions are 0, then all | |
12156 | columns are resized equally (instead of not being resized at all). | |
12157 | """ | |
5b5c9bc7 | 12158 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
d55e5bfc RD |
12159 | |
12160 | def RemoveGrowableRow(*args, **kwargs): | |
bfddbb17 RD |
12161 | """ |
12162 | RemoveGrowableRow(self, size_t idx) | |
12163 | ||
12164 | Specifies that row *idx* is no longer growable. | |
12165 | """ | |
5b5c9bc7 | 12166 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
d55e5bfc RD |
12167 | |
12168 | def AddGrowableCol(*args, **kwargs): | |
bfddbb17 RD |
12169 | """ |
12170 | AddGrowableCol(self, size_t idx, int proportion=0) | |
12171 | ||
12172 | Specifies that column *idx* (starting from zero) should be grown if | |
12173 | there is extra space available to the sizer. | |
12174 | ||
12175 | The *proportion* parameter has the same meaning as the stretch factor | |
12176 | for the box sizers except that if all proportions are 0, then all | |
12177 | columns are resized equally (instead of not being resized at all). | |
12178 | """ | |
5b5c9bc7 | 12179 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
d55e5bfc RD |
12180 | |
12181 | def RemoveGrowableCol(*args, **kwargs): | |
bfddbb17 RD |
12182 | """ |
12183 | RemoveGrowableCol(self, size_t idx) | |
12184 | ||
12185 | Specifies that column *idx* is no longer growable. | |
12186 | """ | |
5b5c9bc7 | 12187 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
d55e5bfc RD |
12188 | |
12189 | def SetFlexibleDirection(*args, **kwargs): | |
bfddbb17 RD |
12190 | """ |
12191 | SetFlexibleDirection(self, int direction) | |
12192 | ||
12193 | Specifies whether the sizer should flexibly resize its columns, rows, | |
12194 | or both. Argument *direction* can be one of the following values. Any | |
12195 | other value is ignored. | |
12196 | ||
12197 | ============== ======================================= | |
12198 | wx.VERTICAL Rows are flexibly sized. | |
12199 | wx.HORIZONTAL Columns are flexibly sized. | |
12200 | wx.BOTH Both rows and columns are flexibly sized | |
12201 | (this is the default value). | |
12202 | ============== ======================================= | |
12203 | ||
12204 | Note that this method does not trigger relayout. | |
12205 | ||
12206 | """ | |
5b5c9bc7 | 12207 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
d55e5bfc RD |
12208 | |
12209 | def GetFlexibleDirection(*args, **kwargs): | |
bfddbb17 RD |
12210 | """ |
12211 | GetFlexibleDirection(self) -> int | |
12212 | ||
12213 | Returns a value that specifies whether the sizer | |
12214 | flexibly resizes its columns, rows, or both (default). | |
12215 | ||
12216 | :see: `SetFlexibleDirection` | |
12217 | """ | |
5b5c9bc7 | 12218 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
d55e5bfc RD |
12219 | |
12220 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
bfddbb17 RD |
12221 | """ |
12222 | SetNonFlexibleGrowMode(self, int mode) | |
12223 | ||
12224 | Specifies how the sizer should grow in the non-flexible direction if | |
12225 | there is one (so `SetFlexibleDirection` must have been called | |
12226 | previously). Argument *mode* can be one of the following values: | |
12227 | ||
12228 | ========================== ================================================= | |
12229 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
12230 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
12231 | `AddGrowableCol` and `AddGrowableRow`. In this | |
12232 | case equal sizing applies to minimum sizes of | |
12233 | columns or rows (this is the default value). | |
12234 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
12235 | the non flexible direction, whether they are | |
12236 | growable or not in the flexbile direction. | |
12237 | ========================== ================================================= | |
12238 | ||
12239 | Note that this method does not trigger relayout. | |
12240 | ||
12241 | ||
12242 | """ | |
5b5c9bc7 | 12243 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
d55e5bfc RD |
12244 | |
12245 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
bfddbb17 RD |
12246 | """ |
12247 | GetNonFlexibleGrowMode(self) -> int | |
12248 | ||
12249 | Returns the value that specifies how the sizer grows in the | |
12250 | non-flexible direction if there is one. | |
12251 | ||
12252 | :see: `SetNonFlexibleGrowMode` | |
12253 | """ | |
5b5c9bc7 | 12254 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
d55e5bfc RD |
12255 | |
12256 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
12257 | """ |
12258 | GetRowHeights(self) -> list | |
12259 | ||
12260 | Returns a list of integers representing the heights of each of the | |
12261 | rows in the sizer. | |
12262 | """ | |
5b5c9bc7 | 12263 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
d55e5bfc RD |
12264 | |
12265 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
12266 | """ |
12267 | GetColWidths(self) -> list | |
12268 | ||
12269 | Returns a list of integers representing the widths of each of the | |
12270 | columns in the sizer. | |
12271 | """ | |
5b5c9bc7 | 12272 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
d55e5bfc RD |
12273 | |
12274 | ||
5b5c9bc7 | 12275 | class FlexGridSizerPtr(FlexGridSizer): |
d55e5bfc RD |
12276 | def __init__(self, this): |
12277 | self.this = this | |
12278 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12279 | self.__class__ = FlexGridSizer |
12280 | _core_.FlexGridSizer_swigregister(FlexGridSizerPtr) | |
d55e5bfc | 12281 | |
5b5c9bc7 | 12282 | class StdDialogButtonSizer(BoxSizer): |
62d32a5f RD |
12283 | """ |
12284 | A special sizer that knows how to order and position standard buttons | |
12285 | in order to conform to the current platform's standards. You simply | |
12286 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 12287 | buttons using the standard ID's. Then call `Realize` and the sizer |
62d32a5f RD |
12288 | will take care of the rest. |
12289 | ||
12290 | """ | |
12291 | def __repr__(self): | |
12292 | return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12293 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
12294 | """__init__(self) -> StdDialogButtonSizer""" |
12295 | newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs) | |
62d32a5f RD |
12296 | self.this = newobj.this |
12297 | self.thisown = 1 | |
12298 | del newobj.thisown | |
12299 | def AddButton(*args, **kwargs): | |
12300 | """ | |
12301 | AddButton(self, wxButton button) | |
12302 | ||
12303 | Use this to add the buttons to this sizer. Do not use the `Add` | |
12304 | method in the base class. | |
12305 | """ | |
5b5c9bc7 | 12306 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) |
62d32a5f | 12307 | |
53aa7709 | 12308 | def Realize(*args, **kwargs): |
62d32a5f | 12309 | """ |
53aa7709 | 12310 | Realize(self) |
62d32a5f RD |
12311 | |
12312 | This funciton needs to be called after all the buttons have been added | |
12313 | to the sizer. It will reorder them and position them in a platform | |
12314 | specifc manner. | |
12315 | """ | |
5b5c9bc7 | 12316 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
12317 | |
12318 | def SetAffirmativeButton(*args, **kwargs): | |
12319 | """SetAffirmativeButton(self, wxButton button)""" | |
5b5c9bc7 | 12320 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) |
51b83b37 RD |
12321 | |
12322 | def SetNegativeButton(*args, **kwargs): | |
12323 | """SetNegativeButton(self, wxButton button)""" | |
5b5c9bc7 | 12324 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) |
51b83b37 RD |
12325 | |
12326 | def SetCancelButton(*args, **kwargs): | |
12327 | """SetCancelButton(self, wxButton button)""" | |
5b5c9bc7 | 12328 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) |
62d32a5f RD |
12329 | |
12330 | def GetAffirmativeButton(*args, **kwargs): | |
12331 | """GetAffirmativeButton(self) -> wxButton""" | |
5b5c9bc7 | 12332 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) |
62d32a5f RD |
12333 | |
12334 | def GetApplyButton(*args, **kwargs): | |
12335 | """GetApplyButton(self) -> wxButton""" | |
5b5c9bc7 | 12336 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) |
62d32a5f RD |
12337 | |
12338 | def GetNegativeButton(*args, **kwargs): | |
12339 | """GetNegativeButton(self) -> wxButton""" | |
5b5c9bc7 | 12340 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) |
62d32a5f RD |
12341 | |
12342 | def GetCancelButton(*args, **kwargs): | |
12343 | """GetCancelButton(self) -> wxButton""" | |
5b5c9bc7 | 12344 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) |
62d32a5f RD |
12345 | |
12346 | def GetHelpButton(*args, **kwargs): | |
12347 | """GetHelpButton(self) -> wxButton""" | |
5b5c9bc7 | 12348 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) |
62d32a5f RD |
12349 | |
12350 | ||
5b5c9bc7 | 12351 | class StdDialogButtonSizerPtr(StdDialogButtonSizer): |
62d32a5f RD |
12352 | def __init__(self, this): |
12353 | self.this = this | |
12354 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12355 | self.__class__ = StdDialogButtonSizer |
12356 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr) | |
62d32a5f | 12357 | |
d55e5bfc RD |
12358 | #--------------------------------------------------------------------------- |
12359 | ||
5b5c9bc7 | 12360 | class GBPosition(object): |
bfddbb17 RD |
12361 | """ |
12362 | This class represents the position of an item in a virtual grid of | |
12363 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12364 | typemaps that will automatically convert from a 2-element sequence of | |
12365 | integers to a wx.GBPosition, so you can use the more pythonic | |
12366 | representation of the position nearly transparently in Python code. | |
12367 | """ | |
d55e5bfc RD |
12368 | def __repr__(self): |
12369 | return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12370 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12371 | """ |
5b5c9bc7 | 12372 | __init__(self, int row=0, int col=0) -> GBPosition |
bfddbb17 RD |
12373 | |
12374 | This class represents the position of an item in a virtual grid of | |
12375 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12376 | typemaps that will automatically convert from a 2-element sequence of | |
12377 | integers to a wx.GBPosition, so you can use the more pythonic | |
12378 | representation of the position nearly transparently in Python code. | |
12379 | """ | |
5b5c9bc7 | 12380 | newobj = _core_.new_GBPosition(*args, **kwargs) |
d55e5bfc RD |
12381 | self.this = newobj.this |
12382 | self.thisown = 1 | |
12383 | del newobj.thisown | |
12384 | def GetRow(*args, **kwargs): | |
12385 | """GetRow(self) -> int""" | |
5b5c9bc7 | 12386 | return _core_.GBPosition_GetRow(*args, **kwargs) |
d55e5bfc RD |
12387 | |
12388 | def GetCol(*args, **kwargs): | |
12389 | """GetCol(self) -> int""" | |
5b5c9bc7 | 12390 | return _core_.GBPosition_GetCol(*args, **kwargs) |
d55e5bfc RD |
12391 | |
12392 | def SetRow(*args, **kwargs): | |
12393 | """SetRow(self, int row)""" | |
5b5c9bc7 | 12394 | return _core_.GBPosition_SetRow(*args, **kwargs) |
d55e5bfc RD |
12395 | |
12396 | def SetCol(*args, **kwargs): | |
12397 | """SetCol(self, int col)""" | |
5b5c9bc7 | 12398 | return _core_.GBPosition_SetCol(*args, **kwargs) |
d55e5bfc RD |
12399 | |
12400 | def __eq__(*args, **kwargs): | |
5b5c9bc7 RD |
12401 | """__eq__(self, GBPosition other) -> bool""" |
12402 | return _core_.GBPosition___eq__(*args, **kwargs) | |
d55e5bfc RD |
12403 | |
12404 | def __ne__(*args, **kwargs): | |
5b5c9bc7 RD |
12405 | """__ne__(self, GBPosition other) -> bool""" |
12406 | return _core_.GBPosition___ne__(*args, **kwargs) | |
d55e5bfc RD |
12407 | |
12408 | def Set(*args, **kwargs): | |
12409 | """Set(self, int row=0, int col=0)""" | |
5b5c9bc7 | 12410 | return _core_.GBPosition_Set(*args, **kwargs) |
d55e5bfc RD |
12411 | |
12412 | def Get(*args, **kwargs): | |
12413 | """Get(self) -> PyObject""" | |
5b5c9bc7 | 12414 | return _core_.GBPosition_Get(*args, **kwargs) |
d55e5bfc | 12415 | |
15817c7e | 12416 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
12417 | def __str__(self): return str(self.Get()) |
12418 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
12419 | def __len__(self): return len(self.Get()) | |
12420 | def __getitem__(self, index): return self.Get()[index] | |
12421 | def __setitem__(self, index, val): | |
12422 | if index == 0: self.SetRow(val) | |
12423 | elif index == 1: self.SetCol(val) | |
12424 | else: raise IndexError | |
12425 | def __nonzero__(self): return self.Get() != (0,0) | |
12426 | __safe_for_unpickling__ = True | |
12427 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
12428 | ||
12429 | row = property(GetRow, SetRow) | |
12430 | col = property(GetCol, SetCol) | |
12431 | ||
12432 | ||
5b5c9bc7 | 12433 | class GBPositionPtr(GBPosition): |
d55e5bfc RD |
12434 | def __init__(self, this): |
12435 | self.this = this | |
12436 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12437 | self.__class__ = GBPosition |
12438 | _core_.GBPosition_swigregister(GBPositionPtr) | |
d55e5bfc | 12439 | |
5b5c9bc7 | 12440 | class GBSpan(object): |
bfddbb17 RD |
12441 | """ |
12442 | This class is used to hold the row and column spanning attributes of | |
12443 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
12444 | automatically convert from a 2-element sequence of integers to a | |
12445 | wx.GBSpan, so you can use the more pythonic representation of the span | |
12446 | nearly transparently in Python code. | |
12447 | ||
12448 | """ | |
d55e5bfc RD |
12449 | def __repr__(self): |
12450 | return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12451 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12452 | """ |
5b5c9bc7 | 12453 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan |
bfddbb17 RD |
12454 | |
12455 | Construct a new wxGBSpan, optionally setting the rowspan and | |
12456 | colspan. The default is (1,1). (Meaning that the item occupies one | |
12457 | cell in each direction. | |
12458 | """ | |
5b5c9bc7 | 12459 | newobj = _core_.new_GBSpan(*args, **kwargs) |
d55e5bfc RD |
12460 | self.this = newobj.this |
12461 | self.thisown = 1 | |
12462 | del newobj.thisown | |
12463 | def GetRowspan(*args, **kwargs): | |
12464 | """GetRowspan(self) -> int""" | |
5b5c9bc7 | 12465 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
d55e5bfc RD |
12466 | |
12467 | def GetColspan(*args, **kwargs): | |
12468 | """GetColspan(self) -> int""" | |
5b5c9bc7 | 12469 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
d55e5bfc RD |
12470 | |
12471 | def SetRowspan(*args, **kwargs): | |
12472 | """SetRowspan(self, int rowspan)""" | |
5b5c9bc7 | 12473 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
d55e5bfc RD |
12474 | |
12475 | def SetColspan(*args, **kwargs): | |
12476 | """SetColspan(self, int colspan)""" | |
5b5c9bc7 | 12477 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
d55e5bfc RD |
12478 | |
12479 | def __eq__(*args, **kwargs): | |
5b5c9bc7 RD |
12480 | """__eq__(self, GBSpan other) -> bool""" |
12481 | return _core_.GBSpan___eq__(*args, **kwargs) | |
d55e5bfc RD |
12482 | |
12483 | def __ne__(*args, **kwargs): | |
5b5c9bc7 RD |
12484 | """__ne__(self, GBSpan other) -> bool""" |
12485 | return _core_.GBSpan___ne__(*args, **kwargs) | |
d55e5bfc RD |
12486 | |
12487 | def Set(*args, **kwargs): | |
12488 | """Set(self, int rowspan=1, int colspan=1)""" | |
5b5c9bc7 | 12489 | return _core_.GBSpan_Set(*args, **kwargs) |
d55e5bfc RD |
12490 | |
12491 | def Get(*args, **kwargs): | |
12492 | """Get(self) -> PyObject""" | |
5b5c9bc7 | 12493 | return _core_.GBSpan_Get(*args, **kwargs) |
d55e5bfc | 12494 | |
15817c7e | 12495 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
12496 | def __str__(self): return str(self.Get()) |
12497 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
12498 | def __len__(self): return len(self.Get()) | |
12499 | def __getitem__(self, index): return self.Get()[index] | |
12500 | def __setitem__(self, index, val): | |
12501 | if index == 0: self.SetRowspan(val) | |
12502 | elif index == 1: self.SetColspan(val) | |
12503 | else: raise IndexError | |
12504 | def __nonzero__(self): return self.Get() != (0,0) | |
12505 | __safe_for_unpickling__ = True | |
12506 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
12507 | ||
12508 | rowspan = property(GetRowspan, SetRowspan) | |
12509 | colspan = property(GetColspan, SetColspan) | |
12510 | ||
12511 | ||
5b5c9bc7 | 12512 | class GBSpanPtr(GBSpan): |
d55e5bfc RD |
12513 | def __init__(self, this): |
12514 | self.this = this | |
12515 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12516 | self.__class__ = GBSpan |
12517 | _core_.GBSpan_swigregister(GBSpanPtr) | |
d55e5bfc | 12518 | |
5b5c9bc7 | 12519 | class GBSizerItem(SizerItem): |
bfddbb17 RD |
12520 | """ |
12521 | The wx.GBSizerItem class is used to track the additional data about | |
12522 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12523 | and how many rows or columns it spans. | |
12524 | ||
12525 | """ | |
d55e5bfc RD |
12526 | def __repr__(self): |
12527 | return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12528 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12529 | """ |
5b5c9bc7 | 12530 | __init__(self) -> GBSizerItem |
bfddbb17 RD |
12531 | |
12532 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12533 | size will need to be set, as well as a position and span before this | |
12534 | item can be used in a Sizer. | |
12535 | ||
12536 | You will probably never need to create a wx.GBSizerItem directly as they | |
12537 | are created automatically when the sizer's Add method is called. | |
12538 | """ | |
5b5c9bc7 | 12539 | newobj = _core_.new_GBSizerItem(*args, **kwargs) |
d55e5bfc RD |
12540 | self.this = newobj.this |
12541 | self.thisown = 1 | |
12542 | del newobj.thisown | |
12543 | def GetPos(*args, **kwargs): | |
bfddbb17 | 12544 | """ |
5b5c9bc7 | 12545 | GetPos(self) -> GBPosition |
bfddbb17 RD |
12546 | |
12547 | Get the grid position of the item | |
12548 | """ | |
5b5c9bc7 | 12549 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
d55e5bfc RD |
12550 | |
12551 | def GetPosTuple(self): return self.GetPos().Get() | |
12552 | def GetSpan(*args, **kwargs): | |
bfddbb17 | 12553 | """ |
5b5c9bc7 | 12554 | GetSpan(self) -> GBSpan |
bfddbb17 RD |
12555 | |
12556 | Get the row and column spanning of the item | |
12557 | """ | |
5b5c9bc7 | 12558 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
d55e5bfc RD |
12559 | |
12560 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12561 | def SetPos(*args, **kwargs): | |
bfddbb17 | 12562 | """ |
5b5c9bc7 | 12563 | SetPos(self, GBPosition pos) -> bool |
bfddbb17 RD |
12564 | |
12565 | If the item is already a member of a sizer then first ensure that | |
12566 | there is no other item that would intersect with this one at the new | |
12567 | position, then set the new position. Returns True if the change is | |
12568 | successful and after the next Layout() the item will be moved. | |
12569 | """ | |
5b5c9bc7 | 12570 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
d55e5bfc RD |
12571 | |
12572 | def SetSpan(*args, **kwargs): | |
bfddbb17 | 12573 | """ |
5b5c9bc7 | 12574 | SetSpan(self, GBSpan span) -> bool |
bfddbb17 RD |
12575 | |
12576 | If the item is already a member of a sizer then first ensure that | |
12577 | there is no other item that would intersect with this one with its new | |
12578 | spanning size, then set the new spanning. Returns True if the change | |
12579 | is successful and after the next Layout() the item will be resized. | |
12580 | ||
12581 | """ | |
5b5c9bc7 | 12582 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
d55e5bfc | 12583 | |
bfddbb17 | 12584 | def Intersects(*args, **kwargs): |
d55e5bfc | 12585 | """ |
5b5c9bc7 | 12586 | Intersects(self, GBSizerItem other) -> bool |
bfddbb17 RD |
12587 | |
12588 | Returns True if this item and the other item instersect. | |
d55e5bfc | 12589 | """ |
5b5c9bc7 | 12590 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
bfddbb17 RD |
12591 | |
12592 | def IntersectsPos(*args, **kwargs): | |
12593 | """ | |
5b5c9bc7 | 12594 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool |
bfddbb17 RD |
12595 | |
12596 | Returns True if the given pos/span would intersect with this item. | |
12597 | """ | |
5b5c9bc7 | 12598 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) |
d55e5bfc RD |
12599 | |
12600 | def GetEndPos(*args, **kwargs): | |
bfddbb17 | 12601 | """ |
5b5c9bc7 | 12602 | GetEndPos(self) -> GBPosition |
bfddbb17 RD |
12603 | |
12604 | Get the row and column of the endpoint of this item. | |
12605 | """ | |
5b5c9bc7 | 12606 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
d55e5bfc RD |
12607 | |
12608 | def GetGBSizer(*args, **kwargs): | |
bfddbb17 | 12609 | """ |
5b5c9bc7 | 12610 | GetGBSizer(self) -> GridBagSizer |
bfddbb17 RD |
12611 | |
12612 | Get the sizer this item is a member of. | |
12613 | """ | |
5b5c9bc7 | 12614 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
d55e5bfc RD |
12615 | |
12616 | def SetGBSizer(*args, **kwargs): | |
bfddbb17 | 12617 | """ |
5b5c9bc7 | 12618 | SetGBSizer(self, GridBagSizer sizer) |
bfddbb17 RD |
12619 | |
12620 | Set the sizer this item is a member of. | |
12621 | """ | |
5b5c9bc7 | 12622 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
d55e5bfc RD |
12623 | |
12624 | ||
5b5c9bc7 | 12625 | class GBSizerItemPtr(GBSizerItem): |
d55e5bfc RD |
12626 | def __init__(self, this): |
12627 | self.this = this | |
12628 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12629 | self.__class__ = GBSizerItem |
12630 | _core_.GBSizerItem_swigregister(GBSizerItemPtr) | |
12631 | DefaultSpan = cvar.DefaultSpan | |
d55e5bfc RD |
12632 | |
12633 | def GBSizerItemWindow(*args, **kwargs): | |
12634 | """ | |
5b5c9bc7 RD |
12635 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, |
12636 | int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12637 | |
12638 | Construct a `wx.GBSizerItem` for a window. | |
d55e5bfc | 12639 | """ |
5b5c9bc7 | 12640 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d55e5bfc RD |
12641 | val.thisown = 1 |
12642 | return val | |
12643 | ||
12644 | def GBSizerItemSizer(*args, **kwargs): | |
12645 | """ | |
5b5c9bc7 RD |
12646 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, |
12647 | int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12648 | |
12649 | Construct a `wx.GBSizerItem` for a sizer | |
d55e5bfc | 12650 | """ |
5b5c9bc7 | 12651 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d55e5bfc RD |
12652 | val.thisown = 1 |
12653 | return val | |
12654 | ||
12655 | def GBSizerItemSpacer(*args, **kwargs): | |
12656 | """ | |
5b5c9bc7 RD |
12657 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, |
12658 | int flag, int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12659 | |
12660 | Construct a `wx.GBSizerItem` for a spacer. | |
d55e5bfc | 12661 | """ |
5b5c9bc7 | 12662 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d55e5bfc RD |
12663 | val.thisown = 1 |
12664 | return val | |
12665 | ||
5b5c9bc7 | 12666 | class GridBagSizer(FlexGridSizer): |
bfddbb17 RD |
12667 | """ |
12668 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12669 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12670 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12671 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12672 | virtual grid is determined by the largest row and column that items are | |
12673 | positioned at, adjusted for spanning. | |
12674 | ||
12675 | """ | |
d55e5bfc RD |
12676 | def __repr__(self): |
12677 | return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12678 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12679 | """ |
5b5c9bc7 | 12680 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer |
bfddbb17 RD |
12681 | |
12682 | Constructor, with optional parameters to specify the gap between the | |
12683 | rows and columns. | |
12684 | """ | |
5b5c9bc7 | 12685 | newobj = _core_.new_GridBagSizer(*args, **kwargs) |
d55e5bfc RD |
12686 | self.this = newobj.this |
12687 | self.thisown = 1 | |
12688 | del newobj.thisown | |
03e46024 RD |
12689 | self._setOORInfo(self) |
12690 | ||
d55e5bfc RD |
12691 | def Add(*args, **kwargs): |
12692 | """ | |
bfddbb17 | 12693 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
070c48b4 | 12694 | int border=0, userData=None) -> wx.GBSizerItem |
bfddbb17 RD |
12695 | |
12696 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12697 | more than one row or column as specified with *span*. The remaining | |
12698 | args behave similarly to `wx.Sizer.Add`. | |
12699 | ||
12700 | Returns True if the item was successfully placed at the given cell | |
12701 | position, False if something was already there. | |
12702 | ||
d55e5bfc | 12703 | """ |
5b5c9bc7 | 12704 | return _core_.GridBagSizer_Add(*args, **kwargs) |
d55e5bfc RD |
12705 | |
12706 | def AddItem(*args, **kwargs): | |
bfddbb17 | 12707 | """ |
070c48b4 | 12708 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
bfddbb17 RD |
12709 | |
12710 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12711 | the item was successfully placed at its given cell position, False if | |
12712 | something was already there. | |
12713 | """ | |
5b5c9bc7 | 12714 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
d55e5bfc | 12715 | |
84f85550 RD |
12716 | def GetCellSize(*args, **kwargs): |
12717 | """ | |
5b5c9bc7 | 12718 | GetCellSize(self, int row, int col) -> Size |
84f85550 RD |
12719 | |
12720 | Get the size of the specified cell, including hgap and | |
12721 | vgap. Only valid after a Layout. | |
12722 | """ | |
5b5c9bc7 | 12723 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) |
84f85550 | 12724 | |
d55e5bfc | 12725 | def GetEmptyCellSize(*args, **kwargs): |
bfddbb17 | 12726 | """ |
5b5c9bc7 | 12727 | GetEmptyCellSize(self) -> Size |
bfddbb17 RD |
12728 | |
12729 | Get the size used for cells in the grid with no item. | |
12730 | """ | |
5b5c9bc7 | 12731 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
d55e5bfc RD |
12732 | |
12733 | def SetEmptyCellSize(*args, **kwargs): | |
bfddbb17 | 12734 | """ |
5b5c9bc7 | 12735 | SetEmptyCellSize(self, Size sz) |
bfddbb17 RD |
12736 | |
12737 | Set the size used for cells in the grid with no item. | |
12738 | """ | |
5b5c9bc7 | 12739 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
d55e5bfc RD |
12740 | |
12741 | def GetItemPosition(*args): | |
12742 | """ | |
bfddbb17 RD |
12743 | GetItemPosition(self, item) -> GBPosition |
12744 | ||
12745 | Get the grid position of the specified *item* where *item* is either a | |
12746 | window or subsizer that is a member of this sizer, or a zero-based | |
12747 | index of an item. | |
d55e5bfc | 12748 | """ |
5b5c9bc7 | 12749 | return _core_.GridBagSizer_GetItemPosition(*args) |
d55e5bfc RD |
12750 | |
12751 | def SetItemPosition(*args): | |
12752 | """ | |
bfddbb17 RD |
12753 | SetItemPosition(self, item, GBPosition pos) -> bool |
12754 | ||
12755 | Set the grid position of the specified *item* where *item* is either a | |
12756 | window or subsizer that is a member of this sizer, or a zero-based | |
12757 | index of an item. Returns True on success. If the move is not | |
12758 | allowed (because an item is already there) then False is returned. | |
12759 | ||
d55e5bfc | 12760 | """ |
5b5c9bc7 | 12761 | return _core_.GridBagSizer_SetItemPosition(*args) |
d55e5bfc RD |
12762 | |
12763 | def GetItemSpan(*args): | |
12764 | """ | |
bfddbb17 RD |
12765 | GetItemSpan(self, item) -> GBSpan |
12766 | ||
12767 | Get the row/col spanning of the specified *item* where *item* is | |
12768 | either a window or subsizer that is a member of this sizer, or a | |
12769 | zero-based index of an item. | |
d55e5bfc | 12770 | """ |
5b5c9bc7 | 12771 | return _core_.GridBagSizer_GetItemSpan(*args) |
d55e5bfc RD |
12772 | |
12773 | def SetItemSpan(*args): | |
12774 | """ | |
bfddbb17 RD |
12775 | SetItemSpan(self, item, GBSpan span) -> bool |
12776 | ||
12777 | Set the row/col spanning of the specified *item* where *item* is | |
12778 | either a window or subsizer that is a member of this sizer, or a | |
12779 | zero-based index of an item. Returns True on success. If the move is | |
12780 | not allowed (because an item is already there) then False is returned. | |
d55e5bfc | 12781 | """ |
5b5c9bc7 | 12782 | return _core_.GridBagSizer_SetItemSpan(*args) |
d55e5bfc RD |
12783 | |
12784 | def FindItem(*args): | |
12785 | """ | |
bfddbb17 RD |
12786 | FindItem(self, item) -> GBSizerItem |
12787 | ||
12788 | Find the sizer item for the given window or subsizer, returns None if | |
12789 | not found. (non-recursive) | |
d55e5bfc | 12790 | """ |
5b5c9bc7 | 12791 | return _core_.GridBagSizer_FindItem(*args) |
d55e5bfc RD |
12792 | |
12793 | def FindItemAtPosition(*args, **kwargs): | |
bfddbb17 | 12794 | """ |
5b5c9bc7 | 12795 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem |
bfddbb17 RD |
12796 | |
12797 | Return the sizer item for the given grid cell, or None if there is no | |
12798 | item at that position. (non-recursive) | |
12799 | """ | |
5b5c9bc7 | 12800 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
d55e5bfc RD |
12801 | |
12802 | def FindItemAtPoint(*args, **kwargs): | |
bfddbb17 | 12803 | """ |
5b5c9bc7 | 12804 | FindItemAtPoint(self, Point pt) -> GBSizerItem |
bfddbb17 RD |
12805 | |
12806 | Return the sizer item located at the point given in *pt*, or None if | |
12807 | there is no item at that point. The (x,y) coordinates in pt correspond | |
12808 | to the client coordinates of the window using the sizer for | |
12809 | layout. (non-recursive) | |
12810 | """ | |
5b5c9bc7 | 12811 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
d55e5bfc | 12812 | |
bfddbb17 RD |
12813 | def CheckForIntersection(*args, **kwargs): |
12814 | """ | |
5b5c9bc7 | 12815 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool |
d55e5bfc | 12816 | |
bfddbb17 RD |
12817 | Look at all items and see if any intersect (or would overlap) the |
12818 | given *item*. Returns True if so, False if there would be no overlap. | |
12819 | If an *excludeItem* is given then it will not be checked for | |
12820 | intersection, for example it may be the item we are checking the | |
12821 | position of. | |
d55e5bfc | 12822 | |
bfddbb17 | 12823 | """ |
5b5c9bc7 | 12824 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) |
d55e5bfc | 12825 | |
bfddbb17 | 12826 | def CheckForIntersectionPos(*args, **kwargs): |
d55e5bfc | 12827 | """ |
5b5c9bc7 | 12828 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
bfddbb17 RD |
12829 | |
12830 | Look at all items and see if any intersect (or would overlap) the | |
12831 | given position and span. Returns True if so, False if there would be | |
12832 | no overlap. If an *excludeItem* is given then it will not be checked | |
12833 | for intersection, for example it may be the item we are checking the | |
12834 | position of. | |
d55e5bfc | 12835 | """ |
5b5c9bc7 | 12836 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
d55e5bfc RD |
12837 | |
12838 | ||
5b5c9bc7 | 12839 | class GridBagSizerPtr(GridBagSizer): |
d55e5bfc RD |
12840 | def __init__(self, this): |
12841 | self.this = this | |
12842 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12843 | self.__class__ = GridBagSizer |
12844 | _core_.GridBagSizer_swigregister(GridBagSizerPtr) | |
d55e5bfc RD |
12845 | |
12846 | #--------------------------------------------------------------------------- | |
12847 | ||
5b5c9bc7 RD |
12848 | Left = _core_.Left |
12849 | Top = _core_.Top | |
12850 | Right = _core_.Right | |
12851 | Bottom = _core_.Bottom | |
12852 | Width = _core_.Width | |
12853 | Height = _core_.Height | |
12854 | Centre = _core_.Centre | |
12855 | Center = _core_.Center | |
12856 | CentreX = _core_.CentreX | |
12857 | CentreY = _core_.CentreY | |
12858 | Unconstrained = _core_.Unconstrained | |
12859 | AsIs = _core_.AsIs | |
12860 | PercentOf = _core_.PercentOf | |
12861 | Above = _core_.Above | |
12862 | Below = _core_.Below | |
12863 | LeftOf = _core_.LeftOf | |
12864 | RightOf = _core_.RightOf | |
12865 | SameAs = _core_.SameAs | |
12866 | Absolute = _core_.Absolute | |
12867 | class IndividualLayoutConstraint(Object): | |
d55e5bfc | 12868 | """ |
15817c7e RD |
12869 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
12870 | one of eight possible constraints that a window can be involved in. | |
12871 | You will never need to create an instance of | |
12872 | wx.IndividualLayoutConstraint, rather you should create a | |
12873 | `wx.LayoutConstraints` instance and use the individual contstraints | |
d55e5bfc | 12874 | that it contains. |
d55e5bfc RD |
12875 | """ |
12876 | def __init__(self): raise RuntimeError, "No constructor defined" | |
12877 | def __repr__(self): | |
12878 | return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12879 | def Set(*args, **kwargs): | |
15817c7e | 12880 | """ |
5b5c9bc7 | 12881 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) |
15817c7e RD |
12882 | |
12883 | Sets the properties of the constraint. Normally called by one of the | |
12884 | convenience functions such as Above, RightOf, SameAs. | |
12885 | """ | |
5b5c9bc7 | 12886 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
d55e5bfc RD |
12887 | |
12888 | def LeftOf(*args, **kwargs): | |
12889 | """ | |
5b5c9bc7 | 12890 | LeftOf(self, Window sibling, int marg=0) |
d55e5bfc | 12891 | |
15817c7e RD |
12892 | Constrains this edge to be to the left of the given window, with an |
12893 | optional margin. Implicitly, this is relative to the left edge of the | |
12894 | other window. | |
d55e5bfc | 12895 | """ |
5b5c9bc7 | 12896 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
d55e5bfc RD |
12897 | |
12898 | def RightOf(*args, **kwargs): | |
12899 | """ | |
5b5c9bc7 | 12900 | RightOf(self, Window sibling, int marg=0) |
d55e5bfc | 12901 | |
15817c7e RD |
12902 | Constrains this edge to be to the right of the given window, with an |
12903 | optional margin. Implicitly, this is relative to the right edge of the | |
12904 | other window. | |
d55e5bfc | 12905 | """ |
5b5c9bc7 | 12906 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
d55e5bfc RD |
12907 | |
12908 | def Above(*args, **kwargs): | |
12909 | """ | |
5b5c9bc7 | 12910 | Above(self, Window sibling, int marg=0) |
d55e5bfc | 12911 | |
15817c7e RD |
12912 | Constrains this edge to be above the given window, with an optional |
12913 | margin. Implicitly, this is relative to the top edge of the other | |
12914 | window. | |
d55e5bfc | 12915 | """ |
5b5c9bc7 | 12916 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
d55e5bfc RD |
12917 | |
12918 | def Below(*args, **kwargs): | |
12919 | """ | |
5b5c9bc7 | 12920 | Below(self, Window sibling, int marg=0) |
d55e5bfc | 12921 | |
15817c7e RD |
12922 | Constrains this edge to be below the given window, with an optional |
12923 | margin. Implicitly, this is relative to the bottom edge of the other | |
12924 | window. | |
d55e5bfc | 12925 | """ |
5b5c9bc7 | 12926 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
d55e5bfc RD |
12927 | |
12928 | def SameAs(*args, **kwargs): | |
12929 | """ | |
5b5c9bc7 | 12930 | SameAs(self, Window otherW, int edge, int marg=0) |
d55e5bfc | 12931 | |
15817c7e RD |
12932 | Constrains this edge or dimension to be to the same as the edge of the |
12933 | given window, with an optional margin. | |
d55e5bfc | 12934 | """ |
5b5c9bc7 | 12935 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
d55e5bfc RD |
12936 | |
12937 | def PercentOf(*args, **kwargs): | |
12938 | """ | |
5b5c9bc7 | 12939 | PercentOf(self, Window otherW, int wh, int per) |
d55e5bfc | 12940 | |
15817c7e RD |
12941 | Constrains this edge or dimension to be to a percentage of the given |
12942 | window, with an optional margin. | |
d55e5bfc | 12943 | """ |
5b5c9bc7 | 12944 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
d55e5bfc RD |
12945 | |
12946 | def Absolute(*args, **kwargs): | |
12947 | """ | |
12948 | Absolute(self, int val) | |
12949 | ||
15817c7e | 12950 | Constrains this edge or dimension to be the given absolute value. |
d55e5bfc | 12951 | """ |
5b5c9bc7 | 12952 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
d55e5bfc RD |
12953 | |
12954 | def Unconstrained(*args, **kwargs): | |
12955 | """ | |
12956 | Unconstrained(self) | |
12957 | ||
15817c7e RD |
12958 | Sets this edge or dimension to be unconstrained, that is, dependent on |
12959 | other edges and dimensions from which this value can be deduced. | |
d55e5bfc | 12960 | """ |
5b5c9bc7 | 12961 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
d55e5bfc RD |
12962 | |
12963 | def AsIs(*args, **kwargs): | |
12964 | """ | |
12965 | AsIs(self) | |
12966 | ||
15817c7e RD |
12967 | Sets this edge or constraint to be whatever the window's value is at |
12968 | the moment. If either of the width and height constraints are *as is*, | |
12969 | the window will not be resized, but moved instead. This is important | |
12970 | when considering panel items which are intended to have a default | |
12971 | size, such as a button, which may take its size from the size of the | |
12972 | button label. | |
d55e5bfc | 12973 | """ |
5b5c9bc7 | 12974 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
d55e5bfc RD |
12975 | |
12976 | def GetOtherWindow(*args, **kwargs): | |
5b5c9bc7 RD |
12977 | """GetOtherWindow(self) -> Window""" |
12978 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) | |
d55e5bfc RD |
12979 | |
12980 | def GetMyEdge(*args, **kwargs): | |
12981 | """GetMyEdge(self) -> int""" | |
5b5c9bc7 | 12982 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
d55e5bfc RD |
12983 | |
12984 | def SetEdge(*args, **kwargs): | |
12985 | """SetEdge(self, int which)""" | |
5b5c9bc7 | 12986 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
d55e5bfc RD |
12987 | |
12988 | def SetValue(*args, **kwargs): | |
12989 | """SetValue(self, int v)""" | |
5b5c9bc7 | 12990 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
d55e5bfc RD |
12991 | |
12992 | def GetMargin(*args, **kwargs): | |
12993 | """GetMargin(self) -> int""" | |
5b5c9bc7 | 12994 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
d55e5bfc RD |
12995 | |
12996 | def SetMargin(*args, **kwargs): | |
12997 | """SetMargin(self, int m)""" | |
5b5c9bc7 | 12998 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
d55e5bfc RD |
12999 | |
13000 | def GetValue(*args, **kwargs): | |
13001 | """GetValue(self) -> int""" | |
5b5c9bc7 | 13002 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
d55e5bfc RD |
13003 | |
13004 | def GetPercent(*args, **kwargs): | |
13005 | """GetPercent(self) -> int""" | |
5b5c9bc7 | 13006 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
d55e5bfc RD |
13007 | |
13008 | def GetOtherEdge(*args, **kwargs): | |
13009 | """GetOtherEdge(self) -> int""" | |
5b5c9bc7 | 13010 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
d55e5bfc RD |
13011 | |
13012 | def GetDone(*args, **kwargs): | |
13013 | """GetDone(self) -> bool""" | |
5b5c9bc7 | 13014 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
d55e5bfc RD |
13015 | |
13016 | def SetDone(*args, **kwargs): | |
13017 | """SetDone(self, bool d)""" | |
5b5c9bc7 | 13018 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
d55e5bfc RD |
13019 | |
13020 | def GetRelationship(*args, **kwargs): | |
13021 | """GetRelationship(self) -> int""" | |
5b5c9bc7 | 13022 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
d55e5bfc RD |
13023 | |
13024 | def SetRelationship(*args, **kwargs): | |
13025 | """SetRelationship(self, int r)""" | |
5b5c9bc7 | 13026 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
d55e5bfc RD |
13027 | |
13028 | def ResetIfWin(*args, **kwargs): | |
13029 | """ | |
5b5c9bc7 | 13030 | ResetIfWin(self, Window otherW) -> bool |
d55e5bfc RD |
13031 | |
13032 | Reset constraint if it mentions otherWin | |
13033 | """ | |
5b5c9bc7 | 13034 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
d55e5bfc RD |
13035 | |
13036 | def SatisfyConstraint(*args, **kwargs): | |
13037 | """ | |
5b5c9bc7 | 13038 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
d55e5bfc RD |
13039 | |
13040 | Try to satisfy constraint | |
13041 | """ | |
5b5c9bc7 | 13042 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
d55e5bfc RD |
13043 | |
13044 | def GetEdge(*args, **kwargs): | |
13045 | """ | |
5b5c9bc7 | 13046 | GetEdge(self, int which, Window thisWin, Window other) -> int |
d55e5bfc RD |
13047 | |
13048 | Get the value of this edge or dimension, or if this | |
13049 | is not determinable, -1. | |
13050 | """ | |
5b5c9bc7 | 13051 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
d55e5bfc RD |
13052 | |
13053 | ||
5b5c9bc7 | 13054 | class IndividualLayoutConstraintPtr(IndividualLayoutConstraint): |
d55e5bfc RD |
13055 | def __init__(self, this): |
13056 | self.this = this | |
13057 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
13058 | self.__class__ = IndividualLayoutConstraint |
13059 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr) | |
d55e5bfc | 13060 | |
5b5c9bc7 | 13061 | class LayoutConstraints(Object): |
d55e5bfc | 13062 | """ |
15817c7e RD |
13063 | **Note:** constraints are now deprecated and you should use sizers |
13064 | instead. | |
d55e5bfc | 13065 | |
15817c7e RD |
13066 | Objects of this class can be associated with a window to define its |
13067 | layout constraints, with respect to siblings or its parent. | |
d55e5bfc RD |
13068 | |
13069 | The class consists of the following eight constraints of class | |
13070 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
13071 | directly to set the appropriate constraints. | |
13072 | ||
13073 | * left: represents the left hand edge of the window | |
13074 | * right: represents the right hand edge of the window | |
13075 | * top: represents the top edge of the window | |
13076 | * bottom: represents the bottom edge of the window | |
13077 | * width: represents the width of the window | |
13078 | * height: represents the height of the window | |
13079 | * centreX: represents the horizontal centre point of the window | |
13080 | * centreY: represents the vertical centre point of the window | |
13081 | ||
15817c7e RD |
13082 | Most constraints are initially set to have the relationship |
13083 | wxUnconstrained, which means that their values should be calculated by | |
13084 | looking at known constraints. The exceptions are width and height, | |
13085 | which are set to wxAsIs to ensure that if the user does not specify a | |
13086 | constraint, the existing width and height will be used, to be | |
13087 | compatible with panel items which often have take a default size. If | |
13088 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
13089 | ||
13090 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
d55e5bfc RD |
13091 | |
13092 | """ | |
13093 | def __repr__(self): | |
13094 | return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 RD |
13095 | left = property(_core_.LayoutConstraints_left_get) |
13096 | top = property(_core_.LayoutConstraints_top_get) | |
13097 | right = property(_core_.LayoutConstraints_right_get) | |
13098 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
13099 | width = property(_core_.LayoutConstraints_width_get) | |
13100 | height = property(_core_.LayoutConstraints_height_get) | |
13101 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
13102 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
d55e5bfc | 13103 | def __init__(self, *args, **kwargs): |
5b5c9bc7 RD |
13104 | """__init__(self) -> LayoutConstraints""" |
13105 | newobj = _core_.new_LayoutConstraints(*args, **kwargs) | |
d55e5bfc RD |
13106 | self.this = newobj.this |
13107 | self.thisown = 1 | |
13108 | del newobj.thisown | |
13109 | def SatisfyConstraints(*args, **kwargs): | |
13110 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" | |
5b5c9bc7 | 13111 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
d55e5bfc RD |
13112 | |
13113 | def AreSatisfied(*args, **kwargs): | |
13114 | """AreSatisfied(self) -> bool""" | |
5b5c9bc7 | 13115 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
d55e5bfc RD |
13116 | |
13117 | ||
5b5c9bc7 | 13118 | class LayoutConstraintsPtr(LayoutConstraints): |
d55e5bfc RD |
13119 | def __init__(self, this): |
13120 | self.this = this | |
13121 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
13122 | self.__class__ = LayoutConstraints |
13123 | _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr) | |
d55e5bfc RD |
13124 | |
13125 | #---------------------------------------------------------------------------- | |
13126 | ||
13127 | # Use Python's bool constants if available, make some if not | |
13128 | try: | |
13129 | True | |
13130 | except NameError: | |
13131 | __builtins__.True = 1==1 | |
13132 | __builtins__.False = 1==0 | |
13133 | def bool(value): return not not value | |
13134 | __builtins__.bool = bool | |
13135 | ||
13136 | ||
13137 | ||
13138 | # workarounds for bad wxRTTI names | |
13139 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
13140 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
13141 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
13142 | ||
13143 | ||
13144 | #---------------------------------------------------------------------------- | |
13145 | # Load version numbers from __version__... Ensure that major and minor | |
0f63ec68 | 13146 | # versions are the same for both wxPython and wxWidgets. |
d55e5bfc RD |
13147 | |
13148 | from __version__ import * | |
13149 | __version__ = VERSION_STRING | |
13150 | ||
0f63ec68 RD |
13151 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
13152 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
d55e5bfc RD |
13153 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
13154 | import warnings | |
0f63ec68 | 13155 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d55e5bfc RD |
13156 | |
13157 | #---------------------------------------------------------------------------- | |
13158 | ||
7993762b RD |
13159 | # Set wxPython's default string<-->unicode conversion encoding from |
13160 | # the locale, but only if Python's default hasn't been changed. (We | |
13161 | # assume that if the user has customized it already then that is the | |
13162 | # encoding we need to use as well.) | |
13163 | # | |
13164 | # The encoding selected here is used when string or unicode objects | |
13165 | # need to be converted in order to pass them to wxWidgets. Please be | |
13166 | # aware that the default encoding within the same locale may be | |
13167 | # slightly different on different platforms. For example, please see | |
62d32a5f RD |
13168 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
13169 | # between the common latin/roman encodings. | |
3837a853 RD |
13170 | |
13171 | default = _sys.getdefaultencoding() | |
13172 | if default == 'ascii': | |
13173 | import locale | |
13174 | import codecs | |
13175 | try: | |
13176 | default = locale.getdefaultlocale()[1] | |
13177 | codecs.lookup(default) | |
7993762b | 13178 | except (ValueError, LookupError, TypeError): |
3837a853 RD |
13179 | default = _sys.getdefaultencoding() |
13180 | del locale | |
13181 | del codecs | |
5cbf236d RD |
13182 | if default: |
13183 | wx.SetDefaultPyEncoding(default) | |
13184 | del default | |
5cbf236d RD |
13185 | |
13186 | #---------------------------------------------------------------------------- | |
13187 | ||
d55e5bfc RD |
13188 | class PyDeadObjectError(AttributeError): |
13189 | pass | |
13190 | ||
13191 | class _wxPyDeadObject(object): | |
13192 | """ | |
13193 | Instances of wx objects that are OOR capable will have their __class__ | |
13194 | changed to this class when the C++ object is deleted. This should help | |
13195 | prevent crashes due to referencing a bogus C++ pointer. | |
13196 | """ | |
13197 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
13198 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
13199 | ||
13200 | def __repr__(self): | |
13201 | if not hasattr(self, "_name"): | |
13202 | self._name = "[unknown]" | |
13203 | return self.reprStr % self._name | |
13204 | ||
13205 | def __getattr__(self, *args): | |
13206 | if not hasattr(self, "_name"): | |
13207 | self._name = "[unknown]" | |
13208 | raise PyDeadObjectError(self.attrStr % self._name) | |
13209 | ||
13210 | def __nonzero__(self): | |
13211 | return 0 | |
13212 | ||
13213 | ||
13214 | ||
13215 | class PyUnbornObjectError(AttributeError): | |
13216 | pass | |
13217 | ||
13218 | class _wxPyUnbornObject(object): | |
13219 | """ | |
13220 | Some stock objects are created when the wx._core module is | |
13221 | imported, but their C++ instance is not created until the wx.App | |
13222 | object is created and initialized. These object instances will | |
13223 | temporarily have their __class__ changed to this class so an | |
13224 | exception will be raised if they are used before the C++ instance | |
13225 | is ready. | |
13226 | """ | |
13227 | ||
13228 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
13229 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
13230 | ||
13231 | def __repr__(self): | |
13232 | #if not hasattr(self, "_name"): | |
13233 | # self._name = "[unknown]" | |
13234 | return self.reprStr #% self._name | |
13235 | ||
13236 | def __getattr__(self, *args): | |
13237 | #if not hasattr(self, "_name"): | |
13238 | # self._name = "[unknown]" | |
13239 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
13240 | ||
13241 | def __nonzero__(self): | |
13242 | return 0 | |
13243 | ||
13244 | ||
13245 | #---------------------------------------------------------------------------- | |
d55e5bfc RD |
13246 | |
13247 | def CallAfter(callable, *args, **kw): | |
13248 | """ | |
13249 | Call the specified function after the current and pending event | |
13250 | handlers have been completed. This is also good for making GUI | |
0439c23b RD |
13251 | method calls from non-GUI threads. Any extra positional or |
13252 | keyword args are passed on to the callable when it is called. | |
13253 | ||
13254 | :see: `wx.FutureCall` | |
d55e5bfc RD |
13255 | """ |
13256 | app = wx.GetApp() | |
a001823c | 13257 | assert app is not None, 'No wx.App created yet' |
d55e5bfc | 13258 | |
891bb194 RD |
13259 | if not hasattr(app, "_CallAfterId"): |
13260 | app._CallAfterId = wx.NewEventType() | |
13261 | app.Connect(-1, -1, app._CallAfterId, | |
13262 | lambda event: event.callable(*event.args, **event.kw) ) | |
d55e5bfc | 13263 | evt = wx.PyEvent() |
891bb194 | 13264 | evt.SetEventType(app._CallAfterId) |
d55e5bfc RD |
13265 | evt.callable = callable |
13266 | evt.args = args | |
13267 | evt.kw = kw | |
13268 | wx.PostEvent(app, evt) | |
13269 | ||
d55e5bfc RD |
13270 | #---------------------------------------------------------------------------- |
13271 | ||
13272 | ||
13273 | class FutureCall: | |
13274 | """ | |
6e0de3df | 13275 | A convenience class for `wx.Timer`, that calls the given callable |
d55e5bfc RD |
13276 | object once after the given amount of milliseconds, passing any |
13277 | positional or keyword args. The return value of the callable is | |
0439c23b | 13278 | availbale after it has been run with the `GetResult` method. |
d55e5bfc RD |
13279 | |
13280 | If you don't need to get the return value or restart the timer | |
13281 | then there is no need to hold a reference to this object. It will | |
13282 | hold a reference to itself while the timer is running (the timer | |
13283 | has a reference to self.Notify) but the cycle will be broken when | |
13284 | the timer completes, automatically cleaning up the wx.FutureCall | |
13285 | object. | |
0439c23b RD |
13286 | |
13287 | :see: `wx.CallAfter` | |
d55e5bfc RD |
13288 | """ |
13289 | def __init__(self, millis, callable, *args, **kwargs): | |
13290 | self.millis = millis | |
13291 | self.callable = callable | |
13292 | self.SetArgs(*args, **kwargs) | |
13293 | self.runCount = 0 | |
13294 | self.running = False | |
13295 | self.hasRun = False | |
13296 | self.result = None | |
13297 | self.timer = None | |
13298 | self.Start() | |
13299 | ||
13300 | def __del__(self): | |
13301 | self.Stop() | |
13302 | ||
13303 | ||
13304 | def Start(self, millis=None, *args, **kwargs): | |
13305 | """ | |
13306 | (Re)start the timer | |
13307 | """ | |
13308 | self.hasRun = False | |
13309 | if millis is not None: | |
13310 | self.millis = millis | |
13311 | if args or kwargs: | |
13312 | self.SetArgs(*args, **kwargs) | |
13313 | self.Stop() | |
13314 | self.timer = wx.PyTimer(self.Notify) | |
13315 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
13316 | self.running = True | |
13317 | Restart = Start | |
13318 | ||
13319 | ||
13320 | def Stop(self): | |
13321 | """ | |
13322 | Stop and destroy the timer. | |
13323 | """ | |
13324 | if self.timer is not None: | |
13325 | self.timer.Stop() | |
13326 | self.timer = None | |
13327 | ||
13328 | ||
13329 | def GetInterval(self): | |
13330 | if self.timer is not None: | |
13331 | return self.timer.GetInterval() | |
13332 | else: | |
13333 | return 0 | |
13334 | ||
13335 | ||
13336 | def IsRunning(self): | |
13337 | return self.timer is not None and self.timer.IsRunning() | |
13338 | ||
13339 | ||
13340 | def SetArgs(self, *args, **kwargs): | |
13341 | """ | |
13342 | (Re)set the args passed to the callable object. This is | |
13343 | useful in conjunction with Restart if you want to schedule a | |
13344 | new call to the same callable object but with different | |
13345 | parameters. | |
13346 | """ | |
13347 | self.args = args | |
13348 | self.kwargs = kwargs | |
13349 | ||
13350 | ||
13351 | def HasRun(self): | |
13352 | return self.hasRun | |
13353 | ||
13354 | def GetResult(self): | |
13355 | return self.result | |
13356 | ||
13357 | def Notify(self): | |
13358 | """ | |
13359 | The timer has expired so call the callable. | |
13360 | """ | |
13361 | if self.callable and getattr(self.callable, 'im_self', True): | |
13362 | self.runCount += 1 | |
13363 | self.running = False | |
13364 | self.result = self.callable(*self.args, **self.kwargs) | |
13365 | self.hasRun = True | |
13366 | if not self.running: | |
13367 | # if it wasn't restarted, then cleanup | |
13368 | wx.CallAfter(self.Stop) | |
13369 | ||
13370 | ||
13371 | ||
13372 | #---------------------------------------------------------------------------- | |
13373 | # Control which items in this module should be documented by epydoc. | |
13374 | # We allow only classes and functions, which will help reduce the size | |
13375 | # of the docs by filtering out the zillions of constants, EVT objects, | |
13376 | # and etc that don't make much sense by themselves, but are instead | |
13377 | # documented (or will be) as part of the classes/functions/methods | |
13378 | # where they should be used. | |
13379 | ||
d6c14a4c RD |
13380 | class __DocFilter: |
13381 | """ | |
13382 | A filter for epydoc that only allows non-Ptr classes and | |
13383 | fucntions, in order to reduce the clutter in the API docs. | |
13384 | """ | |
13385 | def __init__(self, globals): | |
13386 | self._globals = globals | |
13387 | ||
13388 | def __call__(self, name): | |
13389 | import types | |
13390 | obj = self._globals.get(name, None) | |
13391 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: | |
13392 | return False | |
13393 | if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'): | |
13394 | return False | |
13395 | return True | |
d55e5bfc RD |
13396 | |
13397 | #---------------------------------------------------------------------------- | |
13398 | #---------------------------------------------------------------------------- | |
13399 | ||
13400 | # Import other modules in this package that should show up in the | |
13401 | # "core" wx namespace | |
13402 | from _gdi import * | |
13403 | from _windows import * | |
13404 | from _controls import * | |
13405 | from _misc import * | |
13406 | ||
13407 | ||
13408 | # Fixup the stock objects since they can't be used yet. (They will be | |
13409 | # restored in wx.PyApp.OnInit.) | |
13410 | _core_._wxPyFixStockObjects() | |
13411 | ||
13412 | #---------------------------------------------------------------------------- | |
13413 | #---------------------------------------------------------------------------- | |
13414 | ||
13415 |