]>
Commit | Line | Data |
---|---|---|
d14a1e28 RD |
1 | # This file was created automatically by SWIG. |
2 | # Don't modify this file, modify the SWIG interface instead. | |
3 | ||
54f9ee45 | 4 | import _core_ |
d14a1e28 | 5 | |
093d3ff1 RD |
6 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1): |
7 | if (name == "this"): | |
8 | if isinstance(value, class_type): | |
9 | self.__dict__[name] = value.this | |
10 | if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown | |
11 | del value.thisown | |
12 | return | |
13 | method = class_type.__swig_setmethods__.get(name,None) | |
14 | if method: return method(self,value) | |
15 | if (not static) or hasattr(self,name) or (name == "thisown"): | |
16 | self.__dict__[name] = value | |
17 | else: | |
18 | raise AttributeError("You cannot add attributes to %s" % self) | |
19 | ||
20 | def _swig_setattr(self,class_type,name,value): | |
21 | return _swig_setattr_nondynamic(self,class_type,name,value,0) | |
22 | ||
23 | def _swig_getattr(self,class_type,name): | |
24 | method = class_type.__swig_getmethods__.get(name,None) | |
25 | if method: return method(self) | |
26 | raise AttributeError,name | |
27 | ||
28 | import types | |
29 | try: | |
30 | _object = types.ObjectType | |
31 | _newclass = 1 | |
32 | except AttributeError: | |
33 | class _object : pass | |
34 | _newclass = 0 | |
35 | del types | |
36 | ||
37 | ||
38 | def _swig_setattr_nondynamic_method(set): | |
39 | def set_attr(self,name,value): | |
40 | if hasattr(self,name) or (name in ("this", "thisown")): | |
41 | set(self,name,value) | |
42 | else: | |
43 | raise AttributeError("You cannot add attributes to %s" % self) | |
44 | return set_attr | |
45 | ||
46 | ||
d14a1e28 RD |
47 | #// Give a reference to the dictionary of this module to the C++ extension |
48 | #// code. | |
54f9ee45 | 49 | _core_._wxPySetDictionary(vars()) |
d14a1e28 RD |
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 | ||
66c033b4 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 | ||
54f9ee45 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 | |
bcd0d7b6 | 88 | DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER |
6d88e192 | 89 | DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE |
54f9ee45 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 | |
54f9ee45 RD |
96 | CLIP_CHILDREN = _core_.CLIP_CHILDREN |
97 | CLIP_SIBLINGS = _core_.CLIP_SIBLINGS | |
98 | ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB | |
99 | RETAINED = _core_.RETAINED | |
100 | BACKINGSTORE = _core_.BACKINGSTORE | |
101 | COLOURED = _core_.COLOURED | |
102 | FIXED_LENGTH = _core_.FIXED_LENGTH | |
103 | LB_NEEDED_SB = _core_.LB_NEEDED_SB | |
104 | LB_ALWAYS_SB = _core_.LB_ALWAYS_SB | |
105 | LB_SORT = _core_.LB_SORT | |
106 | LB_SINGLE = _core_.LB_SINGLE | |
107 | LB_MULTIPLE = _core_.LB_MULTIPLE | |
108 | LB_EXTENDED = _core_.LB_EXTENDED | |
109 | LB_OWNERDRAW = _core_.LB_OWNERDRAW | |
110 | LB_HSCROLL = _core_.LB_HSCROLL | |
111 | PROCESS_ENTER = _core_.PROCESS_ENTER | |
112 | PASSWORD = _core_.PASSWORD | |
113 | CB_SIMPLE = _core_.CB_SIMPLE | |
114 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
115 | CB_SORT = _core_.CB_SORT | |
116 | CB_READONLY = _core_.CB_READONLY | |
117 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
118 | RA_VERTICAL = _core_.RA_VERTICAL | |
119 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
120 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
fef4c27a | 121 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX |
54f9ee45 RD |
122 | RB_GROUP = _core_.RB_GROUP |
123 | RB_SINGLE = _core_.RB_SINGLE | |
54f9ee45 RD |
124 | SB_HORIZONTAL = _core_.SB_HORIZONTAL |
125 | SB_VERTICAL = _core_.SB_VERTICAL | |
fef4c27a | 126 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX |
54f9ee45 RD |
127 | ST_SIZEGRIP = _core_.ST_SIZEGRIP |
128 | ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE | |
129 | FLOOD_SURFACE = _core_.FLOOD_SURFACE | |
130 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
131 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
132 | WINDING_RULE = _core_.WINDING_RULE | |
133 | TOOL_TOP = _core_.TOOL_TOP | |
134 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
135 | TOOL_LEFT = _core_.TOOL_LEFT | |
136 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
137 | OK = _core_.OK | |
138 | YES_NO = _core_.YES_NO | |
139 | CANCEL = _core_.CANCEL | |
140 | YES = _core_.YES | |
141 | NO = _core_.NO | |
142 | NO_DEFAULT = _core_.NO_DEFAULT | |
143 | YES_DEFAULT = _core_.YES_DEFAULT | |
144 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION | |
145 | ICON_HAND = _core_.ICON_HAND | |
146 | ICON_QUESTION = _core_.ICON_QUESTION | |
147 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
148 | ICON_STOP = _core_.ICON_STOP | |
149 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
150 | ICON_MASK = _core_.ICON_MASK | |
151 | ICON_WARNING = _core_.ICON_WARNING | |
152 | ICON_ERROR = _core_.ICON_ERROR | |
153 | FORWARD = _core_.FORWARD | |
154 | BACKWARD = _core_.BACKWARD | |
155 | RESET = _core_.RESET | |
156 | HELP = _core_.HELP | |
157 | MORE = _core_.MORE | |
158 | SETUP = _core_.SETUP | |
159 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
160 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
161 | SIZE_AUTO = _core_.SIZE_AUTO | |
162 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
163 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
164 | PORTRAIT = _core_.PORTRAIT | |
165 | LANDSCAPE = _core_.LANDSCAPE | |
166 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
167 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
168 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
169 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
170 | ID_ANY = _core_.ID_ANY | |
171 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
172 | ID_LOWEST = _core_.ID_LOWEST | |
173 | ID_OPEN = _core_.ID_OPEN | |
174 | ID_CLOSE = _core_.ID_CLOSE | |
175 | ID_NEW = _core_.ID_NEW | |
176 | ID_SAVE = _core_.ID_SAVE | |
177 | ID_SAVEAS = _core_.ID_SAVEAS | |
178 | ID_REVERT = _core_.ID_REVERT | |
179 | ID_EXIT = _core_.ID_EXIT | |
180 | ID_UNDO = _core_.ID_UNDO | |
181 | ID_REDO = _core_.ID_REDO | |
182 | ID_HELP = _core_.ID_HELP | |
183 | ID_PRINT = _core_.ID_PRINT | |
184 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
185 | ID_PREVIEW = _core_.ID_PREVIEW | |
186 | ID_ABOUT = _core_.ID_ABOUT | |
187 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
188 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
189 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
190 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
191 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL | |
192 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
193 | ID_CUT = _core_.ID_CUT | |
194 | ID_COPY = _core_.ID_COPY | |
195 | ID_PASTE = _core_.ID_PASTE | |
196 | ID_CLEAR = _core_.ID_CLEAR | |
197 | ID_FIND = _core_.ID_FIND | |
198 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
199 | ID_SELECTALL = _core_.ID_SELECTALL | |
200 | ID_DELETE = _core_.ID_DELETE | |
201 | ID_REPLACE = _core_.ID_REPLACE | |
202 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
203 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
204 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
205 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
206 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
207 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
208 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
209 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
210 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
211 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
212 | ID_FILE1 = _core_.ID_FILE1 | |
213 | ID_FILE2 = _core_.ID_FILE2 | |
214 | ID_FILE3 = _core_.ID_FILE3 | |
215 | ID_FILE4 = _core_.ID_FILE4 | |
216 | ID_FILE5 = _core_.ID_FILE5 | |
217 | ID_FILE6 = _core_.ID_FILE6 | |
218 | ID_FILE7 = _core_.ID_FILE7 | |
219 | ID_FILE8 = _core_.ID_FILE8 | |
220 | ID_FILE9 = _core_.ID_FILE9 | |
221 | ID_OK = _core_.ID_OK | |
222 | ID_CANCEL = _core_.ID_CANCEL | |
223 | ID_APPLY = _core_.ID_APPLY | |
224 | ID_YES = _core_.ID_YES | |
225 | ID_NO = _core_.ID_NO | |
226 | ID_STATIC = _core_.ID_STATIC | |
227 | ID_FORWARD = _core_.ID_FORWARD | |
228 | ID_BACKWARD = _core_.ID_BACKWARD | |
229 | ID_DEFAULT = _core_.ID_DEFAULT | |
230 | ID_MORE = _core_.ID_MORE | |
231 | ID_SETUP = _core_.ID_SETUP | |
232 | ID_RESET = _core_.ID_RESET | |
233 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
234 | ID_YESTOALL = _core_.ID_YESTOALL | |
235 | ID_NOTOALL = _core_.ID_NOTOALL | |
236 | ID_ABORT = _core_.ID_ABORT | |
237 | ID_RETRY = _core_.ID_RETRY | |
238 | ID_IGNORE = _core_.ID_IGNORE | |
7bc1e663 RD |
239 | ID_ADD = _core_.ID_ADD |
240 | ID_REMOVE = _core_.ID_REMOVE | |
241 | ID_UP = _core_.ID_UP | |
242 | ID_DOWN = _core_.ID_DOWN | |
243 | ID_HOME = _core_.ID_HOME | |
244 | ID_REFRESH = _core_.ID_REFRESH | |
245 | ID_STOP = _core_.ID_STOP | |
246 | ID_INDEX = _core_.ID_INDEX | |
247 | ID_BOLD = _core_.ID_BOLD | |
248 | ID_ITALIC = _core_.ID_ITALIC | |
249 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
250 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
251 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
252 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
253 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
254 | ID_INDENT = _core_.ID_INDENT | |
255 | ID_UNINDENT = _core_.ID_UNINDENT | |
256 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
257 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
258 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
259 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
260 | ID_UNDELETE = _core_.ID_UNDELETE | |
261 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
54f9ee45 RD |
262 | ID_HIGHEST = _core_.ID_HIGHEST |
263 | OPEN = _core_.OPEN | |
264 | SAVE = _core_.SAVE | |
265 | HIDE_READONLY = _core_.HIDE_READONLY | |
266 | OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT | |
267 | FILE_MUST_EXIST = _core_.FILE_MUST_EXIST | |
268 | MULTIPLE = _core_.MULTIPLE | |
269 | CHANGE_DIR = _core_.CHANGE_DIR | |
270 | ACCEL_ALT = _core_.ACCEL_ALT | |
271 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
272 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
273 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
274 | PD_AUTO_HIDE = _core_.PD_AUTO_HIDE | |
275 | PD_APP_MODAL = _core_.PD_APP_MODAL | |
276 | PD_CAN_ABORT = _core_.PD_CAN_ABORT | |
277 | PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME | |
278 | PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME | |
279 | PD_REMAINING_TIME = _core_.PD_REMAINING_TIME | |
e505d15e RD |
280 | PD_SMOOTH = _core_.PD_SMOOTH |
281 | PD_CAN_SKIP = _core_.PD_CAN_SKIP | |
54f9ee45 RD |
282 | DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON |
283 | DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE | |
284 | MENU_TEAROFF = _core_.MENU_TEAROFF | |
285 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
286 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
287 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
288 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
289 | LI_VERTICAL = _core_.LI_VERTICAL | |
290 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
291 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
292 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
293 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
294 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
295 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
296 | MM_TEXT = _core_.MM_TEXT | |
297 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
298 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
299 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
300 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
301 | MM_TWIPS = _core_.MM_TWIPS | |
302 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
303 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
304 | MM_POINTS = _core_.MM_POINTS | |
305 | MM_METRIC = _core_.MM_METRIC | |
306 | CENTRE = _core_.CENTRE | |
307 | CENTER = _core_.CENTER | |
308 | HORIZONTAL = _core_.HORIZONTAL | |
309 | VERTICAL = _core_.VERTICAL | |
310 | BOTH = _core_.BOTH | |
311 | LEFT = _core_.LEFT | |
312 | RIGHT = _core_.RIGHT | |
313 | UP = _core_.UP | |
314 | DOWN = _core_.DOWN | |
315 | TOP = _core_.TOP | |
316 | BOTTOM = _core_.BOTTOM | |
317 | NORTH = _core_.NORTH | |
318 | SOUTH = _core_.SOUTH | |
319 | WEST = _core_.WEST | |
320 | EAST = _core_.EAST | |
321 | ALL = _core_.ALL | |
322 | ALIGN_NOT = _core_.ALIGN_NOT | |
323 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
324 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
325 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
326 | ALIGN_TOP = _core_.ALIGN_TOP | |
327 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
328 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
329 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
330 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
331 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
332 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
333 | ALIGN_MASK = _core_.ALIGN_MASK | |
334 | STRETCH_NOT = _core_.STRETCH_NOT | |
335 | SHRINK = _core_.SHRINK | |
336 | GROW = _core_.GROW | |
337 | EXPAND = _core_.EXPAND | |
338 | SHAPED = _core_.SHAPED | |
339 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
340 | TILE = _core_.TILE | |
341 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
342 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
343 | BORDER_NONE = _core_.BORDER_NONE | |
344 | BORDER_STATIC = _core_.BORDER_STATIC | |
345 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
346 | BORDER_RAISED = _core_.BORDER_RAISED | |
347 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
348 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
349 | BORDER_MASK = _core_.BORDER_MASK | |
7bc1e663 RD |
350 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM |
351 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
352 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
54f9ee45 RD |
353 | DEFAULT = _core_.DEFAULT |
354 | DECORATIVE = _core_.DECORATIVE | |
355 | ROMAN = _core_.ROMAN | |
356 | SCRIPT = _core_.SCRIPT | |
357 | SWISS = _core_.SWISS | |
358 | MODERN = _core_.MODERN | |
359 | TELETYPE = _core_.TELETYPE | |
360 | VARIABLE = _core_.VARIABLE | |
361 | FIXED = _core_.FIXED | |
362 | NORMAL = _core_.NORMAL | |
363 | LIGHT = _core_.LIGHT | |
364 | BOLD = _core_.BOLD | |
365 | ITALIC = _core_.ITALIC | |
366 | SLANT = _core_.SLANT | |
367 | SOLID = _core_.SOLID | |
368 | DOT = _core_.DOT | |
369 | LONG_DASH = _core_.LONG_DASH | |
370 | SHORT_DASH = _core_.SHORT_DASH | |
371 | DOT_DASH = _core_.DOT_DASH | |
372 | USER_DASH = _core_.USER_DASH | |
373 | TRANSPARENT = _core_.TRANSPARENT | |
374 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
375 | STIPPLE_MASK = _core_.STIPPLE_MASK |
376 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
54f9ee45 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 | |
88c6b281 RD |
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 | |
54f9ee45 RD |
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 | |
6c75a4cf 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 | |
54f9ee45 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 | |
d14a1e28 RD |
681 | #--------------------------------------------------------------------------- |
682 | ||
683 | class Object(object): | |
0df68c9f RD |
684 | """ |
685 | The base class for most wx objects, although in wxPython not | |
686 | much functionality is needed nor exposed. | |
687 | """ | |
d14a1e28 RD |
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,) | |
e811c8ce | 691 | def GetClassName(*args, **kwargs): |
0df68c9f | 692 | """ |
a95a7133 | 693 | GetClassName(self) -> String |
e811c8ce | 694 | |
a95a7133 | 695 | Returns the class name of the C++ class using wxRTTI. |
0df68c9f | 696 | """ |
54f9ee45 | 697 | return _core_.Object_GetClassName(*args, **kwargs) |
e811c8ce RD |
698 | |
699 | def Destroy(*args, **kwargs): | |
0df68c9f | 700 | """ |
a95a7133 | 701 | Destroy(self) |
e811c8ce | 702 | |
0df68c9f RD |
703 | Deletes the C++ object this Python object is a proxy for. |
704 | """ | |
54f9ee45 | 705 | return _core_.Object_Destroy(*args, **kwargs) |
e811c8ce | 706 | |
d14a1e28 RD |
707 | |
708 | class ObjectPtr(Object): | |
709 | def __init__(self, this): | |
710 | self.this = this | |
711 | if not hasattr(self,"thisown"): self.thisown = 0 | |
712 | self.__class__ = Object | |
54f9ee45 RD |
713 | _core_.Object_swigregister(ObjectPtr) |
714 | _wxPySetDictionary = _core_._wxPySetDictionary | |
d14a1e28 | 715 | |
54f9ee45 | 716 | _wxPyFixStockObjects = _core_._wxPyFixStockObjects |
3a04f143 | 717 | |
54f9ee45 | 718 | cvar = _core_.cvar |
196addbf | 719 | EmptyString = cvar.EmptyString |
d14a1e28 RD |
720 | |
721 | #--------------------------------------------------------------------------- | |
722 | ||
54f9ee45 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 | |
d14a1e28 RD |
774 | #--------------------------------------------------------------------------- |
775 | ||
776 | class Size(object): | |
0df68c9f | 777 | """ |
41e2b43e | 778 | wx.Size is a useful data structure used to represent the size of |
093d3ff1 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. | |
0df68c9f | 782 | """ |
e811c8ce RD |
783 | def __repr__(self): |
784 | return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
54f9ee45 RD |
785 | width = property(_core_.Size_width_get, _core_.Size_width_set) |
786 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
242b7b46 | 787 | x = width; y = height |
d14a1e28 | 788 | def __init__(self, *args, **kwargs): |
0df68c9f | 789 | """ |
a95a7133 | 790 | __init__(self, int w=0, int h=0) -> Size |
e811c8ce | 791 | |
0df68c9f RD |
792 | Creates a size object. |
793 | """ | |
54f9ee45 | 794 | newobj = _core_.new_Size(*args, **kwargs) |
d14a1e28 RD |
795 | self.this = newobj.this |
796 | self.thisown = 1 | |
797 | del newobj.thisown | |
54f9ee45 | 798 | def __del__(self, destroy=_core_.delete_Size): |
a95a7133 | 799 | """__del__(self)""" |
d14a1e28 RD |
800 | try: |
801 | if self.thisown: destroy(self) | |
802 | except: pass | |
e811c8ce RD |
803 | |
804 | def __eq__(*args, **kwargs): | |
0df68c9f | 805 | """ |
a95a7133 | 806 | __eq__(self, Size sz) -> bool |
e811c8ce | 807 | |
0df68c9f RD |
808 | Test for equality of wx.Size objects. |
809 | """ | |
54f9ee45 | 810 | return _core_.Size___eq__(*args, **kwargs) |
e811c8ce RD |
811 | |
812 | def __ne__(*args, **kwargs): | |
0df68c9f | 813 | """ |
a95a7133 | 814 | __ne__(self, Size sz) -> bool |
e811c8ce | 815 | |
0df68c9f RD |
816 | Test for inequality. |
817 | """ | |
54f9ee45 | 818 | return _core_.Size___ne__(*args, **kwargs) |
e811c8ce RD |
819 | |
820 | def __add__(*args, **kwargs): | |
0df68c9f | 821 | """ |
a95a7133 | 822 | __add__(self, Size sz) -> Size |
e811c8ce | 823 | |
0df68c9f RD |
824 | Add sz's proprties to this and return the result. |
825 | """ | |
54f9ee45 | 826 | return _core_.Size___add__(*args, **kwargs) |
e811c8ce RD |
827 | |
828 | def __sub__(*args, **kwargs): | |
0df68c9f | 829 | """ |
a95a7133 | 830 | __sub__(self, Size sz) -> Size |
e811c8ce | 831 | |
0df68c9f RD |
832 | Subtract sz's properties from this and return the result. |
833 | """ | |
54f9ee45 | 834 | return _core_.Size___sub__(*args, **kwargs) |
e811c8ce RD |
835 | |
836 | def IncTo(*args, **kwargs): | |
0df68c9f | 837 | """ |
a95a7133 | 838 | IncTo(self, Size sz) |
e811c8ce | 839 | |
0df68c9f RD |
840 | Increments this object so that both of its dimensions are not less |
841 | than the corresponding dimensions of the size. | |
842 | """ | |
54f9ee45 | 843 | return _core_.Size_IncTo(*args, **kwargs) |
e811c8ce RD |
844 | |
845 | def DecTo(*args, **kwargs): | |
0df68c9f | 846 | """ |
a95a7133 | 847 | DecTo(self, Size sz) |
e811c8ce | 848 | |
0df68c9f RD |
849 | Decrements this object so that both of its dimensions are not greater |
850 | than the corresponding dimensions of the size. | |
851 | """ | |
54f9ee45 | 852 | return _core_.Size_DecTo(*args, **kwargs) |
e811c8ce RD |
853 | |
854 | def Set(*args, **kwargs): | |
0df68c9f | 855 | """ |
a95a7133 | 856 | Set(self, int w, int h) |
e811c8ce | 857 | |
0df68c9f RD |
858 | Set both width and height. |
859 | """ | |
54f9ee45 | 860 | return _core_.Size_Set(*args, **kwargs) |
e811c8ce RD |
861 | |
862 | def SetWidth(*args, **kwargs): | |
a95a7133 | 863 | """SetWidth(self, int w)""" |
54f9ee45 | 864 | return _core_.Size_SetWidth(*args, **kwargs) |
e811c8ce RD |
865 | |
866 | def SetHeight(*args, **kwargs): | |
a95a7133 | 867 | """SetHeight(self, int h)""" |
54f9ee45 | 868 | return _core_.Size_SetHeight(*args, **kwargs) |
e811c8ce RD |
869 | |
870 | def GetWidth(*args, **kwargs): | |
a95a7133 | 871 | """GetWidth(self) -> int""" |
54f9ee45 | 872 | return _core_.Size_GetWidth(*args, **kwargs) |
e811c8ce RD |
873 | |
874 | def GetHeight(*args, **kwargs): | |
a95a7133 | 875 | """GetHeight(self) -> int""" |
54f9ee45 | 876 | return _core_.Size_GetHeight(*args, **kwargs) |
e811c8ce | 877 | |
74a57fcd RD |
878 | def IsFullySpecified(*args, **kwargs): |
879 | """ | |
a95a7133 | 880 | IsFullySpecified(self) -> bool |
74a57fcd RD |
881 | |
882 | Returns True if both components of the size are non-default values. | |
883 | """ | |
54f9ee45 | 884 | return _core_.Size_IsFullySpecified(*args, **kwargs) |
74a57fcd RD |
885 | |
886 | def SetDefaults(*args, **kwargs): | |
887 | """ | |
a95a7133 | 888 | SetDefaults(self, Size size) |
74a57fcd | 889 | |
41e2b43e 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. | |
74a57fcd | 892 | """ |
54f9ee45 | 893 | return _core_.Size_SetDefaults(*args, **kwargs) |
74a57fcd | 894 | |
e811c8ce | 895 | def Get(*args, **kwargs): |
0df68c9f RD |
896 | """ |
897 | Get() -> (width,height) | |
e811c8ce | 898 | |
0df68c9f RD |
899 | Returns the width and height properties as a tuple. |
900 | """ | |
54f9ee45 | 901 | return _core_.Size_Get(*args, **kwargs) |
e811c8ce | 902 | |
41e2b43e | 903 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce 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] | |
d14a1e28 RD |
908 | def __setitem__(self, index, val): |
909 | if index == 0: self.width = val | |
910 | elif index == 1: self.height = val | |
911 | else: raise IndexError | |
e811c8ce | 912 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
913 | __safe_for_unpickling__ = True |
914 | def __reduce__(self): return (wx.Size, self.Get()) | |
d14a1e28 RD |
915 | |
916 | ||
917 | class SizePtr(Size): | |
918 | def __init__(self, this): | |
919 | self.this = this | |
920 | if not hasattr(self,"thisown"): self.thisown = 0 | |
921 | self.__class__ = Size | |
54f9ee45 | 922 | _core_.Size_swigregister(SizePtr) |
d14a1e28 RD |
923 | |
924 | #--------------------------------------------------------------------------- | |
925 | ||
926 | class RealPoint(object): | |
0df68c9f | 927 | """ |
41e2b43e 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. | |
0df68c9f | 931 | """ |
e811c8ce RD |
932 | def __repr__(self): |
933 | return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
54f9ee45 RD |
934 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
935 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
d14a1e28 | 936 | def __init__(self, *args, **kwargs): |
0df68c9f | 937 | """ |
a95a7133 | 938 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
e811c8ce | 939 | |
0df68c9f RD |
940 | Create a wx.RealPoint object |
941 | """ | |
54f9ee45 | 942 | newobj = _core_.new_RealPoint(*args, **kwargs) |
d14a1e28 RD |
943 | self.this = newobj.this |
944 | self.thisown = 1 | |
945 | del newobj.thisown | |
54f9ee45 | 946 | def __del__(self, destroy=_core_.delete_RealPoint): |
a95a7133 | 947 | """__del__(self)""" |
d14a1e28 RD |
948 | try: |
949 | if self.thisown: destroy(self) | |
950 | except: pass | |
e811c8ce RD |
951 | |
952 | def __eq__(*args, **kwargs): | |
0df68c9f | 953 | """ |
a95a7133 | 954 | __eq__(self, RealPoint pt) -> bool |
e811c8ce | 955 | |
0df68c9f RD |
956 | Test for equality of wx.RealPoint objects. |
957 | """ | |
54f9ee45 | 958 | return _core_.RealPoint___eq__(*args, **kwargs) |
e811c8ce RD |
959 | |
960 | def __ne__(*args, **kwargs): | |
0df68c9f | 961 | """ |
a95a7133 | 962 | __ne__(self, RealPoint pt) -> bool |
e811c8ce | 963 | |
0df68c9f RD |
964 | Test for inequality of wx.RealPoint objects. |
965 | """ | |
54f9ee45 | 966 | return _core_.RealPoint___ne__(*args, **kwargs) |
e811c8ce RD |
967 | |
968 | def __add__(*args, **kwargs): | |
0df68c9f | 969 | """ |
a95a7133 | 970 | __add__(self, RealPoint pt) -> RealPoint |
e811c8ce | 971 | |
0df68c9f RD |
972 | Add pt's proprties to this and return the result. |
973 | """ | |
54f9ee45 | 974 | return _core_.RealPoint___add__(*args, **kwargs) |
e811c8ce RD |
975 | |
976 | def __sub__(*args, **kwargs): | |
0df68c9f | 977 | """ |
a95a7133 | 978 | __sub__(self, RealPoint pt) -> RealPoint |
e811c8ce | 979 | |
0df68c9f RD |
980 | Subtract pt's proprties from this and return the result |
981 | """ | |
54f9ee45 | 982 | return _core_.RealPoint___sub__(*args, **kwargs) |
e811c8ce RD |
983 | |
984 | def Set(*args, **kwargs): | |
0df68c9f | 985 | """ |
a95a7133 | 986 | Set(self, double x, double y) |
e811c8ce | 987 | |
0df68c9f RD |
988 | Set both the x and y properties |
989 | """ | |
54f9ee45 | 990 | return _core_.RealPoint_Set(*args, **kwargs) |
e811c8ce RD |
991 | |
992 | def Get(*args, **kwargs): | |
0df68c9f RD |
993 | """ |
994 | Get() -> (x,y) | |
e811c8ce | 995 | |
0df68c9f RD |
996 | Return the x and y properties as a tuple. |
997 | """ | |
54f9ee45 | 998 | return _core_.RealPoint_Get(*args, **kwargs) |
e811c8ce | 999 | |
41e2b43e | 1000 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce 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] | |
d14a1e28 | 1005 | def __setitem__(self, index, val): |
e811c8ce RD |
1006 | if index == 0: self.x = val |
1007 | elif index == 1: self.y = val | |
d14a1e28 | 1008 | else: raise IndexError |
e811c8ce | 1009 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1010 | __safe_for_unpickling__ = True |
1011 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
d14a1e28 RD |
1012 | |
1013 | ||
1014 | class RealPointPtr(RealPoint): | |
1015 | def __init__(self, this): | |
1016 | self.this = this | |
1017 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1018 | self.__class__ = RealPoint | |
54f9ee45 | 1019 | _core_.RealPoint_swigregister(RealPointPtr) |
d14a1e28 RD |
1020 | |
1021 | #--------------------------------------------------------------------------- | |
1022 | ||
1023 | class Point(object): | |
0df68c9f | 1024 | """ |
41e2b43e 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. | |
0df68c9f | 1028 | """ |
e811c8ce RD |
1029 | def __repr__(self): |
1030 | return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
54f9ee45 RD |
1031 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1032 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
d14a1e28 | 1033 | def __init__(self, *args, **kwargs): |
0df68c9f | 1034 | """ |
a95a7133 | 1035 | __init__(self, int x=0, int y=0) -> Point |
e811c8ce | 1036 | |
0df68c9f RD |
1037 | Create a wx.Point object |
1038 | """ | |
54f9ee45 | 1039 | newobj = _core_.new_Point(*args, **kwargs) |
d14a1e28 RD |
1040 | self.this = newobj.this |
1041 | self.thisown = 1 | |
1042 | del newobj.thisown | |
54f9ee45 | 1043 | def __del__(self, destroy=_core_.delete_Point): |
a95a7133 | 1044 | """__del__(self)""" |
d14a1e28 RD |
1045 | try: |
1046 | if self.thisown: destroy(self) | |
1047 | except: pass | |
e811c8ce RD |
1048 | |
1049 | def __eq__(*args, **kwargs): | |
0df68c9f | 1050 | """ |
a95a7133 | 1051 | __eq__(self, Point pt) -> bool |
e811c8ce | 1052 | |
0df68c9f RD |
1053 | Test for equality of wx.Point objects. |
1054 | """ | |
54f9ee45 | 1055 | return _core_.Point___eq__(*args, **kwargs) |
e811c8ce RD |
1056 | |
1057 | def __ne__(*args, **kwargs): | |
0df68c9f | 1058 | """ |
a95a7133 | 1059 | __ne__(self, Point pt) -> bool |
e811c8ce | 1060 | |
0df68c9f RD |
1061 | Test for inequality of wx.Point objects. |
1062 | """ | |
54f9ee45 | 1063 | return _core_.Point___ne__(*args, **kwargs) |
e811c8ce RD |
1064 | |
1065 | def __add__(*args, **kwargs): | |
0df68c9f | 1066 | """ |
a95a7133 | 1067 | __add__(self, Point pt) -> Point |
e811c8ce | 1068 | |
0df68c9f RD |
1069 | Add pt's proprties to this and return the result. |
1070 | """ | |
54f9ee45 | 1071 | return _core_.Point___add__(*args, **kwargs) |
e811c8ce RD |
1072 | |
1073 | def __sub__(*args, **kwargs): | |
0df68c9f | 1074 | """ |
a95a7133 | 1075 | __sub__(self, Point pt) -> Point |
e811c8ce | 1076 | |
0df68c9f RD |
1077 | Subtract pt's proprties from this and return the result |
1078 | """ | |
54f9ee45 | 1079 | return _core_.Point___sub__(*args, **kwargs) |
e811c8ce RD |
1080 | |
1081 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1082 | """ |
a95a7133 | 1083 | __iadd__(self, Point pt) -> Point |
e811c8ce | 1084 | |
0df68c9f RD |
1085 | Add pt to this object. |
1086 | """ | |
54f9ee45 | 1087 | return _core_.Point___iadd__(*args, **kwargs) |
e811c8ce RD |
1088 | |
1089 | def __isub__(*args, **kwargs): | |
0df68c9f | 1090 | """ |
a95a7133 | 1091 | __isub__(self, Point pt) -> Point |
e811c8ce | 1092 | |
0df68c9f RD |
1093 | Subtract pt from this object. |
1094 | """ | |
54f9ee45 | 1095 | return _core_.Point___isub__(*args, **kwargs) |
e811c8ce RD |
1096 | |
1097 | def Set(*args, **kwargs): | |
0df68c9f | 1098 | """ |
a95a7133 | 1099 | Set(self, long x, long y) |
e811c8ce | 1100 | |
0df68c9f RD |
1101 | Set both the x and y properties |
1102 | """ | |
54f9ee45 | 1103 | return _core_.Point_Set(*args, **kwargs) |
e811c8ce RD |
1104 | |
1105 | def Get(*args, **kwargs): | |
0df68c9f RD |
1106 | """ |
1107 | Get() -> (x,y) | |
e811c8ce | 1108 | |
0df68c9f RD |
1109 | Return the x and y properties as a tuple. |
1110 | """ | |
54f9ee45 | 1111 | return _core_.Point_Get(*args, **kwargs) |
e811c8ce | 1112 | |
41e2b43e | 1113 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce 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] | |
d14a1e28 RD |
1118 | def __setitem__(self, index, val): |
1119 | if index == 0: self.x = val | |
1120 | elif index == 1: self.y = val | |
1121 | else: raise IndexError | |
e811c8ce | 1122 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
1123 | __safe_for_unpickling__ = True |
1124 | def __reduce__(self): return (wx.Point, self.Get()) | |
d14a1e28 RD |
1125 | |
1126 | ||
1127 | class PointPtr(Point): | |
1128 | def __init__(self, this): | |
1129 | self.this = this | |
1130 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1131 | self.__class__ = Point | |
54f9ee45 | 1132 | _core_.Point_swigregister(PointPtr) |
d14a1e28 RD |
1133 | |
1134 | #--------------------------------------------------------------------------- | |
1135 | ||
1136 | class Rect(object): | |
0df68c9f | 1137 | """ |
41e2b43e 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. | |
0df68c9f | 1141 | """ |
e811c8ce RD |
1142 | def __repr__(self): |
1143 | return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 1144 | def __init__(self, *args, **kwargs): |
0df68c9f | 1145 | """ |
a95a7133 | 1146 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
e811c8ce | 1147 | |
0df68c9f RD |
1148 | Create a new Rect object. |
1149 | """ | |
54f9ee45 | 1150 | newobj = _core_.new_Rect(*args, **kwargs) |
d14a1e28 RD |
1151 | self.this = newobj.this |
1152 | self.thisown = 1 | |
1153 | del newobj.thisown | |
54f9ee45 | 1154 | def __del__(self, destroy=_core_.delete_Rect): |
a95a7133 | 1155 | """__del__(self)""" |
d14a1e28 RD |
1156 | try: |
1157 | if self.thisown: destroy(self) | |
1158 | except: pass | |
e811c8ce RD |
1159 | |
1160 | def GetX(*args, **kwargs): | |
a95a7133 | 1161 | """GetX(self) -> int""" |
54f9ee45 | 1162 | return _core_.Rect_GetX(*args, **kwargs) |
e811c8ce RD |
1163 | |
1164 | def SetX(*args, **kwargs): | |
a95a7133 | 1165 | """SetX(self, int x)""" |
54f9ee45 | 1166 | return _core_.Rect_SetX(*args, **kwargs) |
e811c8ce RD |
1167 | |
1168 | def GetY(*args, **kwargs): | |
a95a7133 | 1169 | """GetY(self) -> int""" |
54f9ee45 | 1170 | return _core_.Rect_GetY(*args, **kwargs) |
e811c8ce RD |
1171 | |
1172 | def SetY(*args, **kwargs): | |
a95a7133 | 1173 | """SetY(self, int y)""" |
54f9ee45 | 1174 | return _core_.Rect_SetY(*args, **kwargs) |
e811c8ce RD |
1175 | |
1176 | def GetWidth(*args, **kwargs): | |
a95a7133 | 1177 | """GetWidth(self) -> int""" |
54f9ee45 | 1178 | return _core_.Rect_GetWidth(*args, **kwargs) |
e811c8ce RD |
1179 | |
1180 | def SetWidth(*args, **kwargs): | |
a95a7133 | 1181 | """SetWidth(self, int w)""" |
54f9ee45 | 1182 | return _core_.Rect_SetWidth(*args, **kwargs) |
e811c8ce RD |
1183 | |
1184 | def GetHeight(*args, **kwargs): | |
a95a7133 | 1185 | """GetHeight(self) -> int""" |
54f9ee45 | 1186 | return _core_.Rect_GetHeight(*args, **kwargs) |
e811c8ce RD |
1187 | |
1188 | def SetHeight(*args, **kwargs): | |
a95a7133 | 1189 | """SetHeight(self, int h)""" |
54f9ee45 | 1190 | return _core_.Rect_SetHeight(*args, **kwargs) |
e811c8ce RD |
1191 | |
1192 | def GetPosition(*args, **kwargs): | |
a95a7133 | 1193 | """GetPosition(self) -> Point""" |
54f9ee45 | 1194 | return _core_.Rect_GetPosition(*args, **kwargs) |
e811c8ce RD |
1195 | |
1196 | def SetPosition(*args, **kwargs): | |
a95a7133 | 1197 | """SetPosition(self, Point p)""" |
54f9ee45 | 1198 | return _core_.Rect_SetPosition(*args, **kwargs) |
e811c8ce RD |
1199 | |
1200 | def GetSize(*args, **kwargs): | |
a95a7133 | 1201 | """GetSize(self) -> Size""" |
54f9ee45 | 1202 | return _core_.Rect_GetSize(*args, **kwargs) |
e811c8ce RD |
1203 | |
1204 | def SetSize(*args, **kwargs): | |
a95a7133 | 1205 | """SetSize(self, Size s)""" |
54f9ee45 | 1206 | return _core_.Rect_SetSize(*args, **kwargs) |
e811c8ce | 1207 | |
aff4cc5c RD |
1208 | def IsEmpty(*args, **kwargs): |
1209 | """IsEmpty(self) -> bool""" | |
1210 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1211 | ||
c9c7117a | 1212 | def GetTopLeft(*args, **kwargs): |
a95a7133 | 1213 | """GetTopLeft(self) -> Point""" |
54f9ee45 | 1214 | return _core_.Rect_GetTopLeft(*args, **kwargs) |
c9c7117a RD |
1215 | |
1216 | def SetTopLeft(*args, **kwargs): | |
a95a7133 | 1217 | """SetTopLeft(self, Point p)""" |
54f9ee45 | 1218 | return _core_.Rect_SetTopLeft(*args, **kwargs) |
c9c7117a RD |
1219 | |
1220 | def GetBottomRight(*args, **kwargs): | |
a95a7133 | 1221 | """GetBottomRight(self) -> Point""" |
54f9ee45 | 1222 | return _core_.Rect_GetBottomRight(*args, **kwargs) |
c9c7117a RD |
1223 | |
1224 | def SetBottomRight(*args, **kwargs): | |
a95a7133 | 1225 | """SetBottomRight(self, Point p)""" |
54f9ee45 | 1226 | return _core_.Rect_SetBottomRight(*args, **kwargs) |
c9c7117a | 1227 | |
e811c8ce | 1228 | def GetLeft(*args, **kwargs): |
a95a7133 | 1229 | """GetLeft(self) -> int""" |
54f9ee45 | 1230 | return _core_.Rect_GetLeft(*args, **kwargs) |
e811c8ce RD |
1231 | |
1232 | def GetTop(*args, **kwargs): | |
a95a7133 | 1233 | """GetTop(self) -> int""" |
54f9ee45 | 1234 | return _core_.Rect_GetTop(*args, **kwargs) |
e811c8ce RD |
1235 | |
1236 | def GetBottom(*args, **kwargs): | |
a95a7133 | 1237 | """GetBottom(self) -> int""" |
54f9ee45 | 1238 | return _core_.Rect_GetBottom(*args, **kwargs) |
e811c8ce RD |
1239 | |
1240 | def GetRight(*args, **kwargs): | |
a95a7133 | 1241 | """GetRight(self) -> int""" |
54f9ee45 | 1242 | return _core_.Rect_GetRight(*args, **kwargs) |
e811c8ce RD |
1243 | |
1244 | def SetLeft(*args, **kwargs): | |
a95a7133 | 1245 | """SetLeft(self, int left)""" |
54f9ee45 | 1246 | return _core_.Rect_SetLeft(*args, **kwargs) |
e811c8ce RD |
1247 | |
1248 | def SetRight(*args, **kwargs): | |
a95a7133 | 1249 | """SetRight(self, int right)""" |
54f9ee45 | 1250 | return _core_.Rect_SetRight(*args, **kwargs) |
e811c8ce RD |
1251 | |
1252 | def SetTop(*args, **kwargs): | |
a95a7133 | 1253 | """SetTop(self, int top)""" |
54f9ee45 | 1254 | return _core_.Rect_SetTop(*args, **kwargs) |
e811c8ce RD |
1255 | |
1256 | def SetBottom(*args, **kwargs): | |
a95a7133 | 1257 | """SetBottom(self, int bottom)""" |
54f9ee45 | 1258 | return _core_.Rect_SetBottom(*args, **kwargs) |
e811c8ce 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): | |
0df68c9f | 1268 | """ |
a95a7133 | 1269 | Inflate(self, int dx, int dy) -> Rect |
e811c8ce | 1270 | |
8e738329 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 | ||
0df68c9f | 1289 | """ |
54f9ee45 | 1290 | return _core_.Rect_Inflate(*args, **kwargs) |
e811c8ce RD |
1291 | |
1292 | def Deflate(*args, **kwargs): | |
0df68c9f | 1293 | """ |
a95a7133 | 1294 | Deflate(self, int dx, int dy) -> Rect |
e811c8ce | 1295 | |
8e738329 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. | |
0df68c9f | 1299 | """ |
54f9ee45 | 1300 | return _core_.Rect_Deflate(*args, **kwargs) |
e811c8ce RD |
1301 | |
1302 | def OffsetXY(*args, **kwargs): | |
0df68c9f | 1303 | """ |
a95a7133 | 1304 | OffsetXY(self, int dx, int dy) |
e811c8ce | 1305 | |
41e2b43e 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. | |
0df68c9f | 1309 | """ |
54f9ee45 | 1310 | return _core_.Rect_OffsetXY(*args, **kwargs) |
e811c8ce RD |
1311 | |
1312 | def Offset(*args, **kwargs): | |
0df68c9f | 1313 | """ |
a95a7133 | 1314 | Offset(self, Point pt) |
e811c8ce | 1315 | |
0df68c9f RD |
1316 | Same as OffsetXY but uses dx,dy from Point |
1317 | """ | |
54f9ee45 | 1318 | return _core_.Rect_Offset(*args, **kwargs) |
e811c8ce RD |
1319 | |
1320 | def Intersect(*args, **kwargs): | |
0df68c9f | 1321 | """ |
a95a7133 | 1322 | Intersect(self, Rect rect) -> Rect |
e811c8ce | 1323 | |
5cbf236d | 1324 | Returns the intersectsion of this rectangle and rect. |
0df68c9f | 1325 | """ |
54f9ee45 | 1326 | return _core_.Rect_Intersect(*args, **kwargs) |
e811c8ce | 1327 | |
5cbf236d RD |
1328 | def Union(*args, **kwargs): |
1329 | """ | |
1330 | Union(self, Rect rect) -> Rect | |
1331 | ||
1332 | Returns the union of this rectangle and rect. | |
1333 | """ | |
1334 | return _core_.Rect_Union(*args, **kwargs) | |
1335 | ||
e811c8ce | 1336 | def __add__(*args, **kwargs): |
0df68c9f | 1337 | """ |
a95a7133 | 1338 | __add__(self, Rect rect) -> Rect |
e811c8ce | 1339 | |
0df68c9f RD |
1340 | Add the properties of rect to this rectangle and return the result. |
1341 | """ | |
54f9ee45 | 1342 | return _core_.Rect___add__(*args, **kwargs) |
e811c8ce RD |
1343 | |
1344 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1345 | """ |
a95a7133 | 1346 | __iadd__(self, Rect rect) -> Rect |
e811c8ce | 1347 | |
0df68c9f RD |
1348 | Add the properties of rect to this rectangle, updating this rectangle. |
1349 | """ | |
54f9ee45 | 1350 | return _core_.Rect___iadd__(*args, **kwargs) |
e811c8ce RD |
1351 | |
1352 | def __eq__(*args, **kwargs): | |
0df68c9f | 1353 | """ |
a95a7133 | 1354 | __eq__(self, Rect rect) -> bool |
e811c8ce | 1355 | |
0df68c9f RD |
1356 | Test for equality. |
1357 | """ | |
54f9ee45 | 1358 | return _core_.Rect___eq__(*args, **kwargs) |
e811c8ce RD |
1359 | |
1360 | def __ne__(*args, **kwargs): | |
0df68c9f | 1361 | """ |
a95a7133 | 1362 | __ne__(self, Rect rect) -> bool |
e811c8ce | 1363 | |
0df68c9f RD |
1364 | Test for inequality. |
1365 | """ | |
54f9ee45 | 1366 | return _core_.Rect___ne__(*args, **kwargs) |
e811c8ce RD |
1367 | |
1368 | def InsideXY(*args, **kwargs): | |
0df68c9f | 1369 | """ |
a95a7133 | 1370 | InsideXY(self, int x, int y) -> bool |
e811c8ce | 1371 | |
0df68c9f RD |
1372 | Return True if the point is (not strcitly) inside the rect. |
1373 | """ | |
54f9ee45 | 1374 | return _core_.Rect_InsideXY(*args, **kwargs) |
e811c8ce RD |
1375 | |
1376 | def Inside(*args, **kwargs): | |
0df68c9f | 1377 | """ |
a95a7133 | 1378 | Inside(self, Point pt) -> bool |
e811c8ce | 1379 | |
0df68c9f RD |
1380 | Return True if the point is (not strcitly) inside the rect. |
1381 | """ | |
54f9ee45 | 1382 | return _core_.Rect_Inside(*args, **kwargs) |
e811c8ce RD |
1383 | |
1384 | def Intersects(*args, **kwargs): | |
0df68c9f | 1385 | """ |
a95a7133 | 1386 | Intersects(self, Rect rect) -> bool |
e811c8ce | 1387 | |
0df68c9f RD |
1388 | Returns True if the rectangles have a non empty intersection. |
1389 | """ | |
54f9ee45 | 1390 | return _core_.Rect_Intersects(*args, **kwargs) |
e811c8ce | 1391 | |
54f9ee45 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) | |
e811c8ce | 1396 | def Set(*args, **kwargs): |
0df68c9f | 1397 | """ |
a95a7133 | 1398 | Set(self, int x=0, int y=0, int width=0, int height=0) |
e811c8ce | 1399 | |
0df68c9f RD |
1400 | Set all rectangle properties. |
1401 | """ | |
54f9ee45 | 1402 | return _core_.Rect_Set(*args, **kwargs) |
e811c8ce RD |
1403 | |
1404 | def Get(*args, **kwargs): | |
0df68c9f RD |
1405 | """ |
1406 | Get() -> (x,y,width,height) | |
e811c8ce | 1407 | |
0df68c9f RD |
1408 | Return the rectangle properties as a tuple. |
1409 | """ | |
54f9ee45 | 1410 | return _core_.Rect_Get(*args, **kwargs) |
e811c8ce | 1411 | |
41e2b43e | 1412 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce 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] | |
d14a1e28 RD |
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 | |
e811c8ce | 1423 | def __nonzero__(self): return self.Get() != (0,0,0,0) |
74e96f3d RD |
1424 | __safe_for_unpickling__ = True |
1425 | def __reduce__(self): return (wx.Rect, self.Get()) | |
d14a1e28 RD |
1426 | |
1427 | ||
1428 | class RectPtr(Rect): | |
1429 | def __init__(self, this): | |
1430 | self.this = this | |
1431 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1432 | self.__class__ = Rect | |
54f9ee45 | 1433 | _core_.Rect_swigregister(RectPtr) |
d14a1e28 RD |
1434 | |
1435 | def RectPP(*args, **kwargs): | |
0df68c9f RD |
1436 | """ |
1437 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
e811c8ce | 1438 | |
0df68c9f RD |
1439 | Create a new Rect object from Points representing two corners. |
1440 | """ | |
54f9ee45 | 1441 | val = _core_.new_RectPP(*args, **kwargs) |
d14a1e28 RD |
1442 | val.thisown = 1 |
1443 | return val | |
1444 | ||
1445 | def RectPS(*args, **kwargs): | |
0df68c9f RD |
1446 | """ |
1447 | RectPS(Point pos, Size size) -> Rect | |
e811c8ce | 1448 | |
0df68c9f RD |
1449 | Create a new Rect from a position and size. |
1450 | """ | |
54f9ee45 | 1451 | val = _core_.new_RectPS(*args, **kwargs) |
d14a1e28 RD |
1452 | val.thisown = 1 |
1453 | return val | |
1454 | ||
d3b6e4ff RD |
1455 | def RectS(*args, **kwargs): |
1456 | """ | |
1457 | RectS(Size size) -> Rect | |
1458 | ||
1459 | Create a new Rect from a size only. | |
1460 | """ | |
1461 | val = _core_.new_RectS(*args, **kwargs) | |
1462 | val.thisown = 1 | |
1463 | return val | |
1464 | ||
d14a1e28 | 1465 | |
e811c8ce | 1466 | def IntersectRect(*args, **kwargs): |
0df68c9f RD |
1467 | """ |
1468 | IntersectRect(Rect r1, Rect r2) -> Rect | |
e811c8ce | 1469 | |
0df68c9f RD |
1470 | Calculate and return the intersection of r1 and r2. |
1471 | """ | |
54f9ee45 | 1472 | return _core_.IntersectRect(*args, **kwargs) |
d14a1e28 RD |
1473 | #--------------------------------------------------------------------------- |
1474 | ||
1475 | class Point2D(object): | |
41e2b43e RD |
1476 | """ |
1477 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1478 | with floating point values. | |
1479 | """ | |
e811c8ce RD |
1480 | def __repr__(self): |
1481 | return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 1482 | def __init__(self, *args, **kwargs): |
0df68c9f | 1483 | """ |
a95a7133 | 1484 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
e811c8ce | 1485 | |
0df68c9f RD |
1486 | Create a w.Point2D object. |
1487 | """ | |
54f9ee45 | 1488 | newobj = _core_.new_Point2D(*args, **kwargs) |
d14a1e28 RD |
1489 | self.this = newobj.this |
1490 | self.thisown = 1 | |
1491 | del newobj.thisown | |
e811c8ce | 1492 | def GetFloor(*args, **kwargs): |
fd2dc343 RD |
1493 | """ |
1494 | GetFloor() -> (x,y) | |
1495 | ||
1496 | Convert to integer | |
1497 | """ | |
54f9ee45 | 1498 | return _core_.Point2D_GetFloor(*args, **kwargs) |
e811c8ce RD |
1499 | |
1500 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1501 | """ |
1502 | GetRounded() -> (x,y) | |
1503 | ||
1504 | Convert to integer | |
1505 | """ | |
54f9ee45 | 1506 | return _core_.Point2D_GetRounded(*args, **kwargs) |
e811c8ce RD |
1507 | |
1508 | def GetVectorLength(*args, **kwargs): | |
a95a7133 | 1509 | """GetVectorLength(self) -> double""" |
54f9ee45 | 1510 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
e811c8ce RD |
1511 | |
1512 | def GetVectorAngle(*args, **kwargs): | |
a95a7133 | 1513 | """GetVectorAngle(self) -> double""" |
54f9ee45 | 1514 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
e811c8ce RD |
1515 | |
1516 | def SetVectorLength(*args, **kwargs): | |
a95a7133 | 1517 | """SetVectorLength(self, double length)""" |
54f9ee45 | 1518 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
e811c8ce RD |
1519 | |
1520 | def SetVectorAngle(*args, **kwargs): | |
a95a7133 | 1521 | """SetVectorAngle(self, double degrees)""" |
54f9ee45 | 1522 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
e811c8ce | 1523 | |
d14a1e28 RD |
1524 | def SetPolarCoordinates(self, angle, length): |
1525 | self.SetVectorLength(length) | |
1526 | self.SetVectorAngle(angle) | |
1527 | def Normalize(self): | |
1528 | self.SetVectorLength(1.0) | |
1529 | ||
e811c8ce | 1530 | def GetDistance(*args, **kwargs): |
a95a7133 | 1531 | """GetDistance(self, Point2D pt) -> double""" |
54f9ee45 | 1532 | return _core_.Point2D_GetDistance(*args, **kwargs) |
e811c8ce RD |
1533 | |
1534 | def GetDistanceSquare(*args, **kwargs): | |
a95a7133 | 1535 | """GetDistanceSquare(self, Point2D pt) -> double""" |
54f9ee45 | 1536 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) |
e811c8ce RD |
1537 | |
1538 | def GetDotProduct(*args, **kwargs): | |
a95a7133 | 1539 | """GetDotProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1540 | return _core_.Point2D_GetDotProduct(*args, **kwargs) |
e811c8ce RD |
1541 | |
1542 | def GetCrossProduct(*args, **kwargs): | |
a95a7133 | 1543 | """GetCrossProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1544 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) |
e811c8ce RD |
1545 | |
1546 | def __neg__(*args, **kwargs): | |
0df68c9f | 1547 | """ |
a95a7133 | 1548 | __neg__(self) -> Point2D |
e811c8ce | 1549 | |
0df68c9f RD |
1550 | the reflection of this point |
1551 | """ | |
54f9ee45 | 1552 | return _core_.Point2D___neg__(*args, **kwargs) |
e811c8ce RD |
1553 | |
1554 | def __iadd__(*args, **kwargs): | |
a95a7133 | 1555 | """__iadd__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1556 | return _core_.Point2D___iadd__(*args, **kwargs) |
e811c8ce RD |
1557 | |
1558 | def __isub__(*args, **kwargs): | |
a95a7133 | 1559 | """__isub__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1560 | return _core_.Point2D___isub__(*args, **kwargs) |
e811c8ce RD |
1561 | |
1562 | def __imul__(*args, **kwargs): | |
a95a7133 | 1563 | """__imul__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1564 | return _core_.Point2D___imul__(*args, **kwargs) |
e811c8ce RD |
1565 | |
1566 | def __idiv__(*args, **kwargs): | |
a95a7133 | 1567 | """__idiv__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1568 | return _core_.Point2D___idiv__(*args, **kwargs) |
e811c8ce RD |
1569 | |
1570 | def __eq__(*args, **kwargs): | |
0df68c9f | 1571 | """ |
a95a7133 | 1572 | __eq__(self, Point2D pt) -> bool |
e811c8ce | 1573 | |
0df68c9f RD |
1574 | Test for equality |
1575 | """ | |
54f9ee45 | 1576 | return _core_.Point2D___eq__(*args, **kwargs) |
e811c8ce RD |
1577 | |
1578 | def __ne__(*args, **kwargs): | |
0df68c9f | 1579 | """ |
a95a7133 | 1580 | __ne__(self, Point2D pt) -> bool |
e811c8ce | 1581 | |
0df68c9f RD |
1582 | Test for inequality |
1583 | """ | |
54f9ee45 | 1584 | return _core_.Point2D___ne__(*args, **kwargs) |
e811c8ce | 1585 | |
54f9ee45 RD |
1586 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1587 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
e811c8ce | 1588 | def Set(*args, **kwargs): |
a95a7133 | 1589 | """Set(self, double x=0, double y=0)""" |
54f9ee45 | 1590 | return _core_.Point2D_Set(*args, **kwargs) |
e811c8ce RD |
1591 | |
1592 | def Get(*args, **kwargs): | |
0df68c9f RD |
1593 | """ |
1594 | Get() -> (x,y) | |
e811c8ce | 1595 | |
0df68c9f RD |
1596 | Return x and y properties as a tuple. |
1597 | """ | |
54f9ee45 | 1598 | return _core_.Point2D_Get(*args, **kwargs) |
e811c8ce | 1599 | |
41e2b43e | 1600 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce 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] | |
d14a1e28 | 1605 | def __setitem__(self, index, val): |
e811c8ce RD |
1606 | if index == 0: self.x = val |
1607 | elif index == 1: self.y = val | |
d14a1e28 | 1608 | else: raise IndexError |
e811c8ce | 1609 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1610 | __safe_for_unpickling__ = True |
1611 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
d14a1e28 RD |
1612 | |
1613 | ||
1614 | class Point2DPtr(Point2D): | |
1615 | def __init__(self, this): | |
1616 | self.this = this | |
1617 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1618 | self.__class__ = Point2D | |
54f9ee45 | 1619 | _core_.Point2D_swigregister(Point2DPtr) |
d14a1e28 RD |
1620 | |
1621 | def Point2DCopy(*args, **kwargs): | |
0df68c9f RD |
1622 | """ |
1623 | Point2DCopy(Point2D pt) -> Point2D | |
e811c8ce | 1624 | |
0df68c9f RD |
1625 | Create a w.Point2D object. |
1626 | """ | |
54f9ee45 | 1627 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d14a1e28 RD |
1628 | val.thisown = 1 |
1629 | return val | |
1630 | ||
1631 | def Point2DFromPoint(*args, **kwargs): | |
0df68c9f RD |
1632 | """ |
1633 | Point2DFromPoint(Point pt) -> Point2D | |
e811c8ce | 1634 | |
0df68c9f RD |
1635 | Create a w.Point2D object. |
1636 | """ | |
54f9ee45 | 1637 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d14a1e28 RD |
1638 | val.thisown = 1 |
1639 | return val | |
1640 | ||
1641 | #--------------------------------------------------------------------------- | |
1642 | ||
54f9ee45 RD |
1643 | FromStart = _core_.FromStart |
1644 | FromCurrent = _core_.FromCurrent | |
1645 | FromEnd = _core_.FromEnd | |
d14a1e28 | 1646 | class InputStream(object): |
093d3ff1 | 1647 | """Proxy of C++ InputStream class""" |
e811c8ce RD |
1648 | def __repr__(self): |
1649 | return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 1650 | def __init__(self, *args, **kwargs): |
a95a7133 | 1651 | """__init__(self, PyObject p) -> InputStream""" |
54f9ee45 | 1652 | newobj = _core_.new_InputStream(*args, **kwargs) |
d14a1e28 RD |
1653 | self.this = newobj.this |
1654 | self.thisown = 1 | |
1655 | del newobj.thisown | |
8fb0e70a RD |
1656 | def __del__(self, destroy=_core_.delete_InputStream): |
1657 | """__del__(self)""" | |
1658 | try: | |
1659 | if self.thisown: destroy(self) | |
1660 | except: pass | |
1661 | ||
e811c8ce | 1662 | def close(*args, **kwargs): |
a95a7133 | 1663 | """close(self)""" |
54f9ee45 | 1664 | return _core_.InputStream_close(*args, **kwargs) |
e811c8ce RD |
1665 | |
1666 | def flush(*args, **kwargs): | |
a95a7133 | 1667 | """flush(self)""" |
54f9ee45 | 1668 | return _core_.InputStream_flush(*args, **kwargs) |
e811c8ce RD |
1669 | |
1670 | def eof(*args, **kwargs): | |
a95a7133 | 1671 | """eof(self) -> bool""" |
54f9ee45 | 1672 | return _core_.InputStream_eof(*args, **kwargs) |
e811c8ce RD |
1673 | |
1674 | def read(*args, **kwargs): | |
a95a7133 | 1675 | """read(self, int size=-1) -> PyObject""" |
54f9ee45 | 1676 | return _core_.InputStream_read(*args, **kwargs) |
e811c8ce RD |
1677 | |
1678 | def readline(*args, **kwargs): | |
a95a7133 | 1679 | """readline(self, int size=-1) -> PyObject""" |
54f9ee45 | 1680 | return _core_.InputStream_readline(*args, **kwargs) |
e811c8ce RD |
1681 | |
1682 | def readlines(*args, **kwargs): | |
a95a7133 | 1683 | """readlines(self, int sizehint=-1) -> PyObject""" |
54f9ee45 | 1684 | return _core_.InputStream_readlines(*args, **kwargs) |
e811c8ce RD |
1685 | |
1686 | def seek(*args, **kwargs): | |
a95a7133 | 1687 | """seek(self, int offset, int whence=0)""" |
54f9ee45 | 1688 | return _core_.InputStream_seek(*args, **kwargs) |
e811c8ce RD |
1689 | |
1690 | def tell(*args, **kwargs): | |
a95a7133 | 1691 | """tell(self) -> int""" |
54f9ee45 | 1692 | return _core_.InputStream_tell(*args, **kwargs) |
e811c8ce RD |
1693 | |
1694 | def Peek(*args, **kwargs): | |
a95a7133 | 1695 | """Peek(self) -> char""" |
54f9ee45 | 1696 | return _core_.InputStream_Peek(*args, **kwargs) |
e811c8ce RD |
1697 | |
1698 | def GetC(*args, **kwargs): | |
a95a7133 | 1699 | """GetC(self) -> char""" |
54f9ee45 | 1700 | return _core_.InputStream_GetC(*args, **kwargs) |
e811c8ce RD |
1701 | |
1702 | def LastRead(*args, **kwargs): | |
a95a7133 | 1703 | """LastRead(self) -> size_t""" |
54f9ee45 | 1704 | return _core_.InputStream_LastRead(*args, **kwargs) |
e811c8ce RD |
1705 | |
1706 | def CanRead(*args, **kwargs): | |
a95a7133 | 1707 | """CanRead(self) -> bool""" |
54f9ee45 | 1708 | return _core_.InputStream_CanRead(*args, **kwargs) |
e811c8ce RD |
1709 | |
1710 | def Eof(*args, **kwargs): | |
a95a7133 | 1711 | """Eof(self) -> bool""" |
54f9ee45 | 1712 | return _core_.InputStream_Eof(*args, **kwargs) |
e811c8ce RD |
1713 | |
1714 | def Ungetch(*args, **kwargs): | |
a95a7133 | 1715 | """Ungetch(self, char c) -> bool""" |
54f9ee45 | 1716 | return _core_.InputStream_Ungetch(*args, **kwargs) |
e811c8ce RD |
1717 | |
1718 | def SeekI(*args, **kwargs): | |
a95a7133 | 1719 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
54f9ee45 | 1720 | return _core_.InputStream_SeekI(*args, **kwargs) |
e811c8ce RD |
1721 | |
1722 | def TellI(*args, **kwargs): | |
a95a7133 | 1723 | """TellI(self) -> long""" |
54f9ee45 | 1724 | return _core_.InputStream_TellI(*args, **kwargs) |
e811c8ce | 1725 | |
d14a1e28 RD |
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 | |
54f9ee45 | 1732 | _core_.InputStream_swigregister(InputStreamPtr) |
d14a1e28 RD |
1733 | DefaultPosition = cvar.DefaultPosition |
1734 | DefaultSize = cvar.DefaultSize | |
1735 | ||
1736 | class OutputStream(object): | |
093d3ff1 | 1737 | """Proxy of C++ OutputStream class""" |
d14a1e28 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,) | |
e811c8ce | 1741 | def write(*args, **kwargs): |
a95a7133 | 1742 | """write(self, PyObject obj)""" |
54f9ee45 | 1743 | return _core_.OutputStream_write(*args, **kwargs) |
e811c8ce | 1744 | |
d14a1e28 RD |
1745 | |
1746 | class OutputStreamPtr(OutputStream): | |
1747 | def __init__(self, this): | |
1748 | self.this = this | |
1749 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1750 | self.__class__ = OutputStream | |
54f9ee45 | 1751 | _core_.OutputStream_swigregister(OutputStreamPtr) |
d14a1e28 RD |
1752 | |
1753 | #--------------------------------------------------------------------------- | |
1754 | ||
1755 | class FSFile(Object): | |
093d3ff1 | 1756 | """Proxy of C++ FSFile class""" |
e811c8ce RD |
1757 | def __repr__(self): |
1758 | return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 1759 | def __init__(self, *args, **kwargs): |
0df68c9f | 1760 | """ |
a95a7133 | 1761 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
196addbf | 1762 | DateTime modif) -> FSFile |
0df68c9f | 1763 | """ |
54f9ee45 | 1764 | newobj = _core_.new_FSFile(*args, **kwargs) |
d14a1e28 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 | |
54f9ee45 | 1770 | def __del__(self, destroy=_core_.delete_FSFile): |
a95a7133 | 1771 | """__del__(self)""" |
d14a1e28 RD |
1772 | try: |
1773 | if self.thisown: destroy(self) | |
1774 | except: pass | |
e811c8ce RD |
1775 | |
1776 | def GetStream(*args, **kwargs): | |
a95a7133 | 1777 | """GetStream(self) -> InputStream""" |
54f9ee45 | 1778 | return _core_.FSFile_GetStream(*args, **kwargs) |
e811c8ce RD |
1779 | |
1780 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 1781 | """GetMimeType(self) -> String""" |
54f9ee45 | 1782 | return _core_.FSFile_GetMimeType(*args, **kwargs) |
e811c8ce RD |
1783 | |
1784 | def GetLocation(*args, **kwargs): | |
a95a7133 | 1785 | """GetLocation(self) -> String""" |
54f9ee45 | 1786 | return _core_.FSFile_GetLocation(*args, **kwargs) |
e811c8ce RD |
1787 | |
1788 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1789 | """GetAnchor(self) -> String""" |
54f9ee45 | 1790 | return _core_.FSFile_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1791 | |
1792 | def GetModificationTime(*args, **kwargs): | |
a95a7133 | 1793 | """GetModificationTime(self) -> DateTime""" |
54f9ee45 | 1794 | return _core_.FSFile_GetModificationTime(*args, **kwargs) |
e811c8ce | 1795 | |
d14a1e28 RD |
1796 | |
1797 | class FSFilePtr(FSFile): | |
1798 | def __init__(self, this): | |
1799 | self.this = this | |
1800 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1801 | self.__class__ = FSFile | |
54f9ee45 | 1802 | _core_.FSFile_swigregister(FSFilePtr) |
d14a1e28 RD |
1803 | |
1804 | class CPPFileSystemHandler(object): | |
093d3ff1 | 1805 | """Proxy of C++ CPPFileSystemHandler class""" |
d14a1e28 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 | |
54f9ee45 | 1815 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr) |
d14a1e28 RD |
1816 | |
1817 | class FileSystemHandler(CPPFileSystemHandler): | |
093d3ff1 | 1818 | """Proxy of C++ FileSystemHandler class""" |
e811c8ce RD |
1819 | def __repr__(self): |
1820 | return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 1821 | def __init__(self, *args, **kwargs): |
a95a7133 | 1822 | """__init__(self) -> FileSystemHandler""" |
54f9ee45 | 1823 | newobj = _core_.new_FileSystemHandler(*args, **kwargs) |
d14a1e28 RD |
1824 | self.this = newobj.this |
1825 | self.thisown = 1 | |
1826 | del newobj.thisown | |
1827 | self._setCallbackInfo(self, FileSystemHandler) | |
e811c8ce RD |
1828 | |
1829 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 1830 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 1831 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
1832 | |
1833 | def CanOpen(*args, **kwargs): | |
a95a7133 | 1834 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1835 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1836 | |
1837 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1838 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1839 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1840 | |
1841 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1842 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1843 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1844 | |
1845 | def FindNext(*args, **kwargs): | |
a95a7133 | 1846 | """FindNext(self) -> String""" |
54f9ee45 | 1847 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) |
e811c8ce RD |
1848 | |
1849 | def GetProtocol(*args, **kwargs): | |
a95a7133 | 1850 | """GetProtocol(self, String location) -> String""" |
54f9ee45 | 1851 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) |
e811c8ce RD |
1852 | |
1853 | def GetLeftLocation(*args, **kwargs): | |
a95a7133 | 1854 | """GetLeftLocation(self, String location) -> String""" |
54f9ee45 | 1855 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) |
e811c8ce RD |
1856 | |
1857 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1858 | """GetAnchor(self, String location) -> String""" |
54f9ee45 | 1859 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1860 | |
1861 | def GetRightLocation(*args, **kwargs): | |
a95a7133 | 1862 | """GetRightLocation(self, String location) -> String""" |
54f9ee45 | 1863 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) |
e811c8ce RD |
1864 | |
1865 | def GetMimeTypeFromExt(*args, **kwargs): | |
a95a7133 | 1866 | """GetMimeTypeFromExt(self, String location) -> String""" |
54f9ee45 | 1867 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) |
e811c8ce | 1868 | |
d14a1e28 RD |
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 | |
54f9ee45 | 1875 | _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr) |
d14a1e28 RD |
1876 | |
1877 | class FileSystem(Object): | |
093d3ff1 | 1878 | """Proxy of C++ FileSystem class""" |
e811c8ce RD |
1879 | def __repr__(self): |
1880 | return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 1881 | def __init__(self, *args, **kwargs): |
a95a7133 | 1882 | """__init__(self) -> FileSystem""" |
54f9ee45 | 1883 | newobj = _core_.new_FileSystem(*args, **kwargs) |
d14a1e28 RD |
1884 | self.this = newobj.this |
1885 | self.thisown = 1 | |
1886 | del newobj.thisown | |
54f9ee45 | 1887 | def __del__(self, destroy=_core_.delete_FileSystem): |
a95a7133 | 1888 | """__del__(self)""" |
d14a1e28 RD |
1889 | try: |
1890 | if self.thisown: destroy(self) | |
1891 | except: pass | |
e811c8ce RD |
1892 | |
1893 | def ChangePathTo(*args, **kwargs): | |
a95a7133 | 1894 | """ChangePathTo(self, String location, bool is_dir=False)""" |
54f9ee45 | 1895 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) |
e811c8ce RD |
1896 | |
1897 | def GetPath(*args, **kwargs): | |
a95a7133 | 1898 | """GetPath(self) -> String""" |
54f9ee45 | 1899 | return _core_.FileSystem_GetPath(*args, **kwargs) |
e811c8ce RD |
1900 | |
1901 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1902 | """OpenFile(self, String location) -> FSFile""" |
54f9ee45 | 1903 | return _core_.FileSystem_OpenFile(*args, **kwargs) |
e811c8ce RD |
1904 | |
1905 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1906 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1907 | return _core_.FileSystem_FindFirst(*args, **kwargs) |
e811c8ce RD |
1908 | |
1909 | def FindNext(*args, **kwargs): | |
a95a7133 | 1910 | """FindNext(self) -> String""" |
54f9ee45 | 1911 | return _core_.FileSystem_FindNext(*args, **kwargs) |
e811c8ce RD |
1912 | |
1913 | def AddHandler(*args, **kwargs): | |
66c033b4 | 1914 | """AddHandler(CPPFileSystemHandler handler)""" |
54f9ee45 | 1915 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
e811c8ce RD |
1916 | |
1917 | AddHandler = staticmethod(AddHandler) | |
1918 | def CleanUpHandlers(*args, **kwargs): | |
66c033b4 | 1919 | """CleanUpHandlers()""" |
54f9ee45 | 1920 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
e811c8ce RD |
1921 | |
1922 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1923 | def FileNameToURL(*args, **kwargs): | |
66c033b4 | 1924 | """FileNameToURL(String filename) -> String""" |
54f9ee45 | 1925 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
e811c8ce RD |
1926 | |
1927 | FileNameToURL = staticmethod(FileNameToURL) | |
2ef75293 RD |
1928 | def URLToFileName(*args, **kwargs): |
1929 | """URLToFileName(String url) -> String""" | |
1930 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
1931 | ||
1932 | URLToFileName = staticmethod(URLToFileName) | |
d14a1e28 RD |
1933 | |
1934 | class FileSystemPtr(FileSystem): | |
1935 | def __init__(self, this): | |
1936 | self.this = this | |
1937 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1938 | self.__class__ = FileSystem | |
54f9ee45 | 1939 | _core_.FileSystem_swigregister(FileSystemPtr) |
d14a1e28 | 1940 | |
e811c8ce RD |
1941 | def FileSystem_AddHandler(*args, **kwargs): |
1942 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" | |
54f9ee45 | 1943 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
d14a1e28 | 1944 | |
e811c8ce RD |
1945 | def FileSystem_CleanUpHandlers(*args, **kwargs): |
1946 | """FileSystem_CleanUpHandlers()""" | |
54f9ee45 | 1947 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
d14a1e28 | 1948 | |
e811c8ce | 1949 | def FileSystem_FileNameToURL(*args, **kwargs): |
196addbf | 1950 | """FileSystem_FileNameToURL(String filename) -> String""" |
54f9ee45 | 1951 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
d14a1e28 | 1952 | |
e811c8ce | 1953 | def FileSystem_URLToFileName(*args, **kwargs): |
196addbf | 1954 | """FileSystem_URLToFileName(String url) -> String""" |
54f9ee45 | 1955 | return _core_.FileSystem_URLToFileName(*args, **kwargs) |
2ef75293 | 1956 | |
d14a1e28 | 1957 | class InternetFSHandler(CPPFileSystemHandler): |
093d3ff1 | 1958 | """Proxy of C++ InternetFSHandler class""" |
e811c8ce RD |
1959 | def __repr__(self): |
1960 | return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 1961 | def __init__(self, *args, **kwargs): |
a95a7133 | 1962 | """__init__(self) -> InternetFSHandler""" |
54f9ee45 | 1963 | newobj = _core_.new_InternetFSHandler(*args, **kwargs) |
d14a1e28 RD |
1964 | self.this = newobj.this |
1965 | self.thisown = 1 | |
1966 | del newobj.thisown | |
e811c8ce | 1967 | def CanOpen(*args, **kwargs): |
a95a7133 | 1968 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1969 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1970 | |
1971 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1972 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1973 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) |
e811c8ce | 1974 | |
d14a1e28 RD |
1975 | |
1976 | class InternetFSHandlerPtr(InternetFSHandler): | |
1977 | def __init__(self, this): | |
1978 | self.this = this | |
1979 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1980 | self.__class__ = InternetFSHandler | |
54f9ee45 | 1981 | _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr) |
d14a1e28 RD |
1982 | |
1983 | class ZipFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1984 | """Proxy of C++ ZipFSHandler class""" |
e811c8ce RD |
1985 | def __repr__(self): |
1986 | return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 1987 | def __init__(self, *args, **kwargs): |
a95a7133 | 1988 | """__init__(self) -> ZipFSHandler""" |
54f9ee45 | 1989 | newobj = _core_.new_ZipFSHandler(*args, **kwargs) |
d14a1e28 RD |
1990 | self.this = newobj.this |
1991 | self.thisown = 1 | |
1992 | del newobj.thisown | |
e811c8ce | 1993 | def CanOpen(*args, **kwargs): |
a95a7133 | 1994 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1995 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1996 | |
1997 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1998 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1999 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
2000 | |
2001 | def FindFirst(*args, **kwargs): | |
a95a7133 | 2002 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 2003 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
2004 | |
2005 | def FindNext(*args, **kwargs): | |
a95a7133 | 2006 | """FindNext(self) -> String""" |
54f9ee45 | 2007 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 2008 | |
d14a1e28 RD |
2009 | |
2010 | class ZipFSHandlerPtr(ZipFSHandler): | |
2011 | def __init__(self, this): | |
2012 | self.this = this | |
2013 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2014 | self.__class__ = ZipFSHandler | |
54f9ee45 | 2015 | _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr) |
d14a1e28 RD |
2016 | |
2017 | ||
e811c8ce | 2018 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): |
196addbf | 2019 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
54f9ee45 | 2020 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) |
d14a1e28 | 2021 | |
e811c8ce | 2022 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): |
196addbf | 2023 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
54f9ee45 | 2024 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) |
d14a1e28 | 2025 | |
e811c8ce | 2026 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): |
196addbf | 2027 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
54f9ee45 | 2028 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) |
2ef75293 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' | |
d14a1e28 RD |
2045 | |
2046 | class MemoryFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 2047 | """Proxy of C++ MemoryFSHandler class""" |
e811c8ce RD |
2048 | def __repr__(self): |
2049 | return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 2050 | def __init__(self, *args, **kwargs): |
a95a7133 | 2051 | """__init__(self) -> MemoryFSHandler""" |
54f9ee45 | 2052 | newobj = _core_.new_MemoryFSHandler(*args, **kwargs) |
d14a1e28 RD |
2053 | self.this = newobj.this |
2054 | self.thisown = 1 | |
2055 | del newobj.thisown | |
e811c8ce | 2056 | def RemoveFile(*args, **kwargs): |
66c033b4 | 2057 | """RemoveFile(String filename)""" |
54f9ee45 | 2058 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
e811c8ce RD |
2059 | |
2060 | RemoveFile = staticmethod(RemoveFile) | |
d14a1e28 | 2061 | AddFile = staticmethod(MemoryFSHandler_AddFile) |
e811c8ce | 2062 | def CanOpen(*args, **kwargs): |
a95a7133 | 2063 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 2064 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
2065 | |
2066 | def OpenFile(*args, **kwargs): | |
a95a7133 | 2067 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 2068 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
2069 | |
2070 | def FindFirst(*args, **kwargs): | |
a95a7133 | 2071 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 2072 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
2073 | |
2074 | def FindNext(*args, **kwargs): | |
a95a7133 | 2075 | """FindNext(self) -> String""" |
54f9ee45 | 2076 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 2077 | |
d14a1e28 RD |
2078 | |
2079 | class MemoryFSHandlerPtr(MemoryFSHandler): | |
2080 | def __init__(self, this): | |
2081 | self.this = this | |
2082 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2083 | self.__class__ = MemoryFSHandler | |
54f9ee45 | 2084 | _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr) |
d14a1e28 | 2085 | |
e811c8ce | 2086 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
196addbf | 2087 | """MemoryFSHandler_RemoveFile(String filename)""" |
54f9ee45 | 2088 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
d14a1e28 | 2089 | |
bcd0d7b6 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 | |
d14a1e28 RD |
2093 | #--------------------------------------------------------------------------- |
2094 | ||
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 | """ | |
d14a1e28 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,) | |
e811c8ce | 2104 | def GetName(*args, **kwargs): |
a95a7133 | 2105 | """GetName(self) -> String""" |
54f9ee45 | 2106 | return _core_.ImageHandler_GetName(*args, **kwargs) |
e811c8ce RD |
2107 | |
2108 | def GetExtension(*args, **kwargs): | |
a95a7133 | 2109 | """GetExtension(self) -> String""" |
54f9ee45 | 2110 | return _core_.ImageHandler_GetExtension(*args, **kwargs) |
e811c8ce RD |
2111 | |
2112 | def GetType(*args, **kwargs): | |
a95a7133 | 2113 | """GetType(self) -> long""" |
54f9ee45 | 2114 | return _core_.ImageHandler_GetType(*args, **kwargs) |
e811c8ce RD |
2115 | |
2116 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 2117 | """GetMimeType(self) -> String""" |
54f9ee45 | 2118 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) |
e811c8ce RD |
2119 | |
2120 | def CanRead(*args, **kwargs): | |
a95a7133 | 2121 | """CanRead(self, String name) -> bool""" |
54f9ee45 | 2122 | return _core_.ImageHandler_CanRead(*args, **kwargs) |
e811c8ce RD |
2123 | |
2124 | def SetName(*args, **kwargs): | |
a95a7133 | 2125 | """SetName(self, String name)""" |
54f9ee45 | 2126 | return _core_.ImageHandler_SetName(*args, **kwargs) |
e811c8ce RD |
2127 | |
2128 | def SetExtension(*args, **kwargs): | |
a95a7133 | 2129 | """SetExtension(self, String extension)""" |
54f9ee45 | 2130 | return _core_.ImageHandler_SetExtension(*args, **kwargs) |
e811c8ce RD |
2131 | |
2132 | def SetType(*args, **kwargs): | |
a95a7133 | 2133 | """SetType(self, long type)""" |
54f9ee45 | 2134 | return _core_.ImageHandler_SetType(*args, **kwargs) |
e811c8ce RD |
2135 | |
2136 | def SetMimeType(*args, **kwargs): | |
a95a7133 | 2137 | """SetMimeType(self, String mimetype)""" |
54f9ee45 | 2138 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) |
e811c8ce | 2139 | |
d14a1e28 RD |
2140 | |
2141 | class ImageHandlerPtr(ImageHandler): | |
2142 | def __init__(self, this): | |
2143 | self.this = this | |
2144 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2145 | self.__class__ = ImageHandler | |
54f9ee45 | 2146 | _core_.ImageHandler_swigregister(ImageHandlerPtr) |
d14a1e28 RD |
2147 | |
2148 | class ImageHistogram(object): | |
093d3ff1 | 2149 | """Proxy of C++ ImageHistogram class""" |
e811c8ce RD |
2150 | def __repr__(self): |
2151 | return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 2152 | def __init__(self, *args, **kwargs): |
a95a7133 | 2153 | """__init__(self) -> ImageHistogram""" |
54f9ee45 | 2154 | newobj = _core_.new_ImageHistogram(*args, **kwargs) |
d14a1e28 RD |
2155 | self.this = newobj.this |
2156 | self.thisown = 1 | |
2157 | del newobj.thisown | |
e811c8ce | 2158 | def MakeKey(*args, **kwargs): |
0df68c9f | 2159 | """ |
7a27cf7c | 2160 | MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2161 | |
0df68c9f RD |
2162 | Get the key in the histogram for the given RGB values |
2163 | """ | |
54f9ee45 | 2164 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2175 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 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 | """ | |
2184 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
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 | """ | |
2192 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2193 | ||
2194 | def GetCountColour(*args, **kwargs): | |
2195 | """ | |
2196 | GetCountColour(self, Colour colour) -> unsigned long | |
2197 | ||
2198 | Returns the pixel count for the given `wx.Colour` value. | |
2199 | """ | |
2200 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2201 | ||
d14a1e28 RD |
2202 | |
2203 | class ImageHistogramPtr(ImageHistogram): | |
2204 | def __init__(self, this): | |
2205 | self.this = this | |
2206 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2207 | self.__class__ = ImageHistogram | |
54f9ee45 | 2208 | _core_.ImageHistogram_swigregister(ImageHistogramPtr) |
d14a1e28 | 2209 | |
e811c8ce | 2210 | def ImageHistogram_MakeKey(*args, **kwargs): |
0df68c9f | 2211 | """ |
7a27cf7c | 2212 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2213 | |
0df68c9f RD |
2214 | Get the key in the histogram for the given RGB values |
2215 | """ | |
54f9ee45 | 2216 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d14a1e28 RD |
2217 | |
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 | """ | |
e811c8ce RD |
2245 | def __repr__(self): |
2246 | return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 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 | """ | |
54f9ee45 | 2253 | newobj = _core_.new_Image(*args, **kwargs) |
d14a1e28 RD |
2254 | self.this = newobj.this |
2255 | self.thisown = 1 | |
2256 | del newobj.thisown | |
54f9ee45 | 2257 | def __del__(self, destroy=_core_.delete_Image): |
a95a7133 | 2258 | """__del__(self)""" |
d14a1e28 RD |
2259 | try: |
2260 | if self.thisown: destroy(self) | |
2261 | except: pass | |
e811c8ce RD |
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 | """ | |
54f9ee45 | 2270 | return _core_.Image_Create(*args, **kwargs) |
e811c8ce RD |
2271 | |
2272 | def Destroy(*args, **kwargs): | |
0df68c9f | 2273 | """ |
a95a7133 | 2274 | Destroy(self) |
e811c8ce | 2275 | |
7a27cf7c | 2276 | Destroys the image data. |
0df68c9f | 2277 | """ |
54f9ee45 | 2278 | return _core_.Image_Destroy(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2288 | return _core_.Image_Scale(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2296 | return _core_.Image_ShrinkBy(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2307 | return _core_.Image_Rescale(*args, **kwargs) |
e811c8ce | 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 | """ | |
aff4cc5c RD |
2323 | return _core_.Image_Resize(*args, **kwargs) |
2324 | ||
e811c8ce | 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 | """ | |
54f9ee45 | 2335 | return _core_.Image_SetRGB(*args, **kwargs) |
e811c8ce | 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 | """ | |
aff4cc5c RD |
2345 | return _core_.Image_SetRGBRect(*args, **kwargs) |
2346 | ||
e811c8ce | 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 | """ | |
54f9ee45 | 2353 | return _core_.Image_GetRed(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2361 | return _core_.Image_GetGreen(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2369 | return _core_.Image_GetBlue(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2379 | return _core_.Image_SetAlpha(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2393 | return _core_.Image_GetAlpha(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2401 | return _core_.Image_HasAlpha(*args, **kwargs) |
e811c8ce | 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 | """ | |
2412 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2413 | ||
bcd0d7b6 RD |
2414 | def IsTransparent(*args, **kwargs): |
2415 | """ | |
7a27cf7c | 2416 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
bcd0d7b6 | 2417 | |
7a27cf7c RD |
2418 | Returns ``True`` if this pixel is masked or has an alpha value less |
2419 | than the spcified threshold. | |
bcd0d7b6 RD |
2420 | """ |
2421 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2422 | ||
e811c8ce | 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 | """ | |
54f9ee45 | 2431 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2432 | |
4cf4100f RD |
2433 | def ConvertAlphaToMask(*args, **kwargs): |
2434 | """ | |
bcd0d7b6 | 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 | """ | |
2445 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
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 | """ | |
2459 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2460 | ||
e811c8ce | 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 | """ | |
54f9ee45 | 2478 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2486 | return _core_.Image_CanRead(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2497 | return _core_.Image_GetImageCount(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2507 | return _core_.Image_LoadFile(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2516 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2524 | return _core_.Image_SaveFile(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2532 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2542 | return _core_.Image_CanReadStream(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2553 | return _core_.Image_LoadStream(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2562 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
e811c8ce RD |
2563 | |
2564 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2565 | """ |
2566 | Ok(self) -> bool | |
2567 | ||
2568 | Returns true if image data is present. | |
2569 | """ | |
54f9ee45 | 2570 | return _core_.Image_Ok(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2578 | return _core_.Image_GetWidth(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2586 | return _core_.Image_GetHeight(*args, **kwargs) |
e811c8ce | 2587 | |
b2df227b | 2588 | def GetSize(*args, **kwargs): |
7a27cf7c RD |
2589 | """ |
2590 | GetSize(self) -> Size | |
2591 | ||
2592 | Returns the size of the image in pixels. | |
2593 | """ | |
54f9ee45 | 2594 | return _core_.Image_GetSize(*args, **kwargs) |
b2df227b | 2595 | |
e811c8ce | 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 | """ | |
54f9ee45 | 2603 | return _core_.Image_GetSubImage(*args, **kwargs) |
e811c8ce | 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 | """ | |
aff4cc5c RD |
2617 | return _core_.Image_Size(*args, **kwargs) |
2618 | ||
e811c8ce | 2619 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2620 | """ |
2621 | Copy(self) -> Image | |
2622 | ||
2623 | Returns an identical copy of the image. | |
2624 | """ | |
54f9ee45 | 2625 | return _core_.Image_Copy(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2634 | return _core_.Image_Paste(*args, **kwargs) |
e811c8ce RD |
2635 | |
2636 | def GetData(*args, **kwargs): | |
61d07ac7 RD |
2637 | """ |
2638 | GetData(self) -> PyObject | |
2639 | ||
2640 | Returns a string containing a copy of the RGB bytes of the image. | |
2641 | """ | |
54f9ee45 | 2642 | return _core_.Image_GetData(*args, **kwargs) |
e811c8ce RD |
2643 | |
2644 | def SetData(*args, **kwargs): | |
61d07ac7 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 | """ | |
54f9ee45 | 2652 | return _core_.Image_SetData(*args, **kwargs) |
e811c8ce RD |
2653 | |
2654 | def GetDataBuffer(*args, **kwargs): | |
61d07ac7 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. | |
61d07ac7 | 2661 | """ |
54f9ee45 | 2662 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2663 | |
2664 | def SetDataBuffer(*args, **kwargs): | |
61d07ac7 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. | |
61d07ac7 | 2671 | """ |
54f9ee45 | 2672 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2673 | |
2674 | def GetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2675 | """ |
2676 | GetAlphaData(self) -> PyObject | |
2677 | ||
2678 | Returns a string containing a copy of the alpha bytes of the image. | |
2679 | """ | |
54f9ee45 | 2680 | return _core_.Image_GetAlphaData(*args, **kwargs) |
e811c8ce RD |
2681 | |
2682 | def SetAlphaData(*args, **kwargs): | |
61d07ac7 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 | """ | |
54f9ee45 | 2690 | return _core_.Image_SetAlphaData(*args, **kwargs) |
e811c8ce RD |
2691 | |
2692 | def GetAlphaBuffer(*args, **kwargs): | |
a95a7133 | 2693 | """GetAlphaBuffer(self) -> PyObject""" |
54f9ee45 | 2694 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2695 | |
2696 | def SetAlphaBuffer(*args, **kwargs): | |
61d07ac7 | 2697 | """SetAlphaBuffer(self, buffer alpha)""" |
54f9ee45 | 2698 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2707 | return _core_.Image_SetMaskColour(*args, **kwargs) |
e811c8ce | 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 | """ | |
2715 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
2716 | ||
e811c8ce | 2717 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2718 | """ |
2719 | GetMaskRed(self) -> byte | |
2720 | ||
2721 | Gets the red component of the mask colour. | |
2722 | """ | |
54f9ee45 | 2723 | return _core_.Image_GetMaskRed(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2731 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2739 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2748 | return _core_.Image_SetMask(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2756 | return _core_.Image_HasMask(*args, **kwargs) |
e811c8ce RD |
2757 | |
2758 | def Rotate(*args, **kwargs): | |
0df68c9f | 2759 | """ |
a95a7133 | 2760 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
0df68c9f | 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. | |
0df68c9f | 2770 | """ |
54f9ee45 | 2771 | return _core_.Image_Rotate(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2780 | return _core_.Image_Rotate90(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2789 | return _core_.Image_Mirror(*args, **kwargs) |
e811c8ce RD |
2790 | |
2791 | def Replace(*args, **kwargs): | |
0df68c9f | 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)``. | |
0df68c9f | 2797 | """ |
54f9ee45 | 2798 | return _core_.Image_Replace(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2808 | return _core_.Image_ConvertToMono(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2818 | return _core_.Image_SetOption(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2826 | return _core_.Image_SetOptionInt(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2834 | return _core_.Image_GetOption(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2843 | return _core_.Image_GetOptionInt(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2851 | return _core_.Image_HasOption(*args, **kwargs) |
e811c8ce RD |
2852 | |
2853 | def CountColours(*args, **kwargs): | |
a95a7133 | 2854 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" |
54f9ee45 | 2855 | return _core_.Image_CountColours(*args, **kwargs) |
e811c8ce RD |
2856 | |
2857 | def ComputeHistogram(*args, **kwargs): | |
a95a7133 | 2858 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
54f9ee45 | 2859 | return _core_.Image_ComputeHistogram(*args, **kwargs) |
e811c8ce RD |
2860 | |
2861 | def AddHandler(*args, **kwargs): | |
66c033b4 | 2862 | """AddHandler(ImageHandler handler)""" |
54f9ee45 | 2863 | return _core_.Image_AddHandler(*args, **kwargs) |
e811c8ce RD |
2864 | |
2865 | AddHandler = staticmethod(AddHandler) | |
2866 | def InsertHandler(*args, **kwargs): | |
66c033b4 | 2867 | """InsertHandler(ImageHandler handler)""" |
54f9ee45 | 2868 | return _core_.Image_InsertHandler(*args, **kwargs) |
e811c8ce RD |
2869 | |
2870 | InsertHandler = staticmethod(InsertHandler) | |
2871 | def RemoveHandler(*args, **kwargs): | |
66c033b4 | 2872 | """RemoveHandler(String name) -> bool""" |
54f9ee45 | 2873 | return _core_.Image_RemoveHandler(*args, **kwargs) |
e811c8ce 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 | """ | |
54f9ee45 | 2884 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
e811c8ce RD |
2885 | |
2886 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
2887 | def ConvertToBitmap(*args, **kwargs): | |
1fbf26be | 2888 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
54f9ee45 | 2889 | return _core_.Image_ConvertToBitmap(*args, **kwargs) |
e811c8ce RD |
2890 | |
2891 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 2892 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
54f9ee45 | 2893 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
e811c8ce RD |
2894 | |
2895 | def __nonzero__(self): return self.Ok() | |
d14a1e28 RD |
2896 | |
2897 | class ImagePtr(Image): | |
2898 | def __init__(self, this): | |
2899 | self.this = this | |
2900 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2901 | self.__class__ = Image | |
54f9ee45 | 2902 | _core_.Image_swigregister(ImagePtr) |
d14a1e28 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 | """ | |
54f9ee45 | 2911 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d14a1e28 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 | """ | |
54f9ee45 | 2922 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d14a1e28 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 | """ | |
54f9ee45 | 2933 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d14a1e28 RD |
2934 | val.thisown = 1 |
2935 | return val | |
2936 | ||
66c033b4 | 2937 | def EmptyImage(*args, **kwargs): |
61d07ac7 RD |
2938 | """ |
2939 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
2940 | ||
2941 | Construct an empty image of a given size, optionally setting all | |
2942 | pixels to black. | |
2943 | """ | |
66c033b4 | 2944 | val = _core_.new_EmptyImage(*args, **kwargs) |
d14a1e28 RD |
2945 | val.thisown = 1 |
2946 | return val | |
2947 | ||
2948 | def ImageFromBitmap(*args, **kwargs): | |
61d07ac7 RD |
2949 | """ |
2950 | ImageFromBitmap(Bitmap bitmap) -> Image | |
2951 | ||
2952 | Construct an Image from a `wx.Bitmap`. | |
2953 | """ | |
54f9ee45 | 2954 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d14a1e28 RD |
2955 | val.thisown = 1 |
2956 | return val | |
2957 | ||
2958 | def ImageFromData(*args, **kwargs): | |
61d07ac7 RD |
2959 | """ |
2960 | ImageFromData(int width, int height, buffer data) -> Image | |
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 | """ | |
54f9ee45 | 2966 | val = _core_.new_ImageFromData(*args, **kwargs) |
d14a1e28 RD |
2967 | val.thisown = 1 |
2968 | return val | |
2969 | ||
1823fbb4 | 2970 | def ImageFromDataWithAlpha(*args, **kwargs): |
61d07ac7 RD |
2971 | """ |
2972 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
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. | |
61d07ac7 | 2978 | """ |
1823fbb4 RD |
2979 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
2980 | val.thisown = 1 | |
2981 | return val | |
2982 | ||
e811c8ce | 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 | """ | |
54f9ee45 | 2989 | return _core_.Image_CanRead(*args, **kwargs) |
d14a1e28 | 2990 | |
e811c8ce | 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 | """ | |
54f9ee45 | 2999 | return _core_.Image_GetImageCount(*args, **kwargs) |
d14a1e28 | 3000 | |
e811c8ce | 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 | """ | |
54f9ee45 | 3009 | return _core_.Image_CanReadStream(*args, **kwargs) |
d14a1e28 | 3010 | |
e811c8ce RD |
3011 | def Image_AddHandler(*args, **kwargs): |
3012 | """Image_AddHandler(ImageHandler handler)""" | |
54f9ee45 | 3013 | return _core_.Image_AddHandler(*args, **kwargs) |
d14a1e28 | 3014 | |
e811c8ce RD |
3015 | def Image_InsertHandler(*args, **kwargs): |
3016 | """Image_InsertHandler(ImageHandler handler)""" | |
54f9ee45 | 3017 | return _core_.Image_InsertHandler(*args, **kwargs) |
d14a1e28 | 3018 | |
e811c8ce | 3019 | def Image_RemoveHandler(*args, **kwargs): |
196addbf | 3020 | """Image_RemoveHandler(String name) -> bool""" |
54f9ee45 | 3021 | return _core_.Image_RemoveHandler(*args, **kwargs) |
d14a1e28 | 3022 | |
e811c8ce | 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 | """ | |
54f9ee45 | 3031 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
d14a1e28 | 3032 | |
5e4ca4a8 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 | |
d14a1e28 | 3039 | |
54f9ee45 RD |
3040 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3041 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
b9d6a5f3 RD |
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 | |
54f9ee45 RD |
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 | |
d14a1e28 | 3054 | class BMPHandler(ImageHandler): |
27fb7603 | 3055 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
e811c8ce RD |
3056 | def __repr__(self): |
3057 | return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3058 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3059 | """ |
3060 | __init__(self) -> BMPHandler | |
3061 | ||
3062 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3063 | """ | |
54f9ee45 | 3064 | newobj = _core_.new_BMPHandler(*args, **kwargs) |
d14a1e28 RD |
3065 | self.this = newobj.this |
3066 | self.thisown = 1 | |
3067 | del newobj.thisown | |
d14a1e28 RD |
3068 | |
3069 | class BMPHandlerPtr(BMPHandler): | |
3070 | def __init__(self, this): | |
3071 | self.this = this | |
3072 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3073 | self.__class__ = BMPHandler | |
54f9ee45 | 3074 | _core_.BMPHandler_swigregister(BMPHandlerPtr) |
d14a1e28 | 3075 | NullImage = cvar.NullImage |
0c243d93 | 3076 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d14a1e28 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 | |
0c243d93 RD |
3081 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3082 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d14a1e28 | 3083 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3084 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
0c243d93 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 | |
b9d6a5f3 RD |
3089 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3090 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d14a1e28 RD |
3091 | |
3092 | class ICOHandler(BMPHandler): | |
27fb7603 | 3093 | """A `wx.ImageHandler` for \*.ico icon files.""" |
e811c8ce RD |
3094 | def __repr__(self): |
3095 | return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3096 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3097 | """ |
3098 | __init__(self) -> ICOHandler | |
3099 | ||
3100 | A `wx.ImageHandler` for \*.ico icon files. | |
3101 | """ | |
54f9ee45 | 3102 | newobj = _core_.new_ICOHandler(*args, **kwargs) |
d14a1e28 RD |
3103 | self.this = newobj.this |
3104 | self.thisown = 1 | |
3105 | del newobj.thisown | |
d14a1e28 RD |
3106 | |
3107 | class ICOHandlerPtr(ICOHandler): | |
3108 | def __init__(self, this): | |
3109 | self.this = this | |
3110 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3111 | self.__class__ = ICOHandler | |
54f9ee45 | 3112 | _core_.ICOHandler_swigregister(ICOHandlerPtr) |
d14a1e28 RD |
3113 | |
3114 | class CURHandler(ICOHandler): | |
27fb7603 | 3115 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
e811c8ce RD |
3116 | def __repr__(self): |
3117 | return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3118 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3119 | """ |
3120 | __init__(self) -> CURHandler | |
3121 | ||
3122 | A `wx.ImageHandler` for \*.cur cursor files. | |
3123 | """ | |
54f9ee45 | 3124 | newobj = _core_.new_CURHandler(*args, **kwargs) |
d14a1e28 RD |
3125 | self.this = newobj.this |
3126 | self.thisown = 1 | |
3127 | del newobj.thisown | |
d14a1e28 RD |
3128 | |
3129 | class CURHandlerPtr(CURHandler): | |
3130 | def __init__(self, this): | |
3131 | self.this = this | |
3132 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3133 | self.__class__ = CURHandler | |
54f9ee45 | 3134 | _core_.CURHandler_swigregister(CURHandlerPtr) |
d14a1e28 RD |
3135 | |
3136 | class ANIHandler(CURHandler): | |
27fb7603 | 3137 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
e811c8ce RD |
3138 | def __repr__(self): |
3139 | return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3140 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3141 | """ |
3142 | __init__(self) -> ANIHandler | |
3143 | ||
3144 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3145 | """ | |
54f9ee45 | 3146 | newobj = _core_.new_ANIHandler(*args, **kwargs) |
d14a1e28 RD |
3147 | self.this = newobj.this |
3148 | self.thisown = 1 | |
3149 | del newobj.thisown | |
d14a1e28 RD |
3150 | |
3151 | class ANIHandlerPtr(ANIHandler): | |
3152 | def __init__(self, this): | |
3153 | self.this = this | |
3154 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3155 | self.__class__ = ANIHandler | |
54f9ee45 | 3156 | _core_.ANIHandler_swigregister(ANIHandlerPtr) |
d14a1e28 RD |
3157 | |
3158 | class PNGHandler(ImageHandler): | |
27fb7603 | 3159 | """A `wx.ImageHandler` for PNG image files.""" |
e811c8ce RD |
3160 | def __repr__(self): |
3161 | return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3162 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3163 | """ |
3164 | __init__(self) -> PNGHandler | |
3165 | ||
3166 | A `wx.ImageHandler` for PNG image files. | |
3167 | """ | |
54f9ee45 | 3168 | newobj = _core_.new_PNGHandler(*args, **kwargs) |
d14a1e28 RD |
3169 | self.this = newobj.this |
3170 | self.thisown = 1 | |
3171 | del newobj.thisown | |
d14a1e28 RD |
3172 | |
3173 | class PNGHandlerPtr(PNGHandler): | |
3174 | def __init__(self, this): | |
3175 | self.this = this | |
3176 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3177 | self.__class__ = PNGHandler | |
54f9ee45 | 3178 | _core_.PNGHandler_swigregister(PNGHandlerPtr) |
d14a1e28 RD |
3179 | |
3180 | class GIFHandler(ImageHandler): | |
27fb7603 | 3181 | """A `wx.ImageHandler` for GIF image files.""" |
e811c8ce RD |
3182 | def __repr__(self): |
3183 | return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3184 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3185 | """ |
3186 | __init__(self) -> GIFHandler | |
3187 | ||
3188 | A `wx.ImageHandler` for GIF image files. | |
3189 | """ | |
54f9ee45 | 3190 | newobj = _core_.new_GIFHandler(*args, **kwargs) |
d14a1e28 RD |
3191 | self.this = newobj.this |
3192 | self.thisown = 1 | |
3193 | del newobj.thisown | |
d14a1e28 RD |
3194 | |
3195 | class GIFHandlerPtr(GIFHandler): | |
3196 | def __init__(self, this): | |
3197 | self.this = this | |
3198 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3199 | self.__class__ = GIFHandler | |
54f9ee45 | 3200 | _core_.GIFHandler_swigregister(GIFHandlerPtr) |
d14a1e28 RD |
3201 | |
3202 | class PCXHandler(ImageHandler): | |
27fb7603 | 3203 | """A `wx.ImageHandler` for PCX imager files.""" |
e811c8ce RD |
3204 | def __repr__(self): |
3205 | return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3206 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3207 | """ |
3208 | __init__(self) -> PCXHandler | |
3209 | ||
3210 | A `wx.ImageHandler` for PCX imager files. | |
3211 | """ | |
54f9ee45 | 3212 | newobj = _core_.new_PCXHandler(*args, **kwargs) |
d14a1e28 RD |
3213 | self.this = newobj.this |
3214 | self.thisown = 1 | |
3215 | del newobj.thisown | |
d14a1e28 RD |
3216 | |
3217 | class PCXHandlerPtr(PCXHandler): | |
3218 | def __init__(self, this): | |
3219 | self.this = this | |
3220 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3221 | self.__class__ = PCXHandler | |
54f9ee45 | 3222 | _core_.PCXHandler_swigregister(PCXHandlerPtr) |
d14a1e28 RD |
3223 | |
3224 | class JPEGHandler(ImageHandler): | |
27fb7603 | 3225 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
e811c8ce RD |
3226 | def __repr__(self): |
3227 | return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3228 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3229 | """ |
3230 | __init__(self) -> JPEGHandler | |
3231 | ||
3232 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3233 | """ | |
54f9ee45 | 3234 | newobj = _core_.new_JPEGHandler(*args, **kwargs) |
d14a1e28 RD |
3235 | self.this = newobj.this |
3236 | self.thisown = 1 | |
3237 | del newobj.thisown | |
d14a1e28 RD |
3238 | |
3239 | class JPEGHandlerPtr(JPEGHandler): | |
3240 | def __init__(self, this): | |
3241 | self.this = this | |
3242 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3243 | self.__class__ = JPEGHandler | |
54f9ee45 | 3244 | _core_.JPEGHandler_swigregister(JPEGHandlerPtr) |
d14a1e28 RD |
3245 | |
3246 | class PNMHandler(ImageHandler): | |
27fb7603 | 3247 | """A `wx.ImageHandler` for PNM image files.""" |
e811c8ce RD |
3248 | def __repr__(self): |
3249 | return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3250 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3251 | """ |
3252 | __init__(self) -> PNMHandler | |
3253 | ||
3254 | A `wx.ImageHandler` for PNM image files. | |
3255 | """ | |
54f9ee45 | 3256 | newobj = _core_.new_PNMHandler(*args, **kwargs) |
d14a1e28 RD |
3257 | self.this = newobj.this |
3258 | self.thisown = 1 | |
3259 | del newobj.thisown | |
d14a1e28 RD |
3260 | |
3261 | class PNMHandlerPtr(PNMHandler): | |
3262 | def __init__(self, this): | |
3263 | self.this = this | |
3264 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3265 | self.__class__ = PNMHandler | |
54f9ee45 | 3266 | _core_.PNMHandler_swigregister(PNMHandlerPtr) |
d14a1e28 RD |
3267 | |
3268 | class XPMHandler(ImageHandler): | |
27fb7603 | 3269 | """A `wx.ImageHandler` for XPM image.""" |
e811c8ce RD |
3270 | def __repr__(self): |
3271 | return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3272 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3273 | """ |
3274 | __init__(self) -> XPMHandler | |
3275 | ||
3276 | A `wx.ImageHandler` for XPM image. | |
3277 | """ | |
54f9ee45 | 3278 | newobj = _core_.new_XPMHandler(*args, **kwargs) |
d14a1e28 RD |
3279 | self.this = newobj.this |
3280 | self.thisown = 1 | |
3281 | del newobj.thisown | |
d14a1e28 RD |
3282 | |
3283 | class XPMHandlerPtr(XPMHandler): | |
3284 | def __init__(self, this): | |
3285 | self.this = this | |
3286 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3287 | self.__class__ = XPMHandler | |
54f9ee45 | 3288 | _core_.XPMHandler_swigregister(XPMHandlerPtr) |
d14a1e28 RD |
3289 | |
3290 | class TIFFHandler(ImageHandler): | |
27fb7603 | 3291 | """A `wx.ImageHandler` for TIFF image files.""" |
e811c8ce RD |
3292 | def __repr__(self): |
3293 | return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3294 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3295 | """ |
3296 | __init__(self) -> TIFFHandler | |
3297 | ||
3298 | A `wx.ImageHandler` for TIFF image files. | |
3299 | """ | |
54f9ee45 | 3300 | newobj = _core_.new_TIFFHandler(*args, **kwargs) |
d14a1e28 RD |
3301 | self.this = newobj.this |
3302 | self.thisown = 1 | |
3303 | del newobj.thisown | |
d14a1e28 RD |
3304 | |
3305 | class TIFFHandlerPtr(TIFFHandler): | |
3306 | def __init__(self, this): | |
3307 | self.this = this | |
3308 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3309 | self.__class__ = TIFFHandler | |
54f9ee45 | 3310 | _core_.TIFFHandler_swigregister(TIFFHandlerPtr) |
d14a1e28 | 3311 | |
c0de73ae 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): | |
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 | """ | |
3321 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
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 | """ | |
3327 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3328 | ||
3329 | Quantize = staticmethod(Quantize) | |
3330 | ||
3331 | class QuantizePtr(Quantize): | |
3332 | def __init__(self, this): | |
3333 | self.this = this | |
3334 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3335 | self.__class__ = Quantize | |
3336 | _core_.Quantize_swigregister(QuantizePtr) | |
3337 | ||
3338 | def Quantize_Quantize(*args, **kwargs): | |
3339 | """ | |
3340 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
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 | """ | |
3346 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3347 | ||
d14a1e28 RD |
3348 | #--------------------------------------------------------------------------- |
3349 | ||
3350 | class EvtHandler(Object): | |
093d3ff1 | 3351 | """Proxy of C++ EvtHandler class""" |
e811c8ce RD |
3352 | def __repr__(self): |
3353 | return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3354 | def __init__(self, *args, **kwargs): |
a95a7133 | 3355 | """__init__(self) -> EvtHandler""" |
54f9ee45 | 3356 | newobj = _core_.new_EvtHandler(*args, **kwargs) |
d14a1e28 RD |
3357 | self.this = newobj.this |
3358 | self.thisown = 1 | |
3359 | del newobj.thisown | |
e811c8ce | 3360 | def GetNextHandler(*args, **kwargs): |
a95a7133 | 3361 | """GetNextHandler(self) -> EvtHandler""" |
54f9ee45 | 3362 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) |
e811c8ce RD |
3363 | |
3364 | def GetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3365 | """GetPreviousHandler(self) -> EvtHandler""" |
54f9ee45 | 3366 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3367 | |
3368 | def SetNextHandler(*args, **kwargs): | |
a95a7133 | 3369 | """SetNextHandler(self, EvtHandler handler)""" |
54f9ee45 | 3370 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) |
e811c8ce RD |
3371 | |
3372 | def SetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3373 | """SetPreviousHandler(self, EvtHandler handler)""" |
54f9ee45 | 3374 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3375 | |
3376 | def GetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3377 | """GetEvtHandlerEnabled(self) -> bool""" |
54f9ee45 | 3378 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3379 | |
3380 | def SetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3381 | """SetEvtHandlerEnabled(self, bool enabled)""" |
54f9ee45 | 3382 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3383 | |
3384 | def ProcessEvent(*args, **kwargs): | |
a95a7133 | 3385 | """ProcessEvent(self, Event event) -> bool""" |
54f9ee45 | 3386 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) |
e811c8ce RD |
3387 | |
3388 | def AddPendingEvent(*args, **kwargs): | |
a95a7133 | 3389 | """AddPendingEvent(self, Event event)""" |
54f9ee45 | 3390 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) |
e811c8ce RD |
3391 | |
3392 | def ProcessPendingEvents(*args, **kwargs): | |
a95a7133 | 3393 | """ProcessPendingEvents(self)""" |
54f9ee45 | 3394 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
3395 | |
3396 | def Connect(*args, **kwargs): | |
a95a7133 | 3397 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" |
54f9ee45 | 3398 | return _core_.EvtHandler_Connect(*args, **kwargs) |
e811c8ce RD |
3399 | |
3400 | def Disconnect(*args, **kwargs): | |
a95a7133 | 3401 | """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool""" |
54f9ee45 | 3402 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
e811c8ce RD |
3403 | |
3404 | def _setOORInfo(*args, **kwargs): | |
689b42ee | 3405 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
54f9ee45 | 3406 | return _core_.EvtHandler__setOORInfo(*args, **kwargs) |
e811c8ce | 3407 | |
d14a1e28 RD |
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 | ||
db3e571a RD |
3412 | :param event: One of the EVT_* objects that specifies the |
3413 | type of event to bind, | |
d14a1e28 | 3414 | |
db3e571a 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. | |
d14a1e28 | 3418 | |
db3e571a 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. | |
d14a1e28 | 3427 | |
db3e571a 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. | |
d14a1e28 RD |
3433 | """ |
3434 | if source is not None: | |
3435 | id = source.GetId() | |
3436 | event.Bind(self, id, id2, handler) | |
3437 | ||
66c033b4 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) | |
d14a1e28 | 3446 | |
d14a1e28 RD |
3447 | |
3448 | class EvtHandlerPtr(EvtHandler): | |
3449 | def __init__(self, this): | |
3450 | self.this = this | |
3451 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3452 | self.__class__ = EvtHandler | |
54f9ee45 | 3453 | _core_.EvtHandler_swigregister(EvtHandlerPtr) |
d14a1e28 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 | ||
66c033b4 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 | ||
d14a1e28 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 | ||
54f9ee45 RD |
3524 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3525 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
d14a1e28 | 3526 | |
e811c8ce RD |
3527 | def NewEventType(*args, **kwargs): |
3528 | """NewEventType() -> wxEventType""" | |
54f9ee45 RD |
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 | |
3592 | wxEVT_SCROLL_ENDSCROLL = _core_.wxEVT_SCROLL_ENDSCROLL | |
3593 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP | |
3594 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3595 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3596 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3597 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3598 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3599 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3600 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3601 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3602 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3603 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3604 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3605 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3606 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
3607 | wxEVT_POWER = _core_.wxEVT_POWER | |
3608 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE | |
3609 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3610 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3611 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3612 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3613 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3614 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
3615 | wxEVT_PAINT = _core_.wxEVT_PAINT | |
3616 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3617 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3618 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3619 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3620 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3621 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3622 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3623 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3624 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3625 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3626 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3627 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3628 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3629 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3630 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3631 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3632 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3633 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3634 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3635 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3636 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
88c6b281 | 3637 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE |
54f9ee45 RD |
3638 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
3639 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3640 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3641 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3642 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3643 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3644 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d14a1e28 RD |
3645 | # |
3646 | # Create some event binders | |
3647 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3648 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3649 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3650 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3651 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3652 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3653 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3654 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3655 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3656 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3657 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3658 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3659 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
3660 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) | |
3661 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) | |
3662 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3663 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3664 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3665 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3666 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3667 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3668 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3669 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3670 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
88c6b281 | 3671 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d14a1e28 RD |
3672 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3673 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3674 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3675 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3676 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3677 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3678 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3679 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3680 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3681 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3682 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3683 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3684 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3685 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3686 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3687 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
3688 | ||
3689 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3690 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3691 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3692 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3693 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3694 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3695 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3696 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3697 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3698 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3699 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3700 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3701 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3702 | ||
3703 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3704 | wxEVT_LEFT_UP, | |
3705 | wxEVT_MIDDLE_DOWN, | |
3706 | wxEVT_MIDDLE_UP, | |
3707 | wxEVT_RIGHT_DOWN, | |
3708 | wxEVT_RIGHT_UP, | |
3709 | wxEVT_MOTION, | |
3710 | wxEVT_LEFT_DCLICK, | |
3711 | wxEVT_MIDDLE_DCLICK, | |
3712 | wxEVT_RIGHT_DCLICK, | |
3713 | wxEVT_ENTER_WINDOW, | |
3714 | wxEVT_LEAVE_WINDOW, | |
3715 | wxEVT_MOUSEWHEEL | |
3716 | ]) | |
3717 | ||
3718 | ||
3719 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
3720 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, | |
3721 | wxEVT_SCROLLWIN_BOTTOM, | |
3722 | wxEVT_SCROLLWIN_LINEUP, | |
3723 | wxEVT_SCROLLWIN_LINEDOWN, | |
3724 | wxEVT_SCROLLWIN_PAGEUP, | |
3725 | wxEVT_SCROLLWIN_PAGEDOWN, | |
3726 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3727 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3728 | ]) | |
3729 | ||
3730 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3731 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3732 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3733 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3734 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3735 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3736 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3737 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3738 | ||
27fb7603 | 3739 | # Scrolling from wx.Slider and wx.ScrollBar |
d14a1e28 RD |
3740 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3741 | wxEVT_SCROLL_BOTTOM, | |
3742 | wxEVT_SCROLL_LINEUP, | |
3743 | wxEVT_SCROLL_LINEDOWN, | |
3744 | wxEVT_SCROLL_PAGEUP, | |
3745 | wxEVT_SCROLL_PAGEDOWN, | |
3746 | wxEVT_SCROLL_THUMBTRACK, | |
3747 | wxEVT_SCROLL_THUMBRELEASE, | |
3748 | wxEVT_SCROLL_ENDSCROLL, | |
3749 | ]) | |
3750 | ||
3751 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3752 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3753 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3754 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3755 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3756 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3757 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3758 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
3759 | EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL ) | |
3760 | ||
27fb7603 | 3761 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
d14a1e28 RD |
3762 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3763 | wxEVT_SCROLL_BOTTOM, | |
3764 | wxEVT_SCROLL_LINEUP, | |
3765 | wxEVT_SCROLL_LINEDOWN, | |
3766 | wxEVT_SCROLL_PAGEUP, | |
3767 | wxEVT_SCROLL_PAGEDOWN, | |
3768 | wxEVT_SCROLL_THUMBTRACK, | |
3769 | wxEVT_SCROLL_THUMBRELEASE, | |
3770 | wxEVT_SCROLL_ENDSCROLL, | |
3771 | ], 1) | |
3772 | ||
3773 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3774 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3775 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3776 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3777 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3778 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3779 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3780 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
3781 | EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1) | |
3782 | ||
d14a1e28 RD |
3783 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) |
3784 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3785 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3786 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3787 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3788 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3789 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3790 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3791 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3792 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3793 | ||
3794 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3795 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3796 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3797 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3798 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3799 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3800 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3801 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3802 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3803 | ||
3804 | ||
3805 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3806 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3807 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3808 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3809 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3810 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3811 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3812 | ||
3813 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
3814 | ||
3815 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
3816 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
3817 | ||
3818 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
3819 | ||
3820 | ||
3821 | ||
3822 | #--------------------------------------------------------------------------- | |
3823 | ||
3824 | class Event(Object): | |
27fb7603 RD |
3825 | """ |
3826 | An event is a structure holding information about an event passed to a | |
3827 | callback or member function. wx.Event is an abstract base class for | |
3828 | other event classes | |
3829 | """ | |
e811c8ce RD |
3830 | def __init__(self): raise RuntimeError, "No constructor defined" |
3831 | def __repr__(self): | |
3832 | return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
54f9ee45 | 3833 | def __del__(self, destroy=_core_.delete_Event): |
a95a7133 | 3834 | """__del__(self)""" |
d14a1e28 RD |
3835 | try: |
3836 | if self.thisown: destroy(self) | |
3837 | except: pass | |
e811c8ce RD |
3838 | |
3839 | def SetEventType(*args, **kwargs): | |
27fb7603 RD |
3840 | """ |
3841 | SetEventType(self, wxEventType typ) | |
3842 | ||
3843 | Sets the specific type of the event. | |
3844 | """ | |
54f9ee45 | 3845 | return _core_.Event_SetEventType(*args, **kwargs) |
e811c8ce RD |
3846 | |
3847 | def GetEventType(*args, **kwargs): | |
27fb7603 RD |
3848 | """ |
3849 | GetEventType(self) -> wxEventType | |
3850 | ||
3851 | Returns the identifier of the given event type, such as | |
3852 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
3853 | """ | |
54f9ee45 | 3854 | return _core_.Event_GetEventType(*args, **kwargs) |
e811c8ce RD |
3855 | |
3856 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
3857 | """ |
3858 | GetEventObject(self) -> Object | |
3859 | ||
3860 | Returns the object (usually a window) associated with the event, if | |
3861 | any. | |
3862 | """ | |
54f9ee45 | 3863 | return _core_.Event_GetEventObject(*args, **kwargs) |
e811c8ce RD |
3864 | |
3865 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
3866 | """ |
3867 | SetEventObject(self, Object obj) | |
3868 | ||
3869 | Sets the originating object, or in other words, obj is normally the | |
3870 | object that is sending the event. | |
3871 | """ | |
54f9ee45 | 3872 | return _core_.Event_SetEventObject(*args, **kwargs) |
e811c8ce RD |
3873 | |
3874 | def GetTimestamp(*args, **kwargs): | |
a95a7133 | 3875 | """GetTimestamp(self) -> long""" |
54f9ee45 | 3876 | return _core_.Event_GetTimestamp(*args, **kwargs) |
e811c8ce RD |
3877 | |
3878 | def SetTimestamp(*args, **kwargs): | |
a95a7133 | 3879 | """SetTimestamp(self, long ts=0)""" |
54f9ee45 | 3880 | return _core_.Event_SetTimestamp(*args, **kwargs) |
e811c8ce RD |
3881 | |
3882 | def GetId(*args, **kwargs): | |
27fb7603 RD |
3883 | """ |
3884 | GetId(self) -> int | |
3885 | ||
3886 | Returns the identifier associated with this event, such as a button | |
3887 | command id. | |
3888 | """ | |
54f9ee45 | 3889 | return _core_.Event_GetId(*args, **kwargs) |
e811c8ce RD |
3890 | |
3891 | def SetId(*args, **kwargs): | |
27fb7603 RD |
3892 | """ |
3893 | SetId(self, int Id) | |
3894 | ||
3895 | Set's the ID for the event. This is usually the ID of the window that | |
3896 | is sending the event, but it can also be a command id from a menu | |
3897 | item, etc. | |
3898 | """ | |
54f9ee45 | 3899 | return _core_.Event_SetId(*args, **kwargs) |
e811c8ce RD |
3900 | |
3901 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
3902 | """ |
3903 | IsCommandEvent(self) -> bool | |
3904 | ||
3905 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
3906 | it returns false. Note: Exists only for optimization purposes. | |
3907 | """ | |
54f9ee45 | 3908 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
e811c8ce RD |
3909 | |
3910 | def Skip(*args, **kwargs): | |
51b83b37 RD |
3911 | """ |
3912 | Skip(self, bool skip=True) | |
3913 | ||
3914 | Called by an event handler, it controls whether additional event | |
3915 | handlers bound to this event will be called after the current event | |
3916 | handler returns. Skip(false) (the default setting) will prevent | |
3917 | additional event handlers from being called and control will be | |
3918 | returned to the sender of the event immediately after the current | |
3919 | handler has finished. Skip(True) will cause the event processing | |
3920 | system to continue searching for a handler function for this event. | |
3921 | ||
3922 | """ | |
54f9ee45 | 3923 | return _core_.Event_Skip(*args, **kwargs) |
e811c8ce RD |
3924 | |
3925 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
3926 | """ |
3927 | GetSkipped(self) -> bool | |
3928 | ||
3929 | Returns true if the event handler should be skipped, false otherwise. | |
3930 | :see: `Skip` | |
3931 | """ | |
54f9ee45 | 3932 | return _core_.Event_GetSkipped(*args, **kwargs) |
e811c8ce RD |
3933 | |
3934 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
3935 | """ |
3936 | ShouldPropagate(self) -> bool | |
3937 | ||
3938 | Test if this event should be propagated to the parent window or not, | |
3939 | i.e. if the propagation level is currently greater than 0. | |
3940 | """ | |
54f9ee45 | 3941 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
e811c8ce RD |
3942 | |
3943 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
3944 | """ |
3945 | StopPropagation(self) -> int | |
3946 | ||
3947 | Stop the event from propagating to its parent window. Returns the old | |
3948 | propagation level value which may be later passed to | |
3949 | `ResumePropagation` to allow propagating the event again. | |
3950 | """ | |
54f9ee45 | 3951 | return _core_.Event_StopPropagation(*args, **kwargs) |
e811c8ce RD |
3952 | |
3953 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
3954 | """ |
3955 | ResumePropagation(self, int propagationLevel) | |
3956 | ||
3957 | Resume the event propagation by restoring the propagation level. (For | |
3958 | example, you can use the value returned by an earlier call to | |
3959 | `StopPropagation`.) | |
3960 | ||
3961 | """ | |
54f9ee45 | 3962 | return _core_.Event_ResumePropagation(*args, **kwargs) |
e811c8ce RD |
3963 | |
3964 | def Clone(*args, **kwargs): | |
a95a7133 | 3965 | """Clone(self) -> Event""" |
54f9ee45 | 3966 | return _core_.Event_Clone(*args, **kwargs) |
e811c8ce | 3967 | |
d14a1e28 RD |
3968 | |
3969 | class EventPtr(Event): | |
3970 | def __init__(self, this): | |
3971 | self.this = this | |
3972 | if not hasattr(self,"thisown"): self.thisown = 0 | |
3973 | self.__class__ = Event | |
54f9ee45 | 3974 | _core_.Event_swigregister(EventPtr) |
d14a1e28 RD |
3975 | |
3976 | #--------------------------------------------------------------------------- | |
3977 | ||
3978 | class PropagationDisabler(object): | |
27fb7603 RD |
3979 | """ |
3980 | Helper class to temporarily change an event not to propagate. Simply | |
3981 | create an instance of this class and then whe it is destroyed the | |
3982 | propogation of the event will be restored. | |
3983 | """ | |
e811c8ce RD |
3984 | def __repr__(self): |
3985 | return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 3986 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
3987 | """ |
3988 | __init__(self, Event event) -> PropagationDisabler | |
3989 | ||
3990 | Helper class to temporarily change an event not to propagate. Simply | |
3991 | create an instance of this class and then whe it is destroyed the | |
3992 | propogation of the event will be restored. | |
3993 | """ | |
54f9ee45 | 3994 | newobj = _core_.new_PropagationDisabler(*args, **kwargs) |
d14a1e28 RD |
3995 | self.this = newobj.this |
3996 | self.thisown = 1 | |
3997 | del newobj.thisown | |
54f9ee45 | 3998 | def __del__(self, destroy=_core_.delete_PropagationDisabler): |
a95a7133 | 3999 | """__del__(self)""" |
d14a1e28 RD |
4000 | try: |
4001 | if self.thisown: destroy(self) | |
4002 | except: pass | |
e811c8ce | 4003 | |
d14a1e28 RD |
4004 | |
4005 | class PropagationDisablerPtr(PropagationDisabler): | |
4006 | def __init__(self, this): | |
4007 | self.this = this | |
4008 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4009 | self.__class__ = PropagationDisabler | |
54f9ee45 | 4010 | _core_.PropagationDisabler_swigregister(PropagationDisablerPtr) |
d14a1e28 RD |
4011 | |
4012 | class PropagateOnce(object): | |
27fb7603 RD |
4013 | """ |
4014 | A helper class that will temporarily lower propagation level of an | |
4015 | event. Simply create an instance of this class and then whe it is | |
4016 | destroyed the propogation of the event will be restored. | |
4017 | """ | |
e811c8ce RD |
4018 | def __repr__(self): |
4019 | return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 4020 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
4021 | """ |
4022 | __init__(self, Event event) -> PropagateOnce | |
4023 | ||
4024 | A helper class that will temporarily lower propagation level of an | |
4025 | event. Simply create an instance of this class and then whe it is | |
4026 | destroyed the propogation of the event will be restored. | |
4027 | """ | |
54f9ee45 | 4028 | newobj = _core_.new_PropagateOnce(*args, **kwargs) |
d14a1e28 RD |
4029 | self.this = newobj.this |
4030 | self.thisown = 1 | |
4031 | del newobj.thisown | |
54f9ee45 | 4032 | def __del__(self, destroy=_core_.delete_PropagateOnce): |
a95a7133 | 4033 | """__del__(self)""" |
d14a1e28 RD |
4034 | try: |
4035 | if self.thisown: destroy(self) | |
4036 | except: pass | |
e811c8ce | 4037 | |
d14a1e28 RD |
4038 | |
4039 | class PropagateOncePtr(PropagateOnce): | |
4040 | def __init__(self, this): | |
4041 | self.this = this | |
4042 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4043 | self.__class__ = PropagateOnce | |
54f9ee45 | 4044 | _core_.PropagateOnce_swigregister(PropagateOncePtr) |
d14a1e28 RD |
4045 | |
4046 | #--------------------------------------------------------------------------- | |
4047 | ||
4048 | class CommandEvent(Event): | |
27fb7603 RD |
4049 | """ |
4050 | This event class contains information about command events, which | |
4051 | originate from a variety of simple controls, as well as menus and | |
4052 | toolbars. | |
4053 | """ | |
e811c8ce RD |
4054 | def __repr__(self): |
4055 | return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 4056 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
4057 | """ |
4058 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent | |
4059 | ||
4060 | This event class contains information about command events, which | |
4061 | originate from a variety of simple controls, as well as menus and | |
4062 | toolbars. | |
4063 | """ | |
54f9ee45 | 4064 | newobj = _core_.new_CommandEvent(*args, **kwargs) |
d14a1e28 RD |
4065 | self.this = newobj.this |
4066 | self.thisown = 1 | |
4067 | del newobj.thisown | |
e811c8ce | 4068 | def GetSelection(*args, **kwargs): |
27fb7603 RD |
4069 | """ |
4070 | GetSelection(self) -> int | |
4071 | ||
4072 | Returns item index for a listbox or choice selection event (not valid | |
4073 | for a deselection). | |
4074 | """ | |
54f9ee45 | 4075 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
e811c8ce RD |
4076 | |
4077 | def SetString(*args, **kwargs): | |
a95a7133 | 4078 | """SetString(self, String s)""" |
54f9ee45 | 4079 | return _core_.CommandEvent_SetString(*args, **kwargs) |
e811c8ce RD |
4080 | |
4081 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4082 | """ |
4083 | GetString(self) -> String | |
4084 | ||
4085 | Returns item string for a listbox or choice selection event (not valid | |
4086 | for a deselection). | |
4087 | """ | |
54f9ee45 | 4088 | return _core_.CommandEvent_GetString(*args, **kwargs) |
e811c8ce RD |
4089 | |
4090 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4091 | """ |
4092 | IsChecked(self) -> bool | |
4093 | ||
4094 | This method can be used with checkbox and menu events: for the | |
4095 | checkboxes, the method returns true for a selection event and false | |
4096 | for a deselection one. For the menu events, this method indicates if | |
4097 | the menu item just has become checked or unchecked (and thus only | |
4098 | makes sense for checkable menu items). | |
4099 | """ | |
54f9ee45 | 4100 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
e811c8ce | 4101 | |
242b7b46 | 4102 | Checked = IsChecked |
e811c8ce | 4103 | def IsSelection(*args, **kwargs): |
27fb7603 RD |
4104 | """ |
4105 | IsSelection(self) -> bool | |
4106 | ||
4107 | For a listbox or similar event, returns true if it is a selection, | |
4108 | false if it is a deselection. | |
4109 | """ | |
54f9ee45 | 4110 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
e811c8ce RD |
4111 | |
4112 | def SetExtraLong(*args, **kwargs): | |
a95a7133 | 4113 | """SetExtraLong(self, long extraLong)""" |
54f9ee45 | 4114 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
e811c8ce RD |
4115 | |
4116 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4117 | """ |
4118 | GetExtraLong(self) -> long | |
4119 | ||
5ba5649b RD |
4120 | Returns extra information dependant on the event objects type. If the |
4121 | event comes from a listbox selection, it is a boolean determining | |
4122 | whether the event was a selection (true) or a deselection (false). A | |
4123 | listbox deselection only occurs for multiple-selection boxes, and in | |
4124 | this case the index and string values are indeterminate and the | |
4125 | listbox must be examined by the application. | |
27fb7603 | 4126 | """ |
54f9ee45 | 4127 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
e811c8ce RD |
4128 | |
4129 | def SetInt(*args, **kwargs): | |
a95a7133 | 4130 | """SetInt(self, int i)""" |
54f9ee45 | 4131 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
e811c8ce RD |
4132 | |
4133 | def GetInt(*args, **kwargs): | |
27fb7603 RD |
4134 | """ |
4135 | GetInt(self) -> long | |
4136 | ||
5ba5649b RD |
4137 | Returns the integer identifier corresponding to a listbox, choice or |
4138 | radiobox selection (only if the event was a selection, not a | |
4139 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4140 | """ |
54f9ee45 | 4141 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
e811c8ce RD |
4142 | |
4143 | def Clone(*args, **kwargs): | |
a95a7133 | 4144 | """Clone(self) -> Event""" |
54f9ee45 | 4145 | return _core_.CommandEvent_Clone(*args, **kwargs) |
e811c8ce | 4146 | |
d14a1e28 RD |
4147 | |
4148 | class CommandEventPtr(CommandEvent): | |
4149 | def __init__(self, this): | |
4150 | self.this = this | |
4151 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4152 | self.__class__ = CommandEvent | |
54f9ee45 | 4153 | _core_.CommandEvent_swigregister(CommandEventPtr) |
d14a1e28 RD |
4154 | |
4155 | #--------------------------------------------------------------------------- | |
4156 | ||
4157 | class NotifyEvent(CommandEvent): | |
27fb7603 RD |
4158 | """ |
4159 | An instance of this class (or one of its derived classes) is sent from | |
4160 | a control when the control's state is being changed and the control | |
4161 | allows that change to be prevented from happening. The event handler | |
4162 | can call `Veto` or `Allow` to tell the control what to do. | |
4163 | """ | |
e811c8ce RD |
4164 | def __repr__(self): |
4165 | return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 4166 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
4167 | """ |
4168 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent | |
4169 | ||
4170 | An instance of this class (or one of its derived classes) is sent from | |
4171 | a control when the control's state is being changed and the control | |
4172 | allows that change to be prevented from happening. The event handler | |
4173 | can call `Veto` or `Allow` to tell the control what to do. | |
4174 | """ | |
54f9ee45 | 4175 | newobj = _core_.new_NotifyEvent(*args, **kwargs) |
d14a1e28 RD |
4176 | self.this = newobj.this |
4177 | self.thisown = 1 | |
4178 | del newobj.thisown | |
e811c8ce | 4179 | def Veto(*args, **kwargs): |
27fb7603 RD |
4180 | """ |
4181 | Veto(self) | |
4182 | ||
4183 | Prevents the change announced by this event from happening. | |
4184 | ||
4185 | It is in general a good idea to notify the user about the reasons for | |
4186 | vetoing the change because otherwise the applications behaviour (which | |
4187 | just refuses to do what the user wants) might be quite surprising. | |
4188 | """ | |
54f9ee45 | 4189 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
e811c8ce RD |
4190 | |
4191 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4192 | """ |
4193 | Allow(self) | |
4194 | ||
4195 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4196 | processed. For most events it is not necessary to call this method as | |
4197 | the events are allowed anyhow but some are forbidden by default (this | |
4198 | will be mentioned in the corresponding event description). | |
4199 | """ | |
54f9ee45 | 4200 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
e811c8ce RD |
4201 | |
4202 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4203 | """ |
4204 | IsAllowed(self) -> bool | |
4205 | ||
4206 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4207 | false otherwise (if it was). | |
4208 | """ | |
54f9ee45 | 4209 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
e811c8ce | 4210 | |
d14a1e28 RD |
4211 | |
4212 | class NotifyEventPtr(NotifyEvent): | |
4213 | def __init__(self, this): | |
4214 | self.this = this | |
4215 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4216 | self.__class__ = NotifyEvent | |
54f9ee45 | 4217 | _core_.NotifyEvent_swigregister(NotifyEventPtr) |
d14a1e28 RD |
4218 | |
4219 | #--------------------------------------------------------------------------- | |
4220 | ||
4221 | class ScrollEvent(CommandEvent): | |
27fb7603 RD |
4222 | """ |
4223 | A scroll event holds information about events sent from stand-alone | |
4224 | scrollbars and sliders. Note that scrolled windows do not send | |
4225 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4226 | instead. | |
4227 | """ | |
e811c8ce RD |
4228 | def __repr__(self): |
4229 | return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 4230 | def __init__(self, *args, **kwargs): |
0df68c9f | 4231 | """ |
a95a7133 | 4232 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0, |
0df68c9f RD |
4233 | int orient=0) -> ScrollEvent |
4234 | """ | |
54f9ee45 | 4235 | newobj = _core_.new_ScrollEvent(*args, **kwargs) |
d14a1e28 RD |
4236 | self.this = newobj.this |
4237 | self.thisown = 1 | |
4238 | del newobj.thisown | |
e811c8ce | 4239 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4240 | """ |
4241 | GetOrientation(self) -> int | |
4242 | ||
4243 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4244 | the scrollbar. | |
4245 | """ | |
54f9ee45 | 4246 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4247 | |
4248 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4249 | """ |
4250 | GetPosition(self) -> int | |
4251 | ||
4252 | Returns the position of the scrollbar. | |
4253 | """ | |
54f9ee45 | 4254 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4255 | |
4256 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4257 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4258 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4259 | |
4260 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4261 | """SetPosition(self, int pos)""" |
54f9ee45 | 4262 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4263 | |
d14a1e28 RD |
4264 | |
4265 | class ScrollEventPtr(ScrollEvent): | |
4266 | def __init__(self, this): | |
4267 | self.this = this | |
4268 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4269 | self.__class__ = ScrollEvent | |
54f9ee45 | 4270 | _core_.ScrollEvent_swigregister(ScrollEventPtr) |
d14a1e28 RD |
4271 | |
4272 | #--------------------------------------------------------------------------- | |
4273 | ||
4274 | class ScrollWinEvent(Event): | |
27fb7603 RD |
4275 | """ |
4276 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4277 | scrolling windows. | |
4278 | """ | |
e811c8ce RD |
4279 | def __repr__(self): |
4280 | return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 4281 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
4282 | """ |
4283 | __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent | |
4284 | ||
4285 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4286 | scrolling windows. | |
4287 | """ | |
54f9ee45 | 4288 | newobj = _core_.new_ScrollWinEvent(*args, **kwargs) |
d14a1e28 RD |
4289 | self.this = newobj.this |
4290 | self.thisown = 1 | |
4291 | del newobj.thisown | |
e811c8ce | 4292 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4293 | """ |
4294 | GetOrientation(self) -> int | |
4295 | ||
4296 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4297 | the scrollbar. | |
4298 | """ | |
54f9ee45 | 4299 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4300 | |
4301 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4302 | """ |
4303 | GetPosition(self) -> int | |
4304 | ||
4305 | Returns the position of the scrollbar for the thumb track and release | |
4306 | events. Note that this field can't be used for the other events, you | |
4307 | need to query the window itself for the current position in that case. | |
4308 | """ | |
54f9ee45 | 4309 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4310 | |
4311 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4312 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4313 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4314 | |
4315 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4316 | """SetPosition(self, int pos)""" |
54f9ee45 | 4317 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4318 | |
d14a1e28 RD |
4319 | |
4320 | class ScrollWinEventPtr(ScrollWinEvent): | |
4321 | def __init__(self, this): | |
4322 | self.this = this | |
4323 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4324 | self.__class__ = ScrollWinEvent | |
54f9ee45 | 4325 | _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr) |
d14a1e28 RD |
4326 | |
4327 | #--------------------------------------------------------------------------- | |
4328 | ||
54f9ee45 RD |
4329 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4330 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4331 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4332 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4333 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
d14a1e28 | 4334 | class MouseEvent(Event): |
27fb7603 RD |
4335 | """ |
4336 | This event class contains information about the events generated by | |
4337 | the mouse: they include mouse buttons press and release events and | |
4338 | mouse move events. | |
4339 | ||
4340 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4341 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4342 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4343 | a middle button so a portable application should avoid relying on the | |
4344 | events from it. | |
4345 | ||
4346 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4347 | the former returns true when the event corresponds to the left mouse | |
4348 | button click while the latter returns true if the left mouse button is | |
4349 | currently being pressed. For example, when the user is dragging the | |
4350 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4351 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4352 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4353 | underlying GUI behaviour is (which is platform-dependent). The same | |
4354 | applies, of course, to other mouse buttons as well. | |
4355 | """ | |
e811c8ce RD |
4356 | def __repr__(self): |
4357 | return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 4358 | def __init__(self, *args, **kwargs): |
27fb7603 RD |
4359 | """ |
4360 | __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent | |
4361 | ||
4362 | Constructs a wx.MouseEvent. Valid event types are: | |
4363 | ||
4364 | * wxEVT_ENTER_WINDOW | |
4365 | * wxEVT_LEAVE_WINDOW | |
4366 | * wxEVT_LEFT_DOWN | |
4367 | * wxEVT_LEFT_UP | |
4368 | * wxEVT_LEFT_DCLICK | |
4369 | * wxEVT_MIDDLE_DOWN | |
4370 | * wxEVT_MIDDLE_UP | |
4371 | * wxEVT_MIDDLE_DCLICK | |
4372 | * wxEVT_RIGHT_DOWN | |
4373 | * wxEVT_RIGHT_UP | |
4374 | * wxEVT_RIGHT_DCLICK | |
4375 | * wxEVT_MOTION | |
4376 | * wxEVT_MOUSEWHEEL | |
4377 | """ | |
54f9ee45 | 4378 | newobj = _core_.new_MouseEvent(*args, **kwargs) |
d14a1e28 RD |
4379 | self.this = newobj.this |
4380 | self.thisown = 1 | |
4381 | del newobj.thisown | |
e811c8ce | 4382 | def IsButton(*args, **kwargs): |
27fb7603 RD |
4383 | """ |
4384 | IsButton(self) -> bool | |
4385 | ||
4386 | Returns true if the event was a mouse button event (not necessarily a | |
4387 | button down event - that may be tested using `ButtonDown`). | |
4388 | """ | |
54f9ee45 | 4389 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
e811c8ce RD |
4390 | |
4391 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4392 | """ |
4393 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4394 | ||
5ba5649b RD |
4395 | If the argument is omitted, this returns true if the event was any |
4396 | mouse button down event. Otherwise the argument specifies which | |
4397 | button-down event shold be checked for (see `Button` for the possible | |
4398 | values). | |
27fb7603 | 4399 | """ |
54f9ee45 | 4400 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
e811c8ce RD |
4401 | |
4402 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4403 | """ |
4404 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4405 | ||
4406 | If the argument is omitted, this returns true if the event was any | |
4407 | mouse double click event. Otherwise the argument specifies which | |
4408 | double click event to check for (see `Button` for the possible | |
4409 | values). | |
4410 | """ | |
54f9ee45 | 4411 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
e811c8ce RD |
4412 | |
4413 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4414 | """ |
4415 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4416 | ||
4417 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4418 | mouse button up event. Otherwise the argument specifies which button |
4419 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4420 | """ |
54f9ee45 | 4421 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
e811c8ce RD |
4422 | |
4423 | def Button(*args, **kwargs): | |
27fb7603 RD |
4424 | """ |
4425 | Button(self, int button) -> bool | |
4426 | ||
4427 | Returns true if the identified mouse button is changing state. Valid | |
4428 | values of button are: | |
4429 | ||
4430 | ==================== ===================================== | |
4431 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4432 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4433 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4434 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4435 | ==================== ===================================== | |
4436 | ||
4437 | """ | |
54f9ee45 | 4438 | return _core_.MouseEvent_Button(*args, **kwargs) |
e811c8ce RD |
4439 | |
4440 | def ButtonIsDown(*args, **kwargs): | |
a95a7133 | 4441 | """ButtonIsDown(self, int but) -> bool""" |
54f9ee45 | 4442 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
e811c8ce RD |
4443 | |
4444 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4445 | """ |
4446 | GetButton(self) -> int | |
4447 | ||
4448 | Returns the mouse button which generated this event or | |
4449 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4450 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4451 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4452 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4453 | right buttons respectively. | |
4454 | """ | |
54f9ee45 | 4455 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
e811c8ce RD |
4456 | |
4457 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4458 | """ |
4459 | ControlDown(self) -> bool | |
4460 | ||
4461 | Returns true if the control key was down at the time of the event. | |
4462 | """ | |
54f9ee45 | 4463 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4464 | |
4465 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4466 | """ |
4467 | MetaDown(self) -> bool | |
4468 | ||
4469 | Returns true if the Meta key was down at the time of the event. | |
4470 | """ | |
54f9ee45 | 4471 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4472 | |
4473 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4474 | """ |
4475 | AltDown(self) -> bool | |
4476 | ||
4477 | Returns true if the Alt key was down at the time of the event. | |
4478 | """ | |
54f9ee45 | 4479 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4480 | |
4481 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4482 | """ |
4483 | ShiftDown(self) -> bool | |
4484 | ||
4485 | Returns true if the Shift key was down at the time of the event. | |
4486 | """ | |
54f9ee45 | 4487 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4488 | |
412d302d RD |
4489 | def CmdDown(*args, **kwargs): |
4490 | """ | |
4491 | CmdDown(self) -> bool | |
4492 | ||
4493 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4494 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4495 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4496 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4497 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4498 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4499 | and Macs this is the same as `MetaDown`. | |
4500 | """ | |
4501 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4502 | ||
e811c8ce | 4503 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4504 | """ |
4505 | LeftDown(self) -> bool | |
4506 | ||
4507 | Returns true if the left mouse button state changed to down. | |
4508 | """ | |
54f9ee45 | 4509 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
e811c8ce RD |
4510 | |
4511 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4512 | """ |
4513 | MiddleDown(self) -> bool | |
4514 | ||
4515 | Returns true if the middle mouse button state changed to down. | |
4516 | """ | |
54f9ee45 | 4517 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
e811c8ce RD |
4518 | |
4519 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4520 | """ |
4521 | RightDown(self) -> bool | |
4522 | ||
4523 | Returns true if the right mouse button state changed to down. | |
4524 | """ | |
54f9ee45 | 4525 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
e811c8ce RD |
4526 | |
4527 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4528 | """ |
4529 | LeftUp(self) -> bool | |
4530 | ||
4531 | Returns true if the left mouse button state changed to up. | |
4532 | """ | |
54f9ee45 | 4533 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
e811c8ce RD |
4534 | |
4535 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4536 | """ |
4537 | MiddleUp(self) -> bool | |
4538 | ||
4539 | Returns true if the middle mouse button state changed to up. | |
4540 | """ | |
54f9ee45 | 4541 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
e811c8ce RD |
4542 | |
4543 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4544 | """ |
4545 | RightUp(self) -> bool | |
4546 | ||
4547 | Returns true if the right mouse button state changed to up. | |
4548 | """ | |
54f9ee45 | 4549 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
e811c8ce RD |
4550 | |
4551 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4552 | """ |
4553 | LeftDClick(self) -> bool | |
4554 | ||
4555 | Returns true if the event was a left button double click. | |
4556 | """ | |
54f9ee45 | 4557 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
e811c8ce RD |
4558 | |
4559 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4560 | """ |
4561 | MiddleDClick(self) -> bool | |
4562 | ||
4563 | Returns true if the event was a middle button double click. | |
4564 | """ | |
54f9ee45 | 4565 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
e811c8ce RD |
4566 | |
4567 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4568 | """ |
4569 | RightDClick(self) -> bool | |
4570 | ||
4571 | Returns true if the event was a right button double click. | |
4572 | """ | |
54f9ee45 | 4573 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
e811c8ce RD |
4574 | |
4575 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4576 | """ |
4577 | LeftIsDown(self) -> bool | |
4578 | ||
4579 | Returns true if the left mouse button is currently down, independent | |
4580 | of the current event type. | |
4581 | ||
4582 | Please notice that it is not the same as LeftDown which returns true | |
4583 | if the left mouse button was just pressed. Rather, it describes the | |
4584 | state of the mouse button before the event happened. | |
4585 | ||
4586 | This event is usually used in the mouse event handlers which process | |
4587 | "move mouse" messages to determine whether the user is (still) | |
4588 | dragging the mouse. | |
4589 | """ | |
54f9ee45 | 4590 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
e811c8ce RD |
4591 | |
4592 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4593 | """ |
4594 | MiddleIsDown(self) -> bool | |
4595 | ||
4596 | Returns true if the middle mouse button is currently down, independent | |
4597 | of the current event type. | |
4598 | """ | |
54f9ee45 | 4599 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
e811c8ce RD |
4600 | |
4601 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4602 | """ |
4603 | RightIsDown(self) -> bool | |
4604 | ||
4605 | Returns true if the right mouse button is currently down, independent | |
4606 | of the current event type. | |
4607 | """ | |
54f9ee45 | 4608 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
e811c8ce RD |
4609 | |
4610 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4611 | """ |
4612 | Dragging(self) -> bool | |
4613 | ||
4614 | Returns true if this was a dragging event (motion while a button is | |
4615 | depressed). | |
4616 | """ | |
54f9ee45 | 4617 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
e811c8ce RD |
4618 | |
4619 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4620 | """ |
4621 | Moving(self) -> bool | |
4622 | ||
4623 | Returns true if this was a motion event and no mouse buttons were | |
4624 | pressed. If any mouse button is held pressed, then this method returns | |
4625 | false and Dragging returns true. | |
4626 | """ | |
54f9ee45 | 4627 | return _core_.MouseEvent_Moving(*args, **kwargs) |
e811c8ce RD |
4628 | |
4629 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4630 | """ |
4631 | Entering(self) -> bool | |
4632 | ||
4633 | Returns true if the mouse was entering the window. | |
4634 | """ | |
54f9ee45 | 4635 | return _core_.MouseEvent_Entering(*args, **kwargs) |
e811c8ce RD |
4636 | |
4637 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4638 | """ |
4639 | Leaving(self) -> bool | |
4640 | ||
4641 | Returns true if the mouse was leaving the window. | |
4642 | """ | |
54f9ee45 | 4643 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
e811c8ce RD |
4644 | |
4645 | def GetPosition(*args, **kwargs): | |
0df68c9f | 4646 | """ |
a95a7133 | 4647 | GetPosition(self) -> Point |
e811c8ce | 4648 | |
27fb7603 RD |
4649 | Returns the pixel position of the mouse in window coordinates when the |
4650 | event happened. | |
0df68c9f | 4651 | """ |
54f9ee45 | 4652 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4653 | |
4654 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
4655 | """ |
4656 | GetPositionTuple() -> (x,y) | |
e811c8ce | 4657 | |
27fb7603 RD |
4658 | Returns the pixel position of the mouse in window coordinates when the |
4659 | event happened. | |
0df68c9f | 4660 | """ |
54f9ee45 | 4661 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
4662 | |
4663 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4664 | """ |
4665 | GetLogicalPosition(self, DC dc) -> Point | |
4666 | ||
4667 | Returns the logical mouse position in pixels (i.e. translated | |
4668 | according to the translation set for the DC, which usually indicates | |
4669 | that the window has been scrolled). | |
4670 | """ | |
54f9ee45 | 4671 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
e811c8ce RD |
4672 | |
4673 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4674 | """ |
4675 | GetX(self) -> int | |
4676 | ||
4677 | Returns X coordinate of the physical mouse event position. | |
4678 | """ | |
54f9ee45 | 4679 | return _core_.MouseEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4680 | |
4681 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4682 | """ |
4683 | GetY(self) -> int | |
4684 | ||
4685 | Returns Y coordinate of the physical mouse event position. | |
4686 | """ | |
54f9ee45 | 4687 | return _core_.MouseEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4688 | |
4689 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4690 | """ |
4691 | GetWheelRotation(self) -> int | |
4692 | ||
4693 | Get wheel rotation, positive or negative indicates direction of | |
4694 | rotation. Current devices all send an event when rotation is equal to | |
4695 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4696 | created in the future. Because of this you shouldn't assume that one | |
4697 | event is equal to 1 line or whatever, but you should be able to either | |
4698 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4699 | have been accumulated before scrolling. | |
4700 | """ | |
54f9ee45 | 4701 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
e811c8ce RD |
4702 | |
4703 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4704 | """ |
4705 | GetWheelDelta(self) -> int | |
4706 | ||
4707 | Get wheel delta, normally 120. This is the threshold for action to be | |
4708 | taken, and one such action (for example, scrolling one increment) | |
4709 | should occur for each delta. | |
4710 | """ | |
54f9ee45 | 4711 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
e811c8ce RD |
4712 | |
4713 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4714 | """ |
4715 | GetLinesPerAction(self) -> int | |
4716 | ||
4717 | Returns the configured number of lines (or whatever) to be scrolled | |
4718 | per wheel action. Defaults to three. | |
4719 | """ | |
54f9ee45 | 4720 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
e811c8ce RD |
4721 | |
4722 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4723 | """ |
4724 | IsPageScroll(self) -> bool | |
4725 | ||
4726 | Returns true if the system has been setup to do page scrolling with | |
4727 | the mouse wheel instead of line scrolling. | |
4728 | """ | |
54f9ee45 RD |
4729 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4730 | ||
4731 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4732 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4733 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4734 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4735 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4736 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4737 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4738 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4739 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4740 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4741 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4742 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
d14a1e28 RD |
4743 | |
4744 | class MouseEventPtr(MouseEvent): | |
4745 | def __init__(self, this): | |
4746 | self.this = this | |
4747 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4748 | self.__class__ = MouseEvent | |
54f9ee45 | 4749 | _core_.MouseEvent_swigregister(MouseEventPtr) |
d14a1e28 RD |
4750 | |
4751 | #--------------------------------------------------------------------------- | |
4752 | ||
4753 | class SetCursorEvent(Event): | |
5ba5649b RD |
4754 | """ |
4755 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4756 | as a result of mouse motion. This event gives the application the | |
4757 | chance to perform specific mouse cursor processing based on the | |
4758 | current position of the mouse within the window. Use the `SetCursor` | |
4759 | method to specify the cursor you want to be displayed. | |
4760 | """ | |
e811c8ce RD |
4761 | def __repr__(self): |
4762 | return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 4763 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
4764 | """ |
4765 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4766 | ||
4767 | Construct a new `wx.SetCursorEvent`. | |
4768 | """ | |
54f9ee45 | 4769 | newobj = _core_.new_SetCursorEvent(*args, **kwargs) |
d14a1e28 RD |
4770 | self.this = newobj.this |
4771 | self.thisown = 1 | |
4772 | del newobj.thisown | |
e811c8ce | 4773 | def GetX(*args, **kwargs): |
5ba5649b RD |
4774 | """ |
4775 | GetX(self) -> int | |
4776 | ||
4777 | Returns the X coordinate of the mouse in client coordinates. | |
4778 | """ | |
54f9ee45 | 4779 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4780 | |
4781 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4782 | """ |
4783 | GetY(self) -> int | |
4784 | ||
4785 | Returns the Y coordinate of the mouse in client coordinates. | |
4786 | """ | |
54f9ee45 | 4787 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4788 | |
4789 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4790 | """ |
4791 | SetCursor(self, Cursor cursor) | |
4792 | ||
4793 | Sets the cursor associated with this event. | |
4794 | """ | |
54f9ee45 | 4795 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
e811c8ce RD |
4796 | |
4797 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4798 | """ |
4799 | GetCursor(self) -> Cursor | |
4800 | ||
4801 | Returns a reference to the cursor specified by this event. | |
4802 | """ | |
54f9ee45 | 4803 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
e811c8ce RD |
4804 | |
4805 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
4806 | """ |
4807 | HasCursor(self) -> bool | |
4808 | ||
4809 | Returns true if the cursor specified by this event is a valid cursor. | |
4810 | """ | |
54f9ee45 | 4811 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
e811c8ce | 4812 | |
d14a1e28 RD |
4813 | |
4814 | class SetCursorEventPtr(SetCursorEvent): | |
4815 | def __init__(self, this): | |
4816 | self.this = this | |
4817 | if not hasattr(self,"thisown"): self.thisown = 0 | |
4818 | self.__class__ = SetCursorEvent | |
54f9ee45 | 4819 | _core_.SetCursorEvent_swigregister(SetCursorEventPtr) |
d14a1e28 RD |
4820 | |
4821 | #--------------------------------------------------------------------------- | |
4822 | ||
4823 | class KeyEvent(Event): | |
5ba5649b RD |
4824 | """ |
4825 | This event class contains information about keypress and character | |
4826 | events. These events are only sent to the widget that currently has | |
4827 | the keyboard focus. | |
4828 | ||
4829 | Notice that there are three different kinds of keyboard events in | |
4830 | wxWidgets: key down and up events and char events. The difference | |
4831 | between the first two is clear - the first corresponds to a key press | |
4832 | and the second to a key release - otherwise they are identical. Just | |
4833 | note that if the key is maintained in a pressed state you will | |
4834 | typically get a lot of (automatically generated) down events but only | |
4835 | one up so it is wrong to assume that there is one up event | |
4836 | corresponding to each down one. | |
4837 | ||
4838 | Both key events provide untranslated key codes while the char event | |
4839 | carries the translated one. The untranslated code for alphanumeric | |
4840 | keys is always an upper case value. For the other keys it is one of | |
4841 | WXK_XXX values from the keycodes table. The translated key is, in | |
4842 | general, the character the user expects to appear as the result of the | |
4843 | key combination when typing the text into a text entry zone, for | |
4844 | example. | |
4845 | ||
4846 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
4847 | and the standard US keyboard): when the 'A' key is pressed, the key | |
4848 | down event key code is equal to ASCII A == 65. But the char event key | |
4849 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
4850 | 'A' keys simultaneously , the key code in key down event will still be | |
4851 | just 'A' while the char event key code parameter will now be 'A' as | |
4852 | well. | |
4853 | ||
4854 | Although in this simple case it is clear that the correct key code | |
4855 | could be found in the key down event handler by checking the value | |
4856 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
4857 | as for non alphanumeric keys or non-US keyboard layouts the | |
4858 | translation is keyboard-layout dependent and can only be done properly | |
4859 | by the system itself. | |
4860 | ||
4861 | Another kind of translation is done when the control key is pressed: | |
4862 | for example, for CTRL-A key press the key down event still carries the | |
4863 | same key code 'A' as usual but the char event will have key code of 1, | |
4864 | the ASCII value of this key combination. | |
4865 | ||
4866 | You may discover how the other keys on your system behave | |
4867 | interactively by running the KeyEvents sample in the wxPython demo and | |
4868 | pressing some keys while the blue box at the top has the keyboard | |
4869 | focus. | |
4870 | ||
4871 | **Note**: If a key down event is caught and the event handler does not | |
4872 | call event.Skip() then the coresponding char event will not | |
4873 | happen. This is by design and enables the programs that handle both | |
4874 | types of events to be a bit simpler. | |
4875 | ||
4876 | **Note for Windows programmers**: The key and char events in wxWidgets | |
4877 | are similar to but slightly different from Windows WM_KEYDOWN and | |
4878 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
4879 | event in wxWidgets (unless it is used as an accelerator). | |
4880 | ||
4881 | **Tip**: be sure to call event.Skip() for events that you don't | |
4882 | process in key event function, otherwise menu shortcuts may cease to | |
4883 | work under Windows. | |
4884 | ||
4885 | """ | |
e811c8ce RD |
4886 | def __repr__(self): |
4887 | return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 4888 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
4889 | """ |
4890 | __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent | |
4891 | ||
4892 | Construct a new `wx.KeyEvent`. Valid event types are: | |
4893 | * | |
4894 | """ | |
54f9ee45 | 4895 | newobj = _core_.new_KeyEvent(*args, **kwargs) |
d14a1e28 RD |
4896 | self.this = newobj.this |
4897 | self.thisown = 1 | |
4898 | del newobj.thisown | |
e811c8ce | 4899 | def ControlDown(*args, **kwargs): |
5ba5649b RD |
4900 | """ |
4901 | ControlDown(self) -> bool | |
4902 | ||
4903 | Returns ``True`` if the Control key was down at the time of the event. | |
4904 | """ | |
54f9ee45 | 4905 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4906 | |
4907 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
4908 | """ |
4909 | MetaDown(self) -> bool | |
4910 | ||
4911 | Returns ``True`` if the Meta key was down at the time of the event. | |
4912 | """ | |
54f9ee45 | 4913 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4914 | |
4915 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
4916 | """ |
4917 | AltDown(self) -> bool | |
4918 | ||
4919 | Returns ``True`` if the Alt key was down at the time of the event. | |
4920 | """ | |
54f9ee45 | 4921 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4922 | |
4923 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
4924 | """ |
4925 | ShiftDown(self) -> bool | |
4926 | ||
4927 | Returns ``True`` if the Shift key was down at the time of the event. | |
4928 | """ | |
54f9ee45 | 4929 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4930 | |
412d302d RD |
4931 | def CmdDown(*args, **kwargs): |
4932 | """ | |
4933 | CmdDown(self) -> bool | |
4934 | ||
4935 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4936 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4937 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
4938 | because Cmd key is used for the same thing under Mac as Ctrl |
4939 | elsewhere. The Ctrl still exists, it's just not used for this | |
4940 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
4941 | and Macs this is the same as `MetaDown`. | |
4942 | """ | |
4943 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
4944 | ||
e811c8ce | 4945 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
4946 | """ |
4947 | HasModifiers(self) -> bool | |
4948 | ||
4949 | Returns true if either CTRL or ALT keys was down at the time of the | |
4950 | key event. Note that this function does not take into account neither | |
4951 | SHIFT nor META key states (the reason for ignoring the latter is that | |
4952 | it is common for NUMLOCK key to be configured as META under X but the | |
4953 | key presses even while NUMLOCK is on should be still processed | |
4954 | normally). | |
4955 | """ | |
54f9ee45 | 4956 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
e811c8ce RD |
4957 | |
4958 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
4959 | """ |
4960 | GetKeyCode(self) -> int | |
4961 | ||
4962 | Returns the virtual key code. ASCII events return normal ASCII values, | |
4963 | while non-ASCII events return values such as WXK_LEFT for the left | |
4964 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
4965 | codes. | |
4966 | ||
4967 | Note that in Unicode build, the returned value is meaningful only if | |
4968 | the user entered a character that can be represented in current | |
4969 | locale's default charset. You can obtain the corresponding Unicode | |
4970 | character using `GetUnicodeKey`. | |
4971 | """ | |
54f9ee45 | 4972 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
e811c8ce | 4973 | |
d14a1e28 | 4974 | KeyCode = GetKeyCode |
19272049 | 4975 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
4976 | """ |
4977 | GetUnicodeKey(self) -> int | |
4978 | ||
4979 | Returns the Unicode character corresponding to this key event. This | |
4980 | function is only meaningfule in a Unicode build of wxPython. | |
4981 | """ | |
19272049 | 4982 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
e811c8ce | 4983 | |
19272049 | 4984 | GetUniChar = GetUnicodeKey |
e811c8ce | 4985 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
4986 | """ |
4987 | GetRawKeyCode(self) -> unsigned int | |
4988 | ||
4989 | Returns the raw key code for this event. This is a platform-dependent | |
4990 | scan code which should only be used in advanced | |
4991 | applications. Currently the raw key codes are not supported by all | |
4992 | ports. | |
4993 | """ | |
54f9ee45 | 4994 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
e811c8ce RD |
4995 | |
4996 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
4997 | """ |
4998 | GetRawKeyFlags(self) -> unsigned int | |
4999 | ||
5000 | Returns the low level key flags for this event. The flags are | |
5001 | platform-dependent and should only be used in advanced applications. | |
5002 | Currently the raw key flags are not supported by all ports. | |
5003 | """ | |
54f9ee45 | 5004 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
e811c8ce RD |
5005 | |
5006 | def GetPosition(*args, **kwargs): | |
0df68c9f | 5007 | """ |
a95a7133 | 5008 | GetPosition(self) -> Point |
e811c8ce | 5009 | |
5ba5649b | 5010 | Find the position of the event, if applicable. |
0df68c9f | 5011 | """ |
54f9ee45 | 5012 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5013 | |
5014 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
5015 | """ |
5016 | GetPositionTuple() -> (x,y) | |
e811c8ce | 5017 | |
5ba5649b | 5018 | Find the position of the event, if applicable. |
0df68c9f | 5019 | """ |
54f9ee45 | 5020 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
5021 | |
5022 | def GetX(*args, **kwargs): | |
5ba5649b RD |
5023 | """ |
5024 | GetX(self) -> int | |
5025 | ||
5026 | Returns the X position (in client coordinates) of the event, if | |
5027 | applicable. | |
5028 | """ | |
54f9ee45 | 5029 | return _core_.KeyEvent_GetX(*args, **kwargs) |
e811c8ce RD |
5030 | |
5031 | def GetY(*args, **kwargs): | |
5ba5649b RD |
5032 | """ |
5033 | GetY(self) -> int | |
5034 | ||
5035 | Returns the Y position (in client coordinates) of the event, if | |
5036 | applicable. | |
5037 | """ | |
54f9ee45 RD |
5038 | return _core_.KeyEvent_GetY(*args, **kwargs) |
5039 | ||
5040 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
5041 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
5042 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
5043 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
5044 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
5045 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
5046 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
5047 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
5048 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
5049 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
d14a1e28 RD |
5050 | |
5051 | class KeyEventPtr(KeyEvent): | |
5052 | def __init__(self, this): | |
5053 | self.this = this | |
5054 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5055 | self.__class__ = KeyEvent | |
54f9ee45 | 5056 | _core_.KeyEvent_swigregister(KeyEventPtr) |
d14a1e28 RD |
5057 | |
5058 | #--------------------------------------------------------------------------- | |
5059 | ||
5060 | class SizeEvent(Event): | |
5ba5649b RD |
5061 | """ |
5062 | A size event holds information about size change events. The EVT_SIZE | |
5063 | handler function will be called when the window it is bound to has | |
5064 | been resized. | |
5065 | ||
5066 | Note that the size passed is of the whole window: call | |
5067 | `wx.Window.GetClientSize` for the area which may be used by the | |
5068 | application. | |
5069 | ||
5070 | When a window is resized, usually only a small part of the window is | |
5071 | damaged and and that area is all that is in the update region for the | |
5072 | next paint event. However, if your drawing depends on the size of the | |
5073 | window, you may need to clear the DC explicitly and repaint the whole | |
5074 | window. In which case, you may need to call `wx.Window.Refresh` to | |
5075 | invalidate the entire window. | |
5076 | ||
5077 | """ | |
e811c8ce RD |
5078 | def __repr__(self): |
5079 | return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5080 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5081 | """ |
5082 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
5083 | ||
5084 | Construct a new ``wx.SizeEvent``. | |
5085 | """ | |
54f9ee45 | 5086 | newobj = _core_.new_SizeEvent(*args, **kwargs) |
d14a1e28 RD |
5087 | self.this = newobj.this |
5088 | self.thisown = 1 | |
5089 | del newobj.thisown | |
e811c8ce | 5090 | def GetSize(*args, **kwargs): |
5ba5649b RD |
5091 | """ |
5092 | GetSize(self) -> Size | |
5093 | ||
5094 | Returns the entire size of the window generating the size change | |
5095 | event. | |
5096 | """ | |
54f9ee45 | 5097 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
e811c8ce RD |
5098 | |
5099 | def GetRect(*args, **kwargs): | |
a95a7133 | 5100 | """GetRect(self) -> Rect""" |
54f9ee45 | 5101 | return _core_.SizeEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5102 | |
5103 | def SetRect(*args, **kwargs): | |
a95a7133 | 5104 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5105 | return _core_.SizeEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5106 | |
5107 | def SetSize(*args, **kwargs): | |
a95a7133 | 5108 | """SetSize(self, Size size)""" |
54f9ee45 | 5109 | return _core_.SizeEvent_SetSize(*args, **kwargs) |
e811c8ce | 5110 | |
54f9ee45 RD |
5111 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
5112 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
d14a1e28 RD |
5113 | |
5114 | class SizeEventPtr(SizeEvent): | |
5115 | def __init__(self, this): | |
5116 | self.this = this | |
5117 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5118 | self.__class__ = SizeEvent | |
54f9ee45 | 5119 | _core_.SizeEvent_swigregister(SizeEventPtr) |
d14a1e28 RD |
5120 | |
5121 | #--------------------------------------------------------------------------- | |
5122 | ||
5123 | class MoveEvent(Event): | |
5ba5649b RD |
5124 | """ |
5125 | This event object is sent for EVT_MOVE event bindings when a window is | |
5126 | moved to a new position. | |
5127 | """ | |
e811c8ce RD |
5128 | def __repr__(self): |
5129 | return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5130 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5131 | """ |
5132 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5133 | ||
5134 | Constructor. | |
5135 | """ | |
54f9ee45 | 5136 | newobj = _core_.new_MoveEvent(*args, **kwargs) |
d14a1e28 RD |
5137 | self.this = newobj.this |
5138 | self.thisown = 1 | |
5139 | del newobj.thisown | |
e811c8ce | 5140 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5141 | """ |
5142 | GetPosition(self) -> Point | |
5143 | ||
5144 | Returns the position of the window generating the move change event. | |
5145 | """ | |
54f9ee45 | 5146 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5147 | |
5148 | def GetRect(*args, **kwargs): | |
a95a7133 | 5149 | """GetRect(self) -> Rect""" |
54f9ee45 | 5150 | return _core_.MoveEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5151 | |
5152 | def SetRect(*args, **kwargs): | |
a95a7133 | 5153 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5154 | return _core_.MoveEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5155 | |
5156 | def SetPosition(*args, **kwargs): | |
a95a7133 | 5157 | """SetPosition(self, Point pos)""" |
54f9ee45 | 5158 | return _core_.MoveEvent_SetPosition(*args, **kwargs) |
e811c8ce | 5159 | |
7557b9b5 RD |
5160 | m_pos = property(GetPosition, SetPosition) |
5161 | m_rect = property(GetRect, SetRect) | |
5162 | ||
d14a1e28 RD |
5163 | |
5164 | class MoveEventPtr(MoveEvent): | |
5165 | def __init__(self, this): | |
5166 | self.this = this | |
5167 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5168 | self.__class__ = MoveEvent | |
54f9ee45 | 5169 | _core_.MoveEvent_swigregister(MoveEventPtr) |
d14a1e28 RD |
5170 | |
5171 | #--------------------------------------------------------------------------- | |
5172 | ||
5173 | class PaintEvent(Event): | |
5ba5649b RD |
5174 | """ |
5175 | A paint event is sent when a window's contents needs to be repainted. | |
5176 | Note that in an EVT_PAINT handler the application must *always* create | |
5177 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5178 | Windows assumes that the window has not been painted yet and will send | |
5179 | the event again, causing endless refreshes. | |
5180 | ||
5181 | You can optimize painting by retrieving the rectangles that have been | |
5182 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5183 | and only repainting these rectangles. The rectangles are in terms of | |
5184 | the client area, and are unscrolled, so you will need to do some | |
5185 | calculations using the current view position to obtain logical, | |
5186 | scrolled units. | |
5187 | ||
5188 | """ | |
e811c8ce RD |
5189 | def __repr__(self): |
5190 | return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5191 | def __init__(self, *args, **kwargs): |
a95a7133 | 5192 | """__init__(self, int Id=0) -> PaintEvent""" |
54f9ee45 | 5193 | newobj = _core_.new_PaintEvent(*args, **kwargs) |
d14a1e28 RD |
5194 | self.this = newobj.this |
5195 | self.thisown = 1 | |
5196 | del newobj.thisown | |
d14a1e28 RD |
5197 | |
5198 | class PaintEventPtr(PaintEvent): | |
5199 | def __init__(self, this): | |
5200 | self.this = this | |
5201 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5202 | self.__class__ = PaintEvent | |
54f9ee45 | 5203 | _core_.PaintEvent_swigregister(PaintEventPtr) |
d14a1e28 RD |
5204 | |
5205 | class NcPaintEvent(Event): | |
093d3ff1 | 5206 | """Proxy of C++ NcPaintEvent class""" |
e811c8ce RD |
5207 | def __repr__(self): |
5208 | return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5209 | def __init__(self, *args, **kwargs): |
a95a7133 | 5210 | """__init__(self, int winid=0) -> NcPaintEvent""" |
54f9ee45 | 5211 | newobj = _core_.new_NcPaintEvent(*args, **kwargs) |
d14a1e28 RD |
5212 | self.this = newobj.this |
5213 | self.thisown = 1 | |
5214 | del newobj.thisown | |
d14a1e28 RD |
5215 | |
5216 | class NcPaintEventPtr(NcPaintEvent): | |
5217 | def __init__(self, this): | |
5218 | self.this = this | |
5219 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5220 | self.__class__ = NcPaintEvent | |
54f9ee45 | 5221 | _core_.NcPaintEvent_swigregister(NcPaintEventPtr) |
d14a1e28 RD |
5222 | |
5223 | #--------------------------------------------------------------------------- | |
5224 | ||
5225 | class EraseEvent(Event): | |
5ba5649b RD |
5226 | """ |
5227 | An erase event is sent whenever the background of a window needs to be | |
5228 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5229 | binder. On some platforms, such as GTK+, this event is simulated | |
5230 | (simply generated just before the paint event) and may cause flicker. | |
5231 | ||
5232 | To paint a custom background use the `GetDC` method and use the returned | |
5233 | device context if it is not ``None``, otherwise create a temporary | |
5234 | `wx.ClientDC` and draw on that. | |
5235 | ||
5236 | """ | |
e811c8ce RD |
5237 | def __repr__(self): |
5238 | return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5239 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5240 | """ |
5241 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5242 | ||
5243 | Constructor | |
5244 | """ | |
54f9ee45 | 5245 | newobj = _core_.new_EraseEvent(*args, **kwargs) |
d14a1e28 RD |
5246 | self.this = newobj.this |
5247 | self.thisown = 1 | |
5248 | del newobj.thisown | |
e811c8ce | 5249 | def GetDC(*args, **kwargs): |
5ba5649b RD |
5250 | """ |
5251 | GetDC(self) -> DC | |
5252 | ||
5253 | Returns the device context the event handler should draw upon. If | |
5254 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5255 | that instead. | |
5256 | """ | |
54f9ee45 | 5257 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
e811c8ce | 5258 | |
d14a1e28 RD |
5259 | |
5260 | class EraseEventPtr(EraseEvent): | |
5261 | def __init__(self, this): | |
5262 | self.this = this | |
5263 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5264 | self.__class__ = EraseEvent | |
54f9ee45 | 5265 | _core_.EraseEvent_swigregister(EraseEventPtr) |
d14a1e28 RD |
5266 | |
5267 | #--------------------------------------------------------------------------- | |
5268 | ||
5269 | class FocusEvent(Event): | |
5ba5649b RD |
5270 | """ |
5271 | A focus event is sent when a window's focus changes. The window losing | |
5272 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5273 | gets an EVT_SET_FOCUS event. | |
5274 | ||
5275 | Notice that the set focus event happens both when the user gives focus | |
5276 | to the window (whether using the mouse or keyboard) and when it is | |
5277 | done from the program itself using `wx.Window.SetFocus`. | |
5278 | ||
5279 | """ | |
e811c8ce RD |
5280 | def __repr__(self): |
5281 | return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5282 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5283 | """ |
5284 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent | |
5285 | ||
5286 | Constructor | |
5287 | """ | |
54f9ee45 | 5288 | newobj = _core_.new_FocusEvent(*args, **kwargs) |
d14a1e28 RD |
5289 | self.this = newobj.this |
5290 | self.thisown = 1 | |
5291 | del newobj.thisown | |
e811c8ce | 5292 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5293 | """ |
5294 | GetWindow(self) -> Window | |
5295 | ||
5296 | Returns the other window associated with this event, that is the | |
5297 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5298 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5299 | ||
5300 | Warning: the window returned may be None! | |
5301 | """ | |
54f9ee45 | 5302 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
e811c8ce RD |
5303 | |
5304 | def SetWindow(*args, **kwargs): | |
a95a7133 | 5305 | """SetWindow(self, Window win)""" |
54f9ee45 | 5306 | return _core_.FocusEvent_SetWindow(*args, **kwargs) |
e811c8ce | 5307 | |
d14a1e28 RD |
5308 | |
5309 | class FocusEventPtr(FocusEvent): | |
5310 | def __init__(self, this): | |
5311 | self.this = this | |
5312 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5313 | self.__class__ = FocusEvent | |
54f9ee45 | 5314 | _core_.FocusEvent_swigregister(FocusEventPtr) |
d14a1e28 RD |
5315 | |
5316 | #--------------------------------------------------------------------------- | |
5317 | ||
5318 | class ChildFocusEvent(CommandEvent): | |
5ba5649b RD |
5319 | """ |
5320 | wx.ChildFocusEvent notifies the parent that a child has received the | |
5321 | focus. Unlike `wx.FocusEvent` it is propagated up the window | |
5322 | heirarchy. | |
5323 | """ | |
e811c8ce RD |
5324 | def __repr__(self): |
5325 | return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5326 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5327 | """ |
5328 | __init__(self, Window win=None) -> ChildFocusEvent | |
5329 | ||
5330 | Constructor | |
5331 | """ | |
54f9ee45 | 5332 | newobj = _core_.new_ChildFocusEvent(*args, **kwargs) |
d14a1e28 RD |
5333 | self.this = newobj.this |
5334 | self.thisown = 1 | |
5335 | del newobj.thisown | |
e811c8ce | 5336 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5337 | """ |
5338 | GetWindow(self) -> Window | |
5339 | ||
5340 | The window which has just received the focus. | |
5341 | """ | |
54f9ee45 | 5342 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
e811c8ce | 5343 | |
d14a1e28 RD |
5344 | |
5345 | class ChildFocusEventPtr(ChildFocusEvent): | |
5346 | def __init__(self, this): | |
5347 | self.this = this | |
5348 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5349 | self.__class__ = ChildFocusEvent | |
54f9ee45 | 5350 | _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr) |
d14a1e28 RD |
5351 | |
5352 | #--------------------------------------------------------------------------- | |
5353 | ||
5354 | class ActivateEvent(Event): | |
5ba5649b RD |
5355 | """ |
5356 | An activate event is sent when a top-level window or the entire | |
5357 | application is being activated or deactivated. | |
5358 | ||
5359 | A top-level window (a dialog or frame) receives an activate event when | |
5360 | is being activated or deactivated. This is indicated visually by the | |
5361 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5362 | An application is activated or deactivated when one of its frames | |
5363 | becomes activated, or a frame becomes inactivate resulting in all | |
5364 | application frames being inactive. | |
5365 | ||
5366 | Please note that usually you should call event.Skip() in your handlers | |
5367 | for these events so the default handlers will still be called, as not | |
5368 | doing so can result in strange effects. | |
5369 | ||
5370 | """ | |
e811c8ce RD |
5371 | def __repr__(self): |
5372 | return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5373 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5374 | """ |
5375 | __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent | |
5376 | ||
5377 | Constructor | |
5378 | """ | |
54f9ee45 | 5379 | newobj = _core_.new_ActivateEvent(*args, **kwargs) |
d14a1e28 RD |
5380 | self.this = newobj.this |
5381 | self.thisown = 1 | |
5382 | del newobj.thisown | |
e811c8ce | 5383 | def GetActive(*args, **kwargs): |
5ba5649b RD |
5384 | """ |
5385 | GetActive(self) -> bool | |
5386 | ||
5387 | Returns true if the application or window is being activated, false | |
5388 | otherwise. | |
5389 | """ | |
54f9ee45 | 5390 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
e811c8ce | 5391 | |
d14a1e28 RD |
5392 | |
5393 | class ActivateEventPtr(ActivateEvent): | |
5394 | def __init__(self, this): | |
5395 | self.this = this | |
5396 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5397 | self.__class__ = ActivateEvent | |
54f9ee45 | 5398 | _core_.ActivateEvent_swigregister(ActivateEventPtr) |
d14a1e28 RD |
5399 | |
5400 | #--------------------------------------------------------------------------- | |
5401 | ||
5402 | class InitDialogEvent(Event): | |
5ba5649b RD |
5403 | """ |
5404 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5405 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5406 | event can transfer data to the window, or anything else that should be | |
5407 | done before the user begins editing the form. The default handler | |
5408 | calls `wx.Window.TransferDataToWindow`. | |
5409 | """ | |
e811c8ce RD |
5410 | def __repr__(self): |
5411 | return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5412 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5413 | """ |
5414 | __init__(self, int Id=0) -> InitDialogEvent | |
5415 | ||
5416 | Constructor | |
5417 | """ | |
54f9ee45 | 5418 | newobj = _core_.new_InitDialogEvent(*args, **kwargs) |
d14a1e28 RD |
5419 | self.this = newobj.this |
5420 | self.thisown = 1 | |
5421 | del newobj.thisown | |
d14a1e28 RD |
5422 | |
5423 | class InitDialogEventPtr(InitDialogEvent): | |
5424 | def __init__(self, this): | |
5425 | self.this = this | |
5426 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5427 | self.__class__ = InitDialogEvent | |
54f9ee45 | 5428 | _core_.InitDialogEvent_swigregister(InitDialogEventPtr) |
d14a1e28 RD |
5429 | |
5430 | #--------------------------------------------------------------------------- | |
5431 | ||
5432 | class MenuEvent(Event): | |
5ba5649b RD |
5433 | """ |
5434 | This class is used for a variety of menu-related events. Note that | |
5435 | these do not include menu command events, which are handled by sending | |
5436 | `wx.CommandEvent` objects. | |
5437 | ||
5438 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5439 | text in the first field of the status bar. | |
5440 | """ | |
e811c8ce RD |
5441 | def __repr__(self): |
5442 | return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5443 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5444 | """ |
5445 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent | |
5446 | ||
5447 | Constructor | |
5448 | """ | |
54f9ee45 | 5449 | newobj = _core_.new_MenuEvent(*args, **kwargs) |
d14a1e28 RD |
5450 | self.this = newobj.this |
5451 | self.thisown = 1 | |
5452 | del newobj.thisown | |
e811c8ce | 5453 | def GetMenuId(*args, **kwargs): |
5ba5649b RD |
5454 | """ |
5455 | GetMenuId(self) -> int | |
5456 | ||
5457 | Returns the menu identifier associated with the event. This method | |
5458 | should be only used with the HIGHLIGHT events. | |
5459 | """ | |
54f9ee45 | 5460 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
e811c8ce RD |
5461 | |
5462 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5463 | """ |
5464 | IsPopup(self) -> bool | |
5465 | ||
5466 | Returns ``True`` if the menu which is being opened or closed is a | |
5467 | popup menu, ``False`` if it is a normal one. This method should only | |
5468 | be used with the OPEN and CLOSE events. | |
5469 | """ | |
54f9ee45 | 5470 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
e811c8ce RD |
5471 | |
5472 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5473 | """ |
5474 | GetMenu(self) -> Menu | |
5475 | ||
5476 | Returns the menu which is being opened or closed. This method should | |
5477 | only be used with the OPEN and CLOSE events. | |
5478 | """ | |
54f9ee45 | 5479 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
e811c8ce | 5480 | |
d14a1e28 RD |
5481 | |
5482 | class MenuEventPtr(MenuEvent): | |
5483 | def __init__(self, this): | |
5484 | self.this = this | |
5485 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5486 | self.__class__ = MenuEvent | |
54f9ee45 | 5487 | _core_.MenuEvent_swigregister(MenuEventPtr) |
d14a1e28 RD |
5488 | |
5489 | #--------------------------------------------------------------------------- | |
5490 | ||
5491 | class CloseEvent(Event): | |
5ba5649b RD |
5492 | """ |
5493 | This event class contains information about window and session close | |
5494 | events. | |
5495 | ||
5496 | The handler function for EVT_CLOSE is called when the user has tried | |
5497 | to close a a frame or dialog box using the window manager controls or | |
5498 | the system menu. It can also be invoked by the application itself | |
5499 | programmatically, for example by calling the `wx.Window.Close` | |
5500 | function. | |
5501 | ||
5502 | You should check whether the application is forcing the deletion of | |
5503 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5504 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5505 | it is up to you whether you respond by destroying the window or not. | |
5506 | For example you may wish to display a message dialog prompting to save | |
5507 | files or to cancel the close. | |
5508 | ||
5509 | If you don't destroy the window, you should call `Veto` to let the | |
5510 | calling code know that you did not destroy the window. This allows the | |
5511 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5512 | on whether the close instruction was honored or not. | |
5513 | """ | |
e811c8ce RD |
5514 | def __repr__(self): |
5515 | return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5516 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5517 | """ |
5518 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent | |
5519 | ||
5520 | Constructor. | |
5521 | """ | |
54f9ee45 | 5522 | newobj = _core_.new_CloseEvent(*args, **kwargs) |
d14a1e28 RD |
5523 | self.this = newobj.this |
5524 | self.thisown = 1 | |
5525 | del newobj.thisown | |
e811c8ce | 5526 | def SetLoggingOff(*args, **kwargs): |
5ba5649b RD |
5527 | """ |
5528 | SetLoggingOff(self, bool logOff) | |
5529 | ||
5530 | Sets the 'logging off' flag. | |
5531 | """ | |
54f9ee45 | 5532 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5533 | |
5534 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5535 | """ |
5536 | GetLoggingOff(self) -> bool | |
5537 | ||
6c75a4cf RD |
5538 | Returns ``True`` if the user is logging off or ``False`` if the |
5539 | system is shutting down. This method can only be called for end | |
5540 | session and query end session events, it doesn't make sense for close | |
5541 | window event. | |
5ba5649b | 5542 | """ |
54f9ee45 | 5543 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5544 | |
5545 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5546 | """ |
5547 | Veto(self, bool veto=True) | |
5548 | ||
5549 | Call this from your event handler to veto a system shutdown or to | |
5550 | signal to the calling application that a window close did not happen. | |
5551 | ||
5552 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5553 | """ | |
54f9ee45 | 5554 | return _core_.CloseEvent_Veto(*args, **kwargs) |
e811c8ce | 5555 | |
5ba5649b RD |
5556 | def GetVeto(*args, **kwargs): |
5557 | """GetVeto(self) -> bool""" | |
5558 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5559 | ||
e811c8ce | 5560 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5561 | """ |
5562 | SetCanVeto(self, bool canVeto) | |
5563 | ||
5564 | Sets the 'can veto' flag. | |
5565 | """ | |
54f9ee45 | 5566 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
e811c8ce RD |
5567 | |
5568 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5569 | """ |
5570 | CanVeto(self) -> bool | |
e811c8ce | 5571 | |
5ba5649b RD |
5572 | Returns true if you can veto a system shutdown or a window close |
5573 | event. Vetoing a window close event is not possible if the calling | |
5574 | code wishes to force the application to exit, and so this function | |
5575 | must be called to check this. | |
5576 | """ | |
5577 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
e811c8ce | 5578 | |
d14a1e28 RD |
5579 | |
5580 | class CloseEventPtr(CloseEvent): | |
5581 | def __init__(self, this): | |
5582 | self.this = this | |
5583 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5584 | self.__class__ = CloseEvent | |
54f9ee45 | 5585 | _core_.CloseEvent_swigregister(CloseEventPtr) |
d14a1e28 RD |
5586 | |
5587 | #--------------------------------------------------------------------------- | |
5588 | ||
5589 | class ShowEvent(Event): | |
5ba5649b | 5590 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
e811c8ce RD |
5591 | def __repr__(self): |
5592 | return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5593 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5594 | """ |
5595 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5596 | ||
5597 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5598 | """ | |
54f9ee45 | 5599 | newobj = _core_.new_ShowEvent(*args, **kwargs) |
d14a1e28 RD |
5600 | self.this = newobj.this |
5601 | self.thisown = 1 | |
5602 | del newobj.thisown | |
e811c8ce | 5603 | def SetShow(*args, **kwargs): |
a95a7133 | 5604 | """SetShow(self, bool show)""" |
54f9ee45 | 5605 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
e811c8ce RD |
5606 | |
5607 | def GetShow(*args, **kwargs): | |
a95a7133 | 5608 | """GetShow(self) -> bool""" |
54f9ee45 | 5609 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
e811c8ce | 5610 | |
d14a1e28 RD |
5611 | |
5612 | class ShowEventPtr(ShowEvent): | |
5613 | def __init__(self, this): | |
5614 | self.this = this | |
5615 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5616 | self.__class__ = ShowEvent | |
54f9ee45 | 5617 | _core_.ShowEvent_swigregister(ShowEventPtr) |
d14a1e28 RD |
5618 | |
5619 | #--------------------------------------------------------------------------- | |
5620 | ||
5621 | class IconizeEvent(Event): | |
5ba5649b RD |
5622 | """ |
5623 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5624 | restored. | |
5625 | """ | |
e811c8ce RD |
5626 | def __repr__(self): |
5627 | return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5628 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5629 | """ |
5630 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5631 | ||
5632 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5633 | restored. | |
5634 | """ | |
54f9ee45 | 5635 | newobj = _core_.new_IconizeEvent(*args, **kwargs) |
d14a1e28 RD |
5636 | self.this = newobj.this |
5637 | self.thisown = 1 | |
5638 | del newobj.thisown | |
e811c8ce | 5639 | def Iconized(*args, **kwargs): |
5ba5649b RD |
5640 | """ |
5641 | Iconized(self) -> bool | |
5642 | ||
5643 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5644 | been restored. | |
5645 | """ | |
54f9ee45 | 5646 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
e811c8ce | 5647 | |
d14a1e28 RD |
5648 | |
5649 | class IconizeEventPtr(IconizeEvent): | |
5650 | def __init__(self, this): | |
5651 | self.this = this | |
5652 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5653 | self.__class__ = IconizeEvent | |
54f9ee45 | 5654 | _core_.IconizeEvent_swigregister(IconizeEventPtr) |
d14a1e28 RD |
5655 | |
5656 | #--------------------------------------------------------------------------- | |
5657 | ||
5658 | class MaximizeEvent(Event): | |
5ba5649b | 5659 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
e811c8ce RD |
5660 | def __repr__(self): |
5661 | return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5662 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5663 | """ |
5664 | __init__(self, int id=0) -> MaximizeEvent | |
5665 | ||
5666 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5667 | """ | |
54f9ee45 | 5668 | newobj = _core_.new_MaximizeEvent(*args, **kwargs) |
d14a1e28 RD |
5669 | self.this = newobj.this |
5670 | self.thisown = 1 | |
5671 | del newobj.thisown | |
d14a1e28 RD |
5672 | |
5673 | class MaximizeEventPtr(MaximizeEvent): | |
5674 | def __init__(self, this): | |
5675 | self.this = this | |
5676 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5677 | self.__class__ = MaximizeEvent | |
54f9ee45 | 5678 | _core_.MaximizeEvent_swigregister(MaximizeEventPtr) |
d14a1e28 RD |
5679 | |
5680 | #--------------------------------------------------------------------------- | |
5681 | ||
5682 | class DropFilesEvent(Event): | |
5ba5649b RD |
5683 | """ |
5684 | This class is used for drop files events, that is, when files have | |
5685 | been dropped onto the window. This functionality is only available | |
5686 | under Windows. The window must have previously been enabled for | |
5687 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5688 | ||
5689 | Important note: this is a separate implementation to the more general | |
5690 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5691 | implementation uses the older, Windows message-based approach of | |
5692 | dropping files. | |
5693 | ||
5694 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5695 | events. | |
5696 | ||
5697 | """ | |
d14a1e28 RD |
5698 | def __init__(self): raise RuntimeError, "No constructor defined" |
5699 | def __repr__(self): | |
5700 | return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
e811c8ce | 5701 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5702 | """ |
5703 | GetPosition(self) -> Point | |
5704 | ||
5705 | Returns the position at which the files were dropped. | |
5706 | """ | |
54f9ee45 | 5707 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5708 | |
5709 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5710 | """ |
5711 | GetNumberOfFiles(self) -> int | |
5712 | ||
5713 | Returns the number of files dropped. | |
5714 | """ | |
54f9ee45 | 5715 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
e811c8ce RD |
5716 | |
5717 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5718 | """ |
5719 | GetFiles(self) -> PyObject | |
5720 | ||
5721 | Returns a list of the filenames that were dropped. | |
5722 | """ | |
54f9ee45 | 5723 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
e811c8ce | 5724 | |
d14a1e28 RD |
5725 | |
5726 | class DropFilesEventPtr(DropFilesEvent): | |
5727 | def __init__(self, this): | |
5728 | self.this = this | |
5729 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5730 | self.__class__ = DropFilesEvent | |
54f9ee45 | 5731 | _core_.DropFilesEvent_swigregister(DropFilesEventPtr) |
d14a1e28 RD |
5732 | |
5733 | #--------------------------------------------------------------------------- | |
5734 | ||
54f9ee45 RD |
5735 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
5736 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
d14a1e28 | 5737 | class UpdateUIEvent(CommandEvent): |
5ba5649b RD |
5738 | """ |
5739 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5740 | wxWidgets to give an application the chance to update various user | |
5741 | interface elements. | |
5742 | ||
5743 | Without update UI events, an application has to work hard to | |
5744 | check/uncheck, enable/disable, and set the text for elements such as | |
5745 | menu items and toolbar buttons. The code for doing this has to be | |
5746 | mixed up with the code that is invoked when an action is invoked for a | |
5747 | menu item or button. | |
5748 | ||
5749 | With update UI events, you define an event handler to look at the | |
5750 | state of the application and change UI elements accordingly. wxWidgets | |
5751 | will call your handler functions in idle time, so you don't have to | |
5752 | worry where to call this code. In addition to being a clearer and more | |
5753 | declarative method, it also means you don't have to worry whether | |
5754 | you're updating a toolbar or menubar identifier. The same handler can | |
5755 | update a menu item and toolbar button, if the ID values are the same. | |
5756 | ||
5757 | Instead of directly manipulating the menu or button, you call | |
5758 | functions in the event object, such as `Check`. wxWidgets will | |
5759 | determine whether such a call has been made, and which UI element to | |
5760 | update. | |
5761 | ||
5762 | These events will work for popup menus as well as menubars. Just | |
5763 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5764 | any UI events for the window that owns the menu. | |
5765 | ||
5766 | If you find that the overhead of UI update processing is affecting | |
5767 | your application, you can do one or both of the following: | |
5768 | ||
5769 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5770 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5771 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5772 | receive update events. No other windows will receive update | |
5773 | events. | |
5774 | ||
5775 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5776 | value to set the delay between updates. You may need to call | |
5777 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5778 | a dialog is about to be shown, in case the user sees a slight | |
5779 | delay before windows are updated. | |
5780 | ||
5781 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5782 | handler for a window does not affect this because the events are sent | |
5783 | from an internal idle handler. | |
5784 | ||
5785 | wxWidgets tries to optimize update events on some platforms. On | |
5786 | Windows and GTK+, events for menubar items are only sent when the menu | |
5787 | is about to be shown, and not in idle time. | |
5788 | ||
5789 | """ | |
e811c8ce RD |
5790 | def __repr__(self): |
5791 | return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 5792 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
5793 | """ |
5794 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5795 | ||
5796 | Constructor | |
5797 | """ | |
54f9ee45 | 5798 | newobj = _core_.new_UpdateUIEvent(*args, **kwargs) |
d14a1e28 RD |
5799 | self.this = newobj.this |
5800 | self.thisown = 1 | |
5801 | del newobj.thisown | |
e811c8ce | 5802 | def GetChecked(*args, **kwargs): |
5ba5649b RD |
5803 | """ |
5804 | GetChecked(self) -> bool | |
5805 | ||
5806 | Returns ``True`` if the UI element should be checked. | |
5807 | """ | |
54f9ee45 | 5808 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
e811c8ce RD |
5809 | |
5810 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
5811 | """ |
5812 | GetEnabled(self) -> bool | |
5813 | ||
5814 | Returns ``True`` if the UI element should be enabled. | |
5815 | """ | |
54f9ee45 | 5816 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
e811c8ce RD |
5817 | |
5818 | def GetText(*args, **kwargs): | |
5ba5649b RD |
5819 | """ |
5820 | GetText(self) -> String | |
5821 | ||
5822 | Returns the text that should be set for the UI element. | |
5823 | """ | |
54f9ee45 | 5824 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
e811c8ce RD |
5825 | |
5826 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
5827 | """ |
5828 | GetSetText(self) -> bool | |
5829 | ||
5830 | Returns ``True`` if the application has called `SetText`. For | |
5831 | wxWidgets internal use only. | |
5832 | """ | |
54f9ee45 | 5833 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
e811c8ce RD |
5834 | |
5835 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
5836 | """ |
5837 | GetSetChecked(self) -> bool | |
5838 | ||
5839 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
5840 | internal use only. | |
5841 | """ | |
54f9ee45 | 5842 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
e811c8ce RD |
5843 | |
5844 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
5845 | """ |
5846 | GetSetEnabled(self) -> bool | |
5847 | ||
5848 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
5849 | internal use only. | |
5850 | """ | |
54f9ee45 | 5851 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
e811c8ce RD |
5852 | |
5853 | def Check(*args, **kwargs): | |
5ba5649b RD |
5854 | """ |
5855 | Check(self, bool check) | |
5856 | ||
5857 | Check or uncheck the UI element. | |
5858 | """ | |
54f9ee45 | 5859 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
e811c8ce RD |
5860 | |
5861 | def Enable(*args, **kwargs): | |
5ba5649b RD |
5862 | """ |
5863 | Enable(self, bool enable) | |
5864 | ||
5865 | Enable or disable the UI element. | |
5866 | """ | |
54f9ee45 | 5867 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
e811c8ce RD |
5868 | |
5869 | def SetText(*args, **kwargs): | |
5ba5649b RD |
5870 | """ |
5871 | SetText(self, String text) | |
5872 | ||
5873 | Sets the text for this UI element. | |
5874 | """ | |
54f9ee45 | 5875 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
e811c8ce RD |
5876 | |
5877 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5878 | """ |
5879 | SetUpdateInterval(long updateInterval) | |
5880 | ||
5881 | Sets the interval between updates in milliseconds. Set to -1 to | |
5882 | disable updates, or to 0 to update as frequently as possible. The | |
5883 | default is 0. | |
5884 | ||
5885 | Use this to reduce the overhead of UI update events if your | |
5886 | application has a lot of windows. If you set the value to -1 or | |
5887 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5888 | at appropriate points in your application, such as when a dialog is | |
5889 | about to be shown. | |
5890 | """ | |
54f9ee45 | 5891 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5892 | |
5893 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
5894 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5895 | """ |
5896 | GetUpdateInterval() -> long | |
5897 | ||
5898 | Returns the current interval between updates in milliseconds. -1 | |
5899 | disables updates, 0 updates as frequently as possible. | |
5900 | """ | |
54f9ee45 | 5901 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5902 | |
5903 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
5904 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
5905 | """ |
5906 | CanUpdate(Window win) -> bool | |
5907 | ||
5908 | Returns ``True`` if it is appropriate to update (send UI update events | |
5909 | to) this window. | |
5910 | ||
5911 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5912 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5913 | events were last sent in idle time, and the update interval, to | |
5914 | determine whether events should be sent to this window now. By default | |
5915 | this will always return true because the update mode is initially | |
5916 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5917 | events will be sent as often as possible. You can reduce the frequency | |
5918 | that events are sent by changing the mode and/or setting an update | |
5919 | interval. | |
5920 | ||
5921 | """ | |
54f9ee45 | 5922 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
e811c8ce RD |
5923 | |
5924 | CanUpdate = staticmethod(CanUpdate) | |
5925 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
5926 | """ |
5927 | ResetUpdateTime() | |
5928 | ||
5929 | Used internally to reset the last-updated time to the current time. It | |
5930 | is assumed that update events are normally sent in idle time, so this | |
5931 | is called at the end of idle processing. | |
5932 | """ | |
54f9ee45 | 5933 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
e811c8ce RD |
5934 | |
5935 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
5936 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
5937 | """ |
5938 | SetMode(int mode) | |
5939 | ||
5940 | Specify how wxWidgets will send update events: to all windows, or only | |
5941 | to those which specify that they will process the events. | |
5942 | ||
5943 | The mode may be one of the following values: | |
5944 | ||
5945 | ============================= ========================================== | |
5946 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5947 | is the default setting. | |
5948 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5949 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5950 | style set. | |
5951 | ============================= ========================================== | |
5952 | ||
5953 | """ | |
54f9ee45 | 5954 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
5955 | |
5956 | SetMode = staticmethod(SetMode) | |
5957 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
5958 | """ |
5959 | GetMode() -> int | |
5960 | ||
5961 | Returns a value specifying how wxWidgets will send update events: to | |
5962 | all windows, or only to those which specify that they will process the | |
5963 | events. | |
5964 | """ | |
54f9ee45 | 5965 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
5966 | |
5967 | GetMode = staticmethod(GetMode) | |
d14a1e28 RD |
5968 | |
5969 | class UpdateUIEventPtr(UpdateUIEvent): | |
5970 | def __init__(self, this): | |
5971 | self.this = this | |
5972 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5973 | self.__class__ = UpdateUIEvent | |
54f9ee45 | 5974 | _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr) |
d14a1e28 | 5975 | |
e811c8ce | 5976 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
5ba5649b RD |
5977 | """ |
5978 | UpdateUIEvent_SetUpdateInterval(long updateInterval) | |
5979 | ||
5980 | Sets the interval between updates in milliseconds. Set to -1 to | |
5981 | disable updates, or to 0 to update as frequently as possible. The | |
5982 | default is 0. | |
5983 | ||
5984 | Use this to reduce the overhead of UI update events if your | |
5985 | application has a lot of windows. If you set the value to -1 or | |
5986 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5987 | at appropriate points in your application, such as when a dialog is | |
5988 | about to be shown. | |
5989 | """ | |
54f9ee45 | 5990 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d14a1e28 | 5991 | |
e811c8ce | 5992 | def UpdateUIEvent_GetUpdateInterval(*args, **kwargs): |
5ba5649b RD |
5993 | """ |
5994 | UpdateUIEvent_GetUpdateInterval() -> long | |
5995 | ||
5996 | Returns the current interval between updates in milliseconds. -1 | |
5997 | disables updates, 0 updates as frequently as possible. | |
5998 | """ | |
54f9ee45 | 5999 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
d14a1e28 | 6000 | |
e811c8ce | 6001 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
5ba5649b RD |
6002 | """ |
6003 | UpdateUIEvent_CanUpdate(Window win) -> bool | |
6004 | ||
6005 | Returns ``True`` if it is appropriate to update (send UI update events | |
6006 | to) this window. | |
6007 | ||
6008 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6009 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6010 | events were last sent in idle time, and the update interval, to | |
6011 | determine whether events should be sent to this window now. By default | |
6012 | this will always return true because the update mode is initially | |
6013 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6014 | events will be sent as often as possible. You can reduce the frequency | |
6015 | that events are sent by changing the mode and/or setting an update | |
6016 | interval. | |
6017 | ||
6018 | """ | |
54f9ee45 | 6019 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d14a1e28 | 6020 | |
e811c8ce | 6021 | def UpdateUIEvent_ResetUpdateTime(*args, **kwargs): |
5ba5649b RD |
6022 | """ |
6023 | UpdateUIEvent_ResetUpdateTime() | |
6024 | ||
6025 | Used internally to reset the last-updated time to the current time. It | |
6026 | is assumed that update events are normally sent in idle time, so this | |
6027 | is called at the end of idle processing. | |
6028 | """ | |
54f9ee45 | 6029 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
d14a1e28 | 6030 | |
e811c8ce | 6031 | def UpdateUIEvent_SetMode(*args, **kwargs): |
5ba5649b RD |
6032 | """ |
6033 | UpdateUIEvent_SetMode(int mode) | |
6034 | ||
6035 | Specify how wxWidgets will send update events: to all windows, or only | |
6036 | to those which specify that they will process the events. | |
6037 | ||
6038 | The mode may be one of the following values: | |
6039 | ||
6040 | ============================= ========================================== | |
6041 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6042 | is the default setting. | |
6043 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6044 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6045 | style set. | |
6046 | ============================= ========================================== | |
6047 | ||
6048 | """ | |
54f9ee45 | 6049 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6050 | |
e811c8ce | 6051 | def UpdateUIEvent_GetMode(*args, **kwargs): |
5ba5649b RD |
6052 | """ |
6053 | UpdateUIEvent_GetMode() -> int | |
6054 | ||
6055 | Returns a value specifying how wxWidgets will send update events: to | |
6056 | all windows, or only to those which specify that they will process the | |
6057 | events. | |
6058 | """ | |
54f9ee45 | 6059 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
d14a1e28 RD |
6060 | |
6061 | #--------------------------------------------------------------------------- | |
6062 | ||
6063 | class SysColourChangedEvent(Event): | |
5ba5649b RD |
6064 | """ |
6065 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
6066 | when the user changes the colour settings using the control | |
6067 | panel. This is only applicable under Windows. | |
6068 | ||
6069 | The default event handler for this event propagates the event to child | |
6070 | windows, since Windows only sends the events to top-level windows. If | |
6071 | intercepting this event for a top-level window, remember to call | |
6072 | `Skip` so the the base class handler will still be executed, or to | |
6073 | pass the event on to the window's children explicitly. | |
6074 | ||
6075 | """ | |
e811c8ce RD |
6076 | def __repr__(self): |
6077 | return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6078 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
6079 | """ |
6080 | __init__(self) -> SysColourChangedEvent | |
6081 | ||
6082 | Constructor | |
6083 | """ | |
54f9ee45 | 6084 | newobj = _core_.new_SysColourChangedEvent(*args, **kwargs) |
d14a1e28 RD |
6085 | self.this = newobj.this |
6086 | self.thisown = 1 | |
6087 | del newobj.thisown | |
d14a1e28 RD |
6088 | |
6089 | class SysColourChangedEventPtr(SysColourChangedEvent): | |
6090 | def __init__(self, this): | |
6091 | self.this = this | |
6092 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6093 | self.__class__ = SysColourChangedEvent | |
54f9ee45 | 6094 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr) |
d14a1e28 RD |
6095 | |
6096 | #--------------------------------------------------------------------------- | |
6097 | ||
6098 | class MouseCaptureChangedEvent(Event): | |
5ba5649b RD |
6099 | """ |
6100 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
6101 | a window that loses its mouse capture. This is called even if | |
6102 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
6103 | this event allows an application to cater for unexpected capture | |
6104 | releases which might otherwise confuse mouse handling code. | |
6105 | ||
6106 | This event is implemented under Windows only. | |
6107 | """ | |
e811c8ce RD |
6108 | def __repr__(self): |
6109 | return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6110 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
6111 | """ |
6112 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
6113 | ||
6114 | Constructor | |
6115 | """ | |
54f9ee45 | 6116 | newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs) |
d14a1e28 RD |
6117 | self.this = newobj.this |
6118 | self.thisown = 1 | |
6119 | del newobj.thisown | |
e811c8ce | 6120 | def GetCapturedWindow(*args, **kwargs): |
5ba5649b RD |
6121 | """ |
6122 | GetCapturedWindow(self) -> Window | |
6123 | ||
6124 | Returns the window that gained the capture, or ``None`` if it was a | |
6125 | non-wxWidgets window. | |
6126 | """ | |
54f9ee45 | 6127 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
e811c8ce | 6128 | |
d14a1e28 RD |
6129 | |
6130 | class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent): | |
6131 | def __init__(self, this): | |
6132 | self.this = this | |
6133 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6134 | self.__class__ = MouseCaptureChangedEvent | |
54f9ee45 | 6135 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr) |
d14a1e28 RD |
6136 | |
6137 | #--------------------------------------------------------------------------- | |
6138 | ||
6139 | class DisplayChangedEvent(Event): | |
5ba5649b RD |
6140 | """ |
6141 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
6142 | resolution has changed. | |
6143 | ||
6144 | This event is implemented under Windows only. | |
6145 | """ | |
e811c8ce RD |
6146 | def __repr__(self): |
6147 | return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6148 | def __init__(self, *args, **kwargs): |
a95a7133 | 6149 | """__init__(self) -> DisplayChangedEvent""" |
54f9ee45 | 6150 | newobj = _core_.new_DisplayChangedEvent(*args, **kwargs) |
d14a1e28 RD |
6151 | self.this = newobj.this |
6152 | self.thisown = 1 | |
6153 | del newobj.thisown | |
d14a1e28 RD |
6154 | |
6155 | class DisplayChangedEventPtr(DisplayChangedEvent): | |
6156 | def __init__(self, this): | |
6157 | self.this = this | |
6158 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6159 | self.__class__ = DisplayChangedEvent | |
54f9ee45 | 6160 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr) |
d14a1e28 RD |
6161 | |
6162 | #--------------------------------------------------------------------------- | |
6163 | ||
6164 | class PaletteChangedEvent(Event): | |
5ba5649b RD |
6165 | """ |
6166 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6167 | changed, thereby giving each window a chance to redo their own to | |
6168 | match. | |
6169 | ||
6170 | This event is implemented under Windows only. | |
6171 | """ | |
e811c8ce RD |
6172 | def __repr__(self): |
6173 | return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6174 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
6175 | """ |
6176 | __init__(self, int id=0) -> PaletteChangedEvent | |
6177 | ||
6178 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6179 | changed, thereby giving each window a chance to redo their own to | |
6180 | match. | |
6181 | ||
6182 | This event is implemented under Windows only. | |
6183 | """ | |
54f9ee45 | 6184 | newobj = _core_.new_PaletteChangedEvent(*args, **kwargs) |
d14a1e28 RD |
6185 | self.this = newobj.this |
6186 | self.thisown = 1 | |
6187 | del newobj.thisown | |
e811c8ce | 6188 | def SetChangedWindow(*args, **kwargs): |
a95a7133 | 6189 | """SetChangedWindow(self, Window win)""" |
54f9ee45 | 6190 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) |
e811c8ce RD |
6191 | |
6192 | def GetChangedWindow(*args, **kwargs): | |
a95a7133 | 6193 | """GetChangedWindow(self) -> Window""" |
54f9ee45 | 6194 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) |
e811c8ce | 6195 | |
d14a1e28 RD |
6196 | |
6197 | class PaletteChangedEventPtr(PaletteChangedEvent): | |
6198 | def __init__(self, this): | |
6199 | self.this = this | |
6200 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6201 | self.__class__ = PaletteChangedEvent | |
54f9ee45 | 6202 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr) |
d14a1e28 RD |
6203 | |
6204 | #--------------------------------------------------------------------------- | |
6205 | ||
6206 | class QueryNewPaletteEvent(Event): | |
5ba5649b RD |
6207 | """ |
6208 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6209 | focus and should re-do its palette. | |
6210 | ||
6211 | This event is implemented under Windows only. | |
6212 | """ | |
e811c8ce RD |
6213 | def __repr__(self): |
6214 | return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6215 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
6216 | """ |
6217 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6218 | ||
6219 | Constructor. | |
6220 | """ | |
54f9ee45 | 6221 | newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs) |
d14a1e28 RD |
6222 | self.this = newobj.this |
6223 | self.thisown = 1 | |
6224 | del newobj.thisown | |
e811c8ce | 6225 | def SetPaletteRealized(*args, **kwargs): |
5ba5649b RD |
6226 | """ |
6227 | SetPaletteRealized(self, bool realized) | |
6228 | ||
6229 | App should set this if it changes the palette. | |
6230 | """ | |
54f9ee45 | 6231 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
e811c8ce RD |
6232 | |
6233 | def GetPaletteRealized(*args, **kwargs): | |
a95a7133 | 6234 | """GetPaletteRealized(self) -> bool""" |
54f9ee45 | 6235 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
e811c8ce | 6236 | |
d14a1e28 RD |
6237 | |
6238 | class QueryNewPaletteEventPtr(QueryNewPaletteEvent): | |
6239 | def __init__(self, this): | |
6240 | self.this = this | |
6241 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6242 | self.__class__ = QueryNewPaletteEvent | |
54f9ee45 | 6243 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr) |
d14a1e28 RD |
6244 | |
6245 | #--------------------------------------------------------------------------- | |
6246 | ||
6247 | class NavigationKeyEvent(Event): | |
5ba5649b RD |
6248 | """ |
6249 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6250 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6251 | catch navigation events in applications as there are already | |
6252 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6253 | it useful to send navigation events in certain situations to change | |
6254 | the focus in certain ways, although it's probably easier to just call | |
6255 | `wx.Window.Navigate`. | |
6256 | """ | |
e811c8ce RD |
6257 | def __repr__(self): |
6258 | return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6259 | def __init__(self, *args, **kwargs): |
a95a7133 | 6260 | """__init__(self) -> NavigationKeyEvent""" |
54f9ee45 | 6261 | newobj = _core_.new_NavigationKeyEvent(*args, **kwargs) |
d14a1e28 RD |
6262 | self.this = newobj.this |
6263 | self.thisown = 1 | |
6264 | del newobj.thisown | |
e811c8ce | 6265 | def GetDirection(*args, **kwargs): |
5ba5649b RD |
6266 | """ |
6267 | GetDirection(self) -> bool | |
6268 | ||
6269 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6270 | """ | |
54f9ee45 | 6271 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
e811c8ce RD |
6272 | |
6273 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6274 | """ |
6275 | SetDirection(self, bool forward) | |
6276 | ||
6277 | Specify the direction that the navigation should take. Usually the | |
6278 | difference between using Tab and Shift-Tab. | |
6279 | """ | |
54f9ee45 | 6280 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
e811c8ce RD |
6281 | |
6282 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6283 | """ |
6284 | IsWindowChange(self) -> bool | |
6285 | ||
6286 | Returns ``True`` if window change is allowed. | |
6287 | """ | |
54f9ee45 | 6288 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
e811c8ce RD |
6289 | |
6290 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6291 | """ |
6292 | SetWindowChange(self, bool ischange) | |
6293 | ||
6294 | Specify if the navigation should be able to change parent windows. | |
6295 | For example, changing notebook pages, etc. This is usually implemented | |
6296 | by using Control-Tab. | |
6297 | """ | |
54f9ee45 | 6298 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
e811c8ce | 6299 | |
68350608 | 6300 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6301 | """ |
6302 | IsFromTab(self) -> bool | |
6303 | ||
6304 | Returns ``True`` if the navigation event is originated from the Tab | |
6305 | key. | |
6306 | """ | |
68350608 RD |
6307 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
6308 | ||
6309 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6310 | """ |
6311 | SetFromTab(self, bool bIs) | |
6312 | ||
6313 | Set to true under MSW if the event was generated using the tab key. | |
6314 | This is required for proper navogation over radio buttons. | |
6315 | """ | |
68350608 RD |
6316 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
6317 | ||
908b74cd | 6318 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6319 | """ |
6320 | SetFlags(self, long flags) | |
6321 | ||
6322 | Set the navigation flags to a combination of the following: | |
6323 | ||
6324 | * wx.NavigationKeyEvent.IsBackward | |
6325 | * wx.NavigationKeyEvent.IsForward | |
6326 | * wx.NavigationKeyEvent.WinChange | |
6327 | * wx.NavigationKeyEvent.FromTab | |
6328 | ||
6329 | """ | |
908b74cd RD |
6330 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
6331 | ||
e811c8ce | 6332 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6333 | """ |
6334 | GetCurrentFocus(self) -> Window | |
6335 | ||
6336 | Returns the child window which currenty has the focus. May be | |
6337 | ``None``. | |
6338 | """ | |
54f9ee45 | 6339 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
e811c8ce RD |
6340 | |
6341 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6342 | """ |
6343 | SetCurrentFocus(self, Window win) | |
6344 | ||
6345 | Set the window that has the focus. | |
6346 | """ | |
54f9ee45 | 6347 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
e811c8ce | 6348 | |
b0f7404b | 6349 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
908b74cd RD |
6350 | IsForward = _core_.NavigationKeyEvent_IsForward |
6351 | WinChange = _core_.NavigationKeyEvent_WinChange | |
68350608 | 6352 | FromTab = _core_.NavigationKeyEvent_FromTab |
d14a1e28 RD |
6353 | |
6354 | class NavigationKeyEventPtr(NavigationKeyEvent): | |
6355 | def __init__(self, this): | |
6356 | self.this = this | |
6357 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6358 | self.__class__ = NavigationKeyEvent | |
54f9ee45 | 6359 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr) |
d14a1e28 RD |
6360 | |
6361 | #--------------------------------------------------------------------------- | |
6362 | ||
6363 | class WindowCreateEvent(CommandEvent): | |
5ba5649b RD |
6364 | """ |
6365 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6366 | underlying GUI object) exists. | |
6367 | """ | |
e811c8ce RD |
6368 | def __repr__(self): |
6369 | return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6370 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
6371 | """ |
6372 | __init__(self, Window win=None) -> WindowCreateEvent | |
6373 | ||
6374 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6375 | underlying GUI object) exists. | |
6376 | """ | |
54f9ee45 | 6377 | newobj = _core_.new_WindowCreateEvent(*args, **kwargs) |
d14a1e28 RD |
6378 | self.this = newobj.this |
6379 | self.thisown = 1 | |
6380 | del newobj.thisown | |
e811c8ce | 6381 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6382 | """ |
6383 | GetWindow(self) -> Window | |
6384 | ||
6385 | Returns the window that this event refers to. | |
6386 | """ | |
54f9ee45 | 6387 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6388 | |
d14a1e28 RD |
6389 | |
6390 | class WindowCreateEventPtr(WindowCreateEvent): | |
6391 | def __init__(self, this): | |
6392 | self.this = this | |
6393 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6394 | self.__class__ = WindowCreateEvent | |
54f9ee45 | 6395 | _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr) |
d14a1e28 RD |
6396 | |
6397 | class WindowDestroyEvent(CommandEvent): | |
5ba5649b RD |
6398 | """ |
6399 | The EVT_WINDOW_DESTROY event is sent right before the window is | |
6400 | destroyed. | |
6401 | """ | |
e811c8ce RD |
6402 | def __repr__(self): |
6403 | return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6404 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
6405 | """ |
6406 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6407 | ||
6408 | The EVT_WINDOW_DESTROY event is sent right before the window is | |
6409 | destroyed. | |
6410 | """ | |
54f9ee45 | 6411 | newobj = _core_.new_WindowDestroyEvent(*args, **kwargs) |
d14a1e28 RD |
6412 | self.this = newobj.this |
6413 | self.thisown = 1 | |
6414 | del newobj.thisown | |
e811c8ce | 6415 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6416 | """ |
6417 | GetWindow(self) -> Window | |
6418 | ||
6419 | Returns the window that this event refers to. | |
6420 | """ | |
54f9ee45 | 6421 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6422 | |
d14a1e28 RD |
6423 | |
6424 | class WindowDestroyEventPtr(WindowDestroyEvent): | |
6425 | def __init__(self, this): | |
6426 | self.this = this | |
6427 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6428 | self.__class__ = WindowDestroyEvent | |
54f9ee45 | 6429 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr) |
d14a1e28 RD |
6430 | |
6431 | #--------------------------------------------------------------------------- | |
6432 | ||
6433 | class ContextMenuEvent(CommandEvent): | |
5ba5649b RD |
6434 | """ |
6435 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6436 | give the application a chance to show a context (popup) menu. | |
6437 | """ | |
e811c8ce RD |
6438 | def __repr__(self): |
6439 | return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6440 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
6441 | """ |
6442 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent | |
6443 | ||
6444 | Constructor. | |
6445 | """ | |
54f9ee45 | 6446 | newobj = _core_.new_ContextMenuEvent(*args, **kwargs) |
d14a1e28 RD |
6447 | self.this = newobj.this |
6448 | self.thisown = 1 | |
6449 | del newobj.thisown | |
e811c8ce | 6450 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
6451 | """ |
6452 | GetPosition(self) -> Point | |
6453 | ||
6454 | Returns the position (in screen coordinants) at which the menu should | |
6455 | be shown. | |
6456 | """ | |
54f9ee45 | 6457 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
6458 | |
6459 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6460 | """ |
6461 | SetPosition(self, Point pos) | |
6462 | ||
6463 | Sets the position at which the menu should be shown. | |
6464 | """ | |
54f9ee45 | 6465 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
e811c8ce | 6466 | |
d14a1e28 RD |
6467 | |
6468 | class ContextMenuEventPtr(ContextMenuEvent): | |
6469 | def __init__(self, this): | |
6470 | self.this = this | |
6471 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6472 | self.__class__ = ContextMenuEvent | |
54f9ee45 | 6473 | _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr) |
d14a1e28 RD |
6474 | |
6475 | #--------------------------------------------------------------------------- | |
6476 | ||
54f9ee45 RD |
6477 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6478 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
d14a1e28 | 6479 | class IdleEvent(Event): |
5ba5649b RD |
6480 | """ |
6481 | This class is used for EVT_IDLE events, which are generated and sent | |
6482 | when the application *becomes* idle. In other words, the when the | |
6483 | event queue becomes empty then idle events are sent to all windows (by | |
6484 | default) and as long as none of them call `RequestMore` then there are | |
6485 | no more idle events until after the system event queue has some normal | |
6486 | events and then becomes empty again. | |
6487 | ||
6488 | By default, idle events are sent to all windows. If this is causing a | |
6489 | significant overhead in your application, you can call | |
6490 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6491 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6492 | which should receive idle events. Then idle events will only be sent | |
6493 | to those windows and not to any others. | |
6494 | """ | |
e811c8ce RD |
6495 | def __repr__(self): |
6496 | return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6497 | def __init__(self, *args, **kwargs): |
5ba5649b RD |
6498 | """ |
6499 | __init__(self) -> IdleEvent | |
6500 | ||
6501 | Constructor | |
6502 | """ | |
54f9ee45 | 6503 | newobj = _core_.new_IdleEvent(*args, **kwargs) |
d14a1e28 RD |
6504 | self.this = newobj.this |
6505 | self.thisown = 1 | |
6506 | del newobj.thisown | |
e811c8ce | 6507 | def RequestMore(*args, **kwargs): |
5ba5649b RD |
6508 | """ |
6509 | RequestMore(self, bool needMore=True) | |
6510 | ||
6511 | Tells wxWidgets that more processing is required. This function can be | |
6512 | called by an EVT_IDLE handler for a window to indicate that the | |
6513 | application should forward the EVT_IDLE event once more to the | |
6514 | application windows. If no window calls this function during its | |
6515 | EVT_IDLE handler, then the application will remain in a passive event | |
6516 | loop until a new event is posted to the application by the windowing | |
6517 | system. | |
6518 | """ | |
54f9ee45 | 6519 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
e811c8ce RD |
6520 | |
6521 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6522 | """ |
6523 | MoreRequested(self) -> bool | |
6524 | ||
6525 | Returns ``True`` if the OnIdle function processing this event | |
6526 | requested more processing time. | |
6527 | """ | |
54f9ee45 | 6528 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
e811c8ce RD |
6529 | |
6530 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6531 | """ |
6532 | SetMode(int mode) | |
6533 | ||
6534 | Static method for specifying how wxWidgets will send idle events: to | |
6535 | all windows, or only to those which specify that they will process the | |
6536 | events. | |
6537 | ||
6538 | The mode can be one of the following values: | |
6539 | ||
6540 | ========================= ======================================== | |
6541 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6542 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6543 | the wx.WS_EX_PROCESS_IDLE extra style | |
6544 | flag set. | |
6545 | ========================= ======================================== | |
6546 | ||
6547 | """ | |
54f9ee45 | 6548 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
6549 | |
6550 | SetMode = staticmethod(SetMode) | |
6551 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6552 | """ |
6553 | GetMode() -> int | |
6554 | ||
6555 | Static method returning a value specifying how wxWidgets will send | |
6556 | idle events: to all windows, or only to those which specify that they | |
6557 | will process the events. | |
6558 | """ | |
54f9ee45 | 6559 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
6560 | |
6561 | GetMode = staticmethod(GetMode) | |
6562 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6563 | """ |
6564 | CanSend(Window win) -> bool | |
6565 | ||
6566 | Returns ``True`` if it is appropriate to send idle events to this | |
6567 | window. | |
6568 | ||
6569 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6570 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6571 | events should be sent to this window now. By default this will always | |
6572 | return ``True`` because the update mode is initially | |
6573 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6574 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6575 | """ | |
54f9ee45 | 6576 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
e811c8ce RD |
6577 | |
6578 | CanSend = staticmethod(CanSend) | |
d14a1e28 RD |
6579 | |
6580 | class IdleEventPtr(IdleEvent): | |
6581 | def __init__(self, this): | |
6582 | self.this = this | |
6583 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6584 | self.__class__ = IdleEvent | |
54f9ee45 | 6585 | _core_.IdleEvent_swigregister(IdleEventPtr) |
d14a1e28 | 6586 | |
e811c8ce | 6587 | def IdleEvent_SetMode(*args, **kwargs): |
5ba5649b RD |
6588 | """ |
6589 | IdleEvent_SetMode(int mode) | |
6590 | ||
6591 | Static method for specifying how wxWidgets will send idle events: to | |
6592 | all windows, or only to those which specify that they will process the | |
6593 | events. | |
6594 | ||
6595 | The mode can be one of the following values: | |
6596 | ||
6597 | ========================= ======================================== | |
6598 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6599 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6600 | the wx.WS_EX_PROCESS_IDLE extra style | |
6601 | flag set. | |
6602 | ========================= ======================================== | |
6603 | ||
6604 | """ | |
54f9ee45 | 6605 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6606 | |
e811c8ce | 6607 | def IdleEvent_GetMode(*args, **kwargs): |
5ba5649b RD |
6608 | """ |
6609 | IdleEvent_GetMode() -> int | |
6610 | ||
6611 | Static method returning a value specifying how wxWidgets will send | |
6612 | idle events: to all windows, or only to those which specify that they | |
6613 | will process the events. | |
6614 | """ | |
54f9ee45 | 6615 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
d14a1e28 | 6616 | |
e811c8ce | 6617 | def IdleEvent_CanSend(*args, **kwargs): |
5ba5649b RD |
6618 | """ |
6619 | IdleEvent_CanSend(Window win) -> bool | |
6620 | ||
6621 | Returns ``True`` if it is appropriate to send idle events to this | |
6622 | window. | |
6623 | ||
6624 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6625 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6626 | events should be sent to this window now. By default this will always | |
6627 | return ``True`` because the update mode is initially | |
6628 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6629 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6630 | """ | |
54f9ee45 | 6631 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d14a1e28 RD |
6632 | |
6633 | #--------------------------------------------------------------------------- | |
6634 | ||
6635 | class PyEvent(Event): | |
5ba5649b RD |
6636 | """ |
6637 | wx.PyEvent can be used as a base class for implementing custom event | |
6638 | types in Python. You should derived from this class instead of | |
6639 | `wx.Event` because this class is Python-aware and is able to transport | |
6640 | its Python bits safely through the wxWidgets event system and have | |
6641 | them still be there when the event handler is invoked. | |
6642 | ||
6643 | :see: `wx.PyCommandEvent` | |
6644 | ||
6645 | """ | |
e811c8ce RD |
6646 | def __repr__(self): |
6647 | return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6648 | def __init__(self, *args, **kwargs): |
5ba5649b | 6649 | """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent""" |
54f9ee45 | 6650 | newobj = _core_.new_PyEvent(*args, **kwargs) |
d14a1e28 RD |
6651 | self.this = newobj.this |
6652 | self.thisown = 1 | |
6653 | del newobj.thisown | |
5ba5649b | 6654 | self._SetSelf(self) |
e811c8ce | 6655 | |
54f9ee45 | 6656 | def __del__(self, destroy=_core_.delete_PyEvent): |
a95a7133 | 6657 | """__del__(self)""" |
d14a1e28 RD |
6658 | try: |
6659 | if self.thisown: destroy(self) | |
6660 | except: pass | |
e811c8ce | 6661 | |
5ba5649b RD |
6662 | def _SetSelf(*args, **kwargs): |
6663 | """_SetSelf(self, PyObject self)""" | |
6664 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6665 | |
5ba5649b RD |
6666 | def _GetSelf(*args, **kwargs): |
6667 | """_GetSelf(self) -> PyObject""" | |
6668 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6669 | |
d14a1e28 RD |
6670 | |
6671 | class PyEventPtr(PyEvent): | |
6672 | def __init__(self, this): | |
6673 | self.this = this | |
6674 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6675 | self.__class__ = PyEvent | |
54f9ee45 | 6676 | _core_.PyEvent_swigregister(PyEventPtr) |
d14a1e28 RD |
6677 | |
6678 | class PyCommandEvent(CommandEvent): | |
5ba5649b RD |
6679 | """ |
6680 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6681 | event types in Python, where the event shoudl travel up to parent | |
6682 | windows looking for a handler. You should derived from this class | |
6683 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6684 | able to transport its Python bits safely through the wxWidgets event | |
6685 | system and have them still be there when the event handler is invoked. | |
6686 | ||
6687 | :see: `wx.PyEvent` | |
6688 | ||
6689 | """ | |
e811c8ce RD |
6690 | def __repr__(self): |
6691 | return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6692 | def __init__(self, *args, **kwargs): |
5ba5649b | 6693 | """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
54f9ee45 | 6694 | newobj = _core_.new_PyCommandEvent(*args, **kwargs) |
d14a1e28 RD |
6695 | self.this = newobj.this |
6696 | self.thisown = 1 | |
6697 | del newobj.thisown | |
5ba5649b | 6698 | self._SetSelf(self) |
e811c8ce | 6699 | |
54f9ee45 | 6700 | def __del__(self, destroy=_core_.delete_PyCommandEvent): |
a95a7133 | 6701 | """__del__(self)""" |
d14a1e28 RD |
6702 | try: |
6703 | if self.thisown: destroy(self) | |
6704 | except: pass | |
e811c8ce | 6705 | |
5ba5649b RD |
6706 | def _SetSelf(*args, **kwargs): |
6707 | """_SetSelf(self, PyObject self)""" | |
6708 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6709 | |
5ba5649b RD |
6710 | def _GetSelf(*args, **kwargs): |
6711 | """_GetSelf(self) -> PyObject""" | |
6712 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6713 | |
d14a1e28 RD |
6714 | |
6715 | class PyCommandEventPtr(PyCommandEvent): | |
6716 | def __init__(self, this): | |
6717 | self.this = this | |
6718 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6719 | self.__class__ = PyCommandEvent | |
54f9ee45 | 6720 | _core_.PyCommandEvent_swigregister(PyCommandEventPtr) |
d14a1e28 | 6721 | |
53aa7709 | 6722 | class DateEvent(CommandEvent): |
5ba5649b RD |
6723 | """ |
6724 | This event class holds information about a date change event and is | |
6725 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6726 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6727 | EVT_DATE_CHANGED. | |
6728 | """ | |
53aa7709 RD |
6729 | def __repr__(self): |
6730 | return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6731 | def __init__(self, *args, **kwargs): | |
6732 | """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent""" | |
6733 | newobj = _core_.new_DateEvent(*args, **kwargs) | |
6734 | self.this = newobj.this | |
6735 | self.thisown = 1 | |
6736 | del newobj.thisown | |
6737 | def GetDate(*args, **kwargs): | |
5ba5649b RD |
6738 | """ |
6739 | GetDate(self) -> DateTime | |
6740 | ||
6741 | Returns the date. | |
6742 | """ | |
53aa7709 RD |
6743 | return _core_.DateEvent_GetDate(*args, **kwargs) |
6744 | ||
6745 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6746 | """ |
6747 | SetDate(self, DateTime date) | |
6748 | ||
6749 | Sets the date carried by the event, normally only used by the library | |
6750 | internally. | |
6751 | """ | |
53aa7709 RD |
6752 | return _core_.DateEvent_SetDate(*args, **kwargs) |
6753 | ||
6754 | ||
6755 | class DateEventPtr(DateEvent): | |
6756 | def __init__(self, this): | |
6757 | self.this = this | |
6758 | if not hasattr(self,"thisown"): self.thisown = 0 | |
6759 | self.__class__ = DateEvent | |
6760 | _core_.DateEvent_swigregister(DateEventPtr) | |
6761 | ||
6762 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
6763 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
6764 | ||
d14a1e28 RD |
6765 | #--------------------------------------------------------------------------- |
6766 | ||
54f9ee45 RD |
6767 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
6768 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6769 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6770 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6771 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6772 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
d14a1e28 | 6773 | class PyApp(EvtHandler): |
66c033b4 RD |
6774 | """ |
6775 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6776 | `wx.App` class (or some other derived class) instead. | |
6777 | """ | |
e811c8ce RD |
6778 | def __repr__(self): |
6779 | return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 6780 | def __init__(self, *args, **kwargs): |
98e665d3 | 6781 | """ |
a95a7133 | 6782 | __init__(self) -> PyApp |
98e665d3 RD |
6783 | |
6784 | Create a new application object, starting the bootstrap process. | |
6785 | """ | |
54f9ee45 | 6786 | newobj = _core_.new_PyApp(*args, **kwargs) |
d14a1e28 RD |
6787 | self.this = newobj.this |
6788 | self.thisown = 1 | |
6789 | del newobj.thisown | |
70b7a5fe RD |
6790 | self._setCallbackInfo(self, PyApp, False) |
6791 | self._setOORInfo(self, False) | |
e811c8ce | 6792 | |
54f9ee45 | 6793 | def __del__(self, destroy=_core_.delete_PyApp): |
a95a7133 | 6794 | """__del__(self)""" |
d14a1e28 RD |
6795 | try: |
6796 | if self.thisown: destroy(self) | |
6797 | except: pass | |
e811c8ce RD |
6798 | |
6799 | def _setCallbackInfo(*args, **kwargs): | |
70b7a5fe | 6800 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
54f9ee45 | 6801 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
6802 | |
6803 | def GetAppName(*args, **kwargs): | |
0df68c9f | 6804 | """ |
a95a7133 | 6805 | GetAppName(self) -> String |
6c3b4aae | 6806 | |
0df68c9f RD |
6807 | Get the application name. |
6808 | """ | |
54f9ee45 | 6809 | return _core_.PyApp_GetAppName(*args, **kwargs) |
e811c8ce RD |
6810 | |
6811 | def SetAppName(*args, **kwargs): | |
0df68c9f | 6812 | """ |
a95a7133 | 6813 | SetAppName(self, String name) |
6c3b4aae | 6814 | |
66c033b4 RD |
6815 | Set the application name. This value may be used automatically by |
6816 | `wx.Config` and such. | |
0df68c9f | 6817 | """ |
54f9ee45 | 6818 | return _core_.PyApp_SetAppName(*args, **kwargs) |
e811c8ce RD |
6819 | |
6820 | def GetClassName(*args, **kwargs): | |
0df68c9f | 6821 | """ |
a95a7133 | 6822 | GetClassName(self) -> String |
e811c8ce | 6823 | |
0df68c9f RD |
6824 | Get the application's class name. |
6825 | """ | |
54f9ee45 | 6826 | return _core_.PyApp_GetClassName(*args, **kwargs) |
e811c8ce RD |
6827 | |
6828 | def SetClassName(*args, **kwargs): | |
0df68c9f | 6829 | """ |
a95a7133 | 6830 | SetClassName(self, String name) |
6c3b4aae | 6831 | |
66c033b4 RD |
6832 | Set the application's class name. This value may be used for |
6833 | X-resources if applicable for the platform | |
0df68c9f | 6834 | """ |
54f9ee45 | 6835 | return _core_.PyApp_SetClassName(*args, **kwargs) |
e811c8ce RD |
6836 | |
6837 | def GetVendorName(*args, **kwargs): | |
0df68c9f | 6838 | """ |
a95a7133 | 6839 | GetVendorName(self) -> String |
6c3b4aae | 6840 | |
0df68c9f RD |
6841 | Get the application's vendor name. |
6842 | """ | |
54f9ee45 | 6843 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
e811c8ce RD |
6844 | |
6845 | def SetVendorName(*args, **kwargs): | |
0df68c9f | 6846 | """ |
a95a7133 | 6847 | SetVendorName(self, String name) |
6c3b4aae | 6848 | |
66c033b4 RD |
6849 | Set the application's vendor name. This value may be used |
6850 | automatically by `wx.Config` and such. | |
0df68c9f | 6851 | """ |
54f9ee45 | 6852 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
e811c8ce RD |
6853 | |
6854 | def GetTraits(*args, **kwargs): | |
0df68c9f | 6855 | """ |
a95a7133 | 6856 | GetTraits(self) -> wxAppTraits |
6c3b4aae | 6857 | |
66c033b4 RD |
6858 | Return (and create if necessary) the app traits object to which we |
6859 | delegate for everything which either should be configurable by the | |
6860 | user (then he can change the default behaviour simply by overriding | |
6861 | CreateTraits() and returning his own traits object) or which is | |
6862 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
6863 | differences behind the common facade. | |
6864 | ||
6865 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
0df68c9f | 6866 | """ |
54f9ee45 | 6867 | return _core_.PyApp_GetTraits(*args, **kwargs) |
e811c8ce RD |
6868 | |
6869 | def ProcessPendingEvents(*args, **kwargs): | |
0df68c9f | 6870 | """ |
a95a7133 | 6871 | ProcessPendingEvents(self) |
6c3b4aae | 6872 | |
66c033b4 RD |
6873 | Process all events in the Pending Events list -- it is necessary to |
6874 | call this function to process posted events. This normally happens | |
6875 | during each event loop iteration. | |
0df68c9f | 6876 | """ |
54f9ee45 | 6877 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
6878 | |
6879 | def Yield(*args, **kwargs): | |
0df68c9f | 6880 | """ |
a95a7133 | 6881 | Yield(self, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 6882 | |
66c033b4 RD |
6883 | Process all currently pending events right now, instead of waiting |
6884 | until return to the event loop. It is an error to call ``Yield`` | |
6885 | recursively unless the value of ``onlyIfNeeded`` is True. | |
6c3b4aae | 6886 | |
66c033b4 | 6887 | :warning: This function is dangerous as it can lead to unexpected |
41e2b43e RD |
6888 | reentrancies (i.e. when called from an event handler it may |
6889 | result in calling the same event handler again), use with | |
6890 | extreme care or, better, don't use at all! | |
0df68c9f | 6891 | |
66c033b4 | 6892 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
41e2b43e | 6893 | |
0df68c9f | 6894 | """ |
54f9ee45 | 6895 | return _core_.PyApp_Yield(*args, **kwargs) |
e811c8ce RD |
6896 | |
6897 | def WakeUpIdle(*args, **kwargs): | |
0df68c9f | 6898 | """ |
a95a7133 | 6899 | WakeUpIdle(self) |
6c3b4aae | 6900 | |
66c033b4 RD |
6901 | Make sure that idle events are sent again. |
6902 | :see: `wx.WakeUpIdle` | |
0df68c9f | 6903 | """ |
54f9ee45 | 6904 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
e811c8ce | 6905 | |
1fc3b23a RD |
6906 | def IsMainLoopRunning(*args, **kwargs): |
6907 | """ | |
6908 | IsMainLoopRunning() -> bool | |
6909 | ||
6910 | Returns True if we're running the main loop, i.e. if the events can | |
6911 | currently be dispatched. | |
6912 | """ | |
6913 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
6914 | ||
6915 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
e811c8ce | 6916 | def MainLoop(*args, **kwargs): |
0df68c9f | 6917 | """ |
a95a7133 | 6918 | MainLoop(self) -> int |
6c3b4aae | 6919 | |
66c033b4 RD |
6920 | Execute the main GUI loop, the function doesn't normally return until |
6921 | all top level windows have been closed and destroyed. | |
0df68c9f | 6922 | """ |
54f9ee45 | 6923 | return _core_.PyApp_MainLoop(*args, **kwargs) |
e811c8ce RD |
6924 | |
6925 | def Exit(*args, **kwargs): | |
0df68c9f | 6926 | """ |
a95a7133 | 6927 | Exit(self) |
6c3b4aae | 6928 | |
0df68c9f | 6929 | Exit the main loop thus terminating the application. |
66c033b4 | 6930 | :see: `wx.Exit` |
0df68c9f | 6931 | """ |
54f9ee45 | 6932 | return _core_.PyApp_Exit(*args, **kwargs) |
e811c8ce RD |
6933 | |
6934 | def ExitMainLoop(*args, **kwargs): | |
0df68c9f | 6935 | """ |
a95a7133 | 6936 | ExitMainLoop(self) |
6c3b4aae | 6937 | |
66c033b4 RD |
6938 | Exit the main GUI loop during the next iteration of the main |
6939 | loop, (i.e. it does not stop the program immediately!) | |
0df68c9f | 6940 | """ |
54f9ee45 | 6941 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
e811c8ce RD |
6942 | |
6943 | def Pending(*args, **kwargs): | |
0df68c9f | 6944 | """ |
a95a7133 | 6945 | Pending(self) -> bool |
6c3b4aae | 6946 | |
0df68c9f RD |
6947 | Returns True if there are unprocessed events in the event queue. |
6948 | """ | |
54f9ee45 | 6949 | return _core_.PyApp_Pending(*args, **kwargs) |
e811c8ce RD |
6950 | |
6951 | def Dispatch(*args, **kwargs): | |
0df68c9f | 6952 | """ |
a95a7133 | 6953 | Dispatch(self) -> bool |
6c3b4aae | 6954 | |
0df68c9f RD |
6955 | Process the first event in the event queue (blocks until an event |
6956 | appears if there are none currently) | |
6957 | """ | |
54f9ee45 | 6958 | return _core_.PyApp_Dispatch(*args, **kwargs) |
e811c8ce RD |
6959 | |
6960 | def ProcessIdle(*args, **kwargs): | |
0df68c9f | 6961 | """ |
a95a7133 | 6962 | ProcessIdle(self) -> bool |
6c3b4aae | 6963 | |
66c033b4 RD |
6964 | Called from the MainLoop when the application becomes idle (there are |
6965 | no pending events) and sends a `wx.IdleEvent` to all interested | |
6966 | parties. Returns True if more idle events are needed, False if not. | |
0df68c9f | 6967 | """ |
54f9ee45 | 6968 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
e811c8ce RD |
6969 | |
6970 | def SendIdleEvents(*args, **kwargs): | |
0df68c9f | 6971 | """ |
a95a7133 | 6972 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
e811c8ce | 6973 | |
66c033b4 RD |
6974 | Send idle event to window and all subwindows. Returns True if more |
6975 | idle time is requested. | |
0df68c9f | 6976 | """ |
54f9ee45 | 6977 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
e811c8ce RD |
6978 | |
6979 | def IsActive(*args, **kwargs): | |
0df68c9f | 6980 | """ |
a95a7133 | 6981 | IsActive(self) -> bool |
6c3b4aae | 6982 | |
0df68c9f RD |
6983 | Return True if our app has focus. |
6984 | """ | |
54f9ee45 | 6985 | return _core_.PyApp_IsActive(*args, **kwargs) |
e811c8ce RD |
6986 | |
6987 | def SetTopWindow(*args, **kwargs): | |
0df68c9f | 6988 | """ |
a95a7133 | 6989 | SetTopWindow(self, Window win) |
6c3b4aae | 6990 | |
66c033b4 | 6991 | Set the *main* top level window |
0df68c9f | 6992 | """ |
54f9ee45 | 6993 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
e811c8ce RD |
6994 | |
6995 | def GetTopWindow(*args, **kwargs): | |
0df68c9f | 6996 | """ |
a95a7133 | 6997 | GetTopWindow(self) -> Window |
6c3b4aae | 6998 | |
66c033b4 RD |
6999 | Return the *main* top level window (if it hadn't been set previously |
7000 | with SetTopWindow(), will return just some top level window and, if | |
7001 | there not any, will return None) | |
0df68c9f | 7002 | """ |
54f9ee45 | 7003 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
e811c8ce RD |
7004 | |
7005 | def SetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 7006 | """ |
a95a7133 | 7007 | SetExitOnFrameDelete(self, bool flag) |
0df68c9f | 7008 | |
66c033b4 RD |
7009 | Control the exit behaviour: by default, the program will exit the main |
7010 | loop (and so, usually, terminate) when the last top-level program | |
7011 | window is deleted. Beware that if you disable this behaviour (with | |
7012 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
7013 | explicitly from somewhere. | |
0df68c9f | 7014 | """ |
54f9ee45 | 7015 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
7016 | |
7017 | def GetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 7018 | """ |
a95a7133 | 7019 | GetExitOnFrameDelete(self) -> bool |
6c3b4aae | 7020 | |
0df68c9f RD |
7021 | Get the current exit behaviour setting. |
7022 | """ | |
54f9ee45 | 7023 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
7024 | |
7025 | def SetUseBestVisual(*args, **kwargs): | |
0df68c9f | 7026 | """ |
a95a7133 | 7027 | SetUseBestVisual(self, bool flag) |
6c3b4aae | 7028 | |
66c033b4 RD |
7029 | Set whether the app should try to use the best available visual on |
7030 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
0df68c9f | 7031 | """ |
54f9ee45 | 7032 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
7033 | |
7034 | def GetUseBestVisual(*args, **kwargs): | |
0df68c9f | 7035 | """ |
a95a7133 | 7036 | GetUseBestVisual(self) -> bool |
6c3b4aae | 7037 | |
0df68c9f RD |
7038 | Get current UseBestVisual setting. |
7039 | """ | |
54f9ee45 | 7040 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
7041 | |
7042 | def SetPrintMode(*args, **kwargs): | |
a95a7133 | 7043 | """SetPrintMode(self, int mode)""" |
54f9ee45 | 7044 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
e811c8ce RD |
7045 | |
7046 | def GetPrintMode(*args, **kwargs): | |
a95a7133 | 7047 | """GetPrintMode(self) -> int""" |
54f9ee45 | 7048 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
e811c8ce | 7049 | |
e811c8ce | 7050 | def SetAssertMode(*args, **kwargs): |
0df68c9f | 7051 | """ |
a95a7133 | 7052 | SetAssertMode(self, int mode) |
6c3b4aae | 7053 | |
41e2b43e | 7054 | Set the OnAssert behaviour for debug and hybrid builds. |
0df68c9f | 7055 | """ |
54f9ee45 | 7056 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
e811c8ce | 7057 | |
6c3b4aae | 7058 | def GetAssertMode(*args, **kwargs): |
0df68c9f | 7059 | """ |
a95a7133 | 7060 | GetAssertMode(self) -> int |
6c3b4aae | 7061 | |
0df68c9f RD |
7062 | Get the current OnAssert behaviour setting. |
7063 | """ | |
54f9ee45 | 7064 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
6c3b4aae | 7065 | |
e811c8ce | 7066 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): |
66c033b4 | 7067 | """GetMacSupportPCMenuShortcuts() -> bool""" |
54f9ee45 | 7068 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
7069 | |
7070 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
7071 | def GetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 7072 | """GetMacAboutMenuItemId() -> long""" |
54f9ee45 | 7073 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
7074 | |
7075 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
7076 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 7077 | """GetMacPreferencesMenuItemId() -> long""" |
54f9ee45 | 7078 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
7079 | |
7080 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
7081 | def GetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 7082 | """GetMacExitMenuItemId() -> long""" |
54f9ee45 | 7083 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
7084 | |
7085 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
7086 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 7087 | """GetMacHelpMenuTitleName() -> String""" |
54f9ee45 | 7088 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
7089 | |
7090 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
7091 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
66c033b4 | 7092 | """SetMacSupportPCMenuShortcuts(bool val)""" |
54f9ee45 | 7093 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
7094 | |
7095 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
7096 | def SetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 7097 | """SetMacAboutMenuItemId(long val)""" |
54f9ee45 | 7098 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
7099 | |
7100 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
7101 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 7102 | """SetMacPreferencesMenuItemId(long val)""" |
54f9ee45 | 7103 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
7104 | |
7105 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
7106 | def SetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 7107 | """SetMacExitMenuItemId(long val)""" |
54f9ee45 | 7108 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
7109 | |
7110 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
7111 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 7112 | """SetMacHelpMenuTitleName(String val)""" |
54f9ee45 | 7113 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
7114 | |
7115 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
7116 | def _BootstrapApp(*args, **kwargs): | |
0df68c9f | 7117 | """ |
a95a7133 | 7118 | _BootstrapApp(self) |
6c3b4aae | 7119 | |
0df68c9f RD |
7120 | For internal use only |
7121 | """ | |
54f9ee45 | 7122 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
e811c8ce RD |
7123 | |
7124 | def GetComCtl32Version(*args, **kwargs): | |
0df68c9f | 7125 | """ |
66c033b4 | 7126 | GetComCtl32Version() -> int |
6c3b4aae | 7127 | |
66c033b4 RD |
7128 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7129 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 7130 | """ |
54f9ee45 | 7131 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
e811c8ce RD |
7132 | |
7133 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
d14a1e28 RD |
7134 | |
7135 | class PyAppPtr(PyApp): | |
7136 | def __init__(self, this): | |
7137 | self.this = this | |
7138 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7139 | self.__class__ = PyApp | |
54f9ee45 | 7140 | _core_.PyApp_swigregister(PyAppPtr) |
d14a1e28 | 7141 | |
1fc3b23a RD |
7142 | def PyApp_IsMainLoopRunning(*args, **kwargs): |
7143 | """ | |
7144 | PyApp_IsMainLoopRunning() -> bool | |
7145 | ||
7146 | Returns True if we're running the main loop, i.e. if the events can | |
7147 | currently be dispatched. | |
7148 | """ | |
7149 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
7150 | ||
e811c8ce RD |
7151 | def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs): |
7152 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
54f9ee45 | 7153 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
d14a1e28 | 7154 | |
e811c8ce RD |
7155 | def PyApp_GetMacAboutMenuItemId(*args, **kwargs): |
7156 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
54f9ee45 | 7157 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
d14a1e28 | 7158 | |
e811c8ce RD |
7159 | def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs): |
7160 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
54f9ee45 | 7161 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
d14a1e28 | 7162 | |
e811c8ce RD |
7163 | def PyApp_GetMacExitMenuItemId(*args, **kwargs): |
7164 | """PyApp_GetMacExitMenuItemId() -> long""" | |
54f9ee45 | 7165 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
d14a1e28 | 7166 | |
e811c8ce | 7167 | def PyApp_GetMacHelpMenuTitleName(*args, **kwargs): |
196addbf | 7168 | """PyApp_GetMacHelpMenuTitleName() -> String""" |
54f9ee45 | 7169 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
d14a1e28 | 7170 | |
e811c8ce RD |
7171 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
7172 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" | |
54f9ee45 | 7173 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
d14a1e28 | 7174 | |
e811c8ce RD |
7175 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
7176 | """PyApp_SetMacAboutMenuItemId(long val)""" | |
54f9ee45 | 7177 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
d14a1e28 | 7178 | |
e811c8ce RD |
7179 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
7180 | """PyApp_SetMacPreferencesMenuItemId(long val)""" | |
54f9ee45 | 7181 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
d14a1e28 | 7182 | |
e811c8ce RD |
7183 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
7184 | """PyApp_SetMacExitMenuItemId(long val)""" | |
54f9ee45 | 7185 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
d14a1e28 | 7186 | |
e811c8ce | 7187 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
196addbf | 7188 | """PyApp_SetMacHelpMenuTitleName(String val)""" |
54f9ee45 | 7189 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
d14a1e28 | 7190 | |
e811c8ce | 7191 | def PyApp_GetComCtl32Version(*args, **kwargs): |
0df68c9f RD |
7192 | """ |
7193 | PyApp_GetComCtl32Version() -> int | |
6c3b4aae | 7194 | |
66c033b4 RD |
7195 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7196 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 7197 | """ |
54f9ee45 | 7198 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
d14a1e28 RD |
7199 | |
7200 | #--------------------------------------------------------------------------- | |
7201 | ||
7202 | ||
e811c8ce | 7203 | def Exit(*args, **kwargs): |
0df68c9f RD |
7204 | """ |
7205 | Exit() | |
6c3b4aae | 7206 | |
0df68c9f RD |
7207 | Force an exit of the application. Convenience for wx.GetApp().Exit() |
7208 | """ | |
54f9ee45 | 7209 | return _core_.Exit(*args, **kwargs) |
d14a1e28 | 7210 | |
e811c8ce | 7211 | def Yield(*args, **kwargs): |
0df68c9f RD |
7212 | """ |
7213 | Yield() -> bool | |
6c3b4aae | 7214 | |
0df68c9f RD |
7215 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() |
7216 | """ | |
54f9ee45 | 7217 | return _core_.Yield(*args, **kwargs) |
d14a1e28 | 7218 | |
e811c8ce | 7219 | def YieldIfNeeded(*args, **kwargs): |
0df68c9f RD |
7220 | """ |
7221 | YieldIfNeeded() -> bool | |
6c3b4aae | 7222 | |
0df68c9f RD |
7223 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) |
7224 | """ | |
54f9ee45 | 7225 | return _core_.YieldIfNeeded(*args, **kwargs) |
d14a1e28 | 7226 | |
e811c8ce | 7227 | def SafeYield(*args, **kwargs): |
0df68c9f RD |
7228 | """ |
7229 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool | |
6c3b4aae | 7230 | |
66c033b4 RD |
7231 | This function is similar to `wx.Yield`, except that it disables the |
7232 | user input to all program windows before calling `wx.Yield` and | |
7233 | re-enables it again afterwards. If ``win`` is not None, this window | |
7234 | will remain enabled, allowing the implementation of some limited user | |
7235 | interaction. | |
6c3b4aae | 7236 | |
66c033b4 | 7237 | :Returns: the result of the call to `wx.Yield`. |
0df68c9f | 7238 | """ |
54f9ee45 | 7239 | return _core_.SafeYield(*args, **kwargs) |
d14a1e28 | 7240 | |
e811c8ce | 7241 | def WakeUpIdle(*args, **kwargs): |
0df68c9f RD |
7242 | """ |
7243 | WakeUpIdle() | |
6c3b4aae | 7244 | |
66c033b4 RD |
7245 | Cause the message queue to become empty again, so idle events will be |
7246 | sent. | |
0df68c9f | 7247 | """ |
54f9ee45 | 7248 | return _core_.WakeUpIdle(*args, **kwargs) |
d14a1e28 | 7249 | |
e811c8ce | 7250 | def PostEvent(*args, **kwargs): |
0df68c9f RD |
7251 | """ |
7252 | PostEvent(EvtHandler dest, Event event) | |
6c3b4aae | 7253 | |
66c033b4 RD |
7254 | Send an event to a window or other wx.EvtHandler to be processed |
7255 | later. | |
0df68c9f | 7256 | """ |
54f9ee45 | 7257 | return _core_.PostEvent(*args, **kwargs) |
d14a1e28 | 7258 | |
e811c8ce | 7259 | def App_CleanUp(*args, **kwargs): |
0df68c9f RD |
7260 | """ |
7261 | App_CleanUp() | |
6c3b4aae | 7262 | |
41e2b43e | 7263 | For internal use only, it is used to cleanup after wxWidgets when |
66c033b4 | 7264 | Python shuts down. |
0df68c9f | 7265 | """ |
54f9ee45 | 7266 | return _core_.App_CleanUp(*args, **kwargs) |
d14a1e28 | 7267 | |
e811c8ce | 7268 | def GetApp(*args, **kwargs): |
0df68c9f RD |
7269 | """ |
7270 | GetApp() -> PyApp | |
6c3b4aae | 7271 | |
196addbf | 7272 | Return a reference to the current wx.App object. |
0df68c9f | 7273 | """ |
54f9ee45 | 7274 | return _core_.GetApp(*args, **kwargs) |
5cbf236d RD |
7275 | |
7276 | def SetDefaultPyEncoding(*args, **kwargs): | |
7277 | """ | |
7278 | SetDefaultPyEncoding(string encoding) | |
7279 | ||
7280 | Sets the encoding that wxPython will use when it needs to convert a | |
7281 | Python string or unicode object to or from a wxString. | |
e505d15e RD |
7282 | |
7283 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7284 | but please be aware that the default encoding within the same locale | |
7285 | may be slightly different on different platforms. For example, please | |
7286 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7287 | between the common latin/roman encodings. | |
5cbf236d RD |
7288 | """ |
7289 | return _core_.SetDefaultPyEncoding(*args, **kwargs) | |
7290 | ||
7291 | def GetDefaultPyEncoding(*args, **kwargs): | |
7292 | """ | |
7293 | GetDefaultPyEncoding() -> string | |
7294 | ||
7295 | Gets the current encoding that wxPython will use when it needs to | |
7296 | convert a Python string or unicode object to or from a wxString. | |
7297 | """ | |
7298 | return _core_.GetDefaultPyEncoding(*args, **kwargs) | |
d14a1e28 RD |
7299 | #---------------------------------------------------------------------- |
7300 | ||
7301 | class PyOnDemandOutputWindow: | |
6c3b4aae RD |
7302 | """ |
7303 | A class that can be used for redirecting Python's stdout and | |
7304 | stderr streams. It will do nothing until something is wrriten to | |
7305 | the stream at which point it will create a Frame with a text area | |
7306 | and write the text there. | |
7307 | """ | |
d14a1e28 RD |
7308 | def __init__(self, title = "wxPython: stdout/stderr"): |
7309 | self.frame = None | |
7310 | self.title = title | |
412d302d RD |
7311 | self.pos = wx.DefaultPosition |
7312 | self.size = (450, 300) | |
d14a1e28 RD |
7313 | self.parent = None |
7314 | ||
7315 | def SetParent(self, parent): | |
6c3b4aae | 7316 | """Set the window to be used as the popup Frame's parent.""" |
d14a1e28 RD |
7317 | self.parent = parent |
7318 | ||
6c3b4aae RD |
7319 | |
7320 | def CreateOutputWindow(self, st): | |
412d302d RD |
7321 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7322 | style=wx.DEFAULT_FRAME_STYLE) | |
196addbf | 7323 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7324 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d1e20054 | 7325 | self.text.AppendText(st) |
6c3b4aae RD |
7326 | self.frame.Show(True) |
7327 | EVT_CLOSE(self.frame, self.OnCloseWindow) | |
7328 | ||
d14a1e28 | 7329 | |
7409c0c6 RD |
7330 | def OnCloseWindow(self, event): |
7331 | if self.frame is not None: | |
7332 | self.frame.Destroy() | |
7333 | self.frame = None | |
7334 | self.text = None | |
7335 | ||
7336 | ||
d14a1e28 | 7337 | # These methods provide the file-like output behaviour. |
6c3b4aae RD |
7338 | def write(self, text): |
7339 | """ | |
7340 | Create the output window if needed and write the string to it. | |
7341 | If not called in the context of the gui thread then uses | |
7342 | CallAfter to do the work there. | |
7343 | """ | |
7344 | if self.frame is None: | |
7345 | if not wx.Thread_IsMain(): | |
7346 | wx.CallAfter(self.CreateOutputWindow, text) | |
7347 | else: | |
7348 | self.CreateOutputWindow(text) | |
7349 | else: | |
7350 | if not wx.Thread_IsMain(): | |
7351 | wx.CallAfter(self.text.AppendText, text) | |
7352 | else: | |
7353 | self.text.AppendText(text) | |
7354 | ||
d14a1e28 RD |
7355 | |
7356 | def close(self): | |
6c3b4aae RD |
7357 | if self.frame is not None: |
7358 | wx.CallAfter(self.frame.Close) | |
7359 | ||
d14a1e28 | 7360 | |
19272049 RD |
7361 | def flush(self): |
7362 | pass | |
7363 | ||
7364 | ||
d14a1e28 RD |
7365 | |
7366 | #---------------------------------------------------------------------- | |
d14a1e28 RD |
7367 | |
7368 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
7369 | ||
7370 | class App(wx.PyApp): | |
6c3b4aae | 7371 | """ |
66c033b4 RD |
7372 | The ``wx.App`` class represents the application and is used to: |
7373 | ||
7374 | * bootstrap the wxPython system and initialize the underlying | |
7375 | gui toolkit | |
7376 | * set and get application-wide properties | |
7377 | * implement the windowing system main message or event loop, | |
7378 | and to dispatch events to window instances | |
7379 | * etc. | |
7380 | ||
7381 | Every application must have a ``wx.App`` instance, and all | |
7382 | creation of UI objects should be delayed until after the | |
03e37cd5 RD |
7383 | ``wx.App`` object has been created in order to ensure that the gui |
7384 | platform and wxWidgets have been fully initialized. | |
66c033b4 RD |
7385 | |
7386 | Normally you would derive from this class and implement an | |
7387 | ``OnInit`` method that creates a frame and then calls | |
7388 | ``self.SetTopWindow(frame)``. | |
7389 | ||
03e37cd5 | 7390 | :see: `wx.PySimpleApp` for a simpler app class that can be used |
1c0f361b | 7391 | directly. |
6c3b4aae | 7392 | """ |
66c033b4 | 7393 | |
d14a1e28 RD |
7394 | outputWindowClass = PyOnDemandOutputWindow |
7395 | ||
03e37cd5 RD |
7396 | def __init__(self, redirect=_defRedirect, filename=None, |
7397 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7398 | """ |
7399 | Construct a ``wx.App`` object. | |
7400 | ||
03e37cd5 RD |
7401 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be |
7402 | redirected? Defaults to True on Windows and Mac, False | |
7403 | otherwise. If `filename` is None then output will be | |
7404 | redirected to a window that pops up as needed. (You can | |
7405 | control what kind of window is created for the output by | |
7406 | resetting the class variable ``outputWindowClass`` to a | |
7407 | class of your choosing.) | |
66c033b4 | 7408 | |
03e37cd5 RD |
7409 | :param filename: The name of a file to redirect output to, if |
7410 | redirect is True. | |
66c033b4 RD |
7411 | |
7412 | :param useBestVisual: Should the app try to use the best | |
03e37cd5 RD |
7413 | available visual provided by the system (only relevant on |
7414 | systems that have more than one visual.) This parameter | |
7415 | must be used instead of calling `SetUseBestVisual` later | |
7416 | on because it must be set before the underlying GUI | |
7417 | toolkit is initialized. | |
7418 | ||
7419 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7420 | app to terminate upon a Ctrl-C in the console like other | |
7421 | GUI apps will. | |
66c033b4 RD |
7422 | |
7423 | :note: You should override OnInit to do applicaition | |
7424 | initialization to ensure that the system, toolkit and | |
7425 | wxWidgets are fully initialized. | |
7426 | """ | |
d14a1e28 RD |
7427 | wx.PyApp.__init__(self) |
7428 | ||
7429 | if wx.Platform == "__WXMAC__": | |
7430 | try: | |
7431 | import MacOS | |
7432 | if not MacOS.WMAvailable(): | |
7433 | print """\ | |
7434 | This program needs access to the screen. Please run with 'pythonw', | |
7435 | not 'python', and only when you are logged in on the main display of | |
7436 | your Mac.""" | |
7437 | _sys.exit(1) | |
36cadbf7 RD |
7438 | except SystemExit: |
7439 | raise | |
d14a1e28 RD |
7440 | except: |
7441 | pass | |
7442 | ||
7443 | # This has to be done before OnInit | |
7444 | self.SetUseBestVisual(useBestVisual) | |
7445 | ||
7446 | # Set the default handler for SIGINT. This fixes a problem | |
7447 | # where if Ctrl-C is pressed in the console that started this | |
7448 | # app then it will not appear to do anything, (not even send | |
7449 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7450 | # setting the default handler then the app will exit, as | |
7451 | # expected (depending on platform.) | |
03e37cd5 RD |
7452 | if clearSigInt: |
7453 | try: | |
7454 | import signal | |
7455 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7456 | except: | |
7457 | pass | |
d14a1e28 RD |
7458 | |
7459 | # Save and redirect the stdio to a window? | |
7460 | self.stdioWin = None | |
7461 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7462 | if redirect: | |
7463 | self.RedirectStdio(filename) | |
7464 | ||
8fb0e70a RD |
7465 | # Use Python's install prefix as the default |
7466 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7467 | ||
d14a1e28 RD |
7468 | # This finishes the initialization of wxWindows and then calls |
7469 | # the OnInit that should be present in the derived class | |
7470 | self._BootstrapApp() | |
7471 | ||
7472 | ||
02b455f2 RD |
7473 | def __del__(self, destroy=wx.PyApp.__del__): |
7474 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7475 | destroy(self) | |
d14a1e28 | 7476 | |
70b7a5fe RD |
7477 | def Destroy(self): |
7478 | wx.PyApp.Destroy(self) | |
7479 | self.thisown = 0 | |
d14a1e28 RD |
7480 | |
7481 | def SetTopWindow(self, frame): | |
1e0c8722 | 7482 | """Set the \"main\" top level window""" |
d14a1e28 RD |
7483 | if self.stdioWin: |
7484 | self.stdioWin.SetParent(frame) | |
7485 | wx.PyApp.SetTopWindow(self, frame) | |
7486 | ||
7487 | ||
7488 | def MainLoop(self): | |
1e0c8722 | 7489 | """Execute the main GUI event loop""" |
d14a1e28 RD |
7490 | wx.PyApp.MainLoop(self) |
7491 | self.RestoreStdio() | |
7492 | ||
7493 | ||
7409c0c6 | 7494 | def RedirectStdio(self, filename=None): |
1e0c8722 | 7495 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" |
d14a1e28 RD |
7496 | if filename: |
7497 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7498 | else: | |
7499 | self.stdioWin = self.outputWindowClass() | |
7500 | _sys.stdout = _sys.stderr = self.stdioWin | |
7501 | ||
7502 | ||
7503 | def RestoreStdio(self): | |
02b455f2 RD |
7504 | try: |
7505 | _sys.stdout, _sys.stderr = self.saveStdio | |
7506 | except: | |
7507 | pass | |
d14a1e28 RD |
7508 | |
7509 | ||
412d302d RD |
7510 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7511 | """ | |
7512 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7513 | the stdio has been redirected. This should be called before |
7514 | any output would cause the output window to be created. | |
412d302d RD |
7515 | """ |
7516 | if self.stdioWin: | |
7517 | if title is not None: | |
7518 | self.stdioWin.title = title | |
7519 | if pos is not None: | |
7520 | self.stdioWin.pos = pos | |
7521 | if size is not None: | |
7522 | self.stdioWin.size = size | |
7523 | ||
7524 | ||
7525 | ||
d14a1e28 | 7526 | |
66c033b4 | 7527 | # change from wx.PyApp_XX to wx.App_XX |
54f9ee45 RD |
7528 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7529 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7530 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7531 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7532 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7533 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7534 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7535 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7536 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7537 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7538 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
d14a1e28 RD |
7539 | |
7540 | #---------------------------------------------------------------------------- | |
7541 | ||
7542 | class PySimpleApp(wx.App): | |
6c3b4aae RD |
7543 | """ |
7544 | A simple application class. You can just create one of these and | |
7545 | then then make your top level windows later, and not have to worry | |
66c033b4 RD |
7546 | about OnInit. For example:: |
7547 | ||
7548 | app = wx.PySimpleApp() | |
7549 | frame = wx.Frame(None, title='Hello World') | |
7550 | frame.Show() | |
7551 | app.MainLoop() | |
7552 | ||
7553 | :see: `wx.App` | |
7554 | """ | |
6c3b4aae | 7555 | |
03e37cd5 RD |
7556 | def __init__(self, redirect=False, filename=None, |
7557 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7558 | """ |
7559 | :see: `wx.App.__init__` | |
7560 | """ | |
03e37cd5 | 7561 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) |
6c3b4aae | 7562 | |
d14a1e28 | 7563 | def OnInit(self): |
d14a1e28 RD |
7564 | return True |
7565 | ||
7566 | ||
66c033b4 | 7567 | |
6c3b4aae | 7568 | # Is anybody using this one? |
d14a1e28 RD |
7569 | class PyWidgetTester(wx.App): |
7570 | def __init__(self, size = (250, 100)): | |
7571 | self.size = size | |
7572 | wx.App.__init__(self, 0) | |
7573 | ||
7574 | def OnInit(self): | |
196addbf | 7575 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) |
d14a1e28 RD |
7576 | self.SetTopWindow(self.frame) |
7577 | return True | |
7578 | ||
66c033b4 RD |
7579 | def SetWidget(self, widgetClass, *args, **kwargs): |
7580 | w = widgetClass(self.frame, *args, **kwargs) | |
d14a1e28 RD |
7581 | self.frame.Show(True) |
7582 | ||
7583 | #---------------------------------------------------------------------------- | |
7584 | # DO NOT hold any other references to this object. This is how we | |
66c033b4 | 7585 | # know when to cleanup system resources that wxWidgets is holding. When |
d14a1e28 | 7586 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
66c033b4 | 7587 | # goes to zero and it calls the wx.App_CleanUp function. |
d14a1e28 RD |
7588 | |
7589 | class __wxPyCleanup: | |
7590 | def __init__(self): | |
54f9ee45 | 7591 | self.cleanup = _core_.App_CleanUp |
d14a1e28 RD |
7592 | def __del__(self): |
7593 | self.cleanup() | |
7594 | ||
7595 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7596 | ||
7597 | ## # another possible solution, but it gets called too early... | |
66c033b4 RD |
7598 | ## import atexit |
7599 | ## atexit.register(_core_.wxApp_CleanUp) | |
d14a1e28 RD |
7600 | |
7601 | ||
7602 | #---------------------------------------------------------------------------- | |
7603 | ||
7604 | #--------------------------------------------------------------------------- | |
2ef75293 RD |
7605 | |
7606 | class EventLoop(object): | |
093d3ff1 | 7607 | """Proxy of C++ EventLoop class""" |
2ef75293 RD |
7608 | def __repr__(self): |
7609 | return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7610 | def __init__(self, *args, **kwargs): | |
7611 | """__init__(self) -> EventLoop""" | |
7612 | newobj = _core_.new_EventLoop(*args, **kwargs) | |
7613 | self.this = newobj.this | |
7614 | self.thisown = 1 | |
7615 | del newobj.thisown | |
7616 | def __del__(self, destroy=_core_.delete_EventLoop): | |
7617 | """__del__(self)""" | |
7618 | try: | |
7619 | if self.thisown: destroy(self) | |
7620 | except: pass | |
7621 | ||
7622 | def Run(*args, **kwargs): | |
7623 | """Run(self) -> int""" | |
7624 | return _core_.EventLoop_Run(*args, **kwargs) | |
7625 | ||
7626 | def Exit(*args, **kwargs): | |
7627 | """Exit(self, int rc=0)""" | |
7628 | return _core_.EventLoop_Exit(*args, **kwargs) | |
7629 | ||
7630 | def Pending(*args, **kwargs): | |
7631 | """Pending(self) -> bool""" | |
7632 | return _core_.EventLoop_Pending(*args, **kwargs) | |
7633 | ||
7634 | def Dispatch(*args, **kwargs): | |
7635 | """Dispatch(self) -> bool""" | |
7636 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
7637 | ||
7638 | def IsRunning(*args, **kwargs): | |
7639 | """IsRunning(self) -> bool""" | |
7640 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
7641 | ||
7642 | def GetActive(*args, **kwargs): | |
7643 | """GetActive() -> EventLoop""" | |
7644 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7645 | ||
7646 | GetActive = staticmethod(GetActive) | |
7647 | def SetActive(*args, **kwargs): | |
7648 | """SetActive(EventLoop loop)""" | |
7649 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7650 | ||
7651 | SetActive = staticmethod(SetActive) | |
7652 | ||
7653 | class EventLoopPtr(EventLoop): | |
7654 | def __init__(self, this): | |
7655 | self.this = this | |
7656 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7657 | self.__class__ = EventLoop | |
7658 | _core_.EventLoop_swigregister(EventLoopPtr) | |
7659 | ||
7660 | def EventLoop_GetActive(*args, **kwargs): | |
7661 | """EventLoop_GetActive() -> EventLoop""" | |
7662 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7663 | ||
7664 | def EventLoop_SetActive(*args, **kwargs): | |
7665 | """EventLoop_SetActive(EventLoop loop)""" | |
7666 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7667 | ||
7668 | #--------------------------------------------------------------------------- | |
d14a1e28 | 7669 | |
1e0c8722 | 7670 | class AcceleratorEntry(object): |
66c033b4 RD |
7671 | """ |
7672 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7673 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7674 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
41e2b43e | 7675 | as well. See `__init__` for of the tuple values. |
66c033b4 RD |
7676 | |
7677 | :see: `wx.AcceleratorTable` | |
7678 | """ | |
1e0c8722 RD |
7679 | def __repr__(self): |
7680 | return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7681 | def __init__(self, *args, **kwargs): | |
66c033b4 RD |
7682 | """ |
7683 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
7684 | ||
7685 | Construct a wx.AcceleratorEntry. | |
66c033b4 | 7686 | """ |
54f9ee45 | 7687 | newobj = _core_.new_AcceleratorEntry(*args, **kwargs) |
1e0c8722 RD |
7688 | self.this = newobj.this |
7689 | self.thisown = 1 | |
7690 | del newobj.thisown | |
54f9ee45 | 7691 | def __del__(self, destroy=_core_.delete_AcceleratorEntry): |
a95a7133 | 7692 | """__del__(self)""" |
1e0c8722 RD |
7693 | try: |
7694 | if self.thisown: destroy(self) | |
7695 | except: pass | |
7696 | ||
7697 | def Set(*args, **kwargs): | |
66c033b4 RD |
7698 | """ |
7699 | Set(self, int flags, int keyCode, int cmd) | |
1e0c8722 | 7700 | |
66c033b4 RD |
7701 | (Re)set the attributes of a wx.AcceleratorEntry. |
7702 | :see `__init__` | |
7703 | """ | |
7704 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
1e0c8722 RD |
7705 | |
7706 | def GetFlags(*args, **kwargs): | |
66c033b4 RD |
7707 | """ |
7708 | GetFlags(self) -> int | |
7709 | ||
7710 | Get the AcceleratorEntry's flags. | |
7711 | """ | |
54f9ee45 | 7712 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
1e0c8722 RD |
7713 | |
7714 | def GetKeyCode(*args, **kwargs): | |
66c033b4 RD |
7715 | """ |
7716 | GetKeyCode(self) -> int | |
7717 | ||
7718 | Get the AcceleratorEntry's keycode. | |
7719 | """ | |
54f9ee45 | 7720 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
1e0c8722 RD |
7721 | |
7722 | def GetCommand(*args, **kwargs): | |
66c033b4 RD |
7723 | """ |
7724 | GetCommand(self) -> int | |
7725 | ||
7726 | Get the AcceleratorEntry's command ID. | |
7727 | """ | |
54f9ee45 | 7728 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
1e0c8722 RD |
7729 | |
7730 | ||
7731 | class AcceleratorEntryPtr(AcceleratorEntry): | |
7732 | def __init__(self, this): | |
7733 | self.this = this | |
7734 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7735 | self.__class__ = AcceleratorEntry | |
54f9ee45 | 7736 | _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr) |
1e0c8722 RD |
7737 | |
7738 | class AcceleratorTable(Object): | |
66c033b4 RD |
7739 | """ |
7740 | An accelerator table allows the application to specify a table of | |
7741 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7742 | button commands are supported; on GTK, only menu commands are | |
7743 | supported. | |
66c033b4 | 7744 | """ |
1e0c8722 RD |
7745 | def __repr__(self): |
7746 | return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7747 | def __init__(self, *args, **kwargs): | |
0df68c9f RD |
7748 | """ |
7749 | __init__(entries) -> AcceleratorTable | |
1e0c8722 | 7750 | |
66c033b4 RD |
7751 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7752 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7753 | ||
7754 | :see: `wx.AcceleratorEntry` | |
0df68c9f | 7755 | """ |
54f9ee45 | 7756 | newobj = _core_.new_AcceleratorTable(*args, **kwargs) |
1e0c8722 RD |
7757 | self.this = newobj.this |
7758 | self.thisown = 1 | |
7759 | del newobj.thisown | |
54f9ee45 | 7760 | def __del__(self, destroy=_core_.delete_AcceleratorTable): |
a95a7133 | 7761 | """__del__(self)""" |
1e0c8722 RD |
7762 | try: |
7763 | if self.thisown: destroy(self) | |
7764 | except: pass | |
7765 | ||
7766 | def Ok(*args, **kwargs): | |
a95a7133 | 7767 | """Ok(self) -> bool""" |
54f9ee45 | 7768 | return _core_.AcceleratorTable_Ok(*args, **kwargs) |
1e0c8722 RD |
7769 | |
7770 | ||
7771 | class AcceleratorTablePtr(AcceleratorTable): | |
7772 | def __init__(self, this): | |
7773 | self.this = this | |
7774 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7775 | self.__class__ = AcceleratorTable | |
54f9ee45 | 7776 | _core_.AcceleratorTable_swigregister(AcceleratorTablePtr) |
1e0c8722 RD |
7777 | |
7778 | ||
7779 | def GetAccelFromString(*args, **kwargs): | |
196addbf | 7780 | """GetAccelFromString(String label) -> AcceleratorEntry""" |
54f9ee45 | 7781 | return _core_.GetAccelFromString(*args, **kwargs) |
1e0c8722 RD |
7782 | #--------------------------------------------------------------------------- |
7783 | ||
74a57fcd RD |
7784 | class VisualAttributes(object): |
7785 | """struct containing all the visual attributes of a control""" | |
7786 | def __repr__(self): | |
7787 | return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7788 | def __init__(self, *args, **kwargs): | |
7789 | """ | |
a95a7133 | 7790 | __init__(self) -> VisualAttributes |
74a57fcd RD |
7791 | |
7792 | struct containing all the visual attributes of a control | |
7793 | """ | |
54f9ee45 | 7794 | newobj = _core_.new_VisualAttributes(*args, **kwargs) |
74a57fcd RD |
7795 | self.this = newobj.this |
7796 | self.thisown = 1 | |
7797 | del newobj.thisown | |
54f9ee45 | 7798 | def __del__(self, destroy=_core_.delete_VisualAttributes): |
a95a7133 | 7799 | """__del__(self)""" |
74a57fcd RD |
7800 | try: |
7801 | if self.thisown: destroy(self) | |
7802 | except: pass | |
7803 | ||
54f9ee45 RD |
7804 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) |
7805 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
7806 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
74a57fcd RD |
7807 | |
7808 | class VisualAttributesPtr(VisualAttributes): | |
7809 | def __init__(self, this): | |
7810 | self.this = this | |
7811 | if not hasattr(self,"thisown"): self.thisown = 0 | |
7812 | self.__class__ = VisualAttributes | |
54f9ee45 | 7813 | _core_.VisualAttributes_swigregister(VisualAttributesPtr) |
74a57fcd RD |
7814 | NullAcceleratorTable = cvar.NullAcceleratorTable |
7815 | PanelNameStr = cvar.PanelNameStr | |
7816 | ||
54f9ee45 RD |
7817 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
7818 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
7819 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
7820 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
7821 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
d14a1e28 | 7822 | class Window(EvtHandler): |
15afbcd0 RD |
7823 | """ |
7824 | wx.Window is the base class for all windows and represents any visible | |
7825 | object on the screen. All controls, top level windows and so on are | |
7826 | wx.Windows. Sizers and device contexts are not however, as they don't | |
7827 | appear on screen themselves. | |
7828 | ||
7829 | """ | |
e811c8ce RD |
7830 | def __repr__(self): |
7831 | return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 7832 | def __init__(self, *args, **kwargs): |
0df68c9f | 7833 | """ |
a95a7133 | 7834 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7835 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window |
15afbcd0 RD |
7836 | |
7837 | Construct and show a generic Window. | |
0df68c9f | 7838 | """ |
54f9ee45 | 7839 | newobj = _core_.new_Window(*args, **kwargs) |
d14a1e28 RD |
7840 | self.this = newobj.this |
7841 | self.thisown = 1 | |
7842 | del newobj.thisown | |
7843 | self._setOORInfo(self) | |
d14a1e28 | 7844 | |
e811c8ce | 7845 | def Create(*args, **kwargs): |
0df68c9f | 7846 | """ |
a95a7133 | 7847 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7848 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool |
15afbcd0 RD |
7849 | |
7850 | Create the GUI part of the Window for 2-phase creation mode. | |
0df68c9f | 7851 | """ |
54f9ee45 | 7852 | return _core_.Window_Create(*args, **kwargs) |
d14a1e28 | 7853 | |
e811c8ce | 7854 | def Close(*args, **kwargs): |
15afbcd0 | 7855 | """ |
a95a7133 | 7856 | Close(self, bool force=False) -> bool |
15afbcd0 RD |
7857 | |
7858 | This function simply generates a EVT_CLOSE event whose handler usually | |
7859 | tries to close the window. It doesn't close the window itself, | |
7860 | however. If force is False (the default) then the window's close | |
7861 | handler will be allowed to veto the destruction of the window. | |
15afbcd0 | 7862 | """ |
54f9ee45 | 7863 | return _core_.Window_Close(*args, **kwargs) |
d14a1e28 | 7864 | |
e811c8ce | 7865 | def Destroy(*args, **kwargs): |
0df68c9f | 7866 | """ |
a95a7133 | 7867 | Destroy(self) -> bool |
d14a1e28 | 7868 | |
15afbcd0 RD |
7869 | Destroys the window safely. Frames and dialogs are not destroyed |
7870 | immediately when this function is called -- they are added to a list | |
7871 | of windows to be deleted on idle time, when all the window's events | |
7872 | have been processed. This prevents problems with events being sent to | |
7873 | non-existent windows. | |
7874 | ||
7875 | Returns True if the window has either been successfully deleted, or it | |
7876 | has been added to the list of windows pending real deletion. | |
0df68c9f | 7877 | """ |
54f9ee45 | 7878 | return _core_.Window_Destroy(*args, **kwargs) |
d14a1e28 | 7879 | |
e811c8ce | 7880 | def DestroyChildren(*args, **kwargs): |
15afbcd0 | 7881 | """ |
a95a7133 | 7882 | DestroyChildren(self) -> bool |
15afbcd0 | 7883 | |
41e2b43e RD |
7884 | Destroys all children of a window. Called automatically by the |
7885 | destructor. | |
15afbcd0 | 7886 | """ |
54f9ee45 | 7887 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d14a1e28 | 7888 | |
e811c8ce | 7889 | def IsBeingDeleted(*args, **kwargs): |
15afbcd0 | 7890 | """ |
a95a7133 | 7891 | IsBeingDeleted(self) -> bool |
15afbcd0 RD |
7892 | |
7893 | Is the window in the process of being deleted? | |
7894 | """ | |
54f9ee45 | 7895 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d14a1e28 | 7896 | |
e811c8ce | 7897 | def SetTitle(*args, **kwargs): |
15afbcd0 | 7898 | """ |
a95a7133 | 7899 | SetTitle(self, String title) |
15afbcd0 RD |
7900 | |
7901 | Sets the window's title. Applicable only to frames and dialogs. | |
7902 | """ | |
54f9ee45 | 7903 | return _core_.Window_SetTitle(*args, **kwargs) |
d14a1e28 | 7904 | |
e811c8ce | 7905 | def GetTitle(*args, **kwargs): |
15afbcd0 | 7906 | """ |
a95a7133 | 7907 | GetTitle(self) -> String |
15afbcd0 RD |
7908 | |
7909 | Gets the window's title. Applicable only to frames and dialogs. | |
7910 | """ | |
54f9ee45 | 7911 | return _core_.Window_GetTitle(*args, **kwargs) |
d14a1e28 | 7912 | |
e811c8ce | 7913 | def SetLabel(*args, **kwargs): |
15afbcd0 | 7914 | """ |
a95a7133 | 7915 | SetLabel(self, String label) |
15afbcd0 RD |
7916 | |
7917 | Set the text which the window shows in its label if applicable. | |
7918 | """ | |
54f9ee45 | 7919 | return _core_.Window_SetLabel(*args, **kwargs) |
d14a1e28 | 7920 | |
e811c8ce | 7921 | def GetLabel(*args, **kwargs): |
15afbcd0 | 7922 | """ |
a95a7133 | 7923 | GetLabel(self) -> String |
15afbcd0 | 7924 | |
41e2b43e RD |
7925 | Generic way of getting a label from any window, for identification |
7926 | purposes. The interpretation of this function differs from class to | |
7927 | class. For frames and dialogs, the value returned is the title. For | |
7928 | buttons or static text controls, it is the button text. This function | |
7929 | can be useful for meta-programs such as testing tools or special-needs | |
7930 | access programs)which need to identify windows by name. | |
15afbcd0 | 7931 | """ |
54f9ee45 | 7932 | return _core_.Window_GetLabel(*args, **kwargs) |
d14a1e28 | 7933 | |
e811c8ce | 7934 | def SetName(*args, **kwargs): |
15afbcd0 | 7935 | """ |
a95a7133 | 7936 | SetName(self, String name) |
15afbcd0 | 7937 | |
41e2b43e RD |
7938 | Sets the window's name. The window name is used for ressource setting |
7939 | in X, it is not the same as the window title/label | |
15afbcd0 | 7940 | """ |
54f9ee45 | 7941 | return _core_.Window_SetName(*args, **kwargs) |
d14a1e28 | 7942 | |
e811c8ce | 7943 | def GetName(*args, **kwargs): |
15afbcd0 | 7944 | """ |
a95a7133 | 7945 | GetName(self) -> String |
15afbcd0 | 7946 | |
41e2b43e RD |
7947 | Returns the windows name. This name is not guaranteed to be unique; |
7948 | it is up to the programmer to supply an appropriate name in the window | |
7949 | constructor or via wx.Window.SetName. | |
15afbcd0 | 7950 | """ |
54f9ee45 | 7951 | return _core_.Window_GetName(*args, **kwargs) |
d14a1e28 | 7952 | |
4276dc52 RD |
7953 | def SetWindowVariant(*args, **kwargs): |
7954 | """ | |
a95a7133 | 7955 | SetWindowVariant(self, int variant) |
4276dc52 | 7956 | |
41e2b43e RD |
7957 | Sets the variant of the window/font size to use for this window, if |
7958 | the platform supports variants, for example, wxMac. | |
4276dc52 | 7959 | """ |
54f9ee45 | 7960 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
4276dc52 RD |
7961 | |
7962 | def GetWindowVariant(*args, **kwargs): | |
a95a7133 | 7963 | """GetWindowVariant(self) -> int""" |
54f9ee45 | 7964 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
4276dc52 | 7965 | |
e811c8ce | 7966 | def SetId(*args, **kwargs): |
15afbcd0 | 7967 | """ |
a95a7133 | 7968 | SetId(self, int winid) |
15afbcd0 RD |
7969 | |
7970 | Sets the identifier of the window. Each window has an integer | |
7971 | identifier. If the application has not provided one, an identifier | |
7972 | will be generated. Normally, the identifier should be provided on | |
7973 | creation and should not be modified subsequently. | |
7974 | """ | |
54f9ee45 | 7975 | return _core_.Window_SetId(*args, **kwargs) |
d14a1e28 | 7976 | |
e811c8ce | 7977 | def GetId(*args, **kwargs): |
15afbcd0 | 7978 | """ |
a95a7133 | 7979 | GetId(self) -> int |
15afbcd0 RD |
7980 | |
7981 | Returns the identifier of the window. Each window has an integer | |
7982 | identifier. If the application has not provided one (or the default Id | |
7983 | -1 is used) then an unique identifier with a negative value will be | |
7984 | generated. | |
7985 | """ | |
54f9ee45 | 7986 | return _core_.Window_GetId(*args, **kwargs) |
d14a1e28 | 7987 | |
e811c8ce | 7988 | def NewControlId(*args, **kwargs): |
15afbcd0 | 7989 | """ |
66c033b4 | 7990 | NewControlId() -> int |
15afbcd0 RD |
7991 | |
7992 | Generate a control id for the controls which were not given one. | |
7993 | """ | |
54f9ee45 | 7994 | return _core_.Window_NewControlId(*args, **kwargs) |
d14a1e28 | 7995 | |
e811c8ce RD |
7996 | NewControlId = staticmethod(NewControlId) |
7997 | def NextControlId(*args, **kwargs): | |
15afbcd0 | 7998 | """ |
66c033b4 | 7999 | NextControlId(int winid) -> int |
15afbcd0 RD |
8000 | |
8001 | Get the id of the control following the one with the given | |
41e2b43e | 8002 | autogenerated) id |
15afbcd0 | 8003 | """ |
54f9ee45 | 8004 | return _core_.Window_NextControlId(*args, **kwargs) |
d14a1e28 | 8005 | |
e811c8ce RD |
8006 | NextControlId = staticmethod(NextControlId) |
8007 | def PrevControlId(*args, **kwargs): | |
15afbcd0 | 8008 | """ |
66c033b4 | 8009 | PrevControlId(int winid) -> int |
15afbcd0 RD |
8010 | |
8011 | Get the id of the control preceding the one with the given | |
41e2b43e | 8012 | autogenerated) id |
15afbcd0 | 8013 | """ |
54f9ee45 | 8014 | return _core_.Window_PrevControlId(*args, **kwargs) |
d14a1e28 | 8015 | |
e811c8ce RD |
8016 | PrevControlId = staticmethod(PrevControlId) |
8017 | def SetSize(*args, **kwargs): | |
15afbcd0 | 8018 | """ |
a95a7133 | 8019 | SetSize(self, Size size) |
15afbcd0 RD |
8020 | |
8021 | Sets the size of the window in pixels. | |
8022 | """ | |
54f9ee45 | 8023 | return _core_.Window_SetSize(*args, **kwargs) |
d14a1e28 | 8024 | |
e811c8ce | 8025 | def SetDimensions(*args, **kwargs): |
15afbcd0 | 8026 | """ |
a95a7133 | 8027 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
8028 | |
8029 | Sets the position and size of the window in pixels. The sizeFlags | |
8030 | parameter indicates the interpretation of the other params if they are | |
e505d15e RD |
8031 | equal to -1. |
8032 | ||
8033 | ======================== ====================================== | |
8034 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
8035 | default should be used. | |
8036 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
8037 | -1 values are supplied. | |
8038 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
8039 | interpreted as real dimensions, not | |
8040 | default values. | |
8041 | ======================== ====================================== | |
8042 | ||
15afbcd0 | 8043 | """ |
54f9ee45 | 8044 | return _core_.Window_SetDimensions(*args, **kwargs) |
d14a1e28 | 8045 | |
e811c8ce | 8046 | def SetRect(*args, **kwargs): |
15afbcd0 | 8047 | """ |
a95a7133 | 8048 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
8049 | |
8050 | Sets the position and size of the window in pixels using a wx.Rect. | |
8051 | """ | |
54f9ee45 | 8052 | return _core_.Window_SetRect(*args, **kwargs) |
d14a1e28 | 8053 | |
e811c8ce | 8054 | def SetSizeWH(*args, **kwargs): |
15afbcd0 | 8055 | """ |
a95a7133 | 8056 | SetSizeWH(self, int width, int height) |
15afbcd0 RD |
8057 | |
8058 | Sets the size of the window in pixels. | |
8059 | """ | |
54f9ee45 | 8060 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d14a1e28 | 8061 | |
e811c8ce | 8062 | def Move(*args, **kwargs): |
15afbcd0 | 8063 | """ |
a95a7133 | 8064 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
8065 | |
8066 | Moves the window to the given position. | |
8067 | """ | |
54f9ee45 | 8068 | return _core_.Window_Move(*args, **kwargs) |
d14a1e28 | 8069 | |
e811c8ce RD |
8070 | SetPosition = Move |
8071 | def MoveXY(*args, **kwargs): | |
15afbcd0 | 8072 | """ |
a95a7133 | 8073 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
8074 | |
8075 | Moves the window to the given position. | |
8076 | """ | |
54f9ee45 | 8077 | return _core_.Window_MoveXY(*args, **kwargs) |
e811c8ce | 8078 | |
f8167d6e RD |
8079 | def SetBestFittingSize(*args, **kwargs): |
8080 | """ | |
8081 | SetBestFittingSize(self, Size size=DefaultSize) | |
8082 | ||
8083 | A 'Smart' SetSize that will fill in default size components with the | |
8084 | window's *best size* values. Also set's the minsize for use with sizers. | |
8085 | """ | |
8086 | return _core_.Window_SetBestFittingSize(*args, **kwargs) | |
8087 | ||
e811c8ce | 8088 | def Raise(*args, **kwargs): |
15afbcd0 | 8089 | """ |
a95a7133 | 8090 | Raise(self) |
15afbcd0 RD |
8091 | |
8092 | Raises the window to the top of the window hierarchy if it is a | |
8093 | managed window (dialog or frame). | |
8094 | """ | |
54f9ee45 | 8095 | return _core_.Window_Raise(*args, **kwargs) |
e811c8ce RD |
8096 | |
8097 | def Lower(*args, **kwargs): | |
15afbcd0 | 8098 | """ |
a95a7133 | 8099 | Lower(self) |
15afbcd0 RD |
8100 | |
8101 | Lowers the window to the bottom of the window hierarchy if it is a | |
8102 | managed window (dialog or frame). | |
8103 | """ | |
54f9ee45 | 8104 | return _core_.Window_Lower(*args, **kwargs) |
e811c8ce RD |
8105 | |
8106 | def SetClientSize(*args, **kwargs): | |
15afbcd0 | 8107 | """ |
a95a7133 | 8108 | SetClientSize(self, Size size) |
15afbcd0 RD |
8109 | |
8110 | This sets the size of the window client area in pixels. Using this | |
8111 | function to size a window tends to be more device-independent than | |
8112 | wx.Window.SetSize, since the application need not worry about what | |
8113 | dimensions the border or title bar have when trying to fit the window | |
8114 | around panel items, for example. | |
8115 | """ | |
54f9ee45 | 8116 | return _core_.Window_SetClientSize(*args, **kwargs) |
e811c8ce RD |
8117 | |
8118 | def SetClientSizeWH(*args, **kwargs): | |
15afbcd0 | 8119 | """ |
a95a7133 | 8120 | SetClientSizeWH(self, int width, int height) |
15afbcd0 RD |
8121 | |
8122 | This sets the size of the window client area in pixels. Using this | |
8123 | function to size a window tends to be more device-independent than | |
8124 | wx.Window.SetSize, since the application need not worry about what | |
8125 | dimensions the border or title bar have when trying to fit the window | |
8126 | around panel items, for example. | |
8127 | """ | |
54f9ee45 | 8128 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
e811c8ce RD |
8129 | |
8130 | def SetClientRect(*args, **kwargs): | |
15afbcd0 | 8131 | """ |
a95a7133 | 8132 | SetClientRect(self, Rect rect) |
15afbcd0 RD |
8133 | |
8134 | This sets the size of the window client area in pixels. Using this | |
8135 | function to size a window tends to be more device-independent than | |
8136 | wx.Window.SetSize, since the application need not worry about what | |
8137 | dimensions the border or title bar have when trying to fit the window | |
8138 | around panel items, for example. | |
8139 | """ | |
54f9ee45 | 8140 | return _core_.Window_SetClientRect(*args, **kwargs) |
e811c8ce RD |
8141 | |
8142 | def GetPosition(*args, **kwargs): | |
0df68c9f | 8143 | """ |
a95a7133 | 8144 | GetPosition(self) -> Point |
e811c8ce | 8145 | |
0df68c9f RD |
8146 | Get the window's position. |
8147 | """ | |
54f9ee45 | 8148 | return _core_.Window_GetPosition(*args, **kwargs) |
e811c8ce RD |
8149 | |
8150 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
8151 | """ |
8152 | GetPositionTuple() -> (x,y) | |
e811c8ce | 8153 | |
0df68c9f RD |
8154 | Get the window's position. |
8155 | """ | |
54f9ee45 | 8156 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
8157 | |
8158 | def GetSize(*args, **kwargs): | |
0df68c9f | 8159 | """ |
a95a7133 | 8160 | GetSize(self) -> Size |
e811c8ce | 8161 | |
0df68c9f RD |
8162 | Get the window size. |
8163 | """ | |
54f9ee45 | 8164 | return _core_.Window_GetSize(*args, **kwargs) |
e811c8ce RD |
8165 | |
8166 | def GetSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8167 | """ |
8168 | GetSizeTuple() -> (width, height) | |
e811c8ce | 8169 | |
0df68c9f RD |
8170 | Get the window size. |
8171 | """ | |
54f9ee45 | 8172 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
e811c8ce RD |
8173 | |
8174 | def GetRect(*args, **kwargs): | |
15afbcd0 | 8175 | """ |
a95a7133 | 8176 | GetRect(self) -> Rect |
15afbcd0 RD |
8177 | |
8178 | Returns the size and position of the window as a wx.Rect object. | |
8179 | """ | |
54f9ee45 | 8180 | return _core_.Window_GetRect(*args, **kwargs) |
e811c8ce RD |
8181 | |
8182 | def GetClientSize(*args, **kwargs): | |
0df68c9f | 8183 | """ |
a95a7133 | 8184 | GetClientSize(self) -> Size |
e811c8ce | 8185 | |
15afbcd0 RD |
8186 | This gets the size of the window's 'client area' in pixels. The client |
8187 | area is the area which may be drawn on by the programmer, excluding | |
8188 | title bar, border, scrollbars, etc. | |
0df68c9f | 8189 | """ |
54f9ee45 | 8190 | return _core_.Window_GetClientSize(*args, **kwargs) |
e811c8ce RD |
8191 | |
8192 | def GetClientSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8193 | """ |
8194 | GetClientSizeTuple() -> (width, height) | |
e811c8ce | 8195 | |
15afbcd0 RD |
8196 | This gets the size of the window's 'client area' in pixels. The client |
8197 | area is the area which may be drawn on by the programmer, excluding | |
8198 | title bar, border, scrollbars, etc. | |
0df68c9f | 8199 | """ |
54f9ee45 | 8200 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
e811c8ce RD |
8201 | |
8202 | def GetClientAreaOrigin(*args, **kwargs): | |
15afbcd0 | 8203 | """ |
a95a7133 | 8204 | GetClientAreaOrigin(self) -> Point |
15afbcd0 RD |
8205 | |
8206 | Get the origin of the client area of the window relative to the | |
8207 | window's top left corner (the client area may be shifted because of | |
8208 | the borders, scrollbars, other decorations...) | |
8209 | """ | |
54f9ee45 | 8210 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
e811c8ce RD |
8211 | |
8212 | def GetClientRect(*args, **kwargs): | |
15afbcd0 | 8213 | """ |
a95a7133 | 8214 | GetClientRect(self) -> Rect |
15afbcd0 | 8215 | |
61863841 | 8216 | Get the client area position and size as a `wx.Rect` object. |
15afbcd0 | 8217 | """ |
54f9ee45 | 8218 | return _core_.Window_GetClientRect(*args, **kwargs) |
e811c8ce RD |
8219 | |
8220 | def GetBestSize(*args, **kwargs): | |
0df68c9f | 8221 | """ |
a95a7133 | 8222 | GetBestSize(self) -> Size |
e811c8ce | 8223 | |
248ed943 | 8224 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8225 | window, if applicable. For example, for a static text control, it will |
8226 | be the minimal size such that the control label is not truncated. For | |
8227 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8228 | this function will be the same as the size the window would have had | |
8229 | after calling Fit. | |
0df68c9f | 8230 | """ |
54f9ee45 | 8231 | return _core_.Window_GetBestSize(*args, **kwargs) |
e811c8ce RD |
8232 | |
8233 | def GetBestSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8234 | """ |
8235 | GetBestSizeTuple() -> (width, height) | |
e811c8ce | 8236 | |
248ed943 | 8237 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8238 | window, if applicable. For example, for a static text control, it will |
8239 | be the minimal size such that the control label is not truncated. For | |
8240 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8241 | this function will be the same as the size the window would have had | |
8242 | after calling Fit. | |
0df68c9f | 8243 | """ |
54f9ee45 | 8244 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
e811c8ce | 8245 | |
dfbb5885 RD |
8246 | def InvalidateBestSize(*args, **kwargs): |
8247 | """ | |
8248 | InvalidateBestSize(self) | |
8249 | ||
8250 | Reset the cached best size value so it will be recalculated the next | |
8251 | time it is needed. | |
8252 | """ | |
8253 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
8254 | ||
e2813725 RD |
8255 | def CacheBestSize(*args, **kwargs): |
8256 | """ | |
8257 | CacheBestSize(self, Size size) | |
8258 | ||
8259 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8260 | some properties of the window change.) | |
8261 | """ | |
8262 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8263 | ||
dfbb5885 RD |
8264 | def GetBestFittingSize(*args, **kwargs): |
8265 | """ | |
8266 | GetBestFittingSize(self) -> Size | |
8267 | ||
8268 | This function will merge the window's best size into the window's | |
8269 | minimum size, giving priority to the min size components, and returns | |
8270 | the results. | |
8271 | ||
8272 | """ | |
8273 | return _core_.Window_GetBestFittingSize(*args, **kwargs) | |
8274 | ||
e811c8ce | 8275 | def GetAdjustedBestSize(*args, **kwargs): |
15afbcd0 | 8276 | """ |
a95a7133 | 8277 | GetAdjustedBestSize(self) -> Size |
15afbcd0 RD |
8278 | |
8279 | This method is similar to GetBestSize, except in one | |
8280 | thing. GetBestSize should return the minimum untruncated size of the | |
8281 | window, while this method will return the largest of BestSize and any | |
8282 | user specified minimum size. ie. it is the minimum size the window | |
8283 | should currently be drawn at, not the minimal size it can possibly | |
8284 | tolerate. | |
8285 | """ | |
54f9ee45 | 8286 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) |
e811c8ce RD |
8287 | |
8288 | def Center(*args, **kwargs): | |
15afbcd0 | 8289 | """ |
a95a7133 | 8290 | Center(self, int direction=BOTH) |
15afbcd0 RD |
8291 | |
8292 | Centers the window. The parameter specifies the direction for | |
8293 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8294 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8295 | on the entire screen and not on its parent window. If it is a | |
8296 | top-level window and has no parent then it will always be centered | |
8297 | relative to the screen. | |
8298 | """ | |
54f9ee45 | 8299 | return _core_.Window_Center(*args, **kwargs) |
e811c8ce RD |
8300 | |
8301 | Centre = Center | |
8302 | def CenterOnScreen(*args, **kwargs): | |
15afbcd0 | 8303 | """ |
a95a7133 | 8304 | CenterOnScreen(self, int dir=BOTH) |
15afbcd0 RD |
8305 | |
8306 | Center on screen (only works for top level windows) | |
8307 | """ | |
54f9ee45 | 8308 | return _core_.Window_CenterOnScreen(*args, **kwargs) |
e811c8ce RD |
8309 | |
8310 | CentreOnScreen = CenterOnScreen | |
8311 | def CenterOnParent(*args, **kwargs): | |
15afbcd0 | 8312 | """ |
a95a7133 | 8313 | CenterOnParent(self, int dir=BOTH) |
15afbcd0 RD |
8314 | |
8315 | Center with respect to the the parent window | |
8316 | """ | |
54f9ee45 | 8317 | return _core_.Window_CenterOnParent(*args, **kwargs) |
e811c8ce RD |
8318 | |
8319 | CentreOnParent = CenterOnParent | |
8320 | def Fit(*args, **kwargs): | |
15afbcd0 | 8321 | """ |
a95a7133 | 8322 | Fit(self) |
15afbcd0 RD |
8323 | |
8324 | Sizes the window so that it fits around its subwindows. This function | |
8325 | won't do anything if there are no subwindows and will only really work | |
8326 | correctly if sizers are used for the subwindows layout. Also, if the | |
8327 | window has exactly one subwindow it is better (faster and the result | |
8328 | is more precise as Fit adds some margin to account for fuzziness of | |
8329 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8330 | instead of calling Fit. | |
8331 | """ | |
54f9ee45 | 8332 | return _core_.Window_Fit(*args, **kwargs) |
e811c8ce RD |
8333 | |
8334 | def FitInside(*args, **kwargs): | |
15afbcd0 | 8335 | """ |
a95a7133 | 8336 | FitInside(self) |
15afbcd0 RD |
8337 | |
8338 | Similar to Fit, but sizes the interior (virtual) size of a | |
8339 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8340 | sizing changes that do not trigger a size event, and/or scrolled | |
8341 | windows without an interior sizer. This function similarly won't do | |
8342 | anything if there are no subwindows. | |
8343 | """ | |
54f9ee45 | 8344 | return _core_.Window_FitInside(*args, **kwargs) |
e811c8ce | 8345 | |
f16ab95d | 8346 | def SetSizeHints(*args, **kwargs): |
0df68c9f | 8347 | """ |
a95a7133 | 8348 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, |
0df68c9f | 8349 | int incH=-1) |
15afbcd0 RD |
8350 | |
8351 | Allows specification of minimum and maximum window sizes, and window | |
8352 | size increments. If a pair of values is not set (or set to -1), the | |
8353 | default values will be used. If this function is called, the user | |
908b74cd RD |
8354 | will not be able to size the window outside the given bounds (if it is |
8355 | a top-level window.) Sizers will also inspect the minimum window size | |
8356 | and will use that value if set when calculating layout. | |
8357 | ||
8358 | The resizing increments are only significant under Motif or Xt. | |
0df68c9f | 8359 | """ |
f16ab95d | 8360 | return _core_.Window_SetSizeHints(*args, **kwargs) |
e811c8ce | 8361 | |
f16ab95d RD |
8362 | def SetSizeHintsSz(*args, **kwargs): |
8363 | """ | |
8364 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
8365 | ||
8366 | Allows specification of minimum and maximum window sizes, and window | |
8367 | size increments. If a pair of values is not set (or set to -1), the | |
8368 | default values will be used. If this function is called, the user | |
8369 | will not be able to size the window outside the given bounds (if it is | |
8370 | a top-level window.) Sizers will also inspect the minimum window size | |
8371 | and will use that value if set when calculating layout. | |
8372 | ||
8373 | The resizing increments are only significant under Motif or Xt. | |
8374 | """ | |
8375 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
8376 | ||
8377 | def SetVirtualSizeHints(*args, **kwargs): | |
15afbcd0 | 8378 | """ |
908b74cd | 8379 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
15afbcd0 RD |
8380 | |
8381 | Allows specification of minimum and maximum virtual window sizes. If a | |
8382 | pair of values is not set (or set to -1), the default values will be | |
8383 | used. If this function is called, the user will not be able to size | |
8384 | the virtual area of the window outside the given bounds. | |
8385 | """ | |
f16ab95d RD |
8386 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
8387 | ||
8388 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8389 | """ | |
8390 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
8391 | ||
8392 | Allows specification of minimum and maximum virtual window sizes. If a | |
8393 | pair of values is not set (or set to -1), the default values will be | |
8394 | used. If this function is called, the user will not be able to size | |
8395 | the virtual area of the window outside the given bounds. | |
8396 | """ | |
8397 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
e811c8ce | 8398 | |
908b74cd RD |
8399 | def GetMaxSize(*args, **kwargs): |
8400 | """GetMaxSize(self) -> Size""" | |
8401 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
8402 | ||
8403 | def GetMinSize(*args, **kwargs): | |
8404 | """GetMinSize(self) -> Size""" | |
8405 | return _core_.Window_GetMinSize(*args, **kwargs) | |
8406 | ||
8407 | def SetMinSize(*args, **kwargs): | |
8408 | """ | |
8409 | SetMinSize(self, Size minSize) | |
8410 | ||
8411 | A more convenient method than `SetSizeHints` for setting just the | |
8412 | min size. | |
8413 | """ | |
8414 | return _core_.Window_SetMinSize(*args, **kwargs) | |
8415 | ||
8416 | def SetMaxSize(*args, **kwargs): | |
8417 | """ | |
8418 | SetMaxSize(self, Size maxSize) | |
8419 | ||
8420 | A more convenient method than `SetSizeHints` for setting just the | |
8421 | max size. | |
8422 | """ | |
8423 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
8424 | ||
e811c8ce | 8425 | def GetMinWidth(*args, **kwargs): |
a95a7133 | 8426 | """GetMinWidth(self) -> int""" |
54f9ee45 | 8427 | return _core_.Window_GetMinWidth(*args, **kwargs) |
e811c8ce RD |
8428 | |
8429 | def GetMinHeight(*args, **kwargs): | |
a95a7133 | 8430 | """GetMinHeight(self) -> int""" |
54f9ee45 | 8431 | return _core_.Window_GetMinHeight(*args, **kwargs) |
e811c8ce RD |
8432 | |
8433 | def GetMaxWidth(*args, **kwargs): | |
a95a7133 | 8434 | """GetMaxWidth(self) -> int""" |
54f9ee45 | 8435 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
e811c8ce RD |
8436 | |
8437 | def GetMaxHeight(*args, **kwargs): | |
a95a7133 | 8438 | """GetMaxHeight(self) -> int""" |
54f9ee45 | 8439 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
e811c8ce | 8440 | |
e811c8ce | 8441 | def SetVirtualSize(*args, **kwargs): |
0df68c9f | 8442 | """ |
a95a7133 | 8443 | SetVirtualSize(self, Size size) |
e811c8ce | 8444 | |
15afbcd0 RD |
8445 | Set the the virtual size of a window in pixels. For most windows this |
8446 | is just the client area of the window, but for some like scrolled | |
8447 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8448 | """ |
54f9ee45 | 8449 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8450 | |
8451 | def SetVirtualSizeWH(*args, **kwargs): | |
0df68c9f | 8452 | """ |
a95a7133 | 8453 | SetVirtualSizeWH(self, int w, int h) |
e811c8ce | 8454 | |
15afbcd0 RD |
8455 | Set the the virtual size of a window in pixels. For most windows this |
8456 | is just the client area of the window, but for some like scrolled | |
8457 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8458 | """ |
54f9ee45 | 8459 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
e811c8ce RD |
8460 | |
8461 | def GetVirtualSize(*args, **kwargs): | |
0df68c9f | 8462 | """ |
a95a7133 | 8463 | GetVirtualSize(self) -> Size |
e811c8ce | 8464 | |
15afbcd0 RD |
8465 | Get the the virtual size of the window in pixels. For most windows |
8466 | this is just the client area of the window, but for some like scrolled | |
8467 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8468 | """ |
54f9ee45 | 8469 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8470 | |
8471 | def GetVirtualSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8472 | """ |
8473 | GetVirtualSizeTuple() -> (width, height) | |
e811c8ce | 8474 | |
15afbcd0 RD |
8475 | Get the the virtual size of the window in pixels. For most windows |
8476 | this is just the client area of the window, but for some like scrolled | |
8477 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8478 | """ |
54f9ee45 | 8479 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
e811c8ce RD |
8480 | |
8481 | def GetBestVirtualSize(*args, **kwargs): | |
15afbcd0 | 8482 | """ |
a95a7133 | 8483 | GetBestVirtualSize(self) -> Size |
15afbcd0 RD |
8484 | |
8485 | Return the largest of ClientSize and BestSize (as determined by a | |
8486 | sizer, interior children, or other means) | |
8487 | """ | |
54f9ee45 | 8488 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
e811c8ce RD |
8489 | |
8490 | def Show(*args, **kwargs): | |
15afbcd0 | 8491 | """ |
a95a7133 | 8492 | Show(self, bool show=True) -> bool |
15afbcd0 RD |
8493 | |
8494 | Shows or hides the window. You may need to call Raise for a top level | |
8495 | window if you want to bring it to top, although this is not needed if | |
8496 | Show is called immediately after the frame creation. Returns True if | |
8497 | the window has been shown or hidden or False if nothing was done | |
8498 | because it already was in the requested state. | |
8499 | """ | |
54f9ee45 | 8500 | return _core_.Window_Show(*args, **kwargs) |
e811c8ce RD |
8501 | |
8502 | def Hide(*args, **kwargs): | |
15afbcd0 | 8503 | """ |
a95a7133 | 8504 | Hide(self) -> bool |
15afbcd0 RD |
8505 | |
8506 | Equivalent to calling Show(False). | |
8507 | """ | |
54f9ee45 | 8508 | return _core_.Window_Hide(*args, **kwargs) |
e811c8ce RD |
8509 | |
8510 | def Enable(*args, **kwargs): | |
15afbcd0 | 8511 | """ |
a95a7133 | 8512 | Enable(self, bool enable=True) -> bool |
15afbcd0 RD |
8513 | |
8514 | Enable or disable the window for user input. Note that when a parent | |
8515 | window is disabled, all of its children are disabled as well and they | |
8516 | are reenabled again when the parent is. Returns true if the window | |
8517 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8518 | window had already been in the specified state. | |
8519 | """ | |
54f9ee45 | 8520 | return _core_.Window_Enable(*args, **kwargs) |
e811c8ce RD |
8521 | |
8522 | def Disable(*args, **kwargs): | |
15afbcd0 | 8523 | """ |
a95a7133 | 8524 | Disable(self) -> bool |
15afbcd0 RD |
8525 | |
8526 | Disables the window, same as Enable(false). | |
8527 | """ | |
54f9ee45 | 8528 | return _core_.Window_Disable(*args, **kwargs) |
e811c8ce RD |
8529 | |
8530 | def IsShown(*args, **kwargs): | |
15afbcd0 | 8531 | """ |
a95a7133 | 8532 | IsShown(self) -> bool |
15afbcd0 RD |
8533 | |
8534 | Returns true if the window is shown, false if it has been hidden. | |
8535 | """ | |
54f9ee45 | 8536 | return _core_.Window_IsShown(*args, **kwargs) |
e811c8ce RD |
8537 | |
8538 | def IsEnabled(*args, **kwargs): | |
15afbcd0 | 8539 | """ |
a95a7133 | 8540 | IsEnabled(self) -> bool |
15afbcd0 RD |
8541 | |
8542 | Returns true if the window is enabled for input, false otherwise. | |
8543 | """ | |
54f9ee45 | 8544 | return _core_.Window_IsEnabled(*args, **kwargs) |
e811c8ce RD |
8545 | |
8546 | def SetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 8547 | """ |
a95a7133 | 8548 | SetWindowStyleFlag(self, long style) |
15afbcd0 | 8549 | |
41e2b43e RD |
8550 | Sets the style of the window. Please note that some styles cannot be |
8551 | changed after the window creation and that Refresh() might need to be | |
8552 | called after changing the others for the change to take place | |
8553 | immediately. | |
15afbcd0 | 8554 | """ |
54f9ee45 | 8555 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
e811c8ce RD |
8556 | |
8557 | def GetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 8558 | """ |
a95a7133 | 8559 | GetWindowStyleFlag(self) -> long |
e811c8ce | 8560 | |
15afbcd0 RD |
8561 | Gets the window style that was passed to the constructor or Create |
8562 | method. | |
8563 | """ | |
54f9ee45 | 8564 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
e811c8ce | 8565 | |
15afbcd0 | 8566 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag |
e811c8ce | 8567 | def HasFlag(*args, **kwargs): |
15afbcd0 | 8568 | """ |
a95a7133 | 8569 | HasFlag(self, int flag) -> bool |
15afbcd0 RD |
8570 | |
8571 | Test if the given style is set for this window. | |
8572 | """ | |
54f9ee45 | 8573 | return _core_.Window_HasFlag(*args, **kwargs) |
e811c8ce RD |
8574 | |
8575 | def IsRetained(*args, **kwargs): | |
15afbcd0 | 8576 | """ |
a95a7133 | 8577 | IsRetained(self) -> bool |
15afbcd0 RD |
8578 | |
8579 | Returns true if the window is retained, false otherwise. Retained | |
8580 | windows are only available on X platforms. | |
8581 | """ | |
54f9ee45 | 8582 | return _core_.Window_IsRetained(*args, **kwargs) |
e811c8ce RD |
8583 | |
8584 | def SetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8585 | """ |
a95a7133 | 8586 | SetExtraStyle(self, long exStyle) |
15afbcd0 RD |
8587 | |
8588 | Sets the extra style bits for the window. Extra styles are the less | |
8589 | often used style bits which can't be set with the constructor or with | |
8590 | SetWindowStyleFlag() | |
8591 | """ | |
54f9ee45 | 8592 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8593 | |
8594 | def GetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8595 | """ |
a95a7133 | 8596 | GetExtraStyle(self) -> long |
15afbcd0 RD |
8597 | |
8598 | Returns the extra style bits for the window. | |
8599 | """ | |
54f9ee45 | 8600 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8601 | |
8602 | def MakeModal(*args, **kwargs): | |
15afbcd0 | 8603 | """ |
a95a7133 | 8604 | MakeModal(self, bool modal=True) |
15afbcd0 RD |
8605 | |
8606 | Disables all other windows in the application so that the user can | |
8607 | only interact with this window. Passing False will reverse this | |
8608 | effect. | |
8609 | """ | |
54f9ee45 | 8610 | return _core_.Window_MakeModal(*args, **kwargs) |
e811c8ce RD |
8611 | |
8612 | def SetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8613 | """ |
a95a7133 | 8614 | SetThemeEnabled(self, bool enableTheme) |
15afbcd0 RD |
8615 | |
8616 | This function tells a window if it should use the system's "theme" | |
8617 | code to draw the windows' background instead if its own background | |
8618 | drawing code. This will only have an effect on platforms that support | |
8619 | the notion of themes in user defined windows. One such platform is | |
8620 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8621 | user's selected theme. | |
8622 | ||
8623 | Dialogs, notebook pages and the status bar have this flag set to true | |
8624 | by default so that the default look and feel is simulated best. | |
8625 | """ | |
54f9ee45 | 8626 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8627 | |
8628 | def GetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8629 | """ |
a95a7133 | 8630 | GetThemeEnabled(self) -> bool |
e811c8ce | 8631 | |
15afbcd0 RD |
8632 | Return the themeEnabled flag. |
8633 | """ | |
54f9ee45 | 8634 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8635 | |
8636 | def SetFocus(*args, **kwargs): | |
15afbcd0 | 8637 | """ |
a95a7133 | 8638 | SetFocus(self) |
15afbcd0 RD |
8639 | |
8640 | Set's the focus to this window, allowing it to receive keyboard input. | |
8641 | """ | |
54f9ee45 | 8642 | return _core_.Window_SetFocus(*args, **kwargs) |
e811c8ce RD |
8643 | |
8644 | def SetFocusFromKbd(*args, **kwargs): | |
15afbcd0 | 8645 | """ |
a95a7133 | 8646 | SetFocusFromKbd(self) |
15afbcd0 RD |
8647 | |
8648 | Set focus to this window as the result of a keyboard action. Normally | |
8649 | only called internally. | |
8650 | """ | |
54f9ee45 | 8651 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
e811c8ce RD |
8652 | |
8653 | def FindFocus(*args, **kwargs): | |
15afbcd0 | 8654 | """ |
66c033b4 | 8655 | FindFocus() -> Window |
15afbcd0 RD |
8656 | |
8657 | Returns the window or control that currently has the keyboard focus, | |
8658 | or None. | |
8659 | """ | |
54f9ee45 | 8660 | return _core_.Window_FindFocus(*args, **kwargs) |
e811c8ce RD |
8661 | |
8662 | FindFocus = staticmethod(FindFocus) | |
8663 | def AcceptsFocus(*args, **kwargs): | |
15afbcd0 | 8664 | """ |
a95a7133 | 8665 | AcceptsFocus(self) -> bool |
15afbcd0 RD |
8666 | |
8667 | Can this window have focus? | |
8668 | """ | |
54f9ee45 | 8669 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
e811c8ce RD |
8670 | |
8671 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
15afbcd0 | 8672 | """ |
a95a7133 | 8673 | AcceptsFocusFromKeyboard(self) -> bool |
15afbcd0 RD |
8674 | |
8675 | Can this window be given focus by keyboard navigation? if not, the | |
8676 | only way to give it focus (provided it accepts it at all) is to click | |
8677 | it. | |
8678 | """ | |
54f9ee45 | 8679 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
e811c8ce RD |
8680 | |
8681 | def GetDefaultItem(*args, **kwargs): | |
15afbcd0 | 8682 | """ |
a95a7133 | 8683 | GetDefaultItem(self) -> Window |
15afbcd0 RD |
8684 | |
8685 | Get the default child of this parent, i.e. the one which is activated | |
8686 | by pressing <Enter> such as the OK button on a wx.Dialog. | |
8687 | """ | |
54f9ee45 | 8688 | return _core_.Window_GetDefaultItem(*args, **kwargs) |
e811c8ce RD |
8689 | |
8690 | def SetDefaultItem(*args, **kwargs): | |
15afbcd0 | 8691 | """ |
a95a7133 | 8692 | SetDefaultItem(self, Window child) -> Window |
15afbcd0 RD |
8693 | |
8694 | Set this child as default, return the old default. | |
8695 | """ | |
54f9ee45 | 8696 | return _core_.Window_SetDefaultItem(*args, **kwargs) |
e811c8ce RD |
8697 | |
8698 | def SetTmpDefaultItem(*args, **kwargs): | |
15afbcd0 | 8699 | """ |
a95a7133 | 8700 | SetTmpDefaultItem(self, Window win) |
15afbcd0 RD |
8701 | |
8702 | Set this child as temporary default | |
8703 | """ | |
54f9ee45 | 8704 | return _core_.Window_SetTmpDefaultItem(*args, **kwargs) |
e811c8ce | 8705 | |
908b74cd RD |
8706 | def Navigate(*args, **kwargs): |
8707 | """ | |
8708 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8709 | ||
fd2dc343 RD |
8710 | Does keyboard navigation from this window to another, by sending a |
8711 | `wx.NavigationKeyEvent`. | |
908b74cd RD |
8712 | """ |
8713 | return _core_.Window_Navigate(*args, **kwargs) | |
8714 | ||
7f98d120 RD |
8715 | def MoveAfterInTabOrder(*args, **kwargs): |
8716 | """ | |
8717 | MoveAfterInTabOrder(self, Window win) | |
8718 | ||
8719 | Moves this window in the tab navigation order after the specified | |
8720 | sibling window. This means that when the user presses the TAB key on | |
8721 | that other window, the focus switches to this window. | |
8722 | ||
8723 | The default tab order is the same as creation order. This function | |
8724 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8725 | windows. | |
8726 | ||
8727 | """ | |
8728 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
8729 | ||
8730 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8731 | """ | |
8732 | MoveBeforeInTabOrder(self, Window win) | |
8733 | ||
8734 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8735 | before win instead of putting it right after it. | |
8736 | """ | |
8737 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
8738 | ||
e811c8ce | 8739 | def GetChildren(*args, **kwargs): |
15afbcd0 | 8740 | """ |
a95a7133 | 8741 | GetChildren(self) -> PyObject |
15afbcd0 RD |
8742 | |
8743 | Returns a list of the window's children. NOTE: Currently this is a | |
8744 | copy of the child window list maintained by the window, so the return | |
8745 | value of this function is only valid as long as the window's children | |
8746 | do not change. | |
8747 | """ | |
54f9ee45 | 8748 | return _core_.Window_GetChildren(*args, **kwargs) |
e811c8ce RD |
8749 | |
8750 | def GetParent(*args, **kwargs): | |
15afbcd0 | 8751 | """ |
a95a7133 | 8752 | GetParent(self) -> Window |
15afbcd0 RD |
8753 | |
8754 | Returns the parent window of this window, or None if there isn't one. | |
8755 | """ | |
54f9ee45 | 8756 | return _core_.Window_GetParent(*args, **kwargs) |
e811c8ce RD |
8757 | |
8758 | def GetGrandParent(*args, **kwargs): | |
15afbcd0 | 8759 | """ |
a95a7133 | 8760 | GetGrandParent(self) -> Window |
15afbcd0 | 8761 | |
41e2b43e RD |
8762 | Returns the parent of the parent of this window, or None if there |
8763 | isn't one. | |
15afbcd0 | 8764 | """ |
54f9ee45 | 8765 | return _core_.Window_GetGrandParent(*args, **kwargs) |
e811c8ce RD |
8766 | |
8767 | def IsTopLevel(*args, **kwargs): | |
15afbcd0 | 8768 | """ |
a95a7133 | 8769 | IsTopLevel(self) -> bool |
15afbcd0 RD |
8770 | |
8771 | Returns true if the given window is a top-level one. Currently all | |
8772 | frames and dialogs are always considered to be top-level windows (even | |
8773 | if they have a parent window). | |
8774 | """ | |
54f9ee45 | 8775 | return _core_.Window_IsTopLevel(*args, **kwargs) |
e811c8ce RD |
8776 | |
8777 | def Reparent(*args, **kwargs): | |
15afbcd0 | 8778 | """ |
a95a7133 | 8779 | Reparent(self, Window newParent) -> bool |
15afbcd0 RD |
8780 | |
8781 | Reparents the window, i.e the window will be removed from its current | |
8782 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
8783 | re-inserted into another. Available on Windows and GTK. Returns True | |
8784 | if the parent was changed, False otherwise (error or newParent == | |
8785 | oldParent) | |
8786 | """ | |
54f9ee45 | 8787 | return _core_.Window_Reparent(*args, **kwargs) |
e811c8ce RD |
8788 | |
8789 | def AddChild(*args, **kwargs): | |
15afbcd0 | 8790 | """ |
a95a7133 | 8791 | AddChild(self, Window child) |
15afbcd0 RD |
8792 | |
8793 | Adds a child window. This is called automatically by window creation | |
8794 | functions so should not be required by the application programmer. | |
8795 | """ | |
54f9ee45 | 8796 | return _core_.Window_AddChild(*args, **kwargs) |
e811c8ce RD |
8797 | |
8798 | def RemoveChild(*args, **kwargs): | |
15afbcd0 | 8799 | """ |
a95a7133 | 8800 | RemoveChild(self, Window child) |
15afbcd0 RD |
8801 | |
8802 | Removes a child window. This is called automatically by window | |
8803 | deletion functions so should not be required by the application | |
8804 | programmer. | |
8805 | """ | |
54f9ee45 | 8806 | return _core_.Window_RemoveChild(*args, **kwargs) |
e811c8ce RD |
8807 | |
8808 | def FindWindowById(*args, **kwargs): | |
15afbcd0 | 8809 | """ |
a95a7133 | 8810 | FindWindowById(self, long winid) -> Window |
15afbcd0 RD |
8811 | |
8812 | Find a chld of this window by window ID | |
8813 | """ | |
54f9ee45 | 8814 | return _core_.Window_FindWindowById(*args, **kwargs) |
e811c8ce RD |
8815 | |
8816 | def FindWindowByName(*args, **kwargs): | |
15afbcd0 | 8817 | """ |
a95a7133 | 8818 | FindWindowByName(self, String name) -> Window |
15afbcd0 RD |
8819 | |
8820 | Find a child of this window by name | |
8821 | """ | |
54f9ee45 | 8822 | return _core_.Window_FindWindowByName(*args, **kwargs) |
e811c8ce RD |
8823 | |
8824 | def GetEventHandler(*args, **kwargs): | |
15afbcd0 | 8825 | """ |
a95a7133 | 8826 | GetEventHandler(self) -> EvtHandler |
15afbcd0 RD |
8827 | |
8828 | Returns the event handler for this window. By default, the window is | |
8829 | its own event handler. | |
8830 | """ | |
54f9ee45 | 8831 | return _core_.Window_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
8832 | |
8833 | def SetEventHandler(*args, **kwargs): | |
15afbcd0 | 8834 | """ |
a95a7133 | 8835 | SetEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8836 | |
8837 | Sets the event handler for this window. An event handler is an object | |
8838 | that is capable of processing the events sent to a window. By default, | |
8839 | the window is its own event handler, but an application may wish to | |
8840 | substitute another, for example to allow central implementation of | |
8841 | event-handling for a variety of different window classes. | |
8842 | ||
41e2b43e | 8843 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
15afbcd0 RD |
8844 | up a chain of event handlers, where an event not handled by one event |
8845 | handler is handed to the next one in the chain. | |
8846 | """ | |
54f9ee45 | 8847 | return _core_.Window_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
8848 | |
8849 | def PushEventHandler(*args, **kwargs): | |
15afbcd0 | 8850 | """ |
a95a7133 | 8851 | PushEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8852 | |
8853 | Pushes this event handler onto the event handler stack for the window. | |
8854 | An event handler is an object that is capable of processing the events | |
8855 | sent to a window. By default, the window is its own event handler, but | |
8856 | an application may wish to substitute another, for example to allow | |
8857 | central implementation of event-handling for a variety of different | |
8858 | window classes. | |
8859 | ||
8860 | wx.Window.PushEventHandler allows an application to set up a chain of | |
8861 | event handlers, where an event not handled by one event handler is | |
41e2b43e | 8862 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` to |
15afbcd0 RD |
8863 | remove the event handler. |
8864 | """ | |
54f9ee45 | 8865 | return _core_.Window_PushEventHandler(*args, **kwargs) |
e811c8ce RD |
8866 | |
8867 | def PopEventHandler(*args, **kwargs): | |
15afbcd0 | 8868 | """ |
a95a7133 | 8869 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
15afbcd0 RD |
8870 | |
8871 | Removes and returns the top-most event handler on the event handler | |
8872 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
8873 | destroyed after it is popped. | |
8874 | """ | |
54f9ee45 | 8875 | return _core_.Window_PopEventHandler(*args, **kwargs) |
e811c8ce RD |
8876 | |
8877 | def RemoveEventHandler(*args, **kwargs): | |
15afbcd0 | 8878 | """ |
a95a7133 | 8879 | RemoveEventHandler(self, EvtHandler handler) -> bool |
15afbcd0 | 8880 | |
41e2b43e RD |
8881 | Find the given handler in the event handler chain and remove (but not |
8882 | delete) it from the event handler chain, return True if it was found | |
8883 | and False otherwise (this also results in an assert failure so this | |
8884 | function should only be called when the handler is supposed to be | |
8885 | there.) | |
15afbcd0 | 8886 | """ |
54f9ee45 | 8887 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
e811c8ce RD |
8888 | |
8889 | def SetValidator(*args, **kwargs): | |
15afbcd0 | 8890 | """ |
a95a7133 | 8891 | SetValidator(self, Validator validator) |
15afbcd0 RD |
8892 | |
8893 | Deletes the current validator (if any) and sets the window validator, | |
8894 | having called wx.Validator.Clone to create a new validator of this | |
8895 | type. | |
8896 | """ | |
54f9ee45 | 8897 | return _core_.Window_SetValidator(*args, **kwargs) |
e811c8ce RD |
8898 | |
8899 | def GetValidator(*args, **kwargs): | |
15afbcd0 | 8900 | """ |
a95a7133 | 8901 | GetValidator(self) -> Validator |
15afbcd0 RD |
8902 | |
8903 | Returns a pointer to the current validator for the window, or None if | |
8904 | there is none. | |
8905 | """ | |
54f9ee45 | 8906 | return _core_.Window_GetValidator(*args, **kwargs) |
e811c8ce | 8907 | |
74a57fcd RD |
8908 | def Validate(*args, **kwargs): |
8909 | """ | |
a95a7133 | 8910 | Validate(self) -> bool |
74a57fcd RD |
8911 | |
8912 | Validates the current values of the child controls using their | |
41e2b43e RD |
8913 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
8914 | style flag set, the method will also call Validate() of all child | |
8915 | windows. Returns false if any of the validations failed. | |
74a57fcd | 8916 | """ |
54f9ee45 | 8917 | return _core_.Window_Validate(*args, **kwargs) |
74a57fcd RD |
8918 | |
8919 | def TransferDataToWindow(*args, **kwargs): | |
8920 | """ | |
a95a7133 | 8921 | TransferDataToWindow(self) -> bool |
74a57fcd | 8922 | |
41e2b43e RD |
8923 | Transfers values to child controls from data areas specified by their |
8924 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
8925 | style flag set, the method will also call TransferDataToWindow() of | |
8926 | all child windows. | |
74a57fcd | 8927 | """ |
54f9ee45 | 8928 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
74a57fcd RD |
8929 | |
8930 | def TransferDataFromWindow(*args, **kwargs): | |
8931 | """ | |
a95a7133 | 8932 | TransferDataFromWindow(self) -> bool |
74a57fcd | 8933 | |
41e2b43e RD |
8934 | Transfers values from child controls to data areas specified by their |
8935 | validators. Returns false if a transfer failed. If the window has | |
8936 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
8937 | also call TransferDataFromWindow() of all child windows. | |
74a57fcd | 8938 | """ |
54f9ee45 | 8939 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
74a57fcd RD |
8940 | |
8941 | def InitDialog(*args, **kwargs): | |
8942 | """ | |
a95a7133 | 8943 | InitDialog(self) |
74a57fcd | 8944 | |
41e2b43e RD |
8945 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
8946 | to the dialog via validators. | |
74a57fcd | 8947 | """ |
54f9ee45 | 8948 | return _core_.Window_InitDialog(*args, **kwargs) |
74a57fcd | 8949 | |
e811c8ce | 8950 | def SetAcceleratorTable(*args, **kwargs): |
15afbcd0 | 8951 | """ |
a95a7133 | 8952 | SetAcceleratorTable(self, AcceleratorTable accel) |
15afbcd0 RD |
8953 | |
8954 | Sets the accelerator table for this window. | |
8955 | """ | |
54f9ee45 | 8956 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
8957 | |
8958 | def GetAcceleratorTable(*args, **kwargs): | |
15afbcd0 | 8959 | """ |
a95a7133 | 8960 | GetAcceleratorTable(self) -> AcceleratorTable |
15afbcd0 RD |
8961 | |
8962 | Gets the accelerator table for this window. | |
8963 | """ | |
54f9ee45 | 8964 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
8965 | |
8966 | def RegisterHotKey(*args, **kwargs): | |
15afbcd0 | 8967 | """ |
a95a7133 | 8968 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool |
15afbcd0 RD |
8969 | |
8970 | Registers a system wide hotkey. Every time the user presses the hotkey | |
8971 | registered here, this window will receive a hotkey event. It will | |
8972 | receive the event even if the application is in the background and | |
8973 | does not have the input focus because the user is working with some | |
8974 | other application. To bind an event handler function to this hotkey | |
8975 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
8976 | hotkey was registered successfully. | |
8977 | """ | |
54f9ee45 | 8978 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
e811c8ce RD |
8979 | |
8980 | def UnregisterHotKey(*args, **kwargs): | |
15afbcd0 | 8981 | """ |
a95a7133 | 8982 | UnregisterHotKey(self, int hotkeyId) -> bool |
15afbcd0 RD |
8983 | |
8984 | Unregisters a system wide hotkey. | |
8985 | """ | |
54f9ee45 | 8986 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
e811c8ce RD |
8987 | |
8988 | def ConvertDialogPointToPixels(*args, **kwargs): | |
15afbcd0 | 8989 | """ |
a95a7133 | 8990 | ConvertDialogPointToPixels(self, Point pt) -> Point |
15afbcd0 RD |
8991 | |
8992 | Converts a point or size from dialog units to pixels. Dialog units | |
8993 | are used for maintaining a dialog's proportions even if the font | |
8994 | changes. For the x dimension, the dialog units are multiplied by the | |
8995 | average character width and then divided by 4. For the y dimension, | |
8996 | the dialog units are multiplied by the average character height and | |
8997 | then divided by 8. | |
8998 | """ | |
54f9ee45 | 8999 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
e811c8ce RD |
9000 | |
9001 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
15afbcd0 | 9002 | """ |
a95a7133 | 9003 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
15afbcd0 RD |
9004 | |
9005 | Converts a point or size from dialog units to pixels. Dialog units | |
9006 | are used for maintaining a dialog's proportions even if the font | |
9007 | changes. For the x dimension, the dialog units are multiplied by the | |
9008 | average character width and then divided by 4. For the y dimension, | |
9009 | the dialog units are multiplied by the average character height and | |
9010 | then divided by 8. | |
9011 | """ | |
54f9ee45 | 9012 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
e811c8ce RD |
9013 | |
9014 | def DLG_PNT(*args, **kwargs): | |
15afbcd0 | 9015 | """ |
a95a7133 | 9016 | DLG_PNT(self, Point pt) -> Point |
15afbcd0 RD |
9017 | |
9018 | Converts a point or size from dialog units to pixels. Dialog units | |
9019 | are used for maintaining a dialog's proportions even if the font | |
9020 | changes. For the x dimension, the dialog units are multiplied by the | |
9021 | average character width and then divided by 4. For the y dimension, | |
9022 | the dialog units are multiplied by the average character height and | |
9023 | then divided by 8. | |
9024 | """ | |
54f9ee45 | 9025 | return _core_.Window_DLG_PNT(*args, **kwargs) |
e811c8ce RD |
9026 | |
9027 | def DLG_SZE(*args, **kwargs): | |
15afbcd0 | 9028 | """ |
a95a7133 | 9029 | DLG_SZE(self, Size sz) -> Size |
15afbcd0 RD |
9030 | |
9031 | Converts a point or size from dialog units to pixels. Dialog units | |
9032 | are used for maintaining a dialog's proportions even if the font | |
9033 | changes. For the x dimension, the dialog units are multiplied by the | |
9034 | average character width and then divided by 4. For the y dimension, | |
9035 | the dialog units are multiplied by the average character height and | |
9036 | then divided by 8. | |
9037 | """ | |
54f9ee45 | 9038 | return _core_.Window_DLG_SZE(*args, **kwargs) |
e811c8ce RD |
9039 | |
9040 | def ConvertPixelPointToDialog(*args, **kwargs): | |
a95a7133 | 9041 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
54f9ee45 | 9042 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) |
e811c8ce RD |
9043 | |
9044 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
a95a7133 | 9045 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
54f9ee45 | 9046 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) |
e811c8ce RD |
9047 | |
9048 | def WarpPointer(*args, **kwargs): | |
15afbcd0 | 9049 | """ |
a95a7133 | 9050 | WarpPointer(self, int x, int y) |
15afbcd0 RD |
9051 | |
9052 | Moves the pointer to the given position on the window. | |
9053 | ||
9054 | NOTE: This function is not supported under Mac because Apple Human | |
9055 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
9056 | """ | |
54f9ee45 | 9057 | return _core_.Window_WarpPointer(*args, **kwargs) |
e811c8ce RD |
9058 | |
9059 | def CaptureMouse(*args, **kwargs): | |
15afbcd0 | 9060 | """ |
a95a7133 | 9061 | CaptureMouse(self) |
15afbcd0 RD |
9062 | |
9063 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
9064 | release the capture. | |
9065 | ||
9066 | Note that wxWindows maintains the stack of windows having captured the | |
9067 | mouse and when the mouse is released the capture returns to the window | |
9068 | which had had captured it previously and it is only really released if | |
9069 | there were no previous window. In particular, this means that you must | |
9070 | release the mouse as many times as you capture it. | |
9071 | """ | |
54f9ee45 | 9072 | return _core_.Window_CaptureMouse(*args, **kwargs) |
e811c8ce RD |
9073 | |
9074 | def ReleaseMouse(*args, **kwargs): | |
15afbcd0 | 9075 | """ |
a95a7133 | 9076 | ReleaseMouse(self) |
15afbcd0 RD |
9077 | |
9078 | Releases mouse input captured with wx.Window.CaptureMouse. | |
9079 | """ | |
54f9ee45 | 9080 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
e811c8ce RD |
9081 | |
9082 | def GetCapture(*args, **kwargs): | |
15afbcd0 | 9083 | """ |
66c033b4 | 9084 | GetCapture() -> Window |
15afbcd0 RD |
9085 | |
9086 | Returns the window which currently captures the mouse or None | |
9087 | """ | |
54f9ee45 | 9088 | return _core_.Window_GetCapture(*args, **kwargs) |
e811c8ce RD |
9089 | |
9090 | GetCapture = staticmethod(GetCapture) | |
9091 | def HasCapture(*args, **kwargs): | |
15afbcd0 | 9092 | """ |
a95a7133 | 9093 | HasCapture(self) -> bool |
15afbcd0 RD |
9094 | |
9095 | Returns true if this window has the current mouse capture. | |
9096 | """ | |
54f9ee45 | 9097 | return _core_.Window_HasCapture(*args, **kwargs) |
e811c8ce RD |
9098 | |
9099 | def Refresh(*args, **kwargs): | |
15afbcd0 | 9100 | """ |
a95a7133 | 9101 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
15afbcd0 RD |
9102 | |
9103 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
9104 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
9105 | to the window. | |
9106 | """ | |
54f9ee45 | 9107 | return _core_.Window_Refresh(*args, **kwargs) |
e811c8ce RD |
9108 | |
9109 | def RefreshRect(*args, **kwargs): | |
15afbcd0 | 9110 | """ |
fef4c27a | 9111 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
15afbcd0 RD |
9112 | |
9113 | Redraws the contents of the given rectangle: the area inside it will | |
9114 | be repainted. This is the same as Refresh but has a nicer syntax. | |
9115 | """ | |
54f9ee45 | 9116 | return _core_.Window_RefreshRect(*args, **kwargs) |
e811c8ce RD |
9117 | |
9118 | def Update(*args, **kwargs): | |
15afbcd0 | 9119 | """ |
a95a7133 | 9120 | Update(self) |
15afbcd0 RD |
9121 | |
9122 | Calling this method immediately repaints the invalidated area of the | |
9123 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
9124 | this would usually only happen when the flow of control returns to the | |
9125 | event loop.) Notice that this function doesn't refresh the window and | |
9126 | does nothing if the window has been already repainted. Use Refresh | |
9127 | first if you want to immediately redraw the window (or some portion of | |
9128 | it) unconditionally. | |
9129 | """ | |
54f9ee45 | 9130 | return _core_.Window_Update(*args, **kwargs) |
e811c8ce RD |
9131 | |
9132 | def ClearBackground(*args, **kwargs): | |
15afbcd0 | 9133 | """ |
a95a7133 | 9134 | ClearBackground(self) |
15afbcd0 RD |
9135 | |
9136 | Clears the window by filling it with the current background | |
9137 | colour. Does not cause an erase background event to be generated. | |
9138 | """ | |
54f9ee45 | 9139 | return _core_.Window_ClearBackground(*args, **kwargs) |
e811c8ce RD |
9140 | |
9141 | def Freeze(*args, **kwargs): | |
15afbcd0 | 9142 | """ |
a95a7133 | 9143 | Freeze(self) |
15afbcd0 | 9144 | |
41e2b43e RD |
9145 | Freezes the window or, in other words, prevents any updates from |
9146 | taking place on screen, the window is not redrawn at all. Thaw must be | |
9147 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
9148 | nested, with the actual Thaw being delayed until all the nesting has | |
9149 | been undone. | |
15afbcd0 RD |
9150 | |
9151 | This method is useful for visual appearance optimization (for example, | |
9152 | it is a good idea to use it before inserting large amount of text into | |
9153 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
9154 | for all controls so it is mostly just a hint to wxWindows and not a | |
9155 | mandatory directive. | |
9156 | """ | |
54f9ee45 | 9157 | return _core_.Window_Freeze(*args, **kwargs) |
e811c8ce RD |
9158 | |
9159 | def Thaw(*args, **kwargs): | |
15afbcd0 | 9160 | """ |
a95a7133 | 9161 | Thaw(self) |
15afbcd0 | 9162 | |
4276dc52 | 9163 | Reenables window updating after a previous call to Freeze. Calls to |
41e2b43e RD |
9164 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
9165 | times that Freeze was before the window will be updated. | |
15afbcd0 | 9166 | """ |
54f9ee45 | 9167 | return _core_.Window_Thaw(*args, **kwargs) |
e811c8ce RD |
9168 | |
9169 | def PrepareDC(*args, **kwargs): | |
15afbcd0 | 9170 | """ |
a95a7133 | 9171 | PrepareDC(self, DC dc) |
15afbcd0 RD |
9172 | |
9173 | Call this function to prepare the device context for drawing a | |
9174 | scrolled image. It sets the device origin according to the current | |
9175 | scroll position. | |
9176 | """ | |
54f9ee45 | 9177 | return _core_.Window_PrepareDC(*args, **kwargs) |
e811c8ce RD |
9178 | |
9179 | def GetUpdateRegion(*args, **kwargs): | |
15afbcd0 | 9180 | """ |
a95a7133 | 9181 | GetUpdateRegion(self) -> Region |
15afbcd0 RD |
9182 | |
9183 | Returns the region specifying which parts of the window have been | |
9184 | damaged. Should only be called within an EVT_PAINT handler. | |
9185 | """ | |
54f9ee45 | 9186 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
e811c8ce RD |
9187 | |
9188 | def GetUpdateClientRect(*args, **kwargs): | |
15afbcd0 | 9189 | """ |
a95a7133 | 9190 | GetUpdateClientRect(self) -> Rect |
15afbcd0 RD |
9191 | |
9192 | Get the update rectangle region bounding box in client coords. | |
9193 | """ | |
54f9ee45 | 9194 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
e811c8ce RD |
9195 | |
9196 | def IsExposed(*args, **kwargs): | |
15afbcd0 | 9197 | """ |
a95a7133 | 9198 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool |
15afbcd0 RD |
9199 | |
9200 | Returns true if the given point or rectangle area has been exposed | |
9201 | since the last repaint. Call this in an paint event handler to | |
9202 | optimize redrawing by only redrawing those areas, which have been | |
9203 | exposed. | |
9204 | """ | |
54f9ee45 | 9205 | return _core_.Window_IsExposed(*args, **kwargs) |
e811c8ce RD |
9206 | |
9207 | def IsExposedPoint(*args, **kwargs): | |
15afbcd0 | 9208 | """ |
a95a7133 | 9209 | IsExposedPoint(self, Point pt) -> bool |
15afbcd0 RD |
9210 | |
9211 | Returns true if the given point or rectangle area has been exposed | |
9212 | since the last repaint. Call this in an paint event handler to | |
9213 | optimize redrawing by only redrawing those areas, which have been | |
9214 | exposed. | |
9215 | """ | |
54f9ee45 | 9216 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
e811c8ce | 9217 | |
4276dc52 | 9218 | def IsExposedRect(*args, **kwargs): |
15afbcd0 | 9219 | """ |
a95a7133 | 9220 | IsExposedRect(self, Rect rect) -> bool |
15afbcd0 RD |
9221 | |
9222 | Returns true if the given point or rectangle area has been exposed | |
9223 | since the last repaint. Call this in an paint event handler to | |
9224 | optimize redrawing by only redrawing those areas, which have been | |
9225 | exposed. | |
9226 | """ | |
54f9ee45 | 9227 | return _core_.Window_IsExposedRect(*args, **kwargs) |
e811c8ce | 9228 | |
74a57fcd RD |
9229 | def GetDefaultAttributes(*args, **kwargs): |
9230 | """ | |
a95a7133 | 9231 | GetDefaultAttributes(self) -> VisualAttributes |
74a57fcd | 9232 | |
41e2b43e RD |
9233 | Get the default attributes for an instance of this class. This is |
9234 | useful if you want to use the same font or colour in your own control | |
9235 | as in a standard control -- which is a much better idea than hard | |
9236 | coding specific colours or fonts which might look completely out of | |
db3e571a | 9237 | place on the user's system, especially if it uses themes. |
74a57fcd | 9238 | """ |
54f9ee45 | 9239 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9240 | |
9241 | def GetClassDefaultAttributes(*args, **kwargs): | |
9242 | """ | |
66c033b4 | 9243 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
74a57fcd | 9244 | |
41e2b43e RD |
9245 | Get the default attributes for this class. This is useful if you want |
9246 | to use the same font or colour in your own control as in a standard | |
9247 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
9248 | colours or fonts which might look completely out of place on the |
9249 | user's system, especially if it uses themes. | |
74a57fcd RD |
9250 | |
9251 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 9252 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
9253 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9254 | this. | |
74a57fcd | 9255 | """ |
54f9ee45 | 9256 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9257 | |
9258 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
e811c8ce | 9259 | def SetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9260 | """ |
a95a7133 | 9261 | SetBackgroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9262 | |
9263 | Sets the background colour of the window. Returns True if the colour | |
9264 | was changed. The background colour is usually painted by the default | |
9265 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9266 | automatically under GTK. Using `wx.NullColour` will reset the window |
9267 | to the default background colour. | |
15afbcd0 | 9268 | |
db3e571a | 9269 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9270 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
15afbcd0 RD |
9271 | calling this function. |
9272 | ||
f8167d6e RD |
9273 | Using this function will disable attempts to use themes for this |
9274 | window, if the system supports them. Use with care since usually the | |
9275 | themes represent the appearance chosen by the user to be used for all | |
9276 | applications on the system. | |
15afbcd0 | 9277 | """ |
54f9ee45 | 9278 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
e811c8ce | 9279 | |
412d302d RD |
9280 | def SetOwnBackgroundColour(*args, **kwargs): |
9281 | """SetOwnBackgroundColour(self, Colour colour)""" | |
9282 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
b2df227b | 9283 | |
e811c8ce | 9284 | def SetForegroundColour(*args, **kwargs): |
15afbcd0 | 9285 | """ |
a95a7133 | 9286 | SetForegroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9287 | |
9288 | Sets the foreground colour of the window. Returns True is the colour | |
9289 | was changed. The interpretation of foreground colour is dependent on | |
9290 | the window class; it may be the text colour or other colour, or it may | |
9291 | not be used at all. | |
9292 | """ | |
54f9ee45 | 9293 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
e811c8ce | 9294 | |
fa47d7a7 VS |
9295 | def SetOwnForegroundColour(*args, **kwargs): |
9296 | """SetOwnForegroundColour(self, Colour colour)""" | |
9297 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
b2df227b | 9298 | |
e811c8ce | 9299 | def GetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9300 | """ |
a95a7133 | 9301 | GetBackgroundColour(self) -> Colour |
15afbcd0 RD |
9302 | |
9303 | Returns the background colour of the window. | |
9304 | """ | |
54f9ee45 | 9305 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
e811c8ce RD |
9306 | |
9307 | def GetForegroundColour(*args, **kwargs): | |
15afbcd0 | 9308 | """ |
a95a7133 | 9309 | GetForegroundColour(self) -> Colour |
15afbcd0 RD |
9310 | |
9311 | Returns the foreground colour of the window. The interpretation of | |
9312 | foreground colour is dependent on the window class; it may be the text | |
9313 | colour or other colour, or it may not be used at all. | |
9314 | """ | |
54f9ee45 | 9315 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
e811c8ce | 9316 | |
562ecc31 RD |
9317 | def InheritsBackgroundColour(*args, **kwargs): |
9318 | """InheritsBackgroundColour(self) -> bool""" | |
9319 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
9320 | ||
9321 | def UseBgCol(*args, **kwargs): | |
9322 | """UseBgCol(self) -> bool""" | |
9323 | return _core_.Window_UseBgCol(*args, **kwargs) | |
9324 | ||
7bc1e663 RD |
9325 | def SetBackgroundStyle(*args, **kwargs): |
9326 | """ | |
9327 | SetBackgroundStyle(self, int style) -> bool | |
9328 | ||
9329 | Returns the background style of the window. The background style | |
9330 | indicates how the background of the window is drawn. | |
9331 | ||
9332 | ====================== ======================================== | |
9333 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9334 | be determined by the system | |
9335 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9336 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9337 | application. | |
9338 | ====================== ======================================== | |
9339 | ||
9340 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9341 | a custom background, such as a tiled bitmap. Currently the style has | |
9342 | no effect on other platforms. | |
9343 | ||
9344 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9345 | """ | |
9346 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
9347 | ||
9348 | def GetBackgroundStyle(*args, **kwargs): | |
9349 | """ | |
9350 | GetBackgroundStyle(self) -> int | |
9351 | ||
9352 | Returns the background style of the window. | |
9353 | ||
9354 | :see: `SetBackgroundStyle` | |
9355 | """ | |
9356 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
9357 | ||
51b83b37 RD |
9358 | def HasTransparentBackground(*args, **kwargs): |
9359 | """ | |
9360 | HasTransparentBackground(self) -> bool | |
9361 | ||
9362 | Returns True if this window's background is transparent (as, for | |
9363 | example, for `wx.StaticText`) and should show the parent window's | |
9364 | background. | |
9365 | ||
9366 | This method is mostly used internally by the library itself and you | |
9367 | normally shouldn't have to call it. You may, however, have to override | |
9368 | it in your custom control classes to ensure that background is painted | |
9369 | correctly. | |
9370 | """ | |
9371 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
9372 | ||
e811c8ce | 9373 | def SetCursor(*args, **kwargs): |
15afbcd0 | 9374 | """ |
a95a7133 | 9375 | SetCursor(self, Cursor cursor) -> bool |
15afbcd0 RD |
9376 | |
9377 | Sets the window's cursor. Notice that the window cursor also sets it | |
9378 | for the children of the window implicitly. | |
9379 | ||
9380 | The cursor may be wx.NullCursor in which case the window cursor will | |
9381 | be reset back to default. | |
9382 | """ | |
54f9ee45 | 9383 | return _core_.Window_SetCursor(*args, **kwargs) |
e811c8ce RD |
9384 | |
9385 | def GetCursor(*args, **kwargs): | |
15afbcd0 | 9386 | """ |
a95a7133 | 9387 | GetCursor(self) -> Cursor |
15afbcd0 RD |
9388 | |
9389 | Return the cursor associated with this window. | |
9390 | """ | |
54f9ee45 | 9391 | return _core_.Window_GetCursor(*args, **kwargs) |
e811c8ce RD |
9392 | |
9393 | def SetFont(*args, **kwargs): | |
15afbcd0 | 9394 | """ |
a95a7133 | 9395 | SetFont(self, Font font) -> bool |
15afbcd0 RD |
9396 | |
9397 | Sets the font for this window. | |
9398 | """ | |
54f9ee45 | 9399 | return _core_.Window_SetFont(*args, **kwargs) |
e811c8ce | 9400 | |
fa47d7a7 VS |
9401 | def SetOwnFont(*args, **kwargs): |
9402 | """SetOwnFont(self, Font font)""" | |
9403 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
b2df227b | 9404 | |
e811c8ce | 9405 | def GetFont(*args, **kwargs): |
15afbcd0 | 9406 | """ |
a95a7133 | 9407 | GetFont(self) -> Font |
15afbcd0 | 9408 | |
4276dc52 | 9409 | Returns the default font used for this window. |
15afbcd0 | 9410 | """ |
54f9ee45 | 9411 | return _core_.Window_GetFont(*args, **kwargs) |
e811c8ce RD |
9412 | |
9413 | def SetCaret(*args, **kwargs): | |
15afbcd0 | 9414 | """ |
a95a7133 | 9415 | SetCaret(self, Caret caret) |
15afbcd0 RD |
9416 | |
9417 | Sets the caret associated with the window. | |
9418 | """ | |
54f9ee45 | 9419 | return _core_.Window_SetCaret(*args, **kwargs) |
e811c8ce RD |
9420 | |
9421 | def GetCaret(*args, **kwargs): | |
15afbcd0 | 9422 | """ |
a95a7133 | 9423 | GetCaret(self) -> Caret |
15afbcd0 RD |
9424 | |
9425 | Returns the caret associated with the window. | |
9426 | """ | |
54f9ee45 | 9427 | return _core_.Window_GetCaret(*args, **kwargs) |
e811c8ce RD |
9428 | |
9429 | def GetCharHeight(*args, **kwargs): | |
15afbcd0 | 9430 | """ |
a95a7133 | 9431 | GetCharHeight(self) -> int |
15afbcd0 RD |
9432 | |
9433 | Get the (average) character size for the current font. | |
9434 | """ | |
54f9ee45 | 9435 | return _core_.Window_GetCharHeight(*args, **kwargs) |
e811c8ce RD |
9436 | |
9437 | def GetCharWidth(*args, **kwargs): | |
15afbcd0 | 9438 | """ |
a95a7133 | 9439 | GetCharWidth(self) -> int |
15afbcd0 RD |
9440 | |
9441 | Get the (average) character size for the current font. | |
9442 | """ | |
54f9ee45 | 9443 | return _core_.Window_GetCharWidth(*args, **kwargs) |
e811c8ce RD |
9444 | |
9445 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9446 | """ |
9447 | GetTextExtent(String string) -> (width, height) | |
9448 | ||
9449 | Get the width and height of the text using the current font. | |
9450 | """ | |
54f9ee45 | 9451 | return _core_.Window_GetTextExtent(*args, **kwargs) |
e811c8ce RD |
9452 | |
9453 | def GetFullTextExtent(*args, **kwargs): | |
0df68c9f | 9454 | """ |
196addbf | 9455 | GetFullTextExtent(String string, Font font=None) -> |
0df68c9f | 9456 | (width, height, descent, externalLeading) |
e811c8ce | 9457 | |
15afbcd0 RD |
9458 | Get the width, height, decent and leading of the text using the |
9459 | current or specified font. | |
0df68c9f | 9460 | """ |
54f9ee45 | 9461 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
e811c8ce RD |
9462 | |
9463 | def ClientToScreenXY(*args, **kwargs): | |
15afbcd0 RD |
9464 | """ |
9465 | ClientToScreenXY(int x, int y) -> (x,y) | |
9466 | ||
9467 | Converts to screen coordinates from coordinates relative to this window. | |
9468 | """ | |
54f9ee45 | 9469 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
e811c8ce RD |
9470 | |
9471 | def ScreenToClientXY(*args, **kwargs): | |
15afbcd0 RD |
9472 | """ |
9473 | ScreenToClientXY(int x, int y) -> (x,y) | |
9474 | ||
9475 | Converts from screen to client window coordinates. | |
9476 | """ | |
54f9ee45 | 9477 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
e811c8ce RD |
9478 | |
9479 | def ClientToScreen(*args, **kwargs): | |
15afbcd0 | 9480 | """ |
a95a7133 | 9481 | ClientToScreen(self, Point pt) -> Point |
15afbcd0 RD |
9482 | |
9483 | Converts to screen coordinates from coordinates relative to this window. | |
9484 | """ | |
54f9ee45 | 9485 | return _core_.Window_ClientToScreen(*args, **kwargs) |
e811c8ce RD |
9486 | |
9487 | def ScreenToClient(*args, **kwargs): | |
15afbcd0 | 9488 | """ |
a95a7133 | 9489 | ScreenToClient(self, Point pt) -> Point |
15afbcd0 RD |
9490 | |
9491 | Converts from screen to client window coordinates. | |
9492 | """ | |
54f9ee45 | 9493 | return _core_.Window_ScreenToClient(*args, **kwargs) |
e811c8ce RD |
9494 | |
9495 | def HitTestXY(*args, **kwargs): | |
15afbcd0 | 9496 | """ |
a95a7133 | 9497 | HitTestXY(self, int x, int y) -> int |
15afbcd0 RD |
9498 | |
9499 | Test where the given (in client coords) point lies | |
9500 | """ | |
54f9ee45 | 9501 | return _core_.Window_HitTestXY(*args, **kwargs) |
e811c8ce RD |
9502 | |
9503 | def HitTest(*args, **kwargs): | |
15afbcd0 | 9504 | """ |
a95a7133 | 9505 | HitTest(self, Point pt) -> int |
15afbcd0 RD |
9506 | |
9507 | Test where the given (in client coords) point lies | |
9508 | """ | |
54f9ee45 | 9509 | return _core_.Window_HitTest(*args, **kwargs) |
e811c8ce | 9510 | |
15afbcd0 RD |
9511 | def GetBorder(*args): |
9512 | """ | |
a95a7133 RD |
9513 | GetBorder(self, long flags) -> int |
9514 | GetBorder(self) -> int | |
e811c8ce | 9515 | |
15afbcd0 RD |
9516 | Get border for the flags of this window |
9517 | """ | |
54f9ee45 | 9518 | return _core_.Window_GetBorder(*args) |
e811c8ce RD |
9519 | |
9520 | def UpdateWindowUI(*args, **kwargs): | |
15afbcd0 | 9521 | """ |
a95a7133 | 9522 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
15afbcd0 RD |
9523 | |
9524 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9525 | implementation depends on the window; for example a wx.ToolBar will | |
9526 | send an update UI event for each toolbar button, and a wx.Frame will | |
9527 | send an update UI event for each menubar menu item. You can call this | |
9528 | function from your application to ensure that your UI is up-to-date at | |
9529 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9530 | concerned). This may be necessary if you have called | |
5ba5649b | 9531 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
15afbcd0 RD |
9532 | limit the overhead that wxWindows incurs by sending update UI events |
9533 | in idle time. | |
15afbcd0 | 9534 | """ |
54f9ee45 | 9535 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
e811c8ce RD |
9536 | |
9537 | def PopupMenuXY(*args, **kwargs): | |
15afbcd0 | 9538 | """ |
b0503257 | 9539 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
15afbcd0 | 9540 | |
b0503257 RD |
9541 | Pops up the given menu at the specified coordinates, relative to this window, |
9542 | and returns control when the user has dismissed the menu. If a menu item is | |
9543 | selected, the corresponding menu event is generated and will be processed as | |
9544 | usual. If the default position is given then the current position of the | |
9545 | mouse cursor will be used. | |
15afbcd0 | 9546 | """ |
54f9ee45 | 9547 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
e811c8ce | 9548 | |
15afbcd0 RD |
9549 | def PopupMenu(*args, **kwargs): |
9550 | """ | |
b0503257 | 9551 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
15afbcd0 | 9552 | |
b0503257 RD |
9553 | Pops up the given menu at the specified coordinates, relative to this window, |
9554 | and returns control when the user has dismissed the menu. If a menu item is | |
9555 | selected, the corresponding menu event is generated and will be processed as | |
9556 | usual. If the default position is given then the current position of the | |
9557 | mouse cursor will be used. | |
15afbcd0 | 9558 | """ |
54f9ee45 | 9559 | return _core_.Window_PopupMenu(*args, **kwargs) |
15afbcd0 RD |
9560 | |
9561 | def GetHandle(*args, **kwargs): | |
9562 | """ | |
a95a7133 | 9563 | GetHandle(self) -> long |
15afbcd0 RD |
9564 | |
9565 | Returns the platform-specific handle (as a long integer) of the | |
9566 | physical window. Currently on wxMac it returns the handle of the | |
9567 | toplevel parent of the window. | |
9568 | """ | |
54f9ee45 | 9569 | return _core_.Window_GetHandle(*args, **kwargs) |
15afbcd0 | 9570 | |
7e63a440 RD |
9571 | def AssociateHandle(*args, **kwargs): |
9572 | """ | |
9573 | AssociateHandle(self, long handle) | |
9574 | ||
9575 | Associate the window with a new native handle | |
9576 | """ | |
9577 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
9578 | ||
9579 | def DissociateHandle(*args, **kwargs): | |
9580 | """ | |
9581 | DissociateHandle(self) | |
9582 | ||
9583 | Dissociate the current native handle from the window | |
9584 | """ | |
9585 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
9586 | ||
15afbcd0 RD |
9587 | def HasScrollbar(*args, **kwargs): |
9588 | """ | |
a95a7133 | 9589 | HasScrollbar(self, int orient) -> bool |
15afbcd0 RD |
9590 | |
9591 | Does the window have the scrollbar for this orientation? | |
9592 | """ | |
54f9ee45 | 9593 | return _core_.Window_HasScrollbar(*args, **kwargs) |
15afbcd0 RD |
9594 | |
9595 | def SetScrollbar(*args, **kwargs): | |
9596 | """ | |
41e2b43e | 9597 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
15afbcd0 RD |
9598 | bool refresh=True) |
9599 | ||
9600 | Sets the scrollbar properties of a built-in scrollbar. | |
15afbcd0 | 9601 | """ |
54f9ee45 | 9602 | return _core_.Window_SetScrollbar(*args, **kwargs) |
e811c8ce RD |
9603 | |
9604 | def SetScrollPos(*args, **kwargs): | |
15afbcd0 | 9605 | """ |
a95a7133 | 9606 | SetScrollPos(self, int orientation, int pos, bool refresh=True) |
15afbcd0 RD |
9607 | |
9608 | Sets the position of one of the built-in scrollbars. | |
9609 | """ | |
54f9ee45 | 9610 | return _core_.Window_SetScrollPos(*args, **kwargs) |
e811c8ce RD |
9611 | |
9612 | def GetScrollPos(*args, **kwargs): | |
15afbcd0 | 9613 | """ |
a95a7133 | 9614 | GetScrollPos(self, int orientation) -> int |
15afbcd0 RD |
9615 | |
9616 | Returns the built-in scrollbar position. | |
9617 | """ | |
54f9ee45 | 9618 | return _core_.Window_GetScrollPos(*args, **kwargs) |
e811c8ce RD |
9619 | |
9620 | def GetScrollThumb(*args, **kwargs): | |
15afbcd0 | 9621 | """ |
a95a7133 | 9622 | GetScrollThumb(self, int orientation) -> int |
15afbcd0 RD |
9623 | |
9624 | Returns the built-in scrollbar thumb size. | |
9625 | """ | |
54f9ee45 | 9626 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
e811c8ce RD |
9627 | |
9628 | def GetScrollRange(*args, **kwargs): | |
15afbcd0 | 9629 | """ |
a95a7133 | 9630 | GetScrollRange(self, int orientation) -> int |
15afbcd0 RD |
9631 | |
9632 | Returns the built-in scrollbar range. | |
9633 | """ | |
54f9ee45 | 9634 | return _core_.Window_GetScrollRange(*args, **kwargs) |
e811c8ce RD |
9635 | |
9636 | def ScrollWindow(*args, **kwargs): | |
15afbcd0 | 9637 | """ |
a95a7133 | 9638 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
15afbcd0 RD |
9639 | |
9640 | Physically scrolls the pixels in the window and move child windows | |
9641 | accordingly. Use this function to optimise your scrolling | |
9642 | implementations, to minimise the area that must be redrawn. Note that | |
9643 | it is rarely required to call this function from a user program. | |
15afbcd0 | 9644 | """ |
54f9ee45 | 9645 | return _core_.Window_ScrollWindow(*args, **kwargs) |
e811c8ce RD |
9646 | |
9647 | def ScrollLines(*args, **kwargs): | |
15afbcd0 | 9648 | """ |
a95a7133 | 9649 | ScrollLines(self, int lines) -> bool |
15afbcd0 RD |
9650 | |
9651 | If the platform and window class supports it, scrolls the window by | |
9652 | the given number of lines down, if lines is positive, or up if lines | |
9653 | is negative. Returns True if the window was scrolled, False if it was | |
9654 | already on top/bottom and nothing was done. | |
9655 | """ | |
54f9ee45 | 9656 | return _core_.Window_ScrollLines(*args, **kwargs) |
e811c8ce RD |
9657 | |
9658 | def ScrollPages(*args, **kwargs): | |
15afbcd0 | 9659 | """ |
a95a7133 | 9660 | ScrollPages(self, int pages) -> bool |
15afbcd0 | 9661 | |
41e2b43e | 9662 | If the platform and window class supports it, scrolls the window by |
15afbcd0 RD |
9663 | the given number of pages down, if pages is positive, or up if pages |
9664 | is negative. Returns True if the window was scrolled, False if it was | |
9665 | already on top/bottom and nothing was done. | |
9666 | """ | |
54f9ee45 | 9667 | return _core_.Window_ScrollPages(*args, **kwargs) |
e811c8ce RD |
9668 | |
9669 | def LineUp(*args, **kwargs): | |
15afbcd0 | 9670 | """ |
a95a7133 | 9671 | LineUp(self) -> bool |
15afbcd0 RD |
9672 | |
9673 | This is just a wrapper for ScrollLines(-1). | |
9674 | """ | |
54f9ee45 | 9675 | return _core_.Window_LineUp(*args, **kwargs) |
e811c8ce RD |
9676 | |
9677 | def LineDown(*args, **kwargs): | |
15afbcd0 | 9678 | """ |
a95a7133 | 9679 | LineDown(self) -> bool |
15afbcd0 RD |
9680 | |
9681 | This is just a wrapper for ScrollLines(1). | |
9682 | """ | |
54f9ee45 | 9683 | return _core_.Window_LineDown(*args, **kwargs) |
e811c8ce RD |
9684 | |
9685 | def PageUp(*args, **kwargs): | |
15afbcd0 | 9686 | """ |
a95a7133 | 9687 | PageUp(self) -> bool |
15afbcd0 RD |
9688 | |
9689 | This is just a wrapper for ScrollPages(-1). | |
9690 | """ | |
54f9ee45 | 9691 | return _core_.Window_PageUp(*args, **kwargs) |
e811c8ce RD |
9692 | |
9693 | def PageDown(*args, **kwargs): | |
15afbcd0 | 9694 | """ |
a95a7133 | 9695 | PageDown(self) -> bool |
15afbcd0 RD |
9696 | |
9697 | This is just a wrapper for ScrollPages(1). | |
9698 | """ | |
54f9ee45 | 9699 | return _core_.Window_PageDown(*args, **kwargs) |
e811c8ce RD |
9700 | |
9701 | def SetHelpText(*args, **kwargs): | |
15afbcd0 | 9702 | """ |
a95a7133 | 9703 | SetHelpText(self, String text) |
15afbcd0 RD |
9704 | |
9705 | Sets the help text to be used as context-sensitive help for this | |
9706 | window. Note that the text is actually stored by the current | |
9707 | wxHelpProvider implementation, and not in the window object itself. | |
9708 | """ | |
54f9ee45 | 9709 | return _core_.Window_SetHelpText(*args, **kwargs) |
e811c8ce RD |
9710 | |
9711 | def SetHelpTextForId(*args, **kwargs): | |
15afbcd0 | 9712 | """ |
a95a7133 | 9713 | SetHelpTextForId(self, String text) |
15afbcd0 RD |
9714 | |
9715 | Associate this help text with all windows with the same id as this | |
9716 | one. | |
9717 | """ | |
54f9ee45 | 9718 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
e811c8ce RD |
9719 | |
9720 | def GetHelpText(*args, **kwargs): | |
15afbcd0 | 9721 | """ |
a95a7133 | 9722 | GetHelpText(self) -> String |
15afbcd0 RD |
9723 | |
9724 | Gets the help text to be used as context-sensitive help for this | |
9725 | window. Note that the text is actually stored by the current | |
9726 | wxHelpProvider implementation, and not in the window object itself. | |
9727 | """ | |
54f9ee45 | 9728 | return _core_.Window_GetHelpText(*args, **kwargs) |
e811c8ce RD |
9729 | |
9730 | def SetToolTipString(*args, **kwargs): | |
15afbcd0 | 9731 | """ |
a95a7133 | 9732 | SetToolTipString(self, String tip) |
15afbcd0 RD |
9733 | |
9734 | Attach a tooltip to the window. | |
9735 | """ | |
54f9ee45 | 9736 | return _core_.Window_SetToolTipString(*args, **kwargs) |
e811c8ce RD |
9737 | |
9738 | def SetToolTip(*args, **kwargs): | |
15afbcd0 | 9739 | """ |
a95a7133 | 9740 | SetToolTip(self, ToolTip tip) |
15afbcd0 RD |
9741 | |
9742 | Attach a tooltip to the window. | |
9743 | """ | |
54f9ee45 | 9744 | return _core_.Window_SetToolTip(*args, **kwargs) |
e811c8ce RD |
9745 | |
9746 | def GetToolTip(*args, **kwargs): | |
15afbcd0 | 9747 | """ |
a95a7133 | 9748 | GetToolTip(self) -> ToolTip |
15afbcd0 RD |
9749 | |
9750 | get the associated tooltip or None if none | |
9751 | """ | |
54f9ee45 | 9752 | return _core_.Window_GetToolTip(*args, **kwargs) |
e811c8ce RD |
9753 | |
9754 | def SetDropTarget(*args, **kwargs): | |
15afbcd0 | 9755 | """ |
a95a7133 | 9756 | SetDropTarget(self, DropTarget dropTarget) |
15afbcd0 RD |
9757 | |
9758 | Associates a drop target with this window. If the window already has | |
9759 | a drop target, it is deleted. | |
9760 | """ | |
54f9ee45 | 9761 | return _core_.Window_SetDropTarget(*args, **kwargs) |
e811c8ce RD |
9762 | |
9763 | def GetDropTarget(*args, **kwargs): | |
15afbcd0 | 9764 | """ |
a95a7133 | 9765 | GetDropTarget(self) -> DropTarget |
15afbcd0 RD |
9766 | |
9767 | Returns the associated drop target, which may be None. | |
9768 | """ | |
54f9ee45 | 9769 | return _core_.Window_GetDropTarget(*args, **kwargs) |
e811c8ce | 9770 | |
5ba5649b RD |
9771 | def DragAcceptFiles(*args, **kwargs): |
9772 | """ | |
9773 | DragAcceptFiles(self, bool accept) | |
9774 | ||
9775 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
9776 | Only functional on Windows. | |
9777 | """ | |
9778 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
9779 | ||
e811c8ce | 9780 | def SetConstraints(*args, **kwargs): |
15afbcd0 | 9781 | """ |
a95a7133 | 9782 | SetConstraints(self, LayoutConstraints constraints) |
15afbcd0 RD |
9783 | |
9784 | Sets the window to have the given layout constraints. If an existing | |
9785 | layout constraints object is already owned by the window, it will be | |
9786 | deleted. Pass None to disassociate and delete the window's current | |
9787 | constraints. | |
9788 | ||
9789 | You must call SetAutoLayout to tell a window to use the constraints | |
9790 | automatically in its default EVT_SIZE handler; otherwise, you must | |
9791 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
9792 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
9793 | effect. | |
9794 | """ | |
54f9ee45 | 9795 | return _core_.Window_SetConstraints(*args, **kwargs) |
e811c8ce RD |
9796 | |
9797 | def GetConstraints(*args, **kwargs): | |
15afbcd0 | 9798 | """ |
a95a7133 | 9799 | GetConstraints(self) -> LayoutConstraints |
15afbcd0 RD |
9800 | |
9801 | Returns a pointer to the window's layout constraints, or None if there | |
9802 | are none. | |
9803 | """ | |
54f9ee45 | 9804 | return _core_.Window_GetConstraints(*args, **kwargs) |
e811c8ce RD |
9805 | |
9806 | def SetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9807 | """ |
a95a7133 | 9808 | SetAutoLayout(self, bool autoLayout) |
15afbcd0 RD |
9809 | |
9810 | Determines whether the Layout function will be called automatically | |
9811 | when the window is resized. It is called implicitly by SetSizer but | |
9812 | if you use SetConstraints you should call it manually or otherwise the | |
9813 | window layout won't be correctly updated when its size changes. | |
9814 | """ | |
54f9ee45 | 9815 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9816 | |
9817 | def GetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9818 | """ |
a95a7133 | 9819 | GetAutoLayout(self) -> bool |
15afbcd0 RD |
9820 | |
9821 | Returns the current autoLayout setting | |
9822 | """ | |
54f9ee45 | 9823 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9824 | |
9825 | def Layout(*args, **kwargs): | |
15afbcd0 | 9826 | """ |
a95a7133 | 9827 | Layout(self) -> bool |
15afbcd0 RD |
9828 | |
9829 | Invokes the constraint-based layout algorithm or the sizer-based | |
9830 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
9831 | this function gets called automatically by the default EVT_SIZE | |
9832 | handler when the window is resized. | |
9833 | """ | |
54f9ee45 | 9834 | return _core_.Window_Layout(*args, **kwargs) |
e811c8ce RD |
9835 | |
9836 | def SetSizer(*args, **kwargs): | |
15afbcd0 | 9837 | """ |
a95a7133 | 9838 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9839 | |
9840 | Sets the window to have the given layout sizer. The window will then | |
9841 | own the object, and will take care of its deletion. If an existing | |
9842 | layout sizer object is already owned by the window, it will be deleted | |
9843 | if the deleteOld parameter is true. Note that this function will also | |
9844 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
ae8162c8 | 9845 | non-None, and False otherwise. |
15afbcd0 | 9846 | """ |
54f9ee45 | 9847 | return _core_.Window_SetSizer(*args, **kwargs) |
e811c8ce RD |
9848 | |
9849 | def SetSizerAndFit(*args, **kwargs): | |
15afbcd0 | 9850 | """ |
a95a7133 | 9851 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9852 | |
9853 | The same as SetSizer, except it also sets the size hints for the | |
9854 | window based on the sizer's minimum size. | |
9855 | """ | |
54f9ee45 | 9856 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
e811c8ce RD |
9857 | |
9858 | def GetSizer(*args, **kwargs): | |
15afbcd0 | 9859 | """ |
a95a7133 | 9860 | GetSizer(self) -> Sizer |
15afbcd0 RD |
9861 | |
9862 | Return the sizer associated with the window by a previous call to | |
9863 | SetSizer or None if there isn't one. | |
9864 | """ | |
54f9ee45 | 9865 | return _core_.Window_GetSizer(*args, **kwargs) |
e811c8ce RD |
9866 | |
9867 | def SetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9868 | """ |
a95a7133 | 9869 | SetContainingSizer(self, Sizer sizer) |
15afbcd0 RD |
9870 | |
9871 | This normally does not need to be called by application code. It is | |
9872 | called internally when a window is added to a sizer, and is used so | |
9873 | the window can remove itself from the sizer when it is destroyed. | |
9874 | """ | |
54f9ee45 | 9875 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
e811c8ce RD |
9876 | |
9877 | def GetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9878 | """ |
a95a7133 | 9879 | GetContainingSizer(self) -> Sizer |
15afbcd0 RD |
9880 | |
9881 | Return the sizer that this window is a member of, if any, otherwise None. | |
9882 | """ | |
54f9ee45 | 9883 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
e811c8ce | 9884 | |
a95a7133 RD |
9885 | def InheritAttributes(*args, **kwargs): |
9886 | """ | |
9887 | InheritAttributes(self) | |
9888 | ||
41e2b43e RD |
9889 | This function is (or should be, in case of custom controls) called |
9890 | during window creation to intelligently set up the window visual | |
9891 | attributes, that is the font and the foreground and background | |
9892 | colours. | |
9893 | ||
9894 | By 'intelligently' the following is meant: by default, all windows use | |
9895 | their own default attributes. However if some of the parent's | |
9896 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 9897 | SetOwnFont) and if the corresponding attribute hadn't been |
41e2b43e RD |
9898 | explicitly set for this window itself, then this window takes the same |
9899 | value as used by the parent. In addition, if the window overrides | |
9900 | ShouldInheritColours to return false, the colours will not be changed | |
9901 | no matter what and only the font might. | |
9902 | ||
34621cc5 | 9903 | This rather complicated logic is necessary in order to accommodate the |
ec9b55ca | 9904 | different usage scenarios. The most common one is when all default |
41e2b43e RD |
9905 | attributes are used and in this case, nothing should be inherited as |
9906 | in modern GUIs different controls use different fonts (and colours) | |
9907 | than their siblings so they can't inherit the same value from the | |
9908 | parent. However it was also deemed desirable to allow to simply change | |
9909 | the attributes of all children at once by just changing the font or | |
9910 | colour of their common parent, hence in this case we do inherit the | |
9911 | parents attributes. | |
9912 | ||
a95a7133 | 9913 | """ |
54f9ee45 | 9914 | return _core_.Window_InheritAttributes(*args, **kwargs) |
a95a7133 RD |
9915 | |
9916 | def ShouldInheritColours(*args, **kwargs): | |
9917 | """ | |
9918 | ShouldInheritColours(self) -> bool | |
9919 | ||
9920 | Return true from here to allow the colours of this window to be | |
41e2b43e RD |
9921 | changed by InheritAttributes, returning false forbids inheriting them |
9922 | from the parent window. | |
a95a7133 | 9923 | |
41e2b43e RD |
9924 | The base class version returns false, but this method is overridden in |
9925 | wxControl where it returns true. | |
a95a7133 | 9926 | """ |
54f9ee45 | 9927 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
a95a7133 | 9928 | |
e811c8ce | 9929 | def PostCreate(self, pre): |
15afbcd0 RD |
9930 | """ |
9931 | Phase 3 of the 2-phase create <wink!> | |
9932 | Call this method after precreating the window with the 2-phase create method. | |
9933 | """ | |
e811c8ce RD |
9934 | self.this = pre.this |
9935 | self.thisown = pre.thisown | |
9936 | pre.thisown = 0 | |
9937 | if hasattr(self, '_setOORInfo'): | |
9938 | self._setOORInfo(self) | |
9939 | if hasattr(self, '_setCallbackInfo'): | |
9940 | self._setCallbackInfo(self, self.__class__) | |
9941 | ||
9942 | ||
9943 | class WindowPtr(Window): | |
9944 | def __init__(self, this): | |
9945 | self.this = this | |
9946 | if not hasattr(self,"thisown"): self.thisown = 0 | |
9947 | self.__class__ = Window | |
54f9ee45 | 9948 | _core_.Window_swigregister(WindowPtr) |
e811c8ce RD |
9949 | |
9950 | def PreWindow(*args, **kwargs): | |
15afbcd0 RD |
9951 | """ |
9952 | PreWindow() -> Window | |
9953 | ||
9954 | Precreate a Window for 2-phase creation. | |
9955 | """ | |
54f9ee45 | 9956 | val = _core_.new_PreWindow(*args, **kwargs) |
e811c8ce RD |
9957 | val.thisown = 1 |
9958 | return val | |
9959 | ||
9960 | def Window_NewControlId(*args, **kwargs): | |
15afbcd0 RD |
9961 | """ |
9962 | Window_NewControlId() -> int | |
9963 | ||
9964 | Generate a control id for the controls which were not given one. | |
9965 | """ | |
54f9ee45 | 9966 | return _core_.Window_NewControlId(*args, **kwargs) |
e811c8ce RD |
9967 | |
9968 | def Window_NextControlId(*args, **kwargs): | |
15afbcd0 RD |
9969 | """ |
9970 | Window_NextControlId(int winid) -> int | |
9971 | ||
9972 | Get the id of the control following the one with the given | |
41e2b43e | 9973 | autogenerated) id |
15afbcd0 | 9974 | """ |
54f9ee45 | 9975 | return _core_.Window_NextControlId(*args, **kwargs) |
e811c8ce RD |
9976 | |
9977 | def Window_PrevControlId(*args, **kwargs): | |
15afbcd0 RD |
9978 | """ |
9979 | Window_PrevControlId(int winid) -> int | |
9980 | ||
9981 | Get the id of the control preceding the one with the given | |
41e2b43e | 9982 | autogenerated) id |
15afbcd0 | 9983 | """ |
54f9ee45 | 9984 | return _core_.Window_PrevControlId(*args, **kwargs) |
e811c8ce RD |
9985 | |
9986 | def Window_FindFocus(*args, **kwargs): | |
15afbcd0 RD |
9987 | """ |
9988 | Window_FindFocus() -> Window | |
9989 | ||
9990 | Returns the window or control that currently has the keyboard focus, | |
9991 | or None. | |
9992 | """ | |
54f9ee45 | 9993 | return _core_.Window_FindFocus(*args, **kwargs) |
e811c8ce RD |
9994 | |
9995 | def Window_GetCapture(*args, **kwargs): | |
15afbcd0 RD |
9996 | """ |
9997 | Window_GetCapture() -> Window | |
9998 | ||
9999 | Returns the window which currently captures the mouse or None | |
10000 | """ | |
54f9ee45 | 10001 | return _core_.Window_GetCapture(*args, **kwargs) |
e811c8ce | 10002 | |
74a57fcd RD |
10003 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
10004 | """ | |
10005 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
10006 | ||
41e2b43e RD |
10007 | Get the default attributes for this class. This is useful if you want |
10008 | to use the same font or colour in your own control as in a standard | |
10009 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
10010 | colours or fonts which might look completely out of place on the |
10011 | user's system, especially if it uses themes. | |
74a57fcd RD |
10012 | |
10013 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 10014 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
10015 | the returned font. See `wx.Window.SetWindowVariant` for more about |
10016 | this. | |
74a57fcd | 10017 | """ |
54f9ee45 | 10018 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 10019 | |
e811c8ce | 10020 | def DLG_PNT(win, point_or_x, y=None): |
15afbcd0 RD |
10021 | """ |
10022 | Convenience function for converting a Point or (x,y) in | |
10023 | dialog units to pixel units. | |
10024 | """ | |
e811c8ce RD |
10025 | if y is None: |
10026 | return win.ConvertDialogPointToPixels(point_or_x) | |
10027 | else: | |
fd3f2efe | 10028 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) |
e811c8ce RD |
10029 | |
10030 | def DLG_SZE(win, size_width, height=None): | |
15afbcd0 RD |
10031 | """ |
10032 | Convenience function for converting a Size or (w,h) in | |
10033 | dialog units to pixel units. | |
10034 | """ | |
e811c8ce RD |
10035 | if height is None: |
10036 | return win.ConvertDialogSizeToPixels(size_width) | |
10037 | else: | |
fd3f2efe | 10038 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) |
e811c8ce RD |
10039 | |
10040 | ||
10041 | def FindWindowById(*args, **kwargs): | |
15afbcd0 RD |
10042 | """ |
10043 | FindWindowById(long id, Window parent=None) -> Window | |
10044 | ||
10045 | Find the first window in the application with the given id. If parent | |
10046 | is None, the search will start from all top-level frames and dialog | |
10047 | boxes; if non-None, the search will be limited to the given window | |
10048 | hierarchy. The search is recursive in both cases. | |
10049 | """ | |
54f9ee45 | 10050 | return _core_.FindWindowById(*args, **kwargs) |
e811c8ce RD |
10051 | |
10052 | def FindWindowByName(*args, **kwargs): | |
15afbcd0 RD |
10053 | """ |
10054 | FindWindowByName(String name, Window parent=None) -> Window | |
10055 | ||
10056 | Find a window by its name (as given in a window constructor or Create | |
10057 | function call). If parent is None, the search will start from all | |
10058 | top-level frames and dialog boxes; if non-None, the search will be | |
10059 | limited to the given window hierarchy. The search is recursive in both | |
10060 | cases. | |
10061 | ||
10062 | If no window with such name is found, wx.FindWindowByLabel is called. | |
10063 | """ | |
54f9ee45 | 10064 | return _core_.FindWindowByName(*args, **kwargs) |
e811c8ce RD |
10065 | |
10066 | def FindWindowByLabel(*args, **kwargs): | |
15afbcd0 RD |
10067 | """ |
10068 | FindWindowByLabel(String label, Window parent=None) -> Window | |
10069 | ||
10070 | Find a window by its label. Depending on the type of window, the label | |
10071 | may be a window title or panel item label. If parent is None, the | |
10072 | search will start from all top-level frames and dialog boxes; if | |
10073 | non-None, the search will be limited to the given window | |
10074 | hierarchy. The search is recursive in both cases. | |
10075 | """ | |
54f9ee45 | 10076 | return _core_.FindWindowByLabel(*args, **kwargs) |
e811c8ce RD |
10077 | |
10078 | def Window_FromHWND(*args, **kwargs): | |
4276dc52 | 10079 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" |
54f9ee45 | 10080 | return _core_.Window_FromHWND(*args, **kwargs) |
b6b0383e RD |
10081 | |
10082 | def GetTopLevelWindows(*args, **kwargs): | |
10083 | """ | |
10084 | GetTopLevelWindows() -> PyObject | |
10085 | ||
10086 | Returns a list of the the application's top-level windows, (frames, | |
10087 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
10088 | by wxWidgets, and so it is only valid as long as no top-level windows | |
10089 | are closed or new top-level windows are created. | |
10090 | ||
10091 | """ | |
10092 | return _core_.GetTopLevelWindows(*args, **kwargs) | |
e811c8ce RD |
10093 | #--------------------------------------------------------------------------- |
10094 | ||
10095 | class Validator(EvtHandler): | |
093d3ff1 | 10096 | """Proxy of C++ Validator class""" |
e811c8ce RD |
10097 | def __repr__(self): |
10098 | return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10099 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10100 | """__init__(self) -> Validator""" |
54f9ee45 | 10101 | newobj = _core_.new_Validator(*args, **kwargs) |
d14a1e28 RD |
10102 | self.this = newobj.this |
10103 | self.thisown = 1 | |
10104 | del newobj.thisown | |
10105 | self._setOORInfo(self) | |
e811c8ce RD |
10106 | |
10107 | def Clone(*args, **kwargs): | |
a95a7133 | 10108 | """Clone(self) -> Validator""" |
54f9ee45 | 10109 | return _core_.Validator_Clone(*args, **kwargs) |
e811c8ce RD |
10110 | |
10111 | def Validate(*args, **kwargs): | |
a95a7133 | 10112 | """Validate(self, Window parent) -> bool""" |
54f9ee45 | 10113 | return _core_.Validator_Validate(*args, **kwargs) |
e811c8ce RD |
10114 | |
10115 | def TransferToWindow(*args, **kwargs): | |
a95a7133 | 10116 | """TransferToWindow(self) -> bool""" |
54f9ee45 | 10117 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
e811c8ce RD |
10118 | |
10119 | def TransferFromWindow(*args, **kwargs): | |
a95a7133 | 10120 | """TransferFromWindow(self) -> bool""" |
54f9ee45 | 10121 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
e811c8ce RD |
10122 | |
10123 | def GetWindow(*args, **kwargs): | |
a95a7133 | 10124 | """GetWindow(self) -> Window""" |
54f9ee45 | 10125 | return _core_.Validator_GetWindow(*args, **kwargs) |
e811c8ce RD |
10126 | |
10127 | def SetWindow(*args, **kwargs): | |
a95a7133 | 10128 | """SetWindow(self, Window window)""" |
54f9ee45 | 10129 | return _core_.Validator_SetWindow(*args, **kwargs) |
e811c8ce RD |
10130 | |
10131 | def IsSilent(*args, **kwargs): | |
66c033b4 | 10132 | """IsSilent() -> bool""" |
54f9ee45 | 10133 | return _core_.Validator_IsSilent(*args, **kwargs) |
e811c8ce RD |
10134 | |
10135 | IsSilent = staticmethod(IsSilent) | |
10136 | def SetBellOnError(*args, **kwargs): | |
66c033b4 | 10137 | """SetBellOnError(int doIt=True)""" |
54f9ee45 | 10138 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
e811c8ce RD |
10139 | |
10140 | SetBellOnError = staticmethod(SetBellOnError) | |
10141 | ||
10142 | class ValidatorPtr(Validator): | |
10143 | def __init__(self, this): | |
10144 | self.this = this | |
10145 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10146 | self.__class__ = Validator | |
54f9ee45 | 10147 | _core_.Validator_swigregister(ValidatorPtr) |
e811c8ce RD |
10148 | |
10149 | def Validator_IsSilent(*args, **kwargs): | |
10150 | """Validator_IsSilent() -> bool""" | |
54f9ee45 | 10151 | return _core_.Validator_IsSilent(*args, **kwargs) |
e811c8ce RD |
10152 | |
10153 | def Validator_SetBellOnError(*args, **kwargs): | |
10154 | """Validator_SetBellOnError(int doIt=True)""" | |
54f9ee45 | 10155 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
e811c8ce RD |
10156 | |
10157 | class PyValidator(Validator): | |
093d3ff1 | 10158 | """Proxy of C++ PyValidator class""" |
e811c8ce RD |
10159 | def __repr__(self): |
10160 | return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10161 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10162 | """__init__(self) -> PyValidator""" |
54f9ee45 | 10163 | newobj = _core_.new_PyValidator(*args, **kwargs) |
e811c8ce RD |
10164 | self.this = newobj.this |
10165 | self.thisown = 1 | |
10166 | del newobj.thisown | |
10167 | ||
10168 | self._setCallbackInfo(self, PyValidator, 1) | |
10169 | self._setOORInfo(self) | |
10170 | ||
10171 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 10172 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" |
54f9ee45 | 10173 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
10174 | |
10175 | ||
10176 | class PyValidatorPtr(PyValidator): | |
10177 | def __init__(self, this): | |
10178 | self.this = this | |
10179 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10180 | self.__class__ = PyValidator | |
54f9ee45 | 10181 | _core_.PyValidator_swigregister(PyValidatorPtr) |
e811c8ce RD |
10182 | |
10183 | #--------------------------------------------------------------------------- | |
10184 | ||
10185 | class Menu(EvtHandler): | |
093d3ff1 | 10186 | """Proxy of C++ Menu class""" |
d14a1e28 RD |
10187 | def __repr__(self): |
10188 | return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
e811c8ce | 10189 | def __init__(self, *args, **kwargs): |
a95a7133 | 10190 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
54f9ee45 | 10191 | newobj = _core_.new_Menu(*args, **kwargs) |
e811c8ce RD |
10192 | self.this = newobj.this |
10193 | self.thisown = 1 | |
10194 | del newobj.thisown | |
10195 | self._setOORInfo(self) | |
10196 | ||
10197 | def Append(*args, **kwargs): | |
a95a7133 | 10198 | """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
54f9ee45 | 10199 | return _core_.Menu_Append(*args, **kwargs) |
e811c8ce RD |
10200 | |
10201 | def AppendSeparator(*args, **kwargs): | |
a95a7133 | 10202 | """AppendSeparator(self) -> MenuItem""" |
54f9ee45 | 10203 | return _core_.Menu_AppendSeparator(*args, **kwargs) |
e811c8ce RD |
10204 | |
10205 | def AppendCheckItem(*args, **kwargs): | |
a95a7133 | 10206 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10207 | return _core_.Menu_AppendCheckItem(*args, **kwargs) |
e811c8ce RD |
10208 | |
10209 | def AppendRadioItem(*args, **kwargs): | |
a95a7133 | 10210 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10211 | return _core_.Menu_AppendRadioItem(*args, **kwargs) |
e811c8ce RD |
10212 | |
10213 | def AppendMenu(*args, **kwargs): | |
a95a7133 | 10214 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10215 | return _core_.Menu_AppendMenu(*args, **kwargs) |
e811c8ce RD |
10216 | |
10217 | def AppendItem(*args, **kwargs): | |
a95a7133 | 10218 | """AppendItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10219 | return _core_.Menu_AppendItem(*args, **kwargs) |
e811c8ce RD |
10220 | |
10221 | def Break(*args, **kwargs): | |
a95a7133 | 10222 | """Break(self)""" |
54f9ee45 | 10223 | return _core_.Menu_Break(*args, **kwargs) |
e811c8ce RD |
10224 | |
10225 | def InsertItem(*args, **kwargs): | |
a95a7133 | 10226 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
54f9ee45 | 10227 | return _core_.Menu_InsertItem(*args, **kwargs) |
e811c8ce RD |
10228 | |
10229 | def Insert(*args, **kwargs): | |
0df68c9f | 10230 | """ |
a95a7133 | 10231 | Insert(self, size_t pos, int id, String text, String help=EmptyString, |
a41e16b6 | 10232 | int kind=ITEM_NORMAL) -> MenuItem |
0df68c9f | 10233 | """ |
54f9ee45 | 10234 | return _core_.Menu_Insert(*args, **kwargs) |
e811c8ce RD |
10235 | |
10236 | def InsertSeparator(*args, **kwargs): | |
a95a7133 | 10237 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
54f9ee45 | 10238 | return _core_.Menu_InsertSeparator(*args, **kwargs) |
e811c8ce RD |
10239 | |
10240 | def InsertCheckItem(*args, **kwargs): | |
a95a7133 | 10241 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10242 | return _core_.Menu_InsertCheckItem(*args, **kwargs) |
e811c8ce RD |
10243 | |
10244 | def InsertRadioItem(*args, **kwargs): | |
a95a7133 | 10245 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10246 | return _core_.Menu_InsertRadioItem(*args, **kwargs) |
e811c8ce RD |
10247 | |
10248 | def InsertMenu(*args, **kwargs): | |
a95a7133 | 10249 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10250 | return _core_.Menu_InsertMenu(*args, **kwargs) |
e811c8ce RD |
10251 | |
10252 | def PrependItem(*args, **kwargs): | |
a95a7133 | 10253 | """PrependItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10254 | return _core_.Menu_PrependItem(*args, **kwargs) |
e811c8ce RD |
10255 | |
10256 | def Prepend(*args, **kwargs): | |
a95a7133 | 10257 | """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
54f9ee45 | 10258 | return _core_.Menu_Prepend(*args, **kwargs) |
e811c8ce RD |
10259 | |
10260 | def PrependSeparator(*args, **kwargs): | |
a95a7133 | 10261 | """PrependSeparator(self) -> MenuItem""" |
54f9ee45 | 10262 | return _core_.Menu_PrependSeparator(*args, **kwargs) |
e811c8ce RD |
10263 | |
10264 | def PrependCheckItem(*args, **kwargs): | |
a95a7133 | 10265 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10266 | return _core_.Menu_PrependCheckItem(*args, **kwargs) |
e811c8ce RD |
10267 | |
10268 | def PrependRadioItem(*args, **kwargs): | |
a95a7133 | 10269 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10270 | return _core_.Menu_PrependRadioItem(*args, **kwargs) |
e811c8ce RD |
10271 | |
10272 | def PrependMenu(*args, **kwargs): | |
a95a7133 | 10273 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10274 | return _core_.Menu_PrependMenu(*args, **kwargs) |
e811c8ce RD |
10275 | |
10276 | def Remove(*args, **kwargs): | |
a95a7133 | 10277 | """Remove(self, int id) -> MenuItem""" |
54f9ee45 | 10278 | return _core_.Menu_Remove(*args, **kwargs) |
e811c8ce RD |
10279 | |
10280 | def RemoveItem(*args, **kwargs): | |
a95a7133 | 10281 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10282 | return _core_.Menu_RemoveItem(*args, **kwargs) |
e811c8ce RD |
10283 | |
10284 | def Delete(*args, **kwargs): | |
a95a7133 | 10285 | """Delete(self, int id) -> bool""" |
54f9ee45 | 10286 | return _core_.Menu_Delete(*args, **kwargs) |
e811c8ce RD |
10287 | |
10288 | def DeleteItem(*args, **kwargs): | |
a95a7133 | 10289 | """DeleteItem(self, MenuItem item) -> bool""" |
54f9ee45 | 10290 | return _core_.Menu_DeleteItem(*args, **kwargs) |
e811c8ce RD |
10291 | |
10292 | def Destroy(*args, **kwargs): | |
0df68c9f | 10293 | """ |
a95a7133 | 10294 | Destroy(self) |
e811c8ce | 10295 | |
0df68c9f RD |
10296 | Deletes the C++ object this Python object is a proxy for. |
10297 | """ | |
54f9ee45 | 10298 | return _core_.Menu_Destroy(*args, **kwargs) |
e811c8ce RD |
10299 | |
10300 | def DestroyId(*args, **kwargs): | |
0df68c9f | 10301 | """ |
a95a7133 | 10302 | DestroyId(self, int id) -> bool |
e811c8ce | 10303 | |
0df68c9f RD |
10304 | Deletes the C++ object this Python object is a proxy for. |
10305 | """ | |
54f9ee45 | 10306 | return _core_.Menu_DestroyId(*args, **kwargs) |
e811c8ce RD |
10307 | |
10308 | def DestroyItem(*args, **kwargs): | |
0df68c9f | 10309 | """ |
a95a7133 | 10310 | DestroyItem(self, MenuItem item) -> bool |
e811c8ce | 10311 | |
0df68c9f RD |
10312 | Deletes the C++ object this Python object is a proxy for. |
10313 | """ | |
54f9ee45 | 10314 | return _core_.Menu_DestroyItem(*args, **kwargs) |
e811c8ce RD |
10315 | |
10316 | def GetMenuItemCount(*args, **kwargs): | |
a95a7133 | 10317 | """GetMenuItemCount(self) -> size_t""" |
54f9ee45 | 10318 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
e811c8ce RD |
10319 | |
10320 | def GetMenuItems(*args, **kwargs): | |
a95a7133 | 10321 | """GetMenuItems(self) -> PyObject""" |
54f9ee45 | 10322 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
e811c8ce RD |
10323 | |
10324 | def FindItem(*args, **kwargs): | |
a95a7133 | 10325 | """FindItem(self, String item) -> int""" |
54f9ee45 | 10326 | return _core_.Menu_FindItem(*args, **kwargs) |
e811c8ce RD |
10327 | |
10328 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10329 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10330 | return _core_.Menu_FindItemById(*args, **kwargs) |
e811c8ce RD |
10331 | |
10332 | def FindItemByPosition(*args, **kwargs): | |
a95a7133 | 10333 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
54f9ee45 | 10334 | return _core_.Menu_FindItemByPosition(*args, **kwargs) |
e811c8ce RD |
10335 | |
10336 | def Enable(*args, **kwargs): | |
a95a7133 | 10337 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10338 | return _core_.Menu_Enable(*args, **kwargs) |
e811c8ce RD |
10339 | |
10340 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10341 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10342 | return _core_.Menu_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10343 | |
10344 | def Check(*args, **kwargs): | |
a95a7133 | 10345 | """Check(self, int id, bool check)""" |
54f9ee45 | 10346 | return _core_.Menu_Check(*args, **kwargs) |
e811c8ce RD |
10347 | |
10348 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10349 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10350 | return _core_.Menu_IsChecked(*args, **kwargs) |
e811c8ce RD |
10351 | |
10352 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10353 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10354 | return _core_.Menu_SetLabel(*args, **kwargs) |
e811c8ce RD |
10355 | |
10356 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10357 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10358 | return _core_.Menu_GetLabel(*args, **kwargs) |
e811c8ce RD |
10359 | |
10360 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10361 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10362 | return _core_.Menu_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10363 | |
10364 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10365 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10366 | return _core_.Menu_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10367 | |
10368 | def SetTitle(*args, **kwargs): | |
a95a7133 | 10369 | """SetTitle(self, String title)""" |
54f9ee45 | 10370 | return _core_.Menu_SetTitle(*args, **kwargs) |
e811c8ce RD |
10371 | |
10372 | def GetTitle(*args, **kwargs): | |
a95a7133 | 10373 | """GetTitle(self) -> String""" |
54f9ee45 | 10374 | return _core_.Menu_GetTitle(*args, **kwargs) |
e811c8ce RD |
10375 | |
10376 | def SetEventHandler(*args, **kwargs): | |
a95a7133 | 10377 | """SetEventHandler(self, EvtHandler handler)""" |
54f9ee45 | 10378 | return _core_.Menu_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
10379 | |
10380 | def GetEventHandler(*args, **kwargs): | |
a95a7133 | 10381 | """GetEventHandler(self) -> EvtHandler""" |
54f9ee45 | 10382 | return _core_.Menu_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
10383 | |
10384 | def SetInvokingWindow(*args, **kwargs): | |
a95a7133 | 10385 | """SetInvokingWindow(self, Window win)""" |
54f9ee45 | 10386 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
10387 | |
10388 | def GetInvokingWindow(*args, **kwargs): | |
a95a7133 | 10389 | """GetInvokingWindow(self) -> Window""" |
54f9ee45 | 10390 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
10391 | |
10392 | def GetStyle(*args, **kwargs): | |
a95a7133 | 10393 | """GetStyle(self) -> long""" |
54f9ee45 | 10394 | return _core_.Menu_GetStyle(*args, **kwargs) |
e811c8ce RD |
10395 | |
10396 | def UpdateUI(*args, **kwargs): | |
a95a7133 | 10397 | """UpdateUI(self, EvtHandler source=None)""" |
54f9ee45 | 10398 | return _core_.Menu_UpdateUI(*args, **kwargs) |
e811c8ce RD |
10399 | |
10400 | def GetMenuBar(*args, **kwargs): | |
a95a7133 | 10401 | """GetMenuBar(self) -> MenuBar""" |
54f9ee45 | 10402 | return _core_.Menu_GetMenuBar(*args, **kwargs) |
e811c8ce RD |
10403 | |
10404 | def Attach(*args, **kwargs): | |
a95a7133 | 10405 | """Attach(self, wxMenuBarBase menubar)""" |
54f9ee45 | 10406 | return _core_.Menu_Attach(*args, **kwargs) |
e811c8ce RD |
10407 | |
10408 | def Detach(*args, **kwargs): | |
a95a7133 | 10409 | """Detach(self)""" |
54f9ee45 | 10410 | return _core_.Menu_Detach(*args, **kwargs) |
e811c8ce RD |
10411 | |
10412 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10413 | """IsAttached(self) -> bool""" |
54f9ee45 | 10414 | return _core_.Menu_IsAttached(*args, **kwargs) |
e811c8ce RD |
10415 | |
10416 | def SetParent(*args, **kwargs): | |
a95a7133 | 10417 | """SetParent(self, Menu parent)""" |
54f9ee45 | 10418 | return _core_.Menu_SetParent(*args, **kwargs) |
e811c8ce RD |
10419 | |
10420 | def GetParent(*args, **kwargs): | |
a95a7133 | 10421 | """GetParent(self) -> Menu""" |
54f9ee45 | 10422 | return _core_.Menu_GetParent(*args, **kwargs) |
e811c8ce | 10423 | |
d14a1e28 RD |
10424 | |
10425 | class MenuPtr(Menu): | |
10426 | def __init__(self, this): | |
10427 | self.this = this | |
10428 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10429 | self.__class__ = Menu | |
54f9ee45 | 10430 | _core_.Menu_swigregister(MenuPtr) |
d14a1e28 RD |
10431 | DefaultValidator = cvar.DefaultValidator |
10432 | ||
10433 | #--------------------------------------------------------------------------- | |
10434 | ||
10435 | class MenuBar(Window): | |
093d3ff1 | 10436 | """Proxy of C++ MenuBar class""" |
e811c8ce RD |
10437 | def __repr__(self): |
10438 | return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 10439 | def __init__(self, *args, **kwargs): |
a95a7133 | 10440 | """__init__(self, long style=0) -> MenuBar""" |
54f9ee45 | 10441 | newobj = _core_.new_MenuBar(*args, **kwargs) |
d14a1e28 RD |
10442 | self.this = newobj.this |
10443 | self.thisown = 1 | |
10444 | del newobj.thisown | |
10445 | self._setOORInfo(self) | |
e811c8ce RD |
10446 | |
10447 | def Append(*args, **kwargs): | |
a95a7133 | 10448 | """Append(self, Menu menu, String title) -> bool""" |
54f9ee45 | 10449 | return _core_.MenuBar_Append(*args, **kwargs) |
e811c8ce RD |
10450 | |
10451 | def Insert(*args, **kwargs): | |
a95a7133 | 10452 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
54f9ee45 | 10453 | return _core_.MenuBar_Insert(*args, **kwargs) |
e811c8ce RD |
10454 | |
10455 | def GetMenuCount(*args, **kwargs): | |
a95a7133 | 10456 | """GetMenuCount(self) -> size_t""" |
54f9ee45 | 10457 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
e811c8ce RD |
10458 | |
10459 | def GetMenu(*args, **kwargs): | |
a95a7133 | 10460 | """GetMenu(self, size_t pos) -> Menu""" |
54f9ee45 | 10461 | return _core_.MenuBar_GetMenu(*args, **kwargs) |
e811c8ce RD |
10462 | |
10463 | def Replace(*args, **kwargs): | |
a95a7133 | 10464 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
54f9ee45 | 10465 | return _core_.MenuBar_Replace(*args, **kwargs) |
e811c8ce RD |
10466 | |
10467 | def Remove(*args, **kwargs): | |
a95a7133 | 10468 | """Remove(self, size_t pos) -> Menu""" |
54f9ee45 | 10469 | return _core_.MenuBar_Remove(*args, **kwargs) |
e811c8ce RD |
10470 | |
10471 | def EnableTop(*args, **kwargs): | |
a95a7133 | 10472 | """EnableTop(self, size_t pos, bool enable)""" |
54f9ee45 | 10473 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
e811c8ce RD |
10474 | |
10475 | def IsEnabledTop(*args, **kwargs): | |
a95a7133 | 10476 | """IsEnabledTop(self, size_t pos) -> bool""" |
54f9ee45 | 10477 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
e811c8ce RD |
10478 | |
10479 | def SetLabelTop(*args, **kwargs): | |
a95a7133 | 10480 | """SetLabelTop(self, size_t pos, String label)""" |
54f9ee45 | 10481 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) |
e811c8ce RD |
10482 | |
10483 | def GetLabelTop(*args, **kwargs): | |
a95a7133 | 10484 | """GetLabelTop(self, size_t pos) -> String""" |
54f9ee45 | 10485 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) |
e811c8ce RD |
10486 | |
10487 | def FindMenuItem(*args, **kwargs): | |
a95a7133 | 10488 | """FindMenuItem(self, String menu, String item) -> int""" |
54f9ee45 | 10489 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) |
e811c8ce RD |
10490 | |
10491 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10492 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10493 | return _core_.MenuBar_FindItemById(*args, **kwargs) |
e811c8ce RD |
10494 | |
10495 | def FindMenu(*args, **kwargs): | |
a95a7133 | 10496 | """FindMenu(self, String title) -> int""" |
54f9ee45 | 10497 | return _core_.MenuBar_FindMenu(*args, **kwargs) |
e811c8ce RD |
10498 | |
10499 | def Enable(*args, **kwargs): | |
a95a7133 | 10500 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10501 | return _core_.MenuBar_Enable(*args, **kwargs) |
e811c8ce RD |
10502 | |
10503 | def Check(*args, **kwargs): | |
a95a7133 | 10504 | """Check(self, int id, bool check)""" |
54f9ee45 | 10505 | return _core_.MenuBar_Check(*args, **kwargs) |
e811c8ce RD |
10506 | |
10507 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10508 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10509 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
e811c8ce RD |
10510 | |
10511 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10512 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10513 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10514 | |
10515 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10516 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10517 | return _core_.MenuBar_SetLabel(*args, **kwargs) |
e811c8ce RD |
10518 | |
10519 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10520 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10521 | return _core_.MenuBar_GetLabel(*args, **kwargs) |
e811c8ce RD |
10522 | |
10523 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10524 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10525 | return _core_.MenuBar_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10526 | |
10527 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10528 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10529 | return _core_.MenuBar_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10530 | |
10531 | def GetFrame(*args, **kwargs): | |
a95a7133 | 10532 | """GetFrame(self) -> wxFrame""" |
54f9ee45 | 10533 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
e811c8ce RD |
10534 | |
10535 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10536 | """IsAttached(self) -> bool""" |
54f9ee45 | 10537 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
e811c8ce RD |
10538 | |
10539 | def Attach(*args, **kwargs): | |
a95a7133 | 10540 | """Attach(self, wxFrame frame)""" |
54f9ee45 | 10541 | return _core_.MenuBar_Attach(*args, **kwargs) |
e811c8ce RD |
10542 | |
10543 | def Detach(*args, **kwargs): | |
a95a7133 | 10544 | """Detach(self)""" |
54f9ee45 | 10545 | return _core_.MenuBar_Detach(*args, **kwargs) |
e811c8ce | 10546 | |
d14a1e28 RD |
10547 | |
10548 | class MenuBarPtr(MenuBar): | |
10549 | def __init__(self, this): | |
10550 | self.this = this | |
10551 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10552 | self.__class__ = MenuBar | |
54f9ee45 | 10553 | _core_.MenuBar_swigregister(MenuBarPtr) |
d14a1e28 RD |
10554 | |
10555 | #--------------------------------------------------------------------------- | |
10556 | ||
10557 | class MenuItem(Object): | |
093d3ff1 | 10558 | """Proxy of C++ MenuItem class""" |
e811c8ce RD |
10559 | def __repr__(self): |
10560 | return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 10561 | def __init__(self, *args, **kwargs): |
0df68c9f | 10562 | """ |
a95a7133 | 10563 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, |
196addbf RD |
10564 | String help=EmptyString, int kind=ITEM_NORMAL, |
10565 | Menu subMenu=None) -> MenuItem | |
0df68c9f | 10566 | """ |
54f9ee45 | 10567 | newobj = _core_.new_MenuItem(*args, **kwargs) |
d14a1e28 RD |
10568 | self.this = newobj.this |
10569 | self.thisown = 1 | |
10570 | del newobj.thisown | |
e811c8ce | 10571 | def GetMenu(*args, **kwargs): |
a95a7133 | 10572 | """GetMenu(self) -> Menu""" |
54f9ee45 | 10573 | return _core_.MenuItem_GetMenu(*args, **kwargs) |
e811c8ce RD |
10574 | |
10575 | def SetMenu(*args, **kwargs): | |
a95a7133 | 10576 | """SetMenu(self, Menu menu)""" |
54f9ee45 | 10577 | return _core_.MenuItem_SetMenu(*args, **kwargs) |
e811c8ce RD |
10578 | |
10579 | def SetId(*args, **kwargs): | |
a95a7133 | 10580 | """SetId(self, int id)""" |
54f9ee45 | 10581 | return _core_.MenuItem_SetId(*args, **kwargs) |
e811c8ce RD |
10582 | |
10583 | def GetId(*args, **kwargs): | |
a95a7133 | 10584 | """GetId(self) -> int""" |
54f9ee45 | 10585 | return _core_.MenuItem_GetId(*args, **kwargs) |
e811c8ce RD |
10586 | |
10587 | def IsSeparator(*args, **kwargs): | |
a95a7133 | 10588 | """IsSeparator(self) -> bool""" |
54f9ee45 | 10589 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
e811c8ce RD |
10590 | |
10591 | def SetText(*args, **kwargs): | |
a95a7133 | 10592 | """SetText(self, String str)""" |
54f9ee45 | 10593 | return _core_.MenuItem_SetText(*args, **kwargs) |
e811c8ce RD |
10594 | |
10595 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10596 | """GetLabel(self) -> String""" |
54f9ee45 | 10597 | return _core_.MenuItem_GetLabel(*args, **kwargs) |
e811c8ce RD |
10598 | |
10599 | def GetText(*args, **kwargs): | |
a95a7133 | 10600 | """GetText(self) -> String""" |
54f9ee45 | 10601 | return _core_.MenuItem_GetText(*args, **kwargs) |
e811c8ce RD |
10602 | |
10603 | def GetLabelFromText(*args, **kwargs): | |
66c033b4 | 10604 | """GetLabelFromText(String text) -> String""" |
54f9ee45 | 10605 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
e811c8ce RD |
10606 | |
10607 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10608 | def GetKind(*args, **kwargs): | |
a95a7133 | 10609 | """GetKind(self) -> int""" |
54f9ee45 | 10610 | return _core_.MenuItem_GetKind(*args, **kwargs) |
e811c8ce | 10611 | |
a95a7133 RD |
10612 | def SetKind(*args, **kwargs): |
10613 | """SetKind(self, int kind)""" | |
54f9ee45 | 10614 | return _core_.MenuItem_SetKind(*args, **kwargs) |
a95a7133 | 10615 | |
e811c8ce | 10616 | def SetCheckable(*args, **kwargs): |
a95a7133 | 10617 | """SetCheckable(self, bool checkable)""" |
54f9ee45 | 10618 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
e811c8ce RD |
10619 | |
10620 | def IsCheckable(*args, **kwargs): | |
a95a7133 | 10621 | """IsCheckable(self) -> bool""" |
54f9ee45 | 10622 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
e811c8ce RD |
10623 | |
10624 | def IsSubMenu(*args, **kwargs): | |
a95a7133 | 10625 | """IsSubMenu(self) -> bool""" |
54f9ee45 | 10626 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
e811c8ce RD |
10627 | |
10628 | def SetSubMenu(*args, **kwargs): | |
a95a7133 | 10629 | """SetSubMenu(self, Menu menu)""" |
54f9ee45 | 10630 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) |
e811c8ce RD |
10631 | |
10632 | def GetSubMenu(*args, **kwargs): | |
a95a7133 | 10633 | """GetSubMenu(self) -> Menu""" |
54f9ee45 | 10634 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) |
e811c8ce RD |
10635 | |
10636 | def Enable(*args, **kwargs): | |
a95a7133 | 10637 | """Enable(self, bool enable=True)""" |
54f9ee45 | 10638 | return _core_.MenuItem_Enable(*args, **kwargs) |
e811c8ce RD |
10639 | |
10640 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10641 | """IsEnabled(self) -> bool""" |
54f9ee45 | 10642 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10643 | |
10644 | def Check(*args, **kwargs): | |
a95a7133 | 10645 | """Check(self, bool check=True)""" |
54f9ee45 | 10646 | return _core_.MenuItem_Check(*args, **kwargs) |
e811c8ce RD |
10647 | |
10648 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10649 | """IsChecked(self) -> bool""" |
54f9ee45 | 10650 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
e811c8ce RD |
10651 | |
10652 | def Toggle(*args, **kwargs): | |
a95a7133 | 10653 | """Toggle(self)""" |
54f9ee45 | 10654 | return _core_.MenuItem_Toggle(*args, **kwargs) |
e811c8ce RD |
10655 | |
10656 | def SetHelp(*args, **kwargs): | |
a95a7133 | 10657 | """SetHelp(self, String str)""" |
54f9ee45 | 10658 | return _core_.MenuItem_SetHelp(*args, **kwargs) |
e811c8ce RD |
10659 | |
10660 | def GetHelp(*args, **kwargs): | |
a95a7133 | 10661 | """GetHelp(self) -> String""" |
54f9ee45 | 10662 | return _core_.MenuItem_GetHelp(*args, **kwargs) |
e811c8ce RD |
10663 | |
10664 | def GetAccel(*args, **kwargs): | |
a95a7133 | 10665 | """GetAccel(self) -> AcceleratorEntry""" |
54f9ee45 | 10666 | return _core_.MenuItem_GetAccel(*args, **kwargs) |
e811c8ce RD |
10667 | |
10668 | def SetAccel(*args, **kwargs): | |
a95a7133 | 10669 | """SetAccel(self, AcceleratorEntry accel)""" |
54f9ee45 | 10670 | return _core_.MenuItem_SetAccel(*args, **kwargs) |
e811c8ce | 10671 | |
c1280d1e RD |
10672 | def SetFont(*args, **kwargs): |
10673 | """SetFont(self, Font font)""" | |
10674 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
10675 | ||
10676 | def GetFont(*args, **kwargs): | |
10677 | """GetFont(self) -> Font""" | |
10678 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
10679 | ||
10680 | def SetTextColour(*args, **kwargs): | |
10681 | """SetTextColour(self, Colour colText)""" | |
10682 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
10683 | ||
10684 | def GetTextColour(*args, **kwargs): | |
10685 | """GetTextColour(self) -> Colour""" | |
10686 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
10687 | ||
10688 | def SetBackgroundColour(*args, **kwargs): | |
10689 | """SetBackgroundColour(self, Colour colBack)""" | |
10690 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
10691 | ||
10692 | def GetBackgroundColour(*args, **kwargs): | |
10693 | """GetBackgroundColour(self) -> Colour""" | |
10694 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
10695 | ||
10696 | def SetBitmaps(*args, **kwargs): | |
10697 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
10698 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
10699 | ||
10700 | def SetDisabledBitmap(*args, **kwargs): | |
10701 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
10702 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
10703 | ||
10704 | def GetDisabledBitmap(*args, **kwargs): | |
10705 | """GetDisabledBitmap(self) -> Bitmap""" | |
10706 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
10707 | ||
10708 | def SetMarginWidth(*args, **kwargs): | |
10709 | """SetMarginWidth(self, int nWidth)""" | |
10710 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
10711 | ||
10712 | def GetMarginWidth(*args, **kwargs): | |
10713 | """GetMarginWidth(self) -> int""" | |
10714 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
10715 | ||
e811c8ce | 10716 | def GetDefaultMarginWidth(*args, **kwargs): |
66c033b4 | 10717 | """GetDefaultMarginWidth() -> int""" |
54f9ee45 | 10718 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
e811c8ce RD |
10719 | |
10720 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
10721 | def IsOwnerDrawn(*args, **kwargs): |
10722 | """IsOwnerDrawn(self) -> bool""" | |
10723 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
10724 | ||
10725 | def SetOwnerDrawn(*args, **kwargs): | |
10726 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
10727 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
10728 | ||
10729 | def ResetOwnerDrawn(*args, **kwargs): | |
10730 | """ResetOwnerDrawn(self)""" | |
10731 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
10732 | ||
e811c8ce | 10733 | def SetBitmap(*args, **kwargs): |
a95a7133 | 10734 | """SetBitmap(self, Bitmap bitmap)""" |
54f9ee45 | 10735 | return _core_.MenuItem_SetBitmap(*args, **kwargs) |
e811c8ce RD |
10736 | |
10737 | def GetBitmap(*args, **kwargs): | |
a95a7133 | 10738 | """GetBitmap(self) -> Bitmap""" |
54f9ee45 | 10739 | return _core_.MenuItem_GetBitmap(*args, **kwargs) |
e811c8ce | 10740 | |
d14a1e28 RD |
10741 | |
10742 | class MenuItemPtr(MenuItem): | |
10743 | def __init__(self, this): | |
10744 | self.this = this | |
10745 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10746 | self.__class__ = MenuItem | |
54f9ee45 | 10747 | _core_.MenuItem_swigregister(MenuItemPtr) |
d14a1e28 | 10748 | |
e811c8ce | 10749 | def MenuItem_GetLabelFromText(*args, **kwargs): |
196addbf | 10750 | """MenuItem_GetLabelFromText(String text) -> String""" |
54f9ee45 | 10751 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
d14a1e28 | 10752 | |
e811c8ce RD |
10753 | def MenuItem_GetDefaultMarginWidth(*args, **kwargs): |
10754 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
54f9ee45 | 10755 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
d14a1e28 RD |
10756 | |
10757 | #--------------------------------------------------------------------------- | |
10758 | ||
10759 | class Control(Window): | |
15afbcd0 RD |
10760 | """ |
10761 | This is the base class for a control or 'widget'. | |
10762 | ||
41e2b43e RD |
10763 | A control is generally a small window which processes user input |
10764 | and/or displays one or more item of data. | |
15afbcd0 | 10765 | """ |
e811c8ce RD |
10766 | def __repr__(self): |
10767 | return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 10768 | def __init__(self, *args, **kwargs): |
0df68c9f | 10769 | """ |
248ed943 RD |
10770 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10771 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10772 | String name=ControlNameStr) -> Control |
15afbcd0 | 10773 | |
41e2b43e RD |
10774 | Create a Control. Normally you should only call this from a subclass' |
10775 | __init__ as a plain old wx.Control is not very useful. | |
0df68c9f | 10776 | """ |
54f9ee45 | 10777 | newobj = _core_.new_Control(*args, **kwargs) |
d14a1e28 RD |
10778 | self.this = newobj.this |
10779 | self.thisown = 1 | |
10780 | del newobj.thisown | |
10781 | self._setOORInfo(self) | |
e811c8ce RD |
10782 | |
10783 | def Create(*args, **kwargs): | |
0df68c9f | 10784 | """ |
248ed943 RD |
10785 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10786 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10787 | String name=ControlNameStr) -> bool |
15afbcd0 RD |
10788 | |
10789 | Do the 2nd phase and create the GUI control. | |
0df68c9f | 10790 | """ |
54f9ee45 | 10791 | return _core_.Control_Create(*args, **kwargs) |
e811c8ce RD |
10792 | |
10793 | def Command(*args, **kwargs): | |
15afbcd0 | 10794 | """ |
a95a7133 | 10795 | Command(self, CommandEvent event) |
15afbcd0 | 10796 | |
41e2b43e RD |
10797 | Simulates the effect of the user issuing a command to the item. |
10798 | ||
10799 | :see: `wx.CommandEvent` | |
10800 | ||
15afbcd0 | 10801 | """ |
54f9ee45 | 10802 | return _core_.Control_Command(*args, **kwargs) |
e811c8ce RD |
10803 | |
10804 | def GetLabel(*args, **kwargs): | |
15afbcd0 | 10805 | """ |
a95a7133 | 10806 | GetLabel(self) -> String |
15afbcd0 RD |
10807 | |
10808 | Return a control's text. | |
10809 | """ | |
54f9ee45 | 10810 | return _core_.Control_GetLabel(*args, **kwargs) |
e811c8ce RD |
10811 | |
10812 | def SetLabel(*args, **kwargs): | |
15afbcd0 | 10813 | """ |
a95a7133 | 10814 | SetLabel(self, String label) |
15afbcd0 RD |
10815 | |
10816 | Sets the item's text. | |
10817 | """ | |
54f9ee45 | 10818 | return _core_.Control_SetLabel(*args, **kwargs) |
e811c8ce | 10819 | |
74a57fcd | 10820 | def GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 RD |
10821 | """ |
10822 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
10823 | ||
10824 | Get the default attributes for this class. This is useful if you want | |
10825 | to use the same font or colour in your own control as in a standard | |
10826 | control -- which is a much better idea than hard coding specific | |
10827 | colours or fonts which might look completely out of place on the | |
10828 | user's system, especially if it uses themes. | |
10829 | ||
10830 | The variant parameter is only relevant under Mac currently and is | |
10831 | ignore under other platforms. Under Mac, it will change the size of | |
10832 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10833 | this. | |
10834 | """ | |
54f9ee45 | 10835 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
10836 | |
10837 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
d14a1e28 RD |
10838 | |
10839 | class ControlPtr(Control): | |
10840 | def __init__(self, this): | |
10841 | self.this = this | |
10842 | if not hasattr(self,"thisown"): self.thisown = 0 | |
10843 | self.__class__ = Control | |
54f9ee45 | 10844 | _core_.Control_swigregister(ControlPtr) |
b2dc1044 | 10845 | ControlNameStr = cvar.ControlNameStr |
d14a1e28 RD |
10846 | |
10847 | def PreControl(*args, **kwargs): | |
15afbcd0 RD |
10848 | """ |
10849 | PreControl() -> Control | |
10850 | ||
10851 | Precreate a Control control for 2-phase creation | |
10852 | """ | |
54f9ee45 | 10853 | val = _core_.new_PreControl(*args, **kwargs) |
d14a1e28 RD |
10854 | val.thisown = 1 |
10855 | return val | |
10856 | ||
74a57fcd | 10857 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 RD |
10858 | """ |
10859 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
10860 | ||
10861 | Get the default attributes for this class. This is useful if you want | |
10862 | to use the same font or colour in your own control as in a standard | |
10863 | control -- which is a much better idea than hard coding specific | |
10864 | colours or fonts which might look completely out of place on the | |
10865 | user's system, especially if it uses themes. | |
10866 | ||
10867 | The variant parameter is only relevant under Mac currently and is | |
10868 | ignore under other platforms. Under Mac, it will change the size of | |
10869 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10870 | this. | |
10871 | """ | |
54f9ee45 | 10872 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 10873 | |
d14a1e28 RD |
10874 | #--------------------------------------------------------------------------- |
10875 | ||
10876 | class ItemContainer(object): | |
15afbcd0 | 10877 | """ |
53aa7709 RD |
10878 | The wx.ItemContainer class defines an interface which is implemented |
10879 | by all controls which have string subitems, each of which may be | |
10880 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
10881 | as `wx.ComboBox` which implements an extended interface deriving from | |
41e2b43e | 10882 | this one. |
15afbcd0 | 10883 | |
41e2b43e RD |
10884 | It defines the methods for accessing the control's items and although |
10885 | each of the derived classes implements them differently, they still | |
10886 | all conform to the same interface. | |
15afbcd0 | 10887 | |
41e2b43e RD |
10888 | The items in a wx.ItemContainer have (non empty) string labels and, |
10889 | optionally, client data associated with them. | |
15afbcd0 RD |
10890 | |
10891 | """ | |
d14a1e28 RD |
10892 | def __init__(self): raise RuntimeError, "No constructor defined" |
10893 | def __repr__(self): | |
10894 | return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
e811c8ce | 10895 | def Append(*args, **kwargs): |
15afbcd0 | 10896 | """ |
a95a7133 | 10897 | Append(self, String item, PyObject clientData=None) -> int |
15afbcd0 | 10898 | |
41e2b43e RD |
10899 | Adds the item to the control, associating the given data with the item |
10900 | if not None. The return value is the index of the newly added item | |
10901 | which may be different from the last one if the control is sorted (e.g. | |
10902 | has wx.LB_SORT or wx.CB_SORT style). | |
15afbcd0 | 10903 | """ |
54f9ee45 | 10904 | return _core_.ItemContainer_Append(*args, **kwargs) |
e811c8ce RD |
10905 | |
10906 | def AppendItems(*args, **kwargs): | |
15afbcd0 | 10907 | """ |
f5b96ee1 | 10908 | AppendItems(self, List strings) |
15afbcd0 | 10909 | |
41e2b43e RD |
10910 | Apend several items at once to the control. Notice that calling this |
10911 | method may be much faster than appending the items one by one if you | |
10912 | need to add a lot of items. | |
15afbcd0 | 10913 | """ |
54f9ee45 | 10914 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
e811c8ce RD |
10915 | |
10916 | def Insert(*args, **kwargs): | |
15afbcd0 | 10917 | """ |
a95a7133 | 10918 | Insert(self, String item, int pos, PyObject clientData=None) -> int |
15afbcd0 | 10919 | |
41e2b43e | 10920 | Insert an item into the control before the item at the ``pos`` index, |
15afbcd0 RD |
10921 | optionally associating some data object with the item. |
10922 | """ | |
54f9ee45 | 10923 | return _core_.ItemContainer_Insert(*args, **kwargs) |
e811c8ce RD |
10924 | |
10925 | def Clear(*args, **kwargs): | |
15afbcd0 | 10926 | """ |
a95a7133 | 10927 | Clear(self) |
15afbcd0 RD |
10928 | |
10929 | Removes all items from the control. | |
10930 | """ | |
54f9ee45 | 10931 | return _core_.ItemContainer_Clear(*args, **kwargs) |
e811c8ce RD |
10932 | |
10933 | def Delete(*args, **kwargs): | |
15afbcd0 | 10934 | """ |
a95a7133 | 10935 | Delete(self, int n) |
15afbcd0 | 10936 | |
41e2b43e RD |
10937 | Deletes the item at the zero-based index 'n' from the control. Note |
10938 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
10939 | enabled) to remove an item with the index negative or greater or equal | |
10940 | than the number of items in the control. | |
15afbcd0 | 10941 | """ |
54f9ee45 | 10942 | return _core_.ItemContainer_Delete(*args, **kwargs) |
e811c8ce | 10943 | |
53aa7709 RD |
10944 | def GetClientData(*args, **kwargs): |
10945 | """ | |
10946 | GetClientData(self, int n) -> PyObject | |
10947 | ||
10948 | Returns the client data associated with the given item, (if any.) | |
10949 | """ | |
10950 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
10951 | ||
10952 | def SetClientData(*args, **kwargs): | |
10953 | """ | |
10954 | SetClientData(self, int n, PyObject clientData) | |
10955 | ||
10956 | Associate the given client data with the item at position n. | |
10957 | """ | |
10958 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
10959 | ||
e811c8ce | 10960 | def GetCount(*args, **kwargs): |
15afbcd0 | 10961 | """ |
a95a7133 | 10962 | GetCount(self) -> int |
15afbcd0 RD |
10963 | |
10964 | Returns the number of items in the control. | |
10965 | """ | |
54f9ee45 | 10966 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
e811c8ce RD |
10967 | |
10968 | def IsEmpty(*args, **kwargs): | |
15afbcd0 | 10969 | """ |
a95a7133 | 10970 | IsEmpty(self) -> bool |
15afbcd0 RD |
10971 | |
10972 | Returns True if the control is empty or False if it has some items. | |
10973 | """ | |
54f9ee45 | 10974 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
e811c8ce RD |
10975 | |
10976 | def GetString(*args, **kwargs): | |
15afbcd0 | 10977 | """ |
a95a7133 | 10978 | GetString(self, int n) -> String |
15afbcd0 RD |
10979 | |
10980 | Returns the label of the item with the given index. | |
10981 | """ | |
54f9ee45 | 10982 | return _core_.ItemContainer_GetString(*args, **kwargs) |
e811c8ce RD |
10983 | |
10984 | def GetStrings(*args, **kwargs): | |
a95a7133 | 10985 | """GetStrings(self) -> wxArrayString""" |
54f9ee45 | 10986 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
e811c8ce RD |
10987 | |
10988 | def SetString(*args, **kwargs): | |
15afbcd0 | 10989 | """ |
a95a7133 | 10990 | SetString(self, int n, String s) |
15afbcd0 RD |
10991 | |
10992 | Sets the label for the given item. | |
10993 | """ | |
54f9ee45 | 10994 | return _core_.ItemContainer_SetString(*args, **kwargs) |
e811c8ce RD |
10995 | |
10996 | def FindString(*args, **kwargs): | |
15afbcd0 | 10997 | """ |
a95a7133 | 10998 | FindString(self, String s) -> int |
15afbcd0 RD |
10999 | |
11000 | Finds an item whose label matches the given string. Returns the | |
41e2b43e RD |
11001 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
11002 | found. | |
15afbcd0 | 11003 | """ |
54f9ee45 | 11004 | return _core_.ItemContainer_FindString(*args, **kwargs) |
e811c8ce | 11005 | |
53aa7709 | 11006 | def SetSelection(*args, **kwargs): |
15afbcd0 | 11007 | """ |
53aa7709 | 11008 | SetSelection(self, int n) |
15afbcd0 RD |
11009 | |
11010 | Sets the item at index 'n' to be the selected item. | |
11011 | """ | |
53aa7709 | 11012 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
e811c8ce RD |
11013 | |
11014 | def GetSelection(*args, **kwargs): | |
15afbcd0 | 11015 | """ |
a95a7133 | 11016 | GetSelection(self) -> int |
15afbcd0 | 11017 | |
41e2b43e RD |
11018 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
11019 | is selected. | |
15afbcd0 | 11020 | """ |
54f9ee45 | 11021 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
e811c8ce | 11022 | |
53aa7709 RD |
11023 | def SetStringSelection(*args, **kwargs): |
11024 | """SetStringSelection(self, String s) -> bool""" | |
11025 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
11026 | ||
e811c8ce | 11027 | def GetStringSelection(*args, **kwargs): |
15afbcd0 | 11028 | """ |
a95a7133 | 11029 | GetStringSelection(self) -> String |
15afbcd0 | 11030 | |
41e2b43e RD |
11031 | Returns the label of the selected item or an empty string if no item |
11032 | is selected. | |
15afbcd0 | 11033 | """ |
54f9ee45 | 11034 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
e811c8ce | 11035 | |
53aa7709 | 11036 | def Select(*args, **kwargs): |
15afbcd0 | 11037 | """ |
53aa7709 | 11038 | Select(self, int n) |
15afbcd0 | 11039 | |
53aa7709 RD |
11040 | This is the same as `SetSelection` and exists only because it is |
11041 | slightly more natural for controls which support multiple selection. | |
15afbcd0 | 11042 | """ |
53aa7709 | 11043 | return _core_.ItemContainer_Select(*args, **kwargs) |
e811c8ce | 11044 | |
d14a1e28 RD |
11045 | |
11046 | class ItemContainerPtr(ItemContainer): | |
11047 | def __init__(self, this): | |
11048 | self.this = this | |
11049 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11050 | self.__class__ = ItemContainer | |
54f9ee45 | 11051 | _core_.ItemContainer_swigregister(ItemContainerPtr) |
d14a1e28 RD |
11052 | |
11053 | #--------------------------------------------------------------------------- | |
11054 | ||
11055 | class ControlWithItems(Control,ItemContainer): | |
15afbcd0 | 11056 | """ |
41e2b43e RD |
11057 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
11058 | wx.Control class, and is used for the base class of various controls | |
11059 | that have items. | |
15afbcd0 | 11060 | """ |
d14a1e28 RD |
11061 | def __init__(self): raise RuntimeError, "No constructor defined" |
11062 | def __repr__(self): | |
11063 | return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11064 | ||
11065 | class ControlWithItemsPtr(ControlWithItems): | |
11066 | def __init__(self, this): | |
11067 | self.this = this | |
11068 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11069 | self.__class__ = ControlWithItems | |
54f9ee45 | 11070 | _core_.ControlWithItems_swigregister(ControlWithItemsPtr) |
d14a1e28 RD |
11071 | |
11072 | #--------------------------------------------------------------------------- | |
11073 | ||
11074 | class SizerItem(Object): | |
248ed943 RD |
11075 | """ |
11076 | The wx.SizerItem class is used to track the position, size and other | |
11077 | attributes of each item managed by a `wx.Sizer`. In normal usage user | |
11078 | code should never need to deal directly with a wx.SizerItem, but | |
11079 | custom classes derived from `wx.PySizer` will probably need to use the | |
11080 | collection of wx.SizerItems held by wx.Sizer when calculating layout. | |
11081 | ||
11082 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
11083 | """ | |
e811c8ce RD |
11084 | def __repr__(self): |
11085 | return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 11086 | def __init__(self, *args, **kwargs): |
248ed943 RD |
11087 | """ |
11088 | __init__(self) -> SizerItem | |
11089 | ||
11090 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
11091 | size will need to be set before this item can be used in a Sizer. | |
11092 | ||
11093 | You will probably never need to create a wx.SizerItem directly as they | |
11094 | are created automatically when the sizer's Add, Insert or Prepend | |
11095 | methods are called. | |
11096 | ||
11097 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
11098 | """ | |
54f9ee45 | 11099 | newobj = _core_.new_SizerItem(*args, **kwargs) |
d14a1e28 RD |
11100 | self.this = newobj.this |
11101 | self.thisown = 1 | |
11102 | del newobj.thisown | |
e811c8ce | 11103 | def DeleteWindows(*args, **kwargs): |
248ed943 RD |
11104 | """ |
11105 | DeleteWindows(self) | |
11106 | ||
11107 | Destroy the window or the windows in a subsizer, depending on the type | |
11108 | of item. | |
11109 | """ | |
54f9ee45 | 11110 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
11111 | |
11112 | def DetachSizer(*args, **kwargs): | |
248ed943 RD |
11113 | """ |
11114 | DetachSizer(self) | |
11115 | ||
11116 | Enable deleting the SizerItem without destroying the contained sizer. | |
11117 | """ | |
54f9ee45 | 11118 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
e811c8ce RD |
11119 | |
11120 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11121 | """ |
11122 | GetSize(self) -> Size | |
11123 | ||
11124 | Get the current size of the item, as set in the last Layout. | |
11125 | """ | |
54f9ee45 | 11126 | return _core_.SizerItem_GetSize(*args, **kwargs) |
e811c8ce RD |
11127 | |
11128 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11129 | """ |
11130 | CalcMin(self) -> Size | |
11131 | ||
11132 | Calculates the minimum desired size for the item, including any space | |
11133 | needed by borders. | |
11134 | """ | |
54f9ee45 | 11135 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
e811c8ce RD |
11136 | |
11137 | def SetDimension(*args, **kwargs): | |
248ed943 RD |
11138 | """ |
11139 | SetDimension(self, Point pos, Size size) | |
11140 | ||
11141 | Set the position and size of the space allocated for this item by the | |
11142 | sizer, and adjust the position and size of the item (window or | |
11143 | subsizer) to be within that space taking alignment and borders into | |
11144 | account. | |
11145 | """ | |
54f9ee45 | 11146 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
e811c8ce RD |
11147 | |
11148 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11149 | """ |
11150 | GetMinSize(self) -> Size | |
11151 | ||
11152 | Get the minimum size needed for the item. | |
11153 | """ | |
54f9ee45 | 11154 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
e811c8ce | 11155 | |
dfbb5885 RD |
11156 | def GetMinSizeWithBorder(*args, **kwargs): |
11157 | """ | |
11158 | GetMinSizeWithBorder(self) -> Size | |
11159 | ||
11160 | Get the minimum size needed for the item with space for the borders | |
11161 | added, if needed. | |
11162 | """ | |
11163 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
11164 | ||
e811c8ce | 11165 | def SetInitSize(*args, **kwargs): |
a95a7133 | 11166 | """SetInitSize(self, int x, int y)""" |
54f9ee45 | 11167 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
e811c8ce RD |
11168 | |
11169 | def SetRatioWH(*args, **kwargs): | |
248ed943 RD |
11170 | """ |
11171 | SetRatioWH(self, int width, int height) | |
11172 | ||
11173 | Set the ratio item attribute. | |
11174 | """ | |
54f9ee45 | 11175 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
e811c8ce RD |
11176 | |
11177 | def SetRatioSize(*args, **kwargs): | |
248ed943 RD |
11178 | """ |
11179 | SetRatioSize(self, Size size) | |
11180 | ||
11181 | Set the ratio item attribute. | |
11182 | """ | |
54f9ee45 | 11183 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
e811c8ce RD |
11184 | |
11185 | def SetRatio(*args, **kwargs): | |
248ed943 RD |
11186 | """ |
11187 | SetRatio(self, float ratio) | |
11188 | ||
11189 | Set the ratio item attribute. | |
11190 | """ | |
54f9ee45 | 11191 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
e811c8ce RD |
11192 | |
11193 | def GetRatio(*args, **kwargs): | |
248ed943 RD |
11194 | """ |
11195 | GetRatio(self) -> float | |
11196 | ||
11197 | Set the ratio item attribute. | |
11198 | """ | |
54f9ee45 | 11199 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
e811c8ce | 11200 | |
d3b6e4ff RD |
11201 | def GetRect(*args, **kwargs): |
11202 | """ | |
11203 | GetRect(self) -> Rect | |
11204 | ||
11205 | Returns the rectangle that the sizer item should occupy | |
11206 | """ | |
11207 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
11208 | ||
e811c8ce | 11209 | def IsWindow(*args, **kwargs): |
248ed943 RD |
11210 | """ |
11211 | IsWindow(self) -> bool | |
11212 | ||
11213 | Is this sizer item a window? | |
11214 | """ | |
54f9ee45 | 11215 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
e811c8ce RD |
11216 | |
11217 | def IsSizer(*args, **kwargs): | |
248ed943 RD |
11218 | """ |
11219 | IsSizer(self) -> bool | |
11220 | ||
11221 | Is this sizer item a subsizer? | |
11222 | """ | |
54f9ee45 | 11223 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
e811c8ce RD |
11224 | |
11225 | def IsSpacer(*args, **kwargs): | |
248ed943 RD |
11226 | """ |
11227 | IsSpacer(self) -> bool | |
11228 | ||
11229 | Is this sizer item a spacer? | |
11230 | """ | |
54f9ee45 | 11231 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
e811c8ce RD |
11232 | |
11233 | def SetProportion(*args, **kwargs): | |
248ed943 RD |
11234 | """ |
11235 | SetProportion(self, int proportion) | |
11236 | ||
11237 | Set the proportion value for this item. | |
11238 | """ | |
54f9ee45 | 11239 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
e811c8ce RD |
11240 | |
11241 | def GetProportion(*args, **kwargs): | |
248ed943 RD |
11242 | """ |
11243 | GetProportion(self) -> int | |
11244 | ||
11245 | Get the proportion value for this item. | |
11246 | """ | |
54f9ee45 | 11247 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
e811c8ce | 11248 | |
248ed943 RD |
11249 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
11250 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
e811c8ce | 11251 | def SetFlag(*args, **kwargs): |
248ed943 RD |
11252 | """ |
11253 | SetFlag(self, int flag) | |
11254 | ||
11255 | Set the flag value for this item. | |
11256 | """ | |
54f9ee45 | 11257 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
e811c8ce RD |
11258 | |
11259 | def GetFlag(*args, **kwargs): | |
248ed943 RD |
11260 | """ |
11261 | GetFlag(self) -> int | |
11262 | ||
11263 | Get the flag value for this item. | |
11264 | """ | |
54f9ee45 | 11265 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
e811c8ce RD |
11266 | |
11267 | def SetBorder(*args, **kwargs): | |
248ed943 RD |
11268 | """ |
11269 | SetBorder(self, int border) | |
11270 | ||
11271 | Set the border value for this item. | |
11272 | """ | |
54f9ee45 | 11273 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
e811c8ce RD |
11274 | |
11275 | def GetBorder(*args, **kwargs): | |
248ed943 RD |
11276 | """ |
11277 | GetBorder(self) -> int | |
11278 | ||
11279 | Get the border value for this item. | |
11280 | """ | |
54f9ee45 | 11281 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
e811c8ce RD |
11282 | |
11283 | def GetWindow(*args, **kwargs): | |
248ed943 RD |
11284 | """ |
11285 | GetWindow(self) -> Window | |
11286 | ||
11287 | Get the window (if any) that is managed by this sizer item. | |
11288 | """ | |
54f9ee45 | 11289 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
e811c8ce RD |
11290 | |
11291 | def SetWindow(*args, **kwargs): | |
248ed943 RD |
11292 | """ |
11293 | SetWindow(self, Window window) | |
11294 | ||
11295 | Set the window to be managed by this sizer item. | |
11296 | """ | |
54f9ee45 | 11297 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
e811c8ce RD |
11298 | |
11299 | def GetSizer(*args, **kwargs): | |
248ed943 RD |
11300 | """ |
11301 | GetSizer(self) -> Sizer | |
11302 | ||
11303 | Get the subsizer (if any) that is managed by this sizer item. | |
11304 | """ | |
54f9ee45 | 11305 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
e811c8ce RD |
11306 | |
11307 | def SetSizer(*args, **kwargs): | |
248ed943 RD |
11308 | """ |
11309 | SetSizer(self, Sizer sizer) | |
11310 | ||
11311 | Set the subsizer to be managed by this sizer item. | |
11312 | """ | |
54f9ee45 | 11313 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
e811c8ce RD |
11314 | |
11315 | def GetSpacer(*args, **kwargs): | |
248ed943 RD |
11316 | """ |
11317 | GetSpacer(self) -> Size | |
11318 | ||
11319 | Get the size of the spacer managed by this sizer item. | |
11320 | """ | |
54f9ee45 | 11321 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
e811c8ce RD |
11322 | |
11323 | def SetSpacer(*args, **kwargs): | |
248ed943 RD |
11324 | """ |
11325 | SetSpacer(self, Size size) | |
11326 | ||
11327 | Set the size of the spacer to be managed by this sizer item. | |
11328 | """ | |
54f9ee45 | 11329 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
e811c8ce RD |
11330 | |
11331 | def Show(*args, **kwargs): | |
248ed943 RD |
11332 | """ |
11333 | Show(self, bool show) | |
11334 | ||
11335 | Set the show item attribute, which sizers use to determine if the item | |
11336 | is to be made part of the layout or not. If the item is tracking a | |
11337 | window then it is shown or hidden as needed. | |
11338 | """ | |
54f9ee45 | 11339 | return _core_.SizerItem_Show(*args, **kwargs) |
e811c8ce RD |
11340 | |
11341 | def IsShown(*args, **kwargs): | |
248ed943 RD |
11342 | """ |
11343 | IsShown(self) -> bool | |
11344 | ||
11345 | Is the item to be shown in the layout? | |
11346 | """ | |
54f9ee45 | 11347 | return _core_.SizerItem_IsShown(*args, **kwargs) |
e811c8ce RD |
11348 | |
11349 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11350 | """ |
11351 | GetPosition(self) -> Point | |
11352 | ||
11353 | Returns the current position of the item, as set in the last Layout. | |
11354 | """ | |
54f9ee45 | 11355 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
e811c8ce RD |
11356 | |
11357 | def GetUserData(*args, **kwargs): | |
248ed943 RD |
11358 | """ |
11359 | GetUserData(self) -> PyObject | |
11360 | ||
11361 | Returns the userData associated with this sizer item, or None if there | |
11362 | isn't any. | |
11363 | """ | |
54f9ee45 | 11364 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
e811c8ce | 11365 | |
d14a1e28 RD |
11366 | |
11367 | class SizerItemPtr(SizerItem): | |
11368 | def __init__(self, this): | |
11369 | self.this = this | |
11370 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11371 | self.__class__ = SizerItem | |
54f9ee45 | 11372 | _core_.SizerItem_swigregister(SizerItemPtr) |
d14a1e28 | 11373 | |
248ed943 | 11374 | def SizerItemWindow(*args, **kwargs): |
0df68c9f | 11375 | """ |
248ed943 RD |
11376 | SizerItemWindow(Window window, int proportion, int flag, int border, |
11377 | PyObject userData=None) -> SizerItem | |
11378 | ||
11379 | Constructs a `wx.SizerItem` for tracking a window. | |
0df68c9f | 11380 | """ |
248ed943 | 11381 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
11382 | val.thisown = 1 |
11383 | return val | |
11384 | ||
248ed943 | 11385 | def SizerItemSpacer(*args, **kwargs): |
0df68c9f | 11386 | """ |
248ed943 RD |
11387 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
11388 | PyObject userData=None) -> SizerItem | |
11389 | ||
11390 | Constructs a `wx.SizerItem` for tracking a spacer. | |
0df68c9f | 11391 | """ |
248ed943 | 11392 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
11393 | val.thisown = 1 |
11394 | return val | |
11395 | ||
11396 | def SizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
11397 | """ |
11398 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
248ed943 RD |
11399 | PyObject userData=None) -> SizerItem |
11400 | ||
11401 | Constructs a `wx.SizerItem` for tracking a subsizer | |
0df68c9f | 11402 | """ |
54f9ee45 | 11403 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
11404 | val.thisown = 1 |
11405 | return val | |
11406 | ||
11407 | class Sizer(Object): | |
248ed943 RD |
11408 | """ |
11409 | wx.Sizer is the abstract base class used for laying out subwindows in | |
11410 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
11411 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
11412 | `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer` | |
11413 | and `wx.GridBagSizer`. | |
11414 | ||
11415 | The concept implemented by sizers in wxWidgets is closely related to | |
11416 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
11417 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
11418 | subwindows reporting their minimal required size and their ability to | |
11419 | get stretched if the size of the parent window has changed. This will | |
11420 | most often mean that the programmer does not set the original size of | |
11421 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
11422 | this sizer will be queried about the recommended size. The sizer in | |
11423 | turn will query its children, which can be normal windows or contorls, | |
11424 | empty space or other sizers, so that a hierarchy of sizers can be | |
11425 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
11426 | do not interfere with tab ordering and requires very little resources | |
11427 | compared to a real window on screen. | |
11428 | ||
11429 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
11430 | every control reports its own minimal size and the algorithm can | |
11431 | handle differences in font sizes or different window (dialog item) | |
11432 | sizes on different platforms without problems. If for example the | |
11433 | standard font as well as the overall design of Mac widgets requires | |
11434 | more space than on Windows, then the initial size of a dialog using a | |
11435 | sizer will automatically be bigger on Mac than on Windows. | |
11436 | """ | |
e811c8ce RD |
11437 | def __init__(self): raise RuntimeError, "No constructor defined" |
11438 | def __repr__(self): | |
11439 | return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11440 | def _setOORInfo(*args, **kwargs): | |
a95a7133 | 11441 | """_setOORInfo(self, PyObject _self)""" |
54f9ee45 | 11442 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
e811c8ce RD |
11443 | |
11444 | def Add(*args, **kwargs): | |
0df68c9f | 11445 | """ |
248ed943 | 11446 | Add(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11447 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11448 | |
11449 | Appends a child item to the sizer. | |
0df68c9f | 11450 | """ |
54f9ee45 | 11451 | return _core_.Sizer_Add(*args, **kwargs) |
e811c8ce RD |
11452 | |
11453 | def Insert(*args, **kwargs): | |
0df68c9f | 11454 | """ |
248ed943 | 11455 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11456 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11457 | |
11458 | Inserts a new item into the list of items managed by this sizer before | |
11459 | the item at index *before*. See `Add` for a description of the parameters. | |
0df68c9f | 11460 | """ |
54f9ee45 | 11461 | return _core_.Sizer_Insert(*args, **kwargs) |
e811c8ce RD |
11462 | |
11463 | def Prepend(*args, **kwargs): | |
0df68c9f | 11464 | """ |
248ed943 | 11465 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11466 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11467 | |
11468 | Adds a new item to the begining of the list of sizer items managed by | |
11469 | this sizer. See `Add` for a description of the parameters. | |
0df68c9f | 11470 | """ |
54f9ee45 | 11471 | return _core_.Sizer_Prepend(*args, **kwargs) |
e811c8ce RD |
11472 | |
11473 | def Remove(*args, **kwargs): | |
248ed943 RD |
11474 | """ |
11475 | Remove(self, item) -> bool | |
11476 | ||
11477 | Removes an item from the sizer and destroys it. This method does not | |
11478 | cause any layout or resizing to take place, call `Layout` to update | |
11479 | the layout on screen after removing a child from the sizer. The | |
11480 | *item* parameter can be either a window, a sizer, or the zero-based | |
11481 | index of an item to remove. Returns True if the child item was found | |
11482 | and removed. | |
11483 | """ | |
54f9ee45 | 11484 | return _core_.Sizer_Remove(*args, **kwargs) |
e811c8ce | 11485 | |
1c0f361b | 11486 | def Detach(*args, **kwargs): |
248ed943 RD |
11487 | """ |
11488 | Detach(self, item) -> bool | |
11489 | ||
11490 | Detaches an item from the sizer without destroying it. This method | |
11491 | does not cause any layout or resizing to take place, call `Layout` to | |
11492 | do so. The *item* parameter can be either a window, a sizer, or the | |
11493 | zero-based index of the item to be detached. Returns True if the child item | |
11494 | was found and detached. | |
11495 | """ | |
1c0f361b RD |
11496 | return _core_.Sizer_Detach(*args, **kwargs) |
11497 | ||
d3b6e4ff RD |
11498 | def GetItem(*args, **kwargs): |
11499 | """ | |
11500 | GetItem(self, item) -> wx.SizerItem | |
11501 | ||
11502 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11503 | parameter can be either a window, a sizer, or the zero-based index of | |
11504 | the item to be detached. | |
11505 | """ | |
11506 | return _core_.Sizer_GetItem(*args, **kwargs) | |
11507 | ||
e811c8ce | 11508 | def _SetItemMinSize(*args, **kwargs): |
a95a7133 | 11509 | """_SetItemMinSize(self, PyObject item, Size size)""" |
54f9ee45 | 11510 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) |
e811c8ce | 11511 | |
248ed943 RD |
11512 | def SetItemMinSize(self, item, *args): |
11513 | """ | |
11514 | SetItemMinSize(self, item, Size size) | |
11515 | ||
11516 | Sets the minimum size that will be allocated for an item in the sizer. | |
11517 | The *item* parameter can be either a window, a sizer, or the | |
11518 | zero-based index of the item. If a window or sizer is given then it | |
11519 | will be searched for recursivly in subsizers if neccessary. | |
11520 | """ | |
11521 | if len(args) == 2: | |
11522 | # for backward compatibility accept separate width,height args too | |
11523 | return self._SetItemMinSize(item, args) | |
11524 | else: | |
11525 | return self._SetItemMinSize(item, args[0]) | |
11526 | ||
e811c8ce | 11527 | def AddItem(*args, **kwargs): |
248ed943 RD |
11528 | """ |
11529 | AddItem(self, SizerItem item) | |
11530 | ||
11531 | Adds a `wx.SizerItem` to the sizer. | |
11532 | """ | |
54f9ee45 | 11533 | return _core_.Sizer_AddItem(*args, **kwargs) |
e811c8ce RD |
11534 | |
11535 | def InsertItem(*args, **kwargs): | |
248ed943 RD |
11536 | """ |
11537 | InsertItem(self, int index, SizerItem item) | |
11538 | ||
11539 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11540 | """ | |
54f9ee45 | 11541 | return _core_.Sizer_InsertItem(*args, **kwargs) |
e811c8ce RD |
11542 | |
11543 | def PrependItem(*args, **kwargs): | |
248ed943 RD |
11544 | """ |
11545 | PrependItem(self, SizerItem item) | |
11546 | ||
11547 | Prepends a `wx.SizerItem` to the sizer. | |
11548 | """ | |
54f9ee45 | 11549 | return _core_.Sizer_PrependItem(*args, **kwargs) |
e811c8ce | 11550 | |
248ed943 | 11551 | def AddMany(self, items): |
66c033b4 RD |
11552 | """ |
11553 | AddMany is a convenience method for adding several items | |
11554 | to a sizer at one time. Simply pass it a list of tuples, | |
11555 | where each tuple consists of the parameters that you | |
11556 | would normally pass to the `Add` method. | |
11557 | """ | |
248ed943 RD |
11558 | for item in items: |
11559 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11560 | item = (item, ) | |
11561 | self.Add(*item) | |
d14a1e28 | 11562 | |
74e96f3d | 11563 | # for backwards compatibility only, please do not use in new code |
b9d6a5f3 RD |
11564 | def AddWindow(self, *args, **kw): |
11565 | """Compatibility alias for `Add`.""" | |
11566 | return self.Add(*args, **kw) | |
11567 | def AddSizer(self, *args, **kw): | |
11568 | """Compatibility alias for `Add`.""" | |
11569 | return self.Add(*args, **kw) | |
11570 | def AddSpacer(self, *args, **kw): | |
11571 | """Compatibility alias for `Add`.""" | |
11572 | return self.Add(*args, **kw) | |
11573 | ||
11574 | def PrependWindow(self, *args, **kw): | |
11575 | """Compatibility alias for `Prepend`.""" | |
11576 | return self.Prepend(*args, **kw) | |
11577 | def PrependSizer(self, *args, **kw): | |
11578 | """Compatibility alias for `Prepend`.""" | |
11579 | return self.Prepend(*args, **kw) | |
11580 | def PrependSpacer(self, *args, **kw): | |
11581 | """Compatibility alias for `Prepend`.""" | |
11582 | return self.Prepend(*args, **kw) | |
11583 | ||
11584 | def InsertWindow(self, *args, **kw): | |
11585 | """Compatibility alias for `Insert`.""" | |
11586 | return self.Insert(*args, **kw) | |
11587 | def InsertSizer(self, *args, **kw): | |
11588 | """Compatibility alias for `Insert`.""" | |
11589 | return self.Insert(*args, **kw) | |
11590 | def InsertSpacer(self, *args, **kw): | |
11591 | """Compatibility alias for `Insert`.""" | |
11592 | return self.Insert(*args, **kw) | |
11593 | ||
11594 | def RemoveWindow(self, *args, **kw): | |
11595 | """Compatibility alias for `Remove`.""" | |
11596 | return self.Remove(*args, **kw) | |
11597 | def RemoveSizer(self, *args, **kw): | |
11598 | """Compatibility alias for `Remove`.""" | |
11599 | return self.Remove(*args, **kw) | |
11600 | def RemovePos(self, *args, **kw): | |
11601 | """Compatibility alias for `Remove`.""" | |
11602 | return self.Remove(*args, **kw) | |
d14a1e28 RD |
11603 | |
11604 | ||
e811c8ce | 11605 | def SetDimension(*args, **kwargs): |
248ed943 RD |
11606 | """ |
11607 | SetDimension(self, int x, int y, int width, int height) | |
11608 | ||
11609 | Call this to force the sizer to take the given dimension and thus | |
11610 | force the items owned by the sizer to resize themselves according to | |
11611 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11612 | methods. | |
11613 | """ | |
54f9ee45 | 11614 | return _core_.Sizer_SetDimension(*args, **kwargs) |
e811c8ce RD |
11615 | |
11616 | def SetMinSize(*args, **kwargs): | |
248ed943 RD |
11617 | """ |
11618 | SetMinSize(self, Size size) | |
11619 | ||
11620 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11621 | calculate its minimal size based purely on how much space its children | |
11622 | need. After calling this method `GetMinSize` will return either the | |
11623 | minimal size as requested by its children or the minimal size set | |
11624 | here, depending on which is bigger. | |
11625 | """ | |
54f9ee45 | 11626 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
e811c8ce RD |
11627 | |
11628 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11629 | """ |
11630 | GetSize(self) -> Size | |
11631 | ||
11632 | Returns the current size of the space managed by the sizer. | |
11633 | """ | |
54f9ee45 | 11634 | return _core_.Sizer_GetSize(*args, **kwargs) |
e811c8ce RD |
11635 | |
11636 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11637 | """ |
11638 | GetPosition(self) -> Point | |
11639 | ||
11640 | Returns the current position of the sizer's managed space. | |
11641 | """ | |
54f9ee45 | 11642 | return _core_.Sizer_GetPosition(*args, **kwargs) |
e811c8ce RD |
11643 | |
11644 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11645 | """ |
11646 | GetMinSize(self) -> Size | |
11647 | ||
11648 | Returns the minimal size of the sizer. This is either the combined | |
11649 | minimal size of all the children and their borders or the minimal size | |
11650 | set by SetMinSize, depending on which is bigger. | |
11651 | """ | |
54f9ee45 | 11652 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
e811c8ce | 11653 | |
d14a1e28 | 11654 | def GetSizeTuple(self): |
1c0f361b | 11655 | return self.GetSize().Get() |
d14a1e28 | 11656 | def GetPositionTuple(self): |
1c0f361b | 11657 | return self.GetPosition().Get() |
d14a1e28 | 11658 | def GetMinSizeTuple(self): |
1c0f361b | 11659 | return self.GetMinSize().Get() |
d14a1e28 | 11660 | |
e811c8ce | 11661 | def RecalcSizes(*args, **kwargs): |
248ed943 RD |
11662 | """ |
11663 | RecalcSizes(self) | |
11664 | ||
11665 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11666 | items managed by this sizer. You should not need to call this directly as | |
11667 | it is called by `Layout`. | |
11668 | """ | |
54f9ee45 | 11669 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
e811c8ce RD |
11670 | |
11671 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11672 | """ |
11673 | CalcMin(self) -> Size | |
11674 | ||
11675 | This method is where the sizer will do the actual calculation of its | |
11676 | children's minimal sizes. You should not need to call this directly as | |
11677 | it is called by `Layout`. | |
11678 | """ | |
54f9ee45 | 11679 | return _core_.Sizer_CalcMin(*args, **kwargs) |
e811c8ce RD |
11680 | |
11681 | def Layout(*args, **kwargs): | |
248ed943 RD |
11682 | """ |
11683 | Layout(self) | |
11684 | ||
11685 | This method will force the recalculation and layout of the items | |
11686 | controlled by the sizer using the current space allocated to the | |
11687 | sizer. Normally this is called automatically from the owning window's | |
11688 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11689 | one of the items in a sizer change size, or items are added or | |
11690 | removed. | |
11691 | """ | |
54f9ee45 | 11692 | return _core_.Sizer_Layout(*args, **kwargs) |
e811c8ce RD |
11693 | |
11694 | def Fit(*args, **kwargs): | |
248ed943 RD |
11695 | """ |
11696 | Fit(self, Window window) -> Size | |
11697 | ||
11698 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11699 | size. This is commonly done in the constructor of the window itself in | |
11700 | order to set its initial size to match the needs of the children as | |
11701 | determined by the sizer. Returns the new size. | |
11702 | ||
11703 | For a top level window this is the total window size, not the client size. | |
11704 | """ | |
54f9ee45 | 11705 | return _core_.Sizer_Fit(*args, **kwargs) |
e811c8ce RD |
11706 | |
11707 | def FitInside(*args, **kwargs): | |
248ed943 RD |
11708 | """ |
11709 | FitInside(self, Window window) | |
11710 | ||
11711 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
11712 | sizer's minimal size. This will not alter the on screen size of the | |
11713 | window, but may cause the addition/removal/alteration of scrollbars | |
11714 | required to view the virtual area in windows which manage it. | |
11715 | ||
11716 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
11717 | ||
11718 | """ | |
54f9ee45 | 11719 | return _core_.Sizer_FitInside(*args, **kwargs) |
e811c8ce RD |
11720 | |
11721 | def SetSizeHints(*args, **kwargs): | |
248ed943 RD |
11722 | """ |
11723 | SetSizeHints(self, Window window) | |
11724 | ||
11725 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
11726 | match the sizer's minimal size. This is commonly done in the | |
11727 | constructor of the window itself if the window is resizable (as are | |
11728 | many dialogs under Unix and frames on probably all platforms) in order | |
11729 | to prevent the window from being sized smaller than the minimal size | |
11730 | required by the sizer. | |
11731 | """ | |
54f9ee45 | 11732 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
e811c8ce RD |
11733 | |
11734 | def SetVirtualSizeHints(*args, **kwargs): | |
248ed943 RD |
11735 | """ |
11736 | SetVirtualSizeHints(self, Window window) | |
11737 | ||
11738 | Tell the sizer to set the minimal size of the window virtual area to | |
11739 | match the sizer's minimal size. For windows with managed scrollbars | |
11740 | this will set them appropriately. | |
11741 | ||
11742 | :see: `wx.ScrolledWindow.SetScrollbars` | |
11743 | ||
11744 | """ | |
54f9ee45 | 11745 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
e811c8ce RD |
11746 | |
11747 | def Clear(*args, **kwargs): | |
248ed943 RD |
11748 | """ |
11749 | Clear(self, bool deleteWindows=False) | |
11750 | ||
11751 | Clear all items from the sizer, optionally destroying the window items | |
11752 | as well. | |
11753 | """ | |
54f9ee45 | 11754 | return _core_.Sizer_Clear(*args, **kwargs) |
e811c8ce RD |
11755 | |
11756 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
11757 | """ |
11758 | DeleteWindows(self) | |
11759 | ||
11760 | Destroy all windows managed by the sizer. | |
11761 | """ | |
54f9ee45 | 11762 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
11763 | |
11764 | def GetChildren(*args, **kwargs): | |
248ed943 | 11765 | """ |
51b83b37 | 11766 | GetChildren(self) -> list |
248ed943 RD |
11767 | |
11768 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
11769 | """ | |
54f9ee45 | 11770 | return _core_.Sizer_GetChildren(*args, **kwargs) |
e811c8ce RD |
11771 | |
11772 | def Show(*args, **kwargs): | |
248ed943 | 11773 | """ |
ae8162c8 | 11774 | Show(self, item, bool show=True, bool recursive=false) -> bool |
e811c8ce | 11775 | |
248ed943 RD |
11776 | Shows or hides an item managed by the sizer. To make a sizer item |
11777 | disappear or reappear, use Show followed by `Layout`. The *item* | |
11778 | parameter can be either a window, a sizer, or the zero-based index of | |
7e63a440 RD |
11779 | the item. Use the recursive parameter to show or hide an item in a |
11780 | subsizer. Returns True if the item was found. | |
248ed943 RD |
11781 | """ |
11782 | return _core_.Sizer_Show(*args, **kwargs) | |
e811c8ce RD |
11783 | |
11784 | def IsShown(*args, **kwargs): | |
248ed943 RD |
11785 | """ |
11786 | IsShown(self, item) | |
11787 | ||
11788 | Determines if the item is currently shown. sizer. To make a sizer | |
11789 | item disappear or reappear, use Show followed by `Layout`. The *item* | |
11790 | parameter can be either a window, a sizer, or the zero-based index of | |
11791 | the item. | |
11792 | """ | |
54f9ee45 | 11793 | return _core_.Sizer_IsShown(*args, **kwargs) |
e811c8ce | 11794 | |
7e63a440 | 11795 | def Hide(self, item, recursive=False): |
248ed943 | 11796 | """ |
27fb7603 | 11797 | A convenience method for `Show` (item, False, recursive). |
248ed943 | 11798 | """ |
06759a38 | 11799 | return self.Show(item, False, recursive) |
248ed943 | 11800 | |
e811c8ce | 11801 | def ShowItems(*args, **kwargs): |
248ed943 RD |
11802 | """ |
11803 | ShowItems(self, bool show) | |
11804 | ||
84f85550 | 11805 | Recursively call `wx.SizerItem.Show` on all sizer items. |
248ed943 | 11806 | """ |
54f9ee45 | 11807 | return _core_.Sizer_ShowItems(*args, **kwargs) |
e811c8ce | 11808 | |
d14a1e28 RD |
11809 | |
11810 | class SizerPtr(Sizer): | |
11811 | def __init__(self, this): | |
11812 | self.this = this | |
11813 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11814 | self.__class__ = Sizer | |
54f9ee45 | 11815 | _core_.Sizer_swigregister(SizerPtr) |
d14a1e28 RD |
11816 | |
11817 | class PySizer(Sizer): | |
248ed943 RD |
11818 | """ |
11819 | wx.PySizer is a special version of `wx.Sizer` that has been | |
11820 | instrumented to allow the C++ virtual methods to be overloaded in | |
11821 | Python derived classes. You would derive from this class if you are | |
11822 | wanting to implement a custom sizer in Python code. Simply implement | |
11823 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
11824 | For example:: | |
11825 | ||
11826 | class MySizer(wx.PySizer): | |
11827 | def __init__(self): | |
11828 | wx.PySizer.__init__(self) | |
11829 | ||
11830 | def CalcMin(self): | |
11831 | for item in self.GetChildren(): | |
11832 | # calculate the total minimum width and height needed | |
11833 | # by all items in the sizer according to this sizer's | |
11834 | # layout algorithm. | |
11835 | ... | |
11836 | return wx.Size(width, height) | |
11837 | ||
11838 | def RecalcSizes(self): | |
11839 | # find the space allotted to this sizer | |
11840 | pos = self.GetPosition() | |
11841 | size = self.GetSize() | |
11842 | for item in self.GetChildren(): | |
11843 | # Recalculate (if necessary) the position and size of | |
11844 | # each item and then call item.SetDimension to do the | |
11845 | # actual positioning and sizing of the items within the | |
11846 | # space alloted to this sizer. | |
11847 | ... | |
11848 | item.SetDimension(itemPos, itemSize) | |
11849 | ||
11850 | ||
11851 | When `Layout` is called it first calls `CalcMin` followed by | |
11852 | `RecalcSizes` so you can optimize a bit by saving the results of | |
e505d15e | 11853 | `CalcMin` and reusing them in `RecalcSizes`. |
248ed943 RD |
11854 | |
11855 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
11856 | ||
11857 | ||
11858 | """ | |
e811c8ce RD |
11859 | def __repr__(self): |
11860 | return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 11861 | def __init__(self, *args, **kwargs): |
248ed943 RD |
11862 | """ |
11863 | __init__(self) -> PySizer | |
11864 | ||
11865 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
11866 | class. | |
11867 | """ | |
54f9ee45 | 11868 | newobj = _core_.new_PySizer(*args, **kwargs) |
d14a1e28 RD |
11869 | self.this = newobj.this |
11870 | self.thisown = 1 | |
11871 | del newobj.thisown | |
11872 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) | |
e811c8ce RD |
11873 | |
11874 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 11875 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 11876 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
e811c8ce | 11877 | |
d14a1e28 RD |
11878 | |
11879 | class PySizerPtr(PySizer): | |
11880 | def __init__(self, this): | |
11881 | self.this = this | |
11882 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11883 | self.__class__ = PySizer | |
54f9ee45 | 11884 | _core_.PySizer_swigregister(PySizerPtr) |
d14a1e28 RD |
11885 | |
11886 | #--------------------------------------------------------------------------- | |
11887 | ||
11888 | class BoxSizer(Sizer): | |
248ed943 RD |
11889 | """ |
11890 | The basic idea behind a box sizer is that windows will most often be | |
11891 | laid out in rather simple basic geometry, typically in a row or a | |
11892 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
11893 | its items in a simple row or column, depending on the orientation | |
11894 | parameter passed to the constructor. | |
11895 | """ | |
e811c8ce RD |
11896 | def __repr__(self): |
11897 | return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 11898 | def __init__(self, *args, **kwargs): |
248ed943 RD |
11899 | """ |
11900 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
11901 | ||
11902 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
11903 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
11904 | sizer. | |
11905 | """ | |
54f9ee45 | 11906 | newobj = _core_.new_BoxSizer(*args, **kwargs) |
d14a1e28 RD |
11907 | self.this = newobj.this |
11908 | self.thisown = 1 | |
11909 | del newobj.thisown | |
11910 | self._setOORInfo(self) | |
e811c8ce RD |
11911 | |
11912 | def GetOrientation(*args, **kwargs): | |
248ed943 RD |
11913 | """ |
11914 | GetOrientation(self) -> int | |
11915 | ||
11916 | Returns the current orientation of the sizer. | |
11917 | """ | |
54f9ee45 | 11918 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
e811c8ce RD |
11919 | |
11920 | def SetOrientation(*args, **kwargs): | |
248ed943 RD |
11921 | """ |
11922 | SetOrientation(self, int orient) | |
e811c8ce | 11923 | |
248ed943 RD |
11924 | Resets the orientation of the sizer. |
11925 | """ | |
11926 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
e811c8ce | 11927 | |
d14a1e28 RD |
11928 | |
11929 | class BoxSizerPtr(BoxSizer): | |
11930 | def __init__(self, this): | |
11931 | self.this = this | |
11932 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11933 | self.__class__ = BoxSizer | |
54f9ee45 | 11934 | _core_.BoxSizer_swigregister(BoxSizerPtr) |
d14a1e28 RD |
11935 | |
11936 | #--------------------------------------------------------------------------- | |
11937 | ||
11938 | class StaticBoxSizer(BoxSizer): | |
248ed943 RD |
11939 | """ |
11940 | wx.StaticBoxSizer derives from and functions identically to the | |
11941 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
11942 | manages. Note that this static box must be created separately and | |
11943 | passed to the sizer constructor. | |
11944 | """ | |
e811c8ce RD |
11945 | def __repr__(self): |
11946 | return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 11947 | def __init__(self, *args, **kwargs): |
248ed943 RD |
11948 | """ |
11949 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
11950 | ||
11951 | Constructor. It takes an associated static box and the orientation | |
11952 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
11953 | ``wx.HORIZONTAL``. | |
11954 | """ | |
54f9ee45 | 11955 | newobj = _core_.new_StaticBoxSizer(*args, **kwargs) |
d14a1e28 RD |
11956 | self.this = newobj.this |
11957 | self.thisown = 1 | |
11958 | del newobj.thisown | |
11959 | self._setOORInfo(self) | |
e811c8ce RD |
11960 | |
11961 | def GetStaticBox(*args, **kwargs): | |
248ed943 RD |
11962 | """ |
11963 | GetStaticBox(self) -> StaticBox | |
e811c8ce | 11964 | |
248ed943 RD |
11965 | Returns the static box associated with this sizer. |
11966 | """ | |
11967 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
e811c8ce | 11968 | |
d14a1e28 RD |
11969 | |
11970 | class StaticBoxSizerPtr(StaticBoxSizer): | |
11971 | def __init__(self, this): | |
11972 | self.this = this | |
11973 | if not hasattr(self,"thisown"): self.thisown = 0 | |
11974 | self.__class__ = StaticBoxSizer | |
54f9ee45 | 11975 | _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr) |
d14a1e28 RD |
11976 | |
11977 | #--------------------------------------------------------------------------- | |
11978 | ||
11979 | class GridSizer(Sizer): | |
248ed943 RD |
11980 | """ |
11981 | A grid sizer is a sizer which lays out its children in a | |
11982 | two-dimensional table with all cells having the same size. In other | |
11983 | words, the width of each cell within the grid is the width of the | |
11984 | widest item added to the sizer and the height of each grid cell is the | |
11985 | height of the tallest item. An optional vertical and/or horizontal | |
11986 | gap between items can also be specified (in pixels.) | |
11987 | ||
11988 | Items are placed in the cells of the grid in the order they are added, | |
11989 | in row-major order. In other words, the first row is filled first, | |
11990 | then the second, and so on until all items have been added. (If | |
11991 | neccessary, additional rows will be added as items are added.) If you | |
11992 | need to have greater control over the cells that items are placed in | |
11993 | then use the `wx.GridBagSizer`. | |
11994 | ||
11995 | """ | |
e811c8ce RD |
11996 | def __repr__(self): |
11997 | return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 11998 | def __init__(self, *args, **kwargs): |
248ed943 RD |
11999 | """ |
12000 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
12001 | ||
12002 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
12003 | of columns and rows in the sizer - if either of the parameters is | |
12004 | zero, it will be calculated to from the total number of children in | |
12005 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12006 | define extra space between all children. | |
12007 | """ | |
54f9ee45 | 12008 | newobj = _core_.new_GridSizer(*args, **kwargs) |
d14a1e28 RD |
12009 | self.this = newobj.this |
12010 | self.thisown = 1 | |
12011 | del newobj.thisown | |
12012 | self._setOORInfo(self) | |
e811c8ce | 12013 | |
e811c8ce | 12014 | def SetCols(*args, **kwargs): |
248ed943 RD |
12015 | """ |
12016 | SetCols(self, int cols) | |
12017 | ||
12018 | Sets the number of columns in the sizer. | |
12019 | """ | |
54f9ee45 | 12020 | return _core_.GridSizer_SetCols(*args, **kwargs) |
e811c8ce RD |
12021 | |
12022 | def SetRows(*args, **kwargs): | |
248ed943 RD |
12023 | """ |
12024 | SetRows(self, int rows) | |
12025 | ||
12026 | Sets the number of rows in the sizer. | |
12027 | """ | |
54f9ee45 | 12028 | return _core_.GridSizer_SetRows(*args, **kwargs) |
e811c8ce RD |
12029 | |
12030 | def SetVGap(*args, **kwargs): | |
248ed943 RD |
12031 | """ |
12032 | SetVGap(self, int gap) | |
12033 | ||
12034 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
12035 | """ | |
54f9ee45 | 12036 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
e811c8ce RD |
12037 | |
12038 | def SetHGap(*args, **kwargs): | |
248ed943 RD |
12039 | """ |
12040 | SetHGap(self, int gap) | |
12041 | ||
12042 | Sets the horizontal gap (in pixels) between cells in the sizer | |
12043 | """ | |
54f9ee45 | 12044 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
e811c8ce RD |
12045 | |
12046 | def GetCols(*args, **kwargs): | |
248ed943 RD |
12047 | """ |
12048 | GetCols(self) -> int | |
12049 | ||
12050 | Returns the number of columns in the sizer. | |
12051 | """ | |
54f9ee45 | 12052 | return _core_.GridSizer_GetCols(*args, **kwargs) |
e811c8ce RD |
12053 | |
12054 | def GetRows(*args, **kwargs): | |
248ed943 RD |
12055 | """ |
12056 | GetRows(self) -> int | |
12057 | ||
12058 | Returns the number of rows in the sizer. | |
12059 | """ | |
54f9ee45 | 12060 | return _core_.GridSizer_GetRows(*args, **kwargs) |
e811c8ce RD |
12061 | |
12062 | def GetVGap(*args, **kwargs): | |
248ed943 RD |
12063 | """ |
12064 | GetVGap(self) -> int | |
12065 | ||
12066 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
12067 | """ | |
54f9ee45 | 12068 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
e811c8ce RD |
12069 | |
12070 | def GetHGap(*args, **kwargs): | |
248ed943 RD |
12071 | """ |
12072 | GetHGap(self) -> int | |
12073 | ||
12074 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
12075 | """ | |
54f9ee45 | 12076 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
e811c8ce | 12077 | |
d14a1e28 RD |
12078 | |
12079 | class GridSizerPtr(GridSizer): | |
12080 | def __init__(self, this): | |
12081 | self.this = this | |
12082 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12083 | self.__class__ = GridSizer | |
54f9ee45 | 12084 | _core_.GridSizer_swigregister(GridSizerPtr) |
d14a1e28 RD |
12085 | |
12086 | #--------------------------------------------------------------------------- | |
12087 | ||
54f9ee45 RD |
12088 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
12089 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
12090 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
d14a1e28 | 12091 | class FlexGridSizer(GridSizer): |
248ed943 RD |
12092 | """ |
12093 | A flex grid sizer is a sizer which lays out its children in a | |
12094 | two-dimensional table with all table cells in one row having the same | |
12095 | height and all cells in one column having the same width, but all | |
12096 | rows or all columns are not necessarily the same height or width as in | |
12097 | the `wx.GridSizer`. | |
12098 | ||
12099 | wx.FlexGridSizer can also size items equally in one direction but | |
12100 | unequally ("flexibly") in the other. If the sizer is only flexible | |
12101 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
12102 | needs to be decided how the sizer should grow in the other ("non | |
12103 | flexible") direction in order to fill the available space. The | |
12104 | `SetNonFlexibleGrowMode` method serves this purpose. | |
12105 | ||
12106 | ||
12107 | """ | |
e811c8ce RD |
12108 | def __repr__(self): |
12109 | return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 12110 | def __init__(self, *args, **kwargs): |
248ed943 RD |
12111 | """ |
12112 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
12113 | ||
12114 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
12115 | number of columns and rows in the sizer - if either of the parameters | |
12116 | is zero, it will be calculated to from the total number of children in | |
12117 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12118 | define extra space between all children. | |
12119 | """ | |
54f9ee45 | 12120 | newobj = _core_.new_FlexGridSizer(*args, **kwargs) |
d14a1e28 RD |
12121 | self.this = newobj.this |
12122 | self.thisown = 1 | |
12123 | del newobj.thisown | |
12124 | self._setOORInfo(self) | |
e811c8ce | 12125 | |
248ed943 RD |
12126 | def AddGrowableRow(*args, **kwargs): |
12127 | """ | |
12128 | AddGrowableRow(self, size_t idx, int proportion=0) | |
e811c8ce | 12129 | |
248ed943 RD |
12130 | Specifies that row *idx* (starting from zero) should be grown if there |
12131 | is extra space available to the sizer. | |
e811c8ce | 12132 | |
248ed943 RD |
12133 | The *proportion* parameter has the same meaning as the stretch factor |
12134 | for the box sizers except that if all proportions are 0, then all | |
12135 | columns are resized equally (instead of not being resized at all). | |
12136 | """ | |
54f9ee45 | 12137 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
e811c8ce RD |
12138 | |
12139 | def RemoveGrowableRow(*args, **kwargs): | |
248ed943 RD |
12140 | """ |
12141 | RemoveGrowableRow(self, size_t idx) | |
12142 | ||
12143 | Specifies that row *idx* is no longer growable. | |
12144 | """ | |
54f9ee45 | 12145 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
e811c8ce RD |
12146 | |
12147 | def AddGrowableCol(*args, **kwargs): | |
248ed943 RD |
12148 | """ |
12149 | AddGrowableCol(self, size_t idx, int proportion=0) | |
12150 | ||
12151 | Specifies that column *idx* (starting from zero) should be grown if | |
12152 | there is extra space available to the sizer. | |
12153 | ||
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 | """ | |
54f9ee45 | 12158 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
e811c8ce RD |
12159 | |
12160 | def RemoveGrowableCol(*args, **kwargs): | |
248ed943 RD |
12161 | """ |
12162 | RemoveGrowableCol(self, size_t idx) | |
12163 | ||
12164 | Specifies that column *idx* is no longer growable. | |
12165 | """ | |
54f9ee45 | 12166 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
e811c8ce RD |
12167 | |
12168 | def SetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12169 | """ |
12170 | SetFlexibleDirection(self, int direction) | |
12171 | ||
12172 | Specifies whether the sizer should flexibly resize its columns, rows, | |
12173 | or both. Argument *direction* can be one of the following values. Any | |
12174 | other value is ignored. | |
12175 | ||
12176 | ============== ======================================= | |
12177 | wx.VERTICAL Rows are flexibly sized. | |
12178 | wx.HORIZONTAL Columns are flexibly sized. | |
12179 | wx.BOTH Both rows and columns are flexibly sized | |
12180 | (this is the default value). | |
12181 | ============== ======================================= | |
12182 | ||
12183 | Note that this method does not trigger relayout. | |
12184 | ||
12185 | """ | |
54f9ee45 | 12186 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
12187 | |
12188 | def GetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
12189 | """ |
12190 | GetFlexibleDirection(self) -> int | |
12191 | ||
12192 | Returns a value that specifies whether the sizer | |
12193 | flexibly resizes its columns, rows, or both (default). | |
12194 | ||
12195 | :see: `SetFlexibleDirection` | |
12196 | """ | |
54f9ee45 | 12197 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
12198 | |
12199 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12200 | """ |
12201 | SetNonFlexibleGrowMode(self, int mode) | |
12202 | ||
12203 | Specifies how the sizer should grow in the non-flexible direction if | |
12204 | there is one (so `SetFlexibleDirection` must have been called | |
12205 | previously). Argument *mode* can be one of the following values: | |
12206 | ||
12207 | ========================== ================================================= | |
12208 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
12209 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
12210 | `AddGrowableCol` and `AddGrowableRow`. In this | |
12211 | case equal sizing applies to minimum sizes of | |
12212 | columns or rows (this is the default value). | |
12213 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
12214 | the non flexible direction, whether they are | |
12215 | growable or not in the flexbile direction. | |
12216 | ========================== ================================================= | |
12217 | ||
12218 | Note that this method does not trigger relayout. | |
12219 | ||
12220 | ||
12221 | """ | |
54f9ee45 | 12222 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
12223 | |
12224 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
12225 | """ |
12226 | GetNonFlexibleGrowMode(self) -> int | |
12227 | ||
12228 | Returns the value that specifies how the sizer grows in the | |
12229 | non-flexible direction if there is one. | |
12230 | ||
12231 | :see: `SetNonFlexibleGrowMode` | |
12232 | """ | |
54f9ee45 | 12233 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
12234 | |
12235 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
12236 | """ |
12237 | GetRowHeights(self) -> list | |
12238 | ||
12239 | Returns a list of integers representing the heights of each of the | |
12240 | rows in the sizer. | |
12241 | """ | |
54f9ee45 | 12242 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
e811c8ce RD |
12243 | |
12244 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
12245 | """ |
12246 | GetColWidths(self) -> list | |
12247 | ||
12248 | Returns a list of integers representing the widths of each of the | |
12249 | columns in the sizer. | |
12250 | """ | |
54f9ee45 | 12251 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
e811c8ce | 12252 | |
d14a1e28 RD |
12253 | |
12254 | class FlexGridSizerPtr(FlexGridSizer): | |
12255 | def __init__(self, this): | |
12256 | self.this = this | |
12257 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12258 | self.__class__ = FlexGridSizer | |
54f9ee45 | 12259 | _core_.FlexGridSizer_swigregister(FlexGridSizerPtr) |
d14a1e28 | 12260 | |
e505d15e RD |
12261 | class StdDialogButtonSizer(BoxSizer): |
12262 | """ | |
12263 | A special sizer that knows how to order and position standard buttons | |
12264 | in order to conform to the current platform's standards. You simply | |
12265 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 12266 | buttons using the standard ID's. Then call `Realize` and the sizer |
e505d15e RD |
12267 | will take care of the rest. |
12268 | ||
12269 | """ | |
12270 | def __repr__(self): | |
12271 | return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12272 | def __init__(self, *args, **kwargs): | |
12273 | """__init__(self) -> StdDialogButtonSizer""" | |
12274 | newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs) | |
12275 | self.this = newobj.this | |
12276 | self.thisown = 1 | |
12277 | del newobj.thisown | |
12278 | def AddButton(*args, **kwargs): | |
12279 | """ | |
12280 | AddButton(self, wxButton button) | |
12281 | ||
12282 | Use this to add the buttons to this sizer. Do not use the `Add` | |
12283 | method in the base class. | |
12284 | """ | |
12285 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
12286 | ||
53aa7709 | 12287 | def Realize(*args, **kwargs): |
e505d15e | 12288 | """ |
53aa7709 | 12289 | Realize(self) |
e505d15e RD |
12290 | |
12291 | This funciton needs to be called after all the buttons have been added | |
12292 | to the sizer. It will reorder them and position them in a platform | |
12293 | specifc manner. | |
12294 | """ | |
53aa7709 | 12295 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
12296 | |
12297 | def SetAffirmativeButton(*args, **kwargs): | |
12298 | """SetAffirmativeButton(self, wxButton button)""" | |
12299 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
12300 | ||
12301 | def SetNegativeButton(*args, **kwargs): | |
12302 | """SetNegativeButton(self, wxButton button)""" | |
12303 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
12304 | ||
12305 | def SetCancelButton(*args, **kwargs): | |
12306 | """SetCancelButton(self, wxButton button)""" | |
12307 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
e505d15e RD |
12308 | |
12309 | def GetAffirmativeButton(*args, **kwargs): | |
12310 | """GetAffirmativeButton(self) -> wxButton""" | |
12311 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
12312 | ||
12313 | def GetApplyButton(*args, **kwargs): | |
12314 | """GetApplyButton(self) -> wxButton""" | |
12315 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
12316 | ||
12317 | def GetNegativeButton(*args, **kwargs): | |
12318 | """GetNegativeButton(self) -> wxButton""" | |
12319 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
12320 | ||
12321 | def GetCancelButton(*args, **kwargs): | |
12322 | """GetCancelButton(self) -> wxButton""" | |
12323 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
12324 | ||
12325 | def GetHelpButton(*args, **kwargs): | |
12326 | """GetHelpButton(self) -> wxButton""" | |
12327 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
12328 | ||
12329 | ||
12330 | class StdDialogButtonSizerPtr(StdDialogButtonSizer): | |
12331 | def __init__(self, this): | |
12332 | self.this = this | |
12333 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12334 | self.__class__ = StdDialogButtonSizer | |
12335 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr) | |
12336 | ||
d14a1e28 RD |
12337 | #--------------------------------------------------------------------------- |
12338 | ||
12339 | class GBPosition(object): | |
248ed943 RD |
12340 | """ |
12341 | This class represents the position of an item in a virtual grid of | |
12342 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12343 | typemaps that will automatically convert from a 2-element sequence of | |
12344 | integers to a wx.GBPosition, so you can use the more pythonic | |
12345 | representation of the position nearly transparently in Python code. | |
12346 | """ | |
e811c8ce RD |
12347 | def __repr__(self): |
12348 | return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 12349 | def __init__(self, *args, **kwargs): |
248ed943 RD |
12350 | """ |
12351 | __init__(self, int row=0, int col=0) -> GBPosition | |
12352 | ||
12353 | This class represents the position of an item in a virtual grid of | |
12354 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12355 | typemaps that will automatically convert from a 2-element sequence of | |
12356 | integers to a wx.GBPosition, so you can use the more pythonic | |
12357 | representation of the position nearly transparently in Python code. | |
12358 | """ | |
54f9ee45 | 12359 | newobj = _core_.new_GBPosition(*args, **kwargs) |
d14a1e28 RD |
12360 | self.this = newobj.this |
12361 | self.thisown = 1 | |
12362 | del newobj.thisown | |
e811c8ce | 12363 | def GetRow(*args, **kwargs): |
a95a7133 | 12364 | """GetRow(self) -> int""" |
54f9ee45 | 12365 | return _core_.GBPosition_GetRow(*args, **kwargs) |
e811c8ce RD |
12366 | |
12367 | def GetCol(*args, **kwargs): | |
a95a7133 | 12368 | """GetCol(self) -> int""" |
54f9ee45 | 12369 | return _core_.GBPosition_GetCol(*args, **kwargs) |
e811c8ce RD |
12370 | |
12371 | def SetRow(*args, **kwargs): | |
a95a7133 | 12372 | """SetRow(self, int row)""" |
54f9ee45 | 12373 | return _core_.GBPosition_SetRow(*args, **kwargs) |
e811c8ce RD |
12374 | |
12375 | def SetCol(*args, **kwargs): | |
a95a7133 | 12376 | """SetCol(self, int col)""" |
54f9ee45 | 12377 | return _core_.GBPosition_SetCol(*args, **kwargs) |
e811c8ce RD |
12378 | |
12379 | def __eq__(*args, **kwargs): | |
a95a7133 | 12380 | """__eq__(self, GBPosition other) -> bool""" |
54f9ee45 | 12381 | return _core_.GBPosition___eq__(*args, **kwargs) |
e811c8ce RD |
12382 | |
12383 | def __ne__(*args, **kwargs): | |
a95a7133 | 12384 | """__ne__(self, GBPosition other) -> bool""" |
54f9ee45 | 12385 | return _core_.GBPosition___ne__(*args, **kwargs) |
e811c8ce RD |
12386 | |
12387 | def Set(*args, **kwargs): | |
a95a7133 | 12388 | """Set(self, int row=0, int col=0)""" |
54f9ee45 | 12389 | return _core_.GBPosition_Set(*args, **kwargs) |
e811c8ce RD |
12390 | |
12391 | def Get(*args, **kwargs): | |
a95a7133 | 12392 | """Get(self) -> PyObject""" |
54f9ee45 | 12393 | return _core_.GBPosition_Get(*args, **kwargs) |
e811c8ce | 12394 | |
41e2b43e | 12395 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
12396 | def __str__(self): return str(self.Get()) |
12397 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
12398 | def __len__(self): return len(self.Get()) | |
12399 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
12400 | def __setitem__(self, index, val): |
12401 | if index == 0: self.SetRow(val) | |
12402 | elif index == 1: self.SetCol(val) | |
12403 | else: raise IndexError | |
e811c8ce | 12404 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12405 | __safe_for_unpickling__ = True |
12406 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
d14a1e28 RD |
12407 | |
12408 | row = property(GetRow, SetRow) | |
12409 | col = property(GetCol, SetCol) | |
12410 | ||
12411 | ||
12412 | class GBPositionPtr(GBPosition): | |
12413 | def __init__(self, this): | |
12414 | self.this = this | |
12415 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12416 | self.__class__ = GBPosition | |
54f9ee45 | 12417 | _core_.GBPosition_swigregister(GBPositionPtr) |
d14a1e28 RD |
12418 | |
12419 | class GBSpan(object): | |
248ed943 RD |
12420 | """ |
12421 | This class is used to hold the row and column spanning attributes of | |
12422 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
12423 | automatically convert from a 2-element sequence of integers to a | |
12424 | wx.GBSpan, so you can use the more pythonic representation of the span | |
12425 | nearly transparently in Python code. | |
12426 | ||
12427 | """ | |
e811c8ce RD |
12428 | def __repr__(self): |
12429 | return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 12430 | def __init__(self, *args, **kwargs): |
248ed943 RD |
12431 | """ |
12432 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
12433 | ||
12434 | Construct a new wxGBSpan, optionally setting the rowspan and | |
12435 | colspan. The default is (1,1). (Meaning that the item occupies one | |
12436 | cell in each direction. | |
12437 | """ | |
54f9ee45 | 12438 | newobj = _core_.new_GBSpan(*args, **kwargs) |
d14a1e28 RD |
12439 | self.this = newobj.this |
12440 | self.thisown = 1 | |
12441 | del newobj.thisown | |
e811c8ce | 12442 | def GetRowspan(*args, **kwargs): |
a95a7133 | 12443 | """GetRowspan(self) -> int""" |
54f9ee45 | 12444 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
e811c8ce RD |
12445 | |
12446 | def GetColspan(*args, **kwargs): | |
a95a7133 | 12447 | """GetColspan(self) -> int""" |
54f9ee45 | 12448 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
e811c8ce RD |
12449 | |
12450 | def SetRowspan(*args, **kwargs): | |
a95a7133 | 12451 | """SetRowspan(self, int rowspan)""" |
54f9ee45 | 12452 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
e811c8ce RD |
12453 | |
12454 | def SetColspan(*args, **kwargs): | |
a95a7133 | 12455 | """SetColspan(self, int colspan)""" |
54f9ee45 | 12456 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
e811c8ce RD |
12457 | |
12458 | def __eq__(*args, **kwargs): | |
a95a7133 | 12459 | """__eq__(self, GBSpan other) -> bool""" |
54f9ee45 | 12460 | return _core_.GBSpan___eq__(*args, **kwargs) |
e811c8ce RD |
12461 | |
12462 | def __ne__(*args, **kwargs): | |
a95a7133 | 12463 | """__ne__(self, GBSpan other) -> bool""" |
54f9ee45 | 12464 | return _core_.GBSpan___ne__(*args, **kwargs) |
e811c8ce RD |
12465 | |
12466 | def Set(*args, **kwargs): | |
a95a7133 | 12467 | """Set(self, int rowspan=1, int colspan=1)""" |
54f9ee45 | 12468 | return _core_.GBSpan_Set(*args, **kwargs) |
e811c8ce RD |
12469 | |
12470 | def Get(*args, **kwargs): | |
a95a7133 | 12471 | """Get(self) -> PyObject""" |
54f9ee45 | 12472 | return _core_.GBSpan_Get(*args, **kwargs) |
e811c8ce | 12473 | |
41e2b43e | 12474 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
12475 | def __str__(self): return str(self.Get()) |
12476 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
12477 | def __len__(self): return len(self.Get()) | |
12478 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
12479 | def __setitem__(self, index, val): |
12480 | if index == 0: self.SetRowspan(val) | |
12481 | elif index == 1: self.SetColspan(val) | |
12482 | else: raise IndexError | |
e811c8ce | 12483 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12484 | __safe_for_unpickling__ = True |
12485 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
d14a1e28 RD |
12486 | |
12487 | rowspan = property(GetRowspan, SetRowspan) | |
12488 | colspan = property(GetColspan, SetColspan) | |
12489 | ||
12490 | ||
12491 | class GBSpanPtr(GBSpan): | |
12492 | def __init__(self, this): | |
12493 | self.this = this | |
12494 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12495 | self.__class__ = GBSpan | |
54f9ee45 | 12496 | _core_.GBSpan_swigregister(GBSpanPtr) |
d14a1e28 RD |
12497 | |
12498 | class GBSizerItem(SizerItem): | |
248ed943 RD |
12499 | """ |
12500 | The wx.GBSizerItem class is used to track the additional data about | |
12501 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12502 | and how many rows or columns it spans. | |
12503 | ||
12504 | """ | |
e811c8ce RD |
12505 | def __repr__(self): |
12506 | return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 12507 | def __init__(self, *args, **kwargs): |
248ed943 RD |
12508 | """ |
12509 | __init__(self) -> GBSizerItem | |
12510 | ||
12511 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12512 | size will need to be set, as well as a position and span before this | |
12513 | item can be used in a Sizer. | |
12514 | ||
12515 | You will probably never need to create a wx.GBSizerItem directly as they | |
12516 | are created automatically when the sizer's Add method is called. | |
12517 | """ | |
54f9ee45 | 12518 | newobj = _core_.new_GBSizerItem(*args, **kwargs) |
d14a1e28 RD |
12519 | self.this = newobj.this |
12520 | self.thisown = 1 | |
12521 | del newobj.thisown | |
e811c8ce | 12522 | def GetPos(*args, **kwargs): |
248ed943 RD |
12523 | """ |
12524 | GetPos(self) -> GBPosition | |
12525 | ||
12526 | Get the grid position of the item | |
12527 | """ | |
54f9ee45 | 12528 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
e811c8ce RD |
12529 | |
12530 | def GetPosTuple(self): return self.GetPos().Get() | |
12531 | def GetSpan(*args, **kwargs): | |
248ed943 RD |
12532 | """ |
12533 | GetSpan(self) -> GBSpan | |
12534 | ||
12535 | Get the row and column spanning of the item | |
12536 | """ | |
54f9ee45 | 12537 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
e811c8ce RD |
12538 | |
12539 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12540 | def SetPos(*args, **kwargs): | |
248ed943 RD |
12541 | """ |
12542 | SetPos(self, GBPosition pos) -> bool | |
12543 | ||
12544 | If the item is already a member of a sizer then first ensure that | |
12545 | there is no other item that would intersect with this one at the new | |
12546 | position, then set the new position. Returns True if the change is | |
12547 | successful and after the next Layout() the item will be moved. | |
12548 | """ | |
54f9ee45 | 12549 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
e811c8ce RD |
12550 | |
12551 | def SetSpan(*args, **kwargs): | |
248ed943 RD |
12552 | """ |
12553 | SetSpan(self, GBSpan span) -> bool | |
12554 | ||
12555 | If the item is already a member of a sizer then first ensure that | |
12556 | there is no other item that would intersect with this one with its new | |
12557 | spanning size, then set the new spanning. Returns True if the change | |
12558 | is successful and after the next Layout() the item will be resized. | |
12559 | ||
12560 | """ | |
54f9ee45 | 12561 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
e811c8ce | 12562 | |
248ed943 | 12563 | def Intersects(*args, **kwargs): |
0df68c9f | 12564 | """ |
a95a7133 | 12565 | Intersects(self, GBSizerItem other) -> bool |
248ed943 RD |
12566 | |
12567 | Returns True if this item and the other item instersect. | |
0df68c9f | 12568 | """ |
248ed943 RD |
12569 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
12570 | ||
12571 | def IntersectsPos(*args, **kwargs): | |
12572 | """ | |
12573 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
12574 | ||
12575 | Returns True if the given pos/span would intersect with this item. | |
12576 | """ | |
12577 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
e811c8ce RD |
12578 | |
12579 | def GetEndPos(*args, **kwargs): | |
248ed943 RD |
12580 | """ |
12581 | GetEndPos(self) -> GBPosition | |
12582 | ||
12583 | Get the row and column of the endpoint of this item. | |
12584 | """ | |
54f9ee45 | 12585 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
e811c8ce RD |
12586 | |
12587 | def GetGBSizer(*args, **kwargs): | |
248ed943 RD |
12588 | """ |
12589 | GetGBSizer(self) -> GridBagSizer | |
12590 | ||
12591 | Get the sizer this item is a member of. | |
12592 | """ | |
54f9ee45 | 12593 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
e811c8ce RD |
12594 | |
12595 | def SetGBSizer(*args, **kwargs): | |
248ed943 RD |
12596 | """ |
12597 | SetGBSizer(self, GridBagSizer sizer) | |
12598 | ||
12599 | Set the sizer this item is a member of. | |
12600 | """ | |
54f9ee45 | 12601 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
e811c8ce | 12602 | |
d14a1e28 RD |
12603 | |
12604 | class GBSizerItemPtr(GBSizerItem): | |
12605 | def __init__(self, this): | |
12606 | self.this = this | |
12607 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12608 | self.__class__ = GBSizerItem | |
54f9ee45 | 12609 | _core_.GBSizerItem_swigregister(GBSizerItemPtr) |
d14a1e28 RD |
12610 | DefaultSpan = cvar.DefaultSpan |
12611 | ||
12612 | def GBSizerItemWindow(*args, **kwargs): | |
0df68c9f RD |
12613 | """ |
12614 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12615 | int border, PyObject userData=None) -> GBSizerItem |
12616 | ||
12617 | Construct a `wx.GBSizerItem` for a window. | |
0df68c9f | 12618 | """ |
54f9ee45 | 12619 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
12620 | val.thisown = 1 |
12621 | return val | |
12622 | ||
12623 | def GBSizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
12624 | """ |
12625 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12626 | int border, PyObject userData=None) -> GBSizerItem |
12627 | ||
12628 | Construct a `wx.GBSizerItem` for a sizer | |
0df68c9f | 12629 | """ |
54f9ee45 | 12630 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
12631 | val.thisown = 1 |
12632 | return val | |
12633 | ||
12634 | def GBSizerItemSpacer(*args, **kwargs): | |
0df68c9f RD |
12635 | """ |
12636 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
248ed943 RD |
12637 | int flag, int border, PyObject userData=None) -> GBSizerItem |
12638 | ||
12639 | Construct a `wx.GBSizerItem` for a spacer. | |
0df68c9f | 12640 | """ |
54f9ee45 | 12641 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
12642 | val.thisown = 1 |
12643 | return val | |
12644 | ||
12645 | class GridBagSizer(FlexGridSizer): | |
248ed943 RD |
12646 | """ |
12647 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12648 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12649 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12650 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12651 | virtual grid is determined by the largest row and column that items are | |
12652 | positioned at, adjusted for spanning. | |
12653 | ||
12654 | """ | |
e811c8ce RD |
12655 | def __repr__(self): |
12656 | return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
d14a1e28 | 12657 | def __init__(self, *args, **kwargs): |
248ed943 RD |
12658 | """ |
12659 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
12660 | ||
12661 | Constructor, with optional parameters to specify the gap between the | |
12662 | rows and columns. | |
12663 | """ | |
54f9ee45 | 12664 | newobj = _core_.new_GridBagSizer(*args, **kwargs) |
d14a1e28 RD |
12665 | self.this = newobj.this |
12666 | self.thisown = 1 | |
12667 | del newobj.thisown | |
1823fbb4 RD |
12668 | self._setOORInfo(self) |
12669 | ||
e811c8ce | 12670 | def Add(*args, **kwargs): |
0df68c9f | 12671 | """ |
248ed943 | 12672 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
d3b6e4ff | 12673 | int border=0, userData=None) -> wx.GBSizerItem |
248ed943 RD |
12674 | |
12675 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12676 | more than one row or column as specified with *span*. The remaining | |
12677 | args behave similarly to `wx.Sizer.Add`. | |
12678 | ||
12679 | Returns True if the item was successfully placed at the given cell | |
12680 | position, False if something was already there. | |
12681 | ||
0df68c9f | 12682 | """ |
54f9ee45 | 12683 | return _core_.GridBagSizer_Add(*args, **kwargs) |
e811c8ce RD |
12684 | |
12685 | def AddItem(*args, **kwargs): | |
248ed943 | 12686 | """ |
d3b6e4ff | 12687 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
248ed943 RD |
12688 | |
12689 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12690 | the item was successfully placed at its given cell position, False if | |
12691 | something was already there. | |
12692 | """ | |
54f9ee45 | 12693 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
e811c8ce | 12694 | |
84f85550 RD |
12695 | def GetCellSize(*args, **kwargs): |
12696 | """ | |
12697 | GetCellSize(self, int row, int col) -> Size | |
12698 | ||
12699 | Get the size of the specified cell, including hgap and | |
12700 | vgap. Only valid after a Layout. | |
12701 | """ | |
12702 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
12703 | ||
e811c8ce | 12704 | def GetEmptyCellSize(*args, **kwargs): |
248ed943 RD |
12705 | """ |
12706 | GetEmptyCellSize(self) -> Size | |
12707 | ||
12708 | Get the size used for cells in the grid with no item. | |
12709 | """ | |
54f9ee45 | 12710 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12711 | |
12712 | def SetEmptyCellSize(*args, **kwargs): | |
248ed943 RD |
12713 | """ |
12714 | SetEmptyCellSize(self, Size sz) | |
12715 | ||
12716 | Set the size used for cells in the grid with no item. | |
12717 | """ | |
54f9ee45 | 12718 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12719 | |
12720 | def GetItemPosition(*args): | |
0df68c9f | 12721 | """ |
248ed943 RD |
12722 | GetItemPosition(self, item) -> GBPosition |
12723 | ||
12724 | Get the grid position of the specified *item* where *item* is either a | |
12725 | window or subsizer that is a member of this sizer, or a zero-based | |
12726 | index of an item. | |
0df68c9f | 12727 | """ |
54f9ee45 | 12728 | return _core_.GridBagSizer_GetItemPosition(*args) |
e811c8ce RD |
12729 | |
12730 | def SetItemPosition(*args): | |
0df68c9f | 12731 | """ |
248ed943 RD |
12732 | SetItemPosition(self, item, GBPosition pos) -> bool |
12733 | ||
12734 | Set the grid position of the specified *item* where *item* is either a | |
12735 | window or subsizer that is a member of this sizer, or a zero-based | |
12736 | index of an item. Returns True on success. If the move is not | |
12737 | allowed (because an item is already there) then False is returned. | |
12738 | ||
0df68c9f | 12739 | """ |
54f9ee45 | 12740 | return _core_.GridBagSizer_SetItemPosition(*args) |
e811c8ce RD |
12741 | |
12742 | def GetItemSpan(*args): | |
0df68c9f | 12743 | """ |
248ed943 RD |
12744 | GetItemSpan(self, item) -> GBSpan |
12745 | ||
12746 | Get the row/col spanning of the specified *item* where *item* is | |
12747 | either a window or subsizer that is a member of this sizer, or a | |
12748 | zero-based index of an item. | |
0df68c9f | 12749 | """ |
54f9ee45 | 12750 | return _core_.GridBagSizer_GetItemSpan(*args) |
e811c8ce RD |
12751 | |
12752 | def SetItemSpan(*args): | |
0df68c9f | 12753 | """ |
248ed943 RD |
12754 | SetItemSpan(self, item, GBSpan span) -> bool |
12755 | ||
12756 | Set the row/col spanning of the specified *item* where *item* is | |
12757 | either a window or subsizer that is a member of this sizer, or a | |
12758 | zero-based index of an item. Returns True on success. If the move is | |
12759 | not allowed (because an item is already there) then False is returned. | |
0df68c9f | 12760 | """ |
54f9ee45 | 12761 | return _core_.GridBagSizer_SetItemSpan(*args) |
e811c8ce RD |
12762 | |
12763 | def FindItem(*args): | |
0df68c9f | 12764 | """ |
248ed943 RD |
12765 | FindItem(self, item) -> GBSizerItem |
12766 | ||
12767 | Find the sizer item for the given window or subsizer, returns None if | |
12768 | not found. (non-recursive) | |
0df68c9f | 12769 | """ |
54f9ee45 | 12770 | return _core_.GridBagSizer_FindItem(*args) |
e811c8ce RD |
12771 | |
12772 | def FindItemAtPosition(*args, **kwargs): | |
248ed943 RD |
12773 | """ |
12774 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
12775 | ||
12776 | Return the sizer item for the given grid cell, or None if there is no | |
12777 | item at that position. (non-recursive) | |
12778 | """ | |
54f9ee45 | 12779 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
e811c8ce RD |
12780 | |
12781 | def FindItemAtPoint(*args, **kwargs): | |
248ed943 RD |
12782 | """ |
12783 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
12784 | ||
12785 | Return the sizer item located at the point given in *pt*, or None if | |
12786 | there is no item at that point. The (x,y) coordinates in pt correspond | |
12787 | to the client coordinates of the window using the sizer for | |
12788 | layout. (non-recursive) | |
12789 | """ | |
54f9ee45 | 12790 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
e811c8ce | 12791 | |
248ed943 RD |
12792 | def CheckForIntersection(*args, **kwargs): |
12793 | """ | |
12794 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
e811c8ce | 12795 | |
248ed943 RD |
12796 | Look at all items and see if any intersect (or would overlap) the |
12797 | given *item*. Returns True if so, False if there would be no overlap. | |
12798 | If an *excludeItem* is given then it will not be checked for | |
12799 | intersection, for example it may be the item we are checking the | |
12800 | position of. | |
e811c8ce | 12801 | |
248ed943 RD |
12802 | """ |
12803 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
e811c8ce | 12804 | |
248ed943 | 12805 | def CheckForIntersectionPos(*args, **kwargs): |
0df68c9f | 12806 | """ |
248ed943 RD |
12807 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
12808 | ||
12809 | Look at all items and see if any intersect (or would overlap) the | |
12810 | given position and span. Returns True if so, False if there would be | |
12811 | no overlap. If an *excludeItem* is given then it will not be checked | |
12812 | for intersection, for example it may be the item we are checking the | |
12813 | position of. | |
0df68c9f | 12814 | """ |
248ed943 | 12815 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
e811c8ce | 12816 | |
d14a1e28 RD |
12817 | |
12818 | class GridBagSizerPtr(GridBagSizer): | |
12819 | def __init__(self, this): | |
12820 | self.this = this | |
12821 | if not hasattr(self,"thisown"): self.thisown = 0 | |
12822 | self.__class__ = GridBagSizer | |
54f9ee45 | 12823 | _core_.GridBagSizer_swigregister(GridBagSizerPtr) |
d14a1e28 RD |
12824 | |
12825 | #--------------------------------------------------------------------------- | |
12826 | ||
54f9ee45 RD |
12827 | Left = _core_.Left |
12828 | Top = _core_.Top | |
12829 | Right = _core_.Right | |
12830 | Bottom = _core_.Bottom | |
12831 | Width = _core_.Width | |
12832 | Height = _core_.Height | |
12833 | Centre = _core_.Centre | |
12834 | Center = _core_.Center | |
12835 | CentreX = _core_.CentreX | |
12836 | CentreY = _core_.CentreY | |
12837 | Unconstrained = _core_.Unconstrained | |
12838 | AsIs = _core_.AsIs | |
12839 | PercentOf = _core_.PercentOf | |
12840 | Above = _core_.Above | |
12841 | Below = _core_.Below | |
12842 | LeftOf = _core_.LeftOf | |
12843 | RightOf = _core_.RightOf | |
12844 | SameAs = _core_.SameAs | |
12845 | Absolute = _core_.Absolute | |
d14a1e28 | 12846 | class IndividualLayoutConstraint(Object): |
15afbcd0 | 12847 | """ |
41e2b43e RD |
12848 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
12849 | one of eight possible constraints that a window can be involved in. | |
12850 | You will never need to create an instance of | |
12851 | wx.IndividualLayoutConstraint, rather you should create a | |
12852 | `wx.LayoutConstraints` instance and use the individual contstraints | |
15afbcd0 | 12853 | that it contains. |
15afbcd0 | 12854 | """ |
d14a1e28 RD |
12855 | def __init__(self): raise RuntimeError, "No constructor defined" |
12856 | def __repr__(self): | |
12857 | return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
e811c8ce | 12858 | def Set(*args, **kwargs): |
41e2b43e RD |
12859 | """ |
12860 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
12861 | ||
12862 | Sets the properties of the constraint. Normally called by one of the | |
12863 | convenience functions such as Above, RightOf, SameAs. | |
12864 | """ | |
54f9ee45 | 12865 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
e811c8ce RD |
12866 | |
12867 | def LeftOf(*args, **kwargs): | |
15afbcd0 | 12868 | """ |
a95a7133 | 12869 | LeftOf(self, Window sibling, int marg=0) |
15afbcd0 | 12870 | |
41e2b43e RD |
12871 | Constrains this edge to be to the left of the given window, with an |
12872 | optional margin. Implicitly, this is relative to the left edge of the | |
12873 | other window. | |
15afbcd0 | 12874 | """ |
54f9ee45 | 12875 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
e811c8ce RD |
12876 | |
12877 | def RightOf(*args, **kwargs): | |
15afbcd0 | 12878 | """ |
a95a7133 | 12879 | RightOf(self, Window sibling, int marg=0) |
15afbcd0 | 12880 | |
41e2b43e RD |
12881 | Constrains this edge to be to the right of the given window, with an |
12882 | optional margin. Implicitly, this is relative to the right edge of the | |
12883 | other window. | |
15afbcd0 | 12884 | """ |
54f9ee45 | 12885 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
e811c8ce RD |
12886 | |
12887 | def Above(*args, **kwargs): | |
15afbcd0 | 12888 | """ |
a95a7133 | 12889 | Above(self, Window sibling, int marg=0) |
15afbcd0 | 12890 | |
41e2b43e RD |
12891 | Constrains this edge to be above the given window, with an optional |
12892 | margin. Implicitly, this is relative to the top edge of the other | |
12893 | window. | |
15afbcd0 | 12894 | """ |
54f9ee45 | 12895 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
e811c8ce RD |
12896 | |
12897 | def Below(*args, **kwargs): | |
15afbcd0 | 12898 | """ |
a95a7133 | 12899 | Below(self, Window sibling, int marg=0) |
15afbcd0 | 12900 | |
41e2b43e RD |
12901 | Constrains this edge to be below the given window, with an optional |
12902 | margin. Implicitly, this is relative to the bottom edge of the other | |
12903 | window. | |
15afbcd0 | 12904 | """ |
54f9ee45 | 12905 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
e811c8ce RD |
12906 | |
12907 | def SameAs(*args, **kwargs): | |
15afbcd0 | 12908 | """ |
a95a7133 | 12909 | SameAs(self, Window otherW, int edge, int marg=0) |
15afbcd0 | 12910 | |
41e2b43e RD |
12911 | Constrains this edge or dimension to be to the same as the edge of the |
12912 | given window, with an optional margin. | |
15afbcd0 | 12913 | """ |
54f9ee45 | 12914 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
e811c8ce RD |
12915 | |
12916 | def PercentOf(*args, **kwargs): | |
15afbcd0 | 12917 | """ |
a95a7133 | 12918 | PercentOf(self, Window otherW, int wh, int per) |
15afbcd0 | 12919 | |
41e2b43e RD |
12920 | Constrains this edge or dimension to be to a percentage of the given |
12921 | window, with an optional margin. | |
15afbcd0 | 12922 | """ |
54f9ee45 | 12923 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
e811c8ce RD |
12924 | |
12925 | def Absolute(*args, **kwargs): | |
15afbcd0 | 12926 | """ |
a95a7133 | 12927 | Absolute(self, int val) |
15afbcd0 | 12928 | |
41e2b43e | 12929 | Constrains this edge or dimension to be the given absolute value. |
15afbcd0 | 12930 | """ |
54f9ee45 | 12931 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
e811c8ce RD |
12932 | |
12933 | def Unconstrained(*args, **kwargs): | |
15afbcd0 | 12934 | """ |
a95a7133 | 12935 | Unconstrained(self) |
15afbcd0 | 12936 | |
41e2b43e RD |
12937 | Sets this edge or dimension to be unconstrained, that is, dependent on |
12938 | other edges and dimensions from which this value can be deduced. | |
15afbcd0 | 12939 | """ |
54f9ee45 | 12940 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
e811c8ce RD |
12941 | |
12942 | def AsIs(*args, **kwargs): | |
15afbcd0 | 12943 | """ |
a95a7133 | 12944 | AsIs(self) |
15afbcd0 | 12945 | |
41e2b43e RD |
12946 | Sets this edge or constraint to be whatever the window's value is at |
12947 | the moment. If either of the width and height constraints are *as is*, | |
12948 | the window will not be resized, but moved instead. This is important | |
12949 | when considering panel items which are intended to have a default | |
12950 | size, such as a button, which may take its size from the size of the | |
12951 | button label. | |
15afbcd0 | 12952 | """ |
54f9ee45 | 12953 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
e811c8ce RD |
12954 | |
12955 | def GetOtherWindow(*args, **kwargs): | |
a95a7133 | 12956 | """GetOtherWindow(self) -> Window""" |
54f9ee45 | 12957 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) |
e811c8ce RD |
12958 | |
12959 | def GetMyEdge(*args, **kwargs): | |
a95a7133 | 12960 | """GetMyEdge(self) -> int""" |
54f9ee45 | 12961 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
e811c8ce RD |
12962 | |
12963 | def SetEdge(*args, **kwargs): | |
a95a7133 | 12964 | """SetEdge(self, int which)""" |
54f9ee45 | 12965 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
e811c8ce RD |
12966 | |
12967 | def SetValue(*args, **kwargs): | |
a95a7133 | 12968 | """SetValue(self, int v)""" |
54f9ee45 | 12969 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
e811c8ce RD |
12970 | |
12971 | def GetMargin(*args, **kwargs): | |
a95a7133 | 12972 | """GetMargin(self) -> int""" |
54f9ee45 | 12973 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
e811c8ce RD |
12974 | |
12975 | def SetMargin(*args, **kwargs): | |
a95a7133 | 12976 | """SetMargin(self, int m)""" |
54f9ee45 | 12977 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
e811c8ce RD |
12978 | |
12979 | def GetValue(*args, **kwargs): | |
a95a7133 | 12980 | """GetValue(self) -> int""" |
54f9ee45 | 12981 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
e811c8ce RD |
12982 | |
12983 | def GetPercent(*args, **kwargs): | |
a95a7133 | 12984 | """GetPercent(self) -> int""" |
54f9ee45 | 12985 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
e811c8ce RD |
12986 | |
12987 | def GetOtherEdge(*args, **kwargs): | |
a95a7133 | 12988 | """GetOtherEdge(self) -> int""" |
54f9ee45 | 12989 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
e811c8ce RD |
12990 | |
12991 | def GetDone(*args, **kwargs): | |
a95a7133 | 12992 | """GetDone(self) -> bool""" |
54f9ee45 | 12993 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
e811c8ce RD |
12994 | |
12995 | def SetDone(*args, **kwargs): | |
a95a7133 | 12996 | """SetDone(self, bool d)""" |
54f9ee45 | 12997 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
e811c8ce RD |
12998 | |
12999 | def GetRelationship(*args, **kwargs): | |
a95a7133 | 13000 | """GetRelationship(self) -> int""" |
54f9ee45 | 13001 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
e811c8ce RD |
13002 | |
13003 | def SetRelationship(*args, **kwargs): | |
a95a7133 | 13004 | """SetRelationship(self, int r)""" |
54f9ee45 | 13005 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
e811c8ce RD |
13006 | |
13007 | def ResetIfWin(*args, **kwargs): | |
15afbcd0 | 13008 | """ |
a95a7133 | 13009 | ResetIfWin(self, Window otherW) -> bool |
15afbcd0 RD |
13010 | |
13011 | Reset constraint if it mentions otherWin | |
13012 | """ | |
54f9ee45 | 13013 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
e811c8ce RD |
13014 | |
13015 | def SatisfyConstraint(*args, **kwargs): | |
15afbcd0 | 13016 | """ |
a95a7133 | 13017 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
15afbcd0 RD |
13018 | |
13019 | Try to satisfy constraint | |
13020 | """ | |
54f9ee45 | 13021 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
e811c8ce RD |
13022 | |
13023 | def GetEdge(*args, **kwargs): | |
15afbcd0 | 13024 | """ |
a95a7133 | 13025 | GetEdge(self, int which, Window thisWin, Window other) -> int |
15afbcd0 RD |
13026 | |
13027 | Get the value of this edge or dimension, or if this | |
13028 | is not determinable, -1. | |
13029 | """ | |
54f9ee45 | 13030 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
e811c8ce | 13031 | |
d14a1e28 RD |
13032 | |
13033 | class IndividualLayoutConstraintPtr(IndividualLayoutConstraint): | |
13034 | def __init__(self, this): | |
13035 | self.this = this | |
13036 | if not hasattr(self,"thisown"): self.thisown = 0 | |
13037 | self.__class__ = IndividualLayoutConstraint | |
54f9ee45 | 13038 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr) |
d14a1e28 RD |
13039 | |
13040 | class LayoutConstraints(Object): | |
15afbcd0 | 13041 | """ |
41e2b43e RD |
13042 | **Note:** constraints are now deprecated and you should use sizers |
13043 | instead. | |
15afbcd0 | 13044 | |
41e2b43e RD |
13045 | Objects of this class can be associated with a window to define its |
13046 | layout constraints, with respect to siblings or its parent. | |
15afbcd0 RD |
13047 | |
13048 | The class consists of the following eight constraints of class | |
13049 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
13050 | directly to set the appropriate constraints. | |
13051 | ||
13052 | * left: represents the left hand edge of the window | |
13053 | * right: represents the right hand edge of the window | |
13054 | * top: represents the top edge of the window | |
13055 | * bottom: represents the bottom edge of the window | |
13056 | * width: represents the width of the window | |
13057 | * height: represents the height of the window | |
13058 | * centreX: represents the horizontal centre point of the window | |
13059 | * centreY: represents the vertical centre point of the window | |
13060 | ||
41e2b43e RD |
13061 | Most constraints are initially set to have the relationship |
13062 | wxUnconstrained, which means that their values should be calculated by | |
13063 | looking at known constraints. The exceptions are width and height, | |
13064 | which are set to wxAsIs to ensure that if the user does not specify a | |
13065 | constraint, the existing width and height will be used, to be | |
13066 | compatible with panel items which often have take a default size. If | |
13067 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
13068 | ||
13069 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
15afbcd0 RD |
13070 | |
13071 | """ | |
e811c8ce RD |
13072 | def __repr__(self): |
13073 | return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
54f9ee45 RD |
13074 | left = property(_core_.LayoutConstraints_left_get) |
13075 | top = property(_core_.LayoutConstraints_top_get) | |
13076 | right = property(_core_.LayoutConstraints_right_get) | |
13077 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
13078 | width = property(_core_.LayoutConstraints_width_get) | |
13079 | height = property(_core_.LayoutConstraints_height_get) | |
13080 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
13081 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
d14a1e28 | 13082 | def __init__(self, *args, **kwargs): |
a95a7133 | 13083 | """__init__(self) -> LayoutConstraints""" |
54f9ee45 | 13084 | newobj = _core_.new_LayoutConstraints(*args, **kwargs) |
d14a1e28 RD |
13085 | self.this = newobj.this |
13086 | self.thisown = 1 | |
13087 | del newobj.thisown | |
e811c8ce | 13088 | def SatisfyConstraints(*args, **kwargs): |
6c3b4aae | 13089 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" |
54f9ee45 | 13090 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
e811c8ce RD |
13091 | |
13092 | def AreSatisfied(*args, **kwargs): | |
a95a7133 | 13093 | """AreSatisfied(self) -> bool""" |
54f9ee45 | 13094 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
e811c8ce | 13095 | |
d14a1e28 RD |
13096 | |
13097 | class LayoutConstraintsPtr(LayoutConstraints): | |
13098 | def __init__(self, this): | |
13099 | self.this = this | |
13100 | if not hasattr(self,"thisown"): self.thisown = 0 | |
13101 | self.__class__ = LayoutConstraints | |
54f9ee45 | 13102 | _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr) |
d14a1e28 RD |
13103 | |
13104 | #---------------------------------------------------------------------------- | |
13105 | ||
322913ce | 13106 | # Use Python's bool constants if available, make some if not |
d14a1e28 RD |
13107 | try: |
13108 | True | |
13109 | except NameError: | |
322913ce RD |
13110 | __builtins__.True = 1==1 |
13111 | __builtins__.False = 1==0 | |
4f89f6a3 RD |
13112 | def bool(value): return not not value |
13113 | __builtins__.bool = bool | |
d14a1e28 | 13114 | |
d14a1e28 RD |
13115 | |
13116 | ||
13117 | # workarounds for bad wxRTTI names | |
13118 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
13119 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
13120 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
13121 | ||
13122 | ||
13123 | #---------------------------------------------------------------------------- | |
13124 | # Load version numbers from __version__... Ensure that major and minor | |
7bc1e663 | 13125 | # versions are the same for both wxPython and wxWidgets. |
d14a1e28 RD |
13126 | |
13127 | from __version__ import * | |
13128 | __version__ = VERSION_STRING | |
13129 | ||
7bc1e663 RD |
13130 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
13131 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
54f9ee45 | 13132 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
d14a1e28 | 13133 | import warnings |
7bc1e663 | 13134 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d14a1e28 RD |
13135 | |
13136 | #---------------------------------------------------------------------------- | |
13137 | ||
70b7a5fe RD |
13138 | # Set wxPython's default string<-->unicode conversion encoding from |
13139 | # the locale, but only if Python's default hasn't been changed. (We | |
13140 | # assume that if the user has customized it already then that is the | |
13141 | # encoding we need to use as well.) | |
13142 | # | |
13143 | # The encoding selected here is used when string or unicode objects | |
13144 | # need to be converted in order to pass them to wxWidgets. Please be | |
13145 | # aware that the default encoding within the same locale may be | |
13146 | # slightly different on different platforms. For example, please see | |
e505d15e RD |
13147 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
13148 | # between the common latin/roman encodings. | |
396fb509 RD |
13149 | |
13150 | default = _sys.getdefaultencoding() | |
13151 | if default == 'ascii': | |
13152 | import locale | |
13153 | import codecs | |
13154 | try: | |
13155 | default = locale.getdefaultlocale()[1] | |
13156 | codecs.lookup(default) | |
70b7a5fe | 13157 | except (ValueError, LookupError, TypeError): |
396fb509 RD |
13158 | default = _sys.getdefaultencoding() |
13159 | del locale | |
13160 | del codecs | |
5cbf236d RD |
13161 | if default: |
13162 | wx.SetDefaultPyEncoding(default) | |
13163 | del default | |
5cbf236d RD |
13164 | |
13165 | #---------------------------------------------------------------------------- | |
13166 | ||
d14a1e28 RD |
13167 | class PyDeadObjectError(AttributeError): |
13168 | pass | |
13169 | ||
d14a1e28 RD |
13170 | class _wxPyDeadObject(object): |
13171 | """ | |
13172 | Instances of wx objects that are OOR capable will have their __class__ | |
13173 | changed to this class when the C++ object is deleted. This should help | |
13174 | prevent crashes due to referencing a bogus C++ pointer. | |
13175 | """ | |
13176 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
13177 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
13178 | ||
3a04f143 | 13179 | def __repr__(self): |
d14a1e28 RD |
13180 | if not hasattr(self, "_name"): |
13181 | self._name = "[unknown]" | |
13182 | return self.reprStr % self._name | |
13183 | ||
3a04f143 | 13184 | def __getattr__(self, *args): |
d14a1e28 RD |
13185 | if not hasattr(self, "_name"): |
13186 | self._name = "[unknown]" | |
3a04f143 RD |
13187 | raise PyDeadObjectError(self.attrStr % self._name) |
13188 | ||
13189 | def __nonzero__(self): | |
13190 | return 0 | |
13191 | ||
13192 | ||
13193 | ||
13194 | class PyUnbornObjectError(AttributeError): | |
13195 | pass | |
13196 | ||
13197 | class _wxPyUnbornObject(object): | |
13198 | """ | |
54f9ee45 | 13199 | Some stock objects are created when the wx._core module is |
3a04f143 RD |
13200 | imported, but their C++ instance is not created until the wx.App |
13201 | object is created and initialized. These object instances will | |
13202 | temporarily have their __class__ changed to this class so an | |
13203 | exception will be raised if they are used before the C++ instance | |
13204 | is ready. | |
13205 | """ | |
13206 | ||
13207 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
13208 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
13209 | ||
13210 | def __repr__(self): | |
13211 | #if not hasattr(self, "_name"): | |
13212 | # self._name = "[unknown]" | |
13213 | return self.reprStr #% self._name | |
13214 | ||
13215 | def __getattr__(self, *args): | |
13216 | #if not hasattr(self, "_name"): | |
13217 | # self._name = "[unknown]" | |
13218 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
d14a1e28 RD |
13219 | |
13220 | def __nonzero__(self): | |
13221 | return 0 | |
13222 | ||
13223 | ||
13224 | #---------------------------------------------------------------------------- | |
d14a1e28 RD |
13225 | |
13226 | def CallAfter(callable, *args, **kw): | |
13227 | """ | |
13228 | Call the specified function after the current and pending event | |
13229 | handlers have been completed. This is also good for making GUI | |
61863841 RD |
13230 | method calls from non-GUI threads. Any extra positional or |
13231 | keyword args are passed on to the callable when it is called. | |
13232 | ||
13233 | :see: `wx.FutureCall` | |
d14a1e28 RD |
13234 | """ |
13235 | app = wx.GetApp() | |
dfbb5885 | 13236 | assert app is not None, 'No wx.App created yet' |
d14a1e28 | 13237 | |
148275d3 RD |
13238 | if not hasattr(app, "_CallAfterId"): |
13239 | app._CallAfterId = wx.NewEventType() | |
13240 | app.Connect(-1, -1, app._CallAfterId, | |
13241 | lambda event: event.callable(*event.args, **event.kw) ) | |
d14a1e28 | 13242 | evt = wx.PyEvent() |
148275d3 | 13243 | evt.SetEventType(app._CallAfterId) |
d14a1e28 RD |
13244 | evt.callable = callable |
13245 | evt.args = args | |
13246 | evt.kw = kw | |
13247 | wx.PostEvent(app, evt) | |
13248 | ||
d14a1e28 RD |
13249 | #---------------------------------------------------------------------------- |
13250 | ||
13251 | ||
13252 | class FutureCall: | |
13253 | """ | |
8ac8dba0 | 13254 | A convenience class for `wx.Timer`, that calls the given callable |
d14a1e28 RD |
13255 | object once after the given amount of milliseconds, passing any |
13256 | positional or keyword args. The return value of the callable is | |
61863841 | 13257 | availbale after it has been run with the `GetResult` method. |
d14a1e28 RD |
13258 | |
13259 | If you don't need to get the return value or restart the timer | |
13260 | then there is no need to hold a reference to this object. It will | |
13261 | hold a reference to itself while the timer is running (the timer | |
13262 | has a reference to self.Notify) but the cycle will be broken when | |
13263 | the timer completes, automatically cleaning up the wx.FutureCall | |
13264 | object. | |
61863841 RD |
13265 | |
13266 | :see: `wx.CallAfter` | |
d14a1e28 RD |
13267 | """ |
13268 | def __init__(self, millis, callable, *args, **kwargs): | |
13269 | self.millis = millis | |
13270 | self.callable = callable | |
13271 | self.SetArgs(*args, **kwargs) | |
13272 | self.runCount = 0 | |
4276dc52 | 13273 | self.running = False |
d14a1e28 RD |
13274 | self.hasRun = False |
13275 | self.result = None | |
13276 | self.timer = None | |
13277 | self.Start() | |
13278 | ||
13279 | def __del__(self): | |
13280 | self.Stop() | |
13281 | ||
13282 | ||
13283 | def Start(self, millis=None, *args, **kwargs): | |
13284 | """ | |
13285 | (Re)start the timer | |
13286 | """ | |
13287 | self.hasRun = False | |
13288 | if millis is not None: | |
13289 | self.millis = millis | |
13290 | if args or kwargs: | |
13291 | self.SetArgs(*args, **kwargs) | |
13292 | self.Stop() | |
13293 | self.timer = wx.PyTimer(self.Notify) | |
13294 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
4276dc52 | 13295 | self.running = True |
d14a1e28 RD |
13296 | Restart = Start |
13297 | ||
13298 | ||
13299 | def Stop(self): | |
13300 | """ | |
13301 | Stop and destroy the timer. | |
13302 | """ | |
13303 | if self.timer is not None: | |
13304 | self.timer.Stop() | |
13305 | self.timer = None | |
13306 | ||
13307 | ||
13308 | def GetInterval(self): | |
13309 | if self.timer is not None: | |
13310 | return self.timer.GetInterval() | |
13311 | else: | |
13312 | return 0 | |
13313 | ||
13314 | ||
13315 | def IsRunning(self): | |
13316 | return self.timer is not None and self.timer.IsRunning() | |
13317 | ||
13318 | ||
13319 | def SetArgs(self, *args, **kwargs): | |
13320 | """ | |
13321 | (Re)set the args passed to the callable object. This is | |
13322 | useful in conjunction with Restart if you want to schedule a | |
13323 | new call to the same callable object but with different | |
13324 | parameters. | |
13325 | """ | |
13326 | self.args = args | |
13327 | self.kwargs = kwargs | |
13328 | ||
13329 | ||
13330 | def HasRun(self): | |
13331 | return self.hasRun | |
13332 | ||
13333 | def GetResult(self): | |
13334 | return self.result | |
13335 | ||
13336 | def Notify(self): | |
13337 | """ | |
13338 | The timer has expired so call the callable. | |
13339 | """ | |
13340 | if self.callable and getattr(self.callable, 'im_self', True): | |
13341 | self.runCount += 1 | |
4276dc52 | 13342 | self.running = False |
d14a1e28 RD |
13343 | self.result = self.callable(*self.args, **self.kwargs) |
13344 | self.hasRun = True | |
4276dc52 RD |
13345 | if not self.running: |
13346 | # if it wasn't restarted, then cleanup | |
13347 | wx.CallAfter(self.Stop) | |
d14a1e28 RD |
13348 | |
13349 | ||
a95a7133 RD |
13350 | |
13351 | #---------------------------------------------------------------------------- | |
13352 | # Control which items in this module should be documented by epydoc. | |
13353 | # We allow only classes and functions, which will help reduce the size | |
13354 | # of the docs by filtering out the zillions of constants, EVT objects, | |
13355 | # and etc that don't make much sense by themselves, but are instead | |
13356 | # documented (or will be) as part of the classes/functions/methods | |
13357 | # where they should be used. | |
13358 | ||
66c033b4 RD |
13359 | class __DocFilter: |
13360 | """ | |
13361 | A filter for epydoc that only allows non-Ptr classes and | |
13362 | fucntions, in order to reduce the clutter in the API docs. | |
13363 | """ | |
13364 | def __init__(self, globals): | |
13365 | self._globals = globals | |
13366 | ||
13367 | def __call__(self, name): | |
13368 | import types | |
13369 | obj = self._globals.get(name, None) | |
13370 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: | |
13371 | return False | |
13372 | if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'): | |
13373 | return False | |
13374 | return True | |
a95a7133 | 13375 | |
d14a1e28 RD |
13376 | #---------------------------------------------------------------------------- |
13377 | #---------------------------------------------------------------------------- | |
13378 | ||
13379 | # Import other modules in this package that should show up in the | |
13380 | # "core" wx namespace | |
54f9ee45 RD |
13381 | from _gdi import * |
13382 | from _windows import * | |
13383 | from _controls import * | |
13384 | from _misc import * | |
d14a1e28 | 13385 | |
3a04f143 RD |
13386 | |
13387 | # Fixup the stock objects since they can't be used yet. (They will be | |
13388 | # restored in wx.PyApp.OnInit.) | |
54f9ee45 | 13389 | _core_._wxPyFixStockObjects() |
3a04f143 | 13390 | |
d14a1e28 RD |
13391 | #---------------------------------------------------------------------------- |
13392 | #---------------------------------------------------------------------------- | |
13393 | ||
13394 |