]>
Commit | Line | Data |
---|---|---|
d55e5bfc RD |
1 | # This file was created automatically by SWIG. |
2 | # Don't modify this file, modify the SWIG interface instead. | |
3 | ||
5b5c9bc7 | 4 | import _core_ |
d55e5bfc | 5 | |
36ed4f51 RD |
6 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1): |
7 | if (name == "this"): | |
8 | if isinstance(value, class_type): | |
9 | self.__dict__[name] = value.this | |
10 | if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown | |
11 | del value.thisown | |
12 | return | |
13 | method = class_type.__swig_setmethods__.get(name,None) | |
14 | if method: return method(self,value) | |
15 | if (not static) or hasattr(self,name) or (name == "thisown"): | |
16 | self.__dict__[name] = value | |
17 | else: | |
18 | raise AttributeError("You cannot add attributes to %s" % self) | |
19 | ||
20 | def _swig_setattr(self,class_type,name,value): | |
21 | return _swig_setattr_nondynamic(self,class_type,name,value,0) | |
22 | ||
23 | def _swig_getattr(self,class_type,name): | |
24 | method = class_type.__swig_getmethods__.get(name,None) | |
25 | if method: return method(self) | |
26 | raise AttributeError,name | |
27 | ||
28 | import types | |
29 | try: | |
30 | _object = types.ObjectType | |
31 | _newclass = 1 | |
32 | except AttributeError: | |
33 | class _object : pass | |
34 | _newclass = 0 | |
35 | del types | |
36 | ||
37 | ||
38 | def _swig_setattr_nondynamic_method(set): | |
39 | def set_attr(self,name,value): | |
40 | if hasattr(self,name) or (name in ("this", "thisown")): | |
41 | set(self,name,value) | |
42 | else: | |
43 | raise AttributeError("You cannot add attributes to %s" % self) | |
44 | return set_attr | |
45 | ||
46 | ||
d55e5bfc RD |
47 | #// Give a reference to the dictionary of this module to the C++ extension |
48 | #// code. | |
49 | _core_._wxPySetDictionary(vars()) | |
50 | ||
51 | #// A little trick to make 'wx' be a reference to this module so wx.Names can | |
52 | #// be used here. | |
53 | import sys as _sys | |
54 | wx = _sys.modules[__name__] | |
55 | ||
d6c14a4c RD |
56 | |
57 | #---------------------------------------------------------------------------- | |
58 | ||
59 | def _deprecated(callable, msg=None): | |
60 | """ | |
61 | Create a wrapper function that will raise a DeprecationWarning | |
62 | before calling the callable. | |
63 | """ | |
64 | if msg is None: | |
65 | msg = "%s is deprecated" % callable | |
66 | def deprecatedWrapper(*args, **kwargs): | |
67 | import warnings | |
68 | warnings.warn(msg, DeprecationWarning, stacklevel=2) | |
69 | return callable(*args, **kwargs) | |
70 | deprecatedWrapper.__doc__ = msg | |
71 | return deprecatedWrapper | |
72 | ||
73 | ||
74 | #---------------------------------------------------------------------------- | |
75 | ||
5b5c9bc7 RD |
76 | NOT_FOUND = _core_.NOT_FOUND |
77 | VSCROLL = _core_.VSCROLL | |
78 | HSCROLL = _core_.HSCROLL | |
79 | CAPTION = _core_.CAPTION | |
80 | DOUBLE_BORDER = _core_.DOUBLE_BORDER | |
81 | SUNKEN_BORDER = _core_.SUNKEN_BORDER | |
82 | RAISED_BORDER = _core_.RAISED_BORDER | |
83 | BORDER = _core_.BORDER | |
84 | SIMPLE_BORDER = _core_.SIMPLE_BORDER | |
85 | STATIC_BORDER = _core_.STATIC_BORDER | |
86 | TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW | |
87 | NO_BORDER = _core_.NO_BORDER | |
88 | DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER | |
6d88e192 | 89 | DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE |
5b5c9bc7 RD |
90 | TAB_TRAVERSAL = _core_.TAB_TRAVERSAL |
91 | WANTS_CHARS = _core_.WANTS_CHARS | |
92 | POPUP_WINDOW = _core_.POPUP_WINDOW | |
93 | CENTER_FRAME = _core_.CENTER_FRAME | |
94 | CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN | |
95 | CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN | |
96 | CLIP_CHILDREN = _core_.CLIP_CHILDREN | |
97 | CLIP_SIBLINGS = _core_.CLIP_SIBLINGS | |
98 | ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB | |
99 | RETAINED = _core_.RETAINED | |
100 | BACKINGSTORE = _core_.BACKINGSTORE | |
101 | COLOURED = _core_.COLOURED | |
102 | FIXED_LENGTH = _core_.FIXED_LENGTH | |
103 | LB_NEEDED_SB = _core_.LB_NEEDED_SB | |
104 | LB_ALWAYS_SB = _core_.LB_ALWAYS_SB | |
105 | LB_SORT = _core_.LB_SORT | |
106 | LB_SINGLE = _core_.LB_SINGLE | |
107 | LB_MULTIPLE = _core_.LB_MULTIPLE | |
108 | LB_EXTENDED = _core_.LB_EXTENDED | |
109 | LB_OWNERDRAW = _core_.LB_OWNERDRAW | |
110 | LB_HSCROLL = _core_.LB_HSCROLL | |
111 | PROCESS_ENTER = _core_.PROCESS_ENTER | |
112 | PASSWORD = _core_.PASSWORD | |
113 | CB_SIMPLE = _core_.CB_SIMPLE | |
114 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
115 | CB_SORT = _core_.CB_SORT | |
116 | CB_READONLY = _core_.CB_READONLY | |
117 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
118 | RA_VERTICAL = _core_.RA_VERTICAL | |
119 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
120 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
121 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX | |
122 | RB_GROUP = _core_.RB_GROUP | |
123 | RB_SINGLE = _core_.RB_SINGLE | |
124 | SB_HORIZONTAL = _core_.SB_HORIZONTAL | |
125 | SB_VERTICAL = _core_.SB_VERTICAL | |
126 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX | |
127 | ST_SIZEGRIP = _core_.ST_SIZEGRIP | |
128 | ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE | |
129 | FLOOD_SURFACE = _core_.FLOOD_SURFACE | |
130 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
131 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
132 | WINDING_RULE = _core_.WINDING_RULE | |
133 | TOOL_TOP = _core_.TOOL_TOP | |
134 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
135 | TOOL_LEFT = _core_.TOOL_LEFT | |
136 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
137 | OK = _core_.OK | |
138 | YES_NO = _core_.YES_NO | |
139 | CANCEL = _core_.CANCEL | |
140 | YES = _core_.YES | |
141 | NO = _core_.NO | |
142 | NO_DEFAULT = _core_.NO_DEFAULT | |
143 | YES_DEFAULT = _core_.YES_DEFAULT | |
144 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION | |
145 | ICON_HAND = _core_.ICON_HAND | |
146 | ICON_QUESTION = _core_.ICON_QUESTION | |
147 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
148 | ICON_STOP = _core_.ICON_STOP | |
149 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
150 | ICON_MASK = _core_.ICON_MASK | |
151 | ICON_WARNING = _core_.ICON_WARNING | |
152 | ICON_ERROR = _core_.ICON_ERROR | |
153 | FORWARD = _core_.FORWARD | |
154 | BACKWARD = _core_.BACKWARD | |
155 | RESET = _core_.RESET | |
156 | HELP = _core_.HELP | |
157 | MORE = _core_.MORE | |
158 | SETUP = _core_.SETUP | |
159 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
160 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
161 | SIZE_AUTO = _core_.SIZE_AUTO | |
162 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
163 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
943e8dfd | 164 | SIZE_FORCE = _core_.SIZE_FORCE |
5b5c9bc7 RD |
165 | PORTRAIT = _core_.PORTRAIT |
166 | LANDSCAPE = _core_.LANDSCAPE | |
167 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
168 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
169 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
170 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
171 | ID_ANY = _core_.ID_ANY | |
172 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
943e8dfd | 173 | ID_NONE = _core_.ID_NONE |
5b5c9bc7 RD |
174 | ID_LOWEST = _core_.ID_LOWEST |
175 | ID_OPEN = _core_.ID_OPEN | |
176 | ID_CLOSE = _core_.ID_CLOSE | |
177 | ID_NEW = _core_.ID_NEW | |
178 | ID_SAVE = _core_.ID_SAVE | |
179 | ID_SAVEAS = _core_.ID_SAVEAS | |
180 | ID_REVERT = _core_.ID_REVERT | |
181 | ID_EXIT = _core_.ID_EXIT | |
182 | ID_UNDO = _core_.ID_UNDO | |
183 | ID_REDO = _core_.ID_REDO | |
184 | ID_HELP = _core_.ID_HELP | |
185 | ID_PRINT = _core_.ID_PRINT | |
186 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
187 | ID_PREVIEW = _core_.ID_PREVIEW | |
188 | ID_ABOUT = _core_.ID_ABOUT | |
189 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
190 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
191 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
192 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
193 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL | |
194 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
195 | ID_CUT = _core_.ID_CUT | |
196 | ID_COPY = _core_.ID_COPY | |
197 | ID_PASTE = _core_.ID_PASTE | |
198 | ID_CLEAR = _core_.ID_CLEAR | |
199 | ID_FIND = _core_.ID_FIND | |
200 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
201 | ID_SELECTALL = _core_.ID_SELECTALL | |
202 | ID_DELETE = _core_.ID_DELETE | |
203 | ID_REPLACE = _core_.ID_REPLACE | |
204 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
205 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
206 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
207 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
208 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
209 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
210 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
211 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
212 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
213 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
214 | ID_FILE1 = _core_.ID_FILE1 | |
215 | ID_FILE2 = _core_.ID_FILE2 | |
216 | ID_FILE3 = _core_.ID_FILE3 | |
217 | ID_FILE4 = _core_.ID_FILE4 | |
218 | ID_FILE5 = _core_.ID_FILE5 | |
219 | ID_FILE6 = _core_.ID_FILE6 | |
220 | ID_FILE7 = _core_.ID_FILE7 | |
221 | ID_FILE8 = _core_.ID_FILE8 | |
222 | ID_FILE9 = _core_.ID_FILE9 | |
223 | ID_OK = _core_.ID_OK | |
224 | ID_CANCEL = _core_.ID_CANCEL | |
225 | ID_APPLY = _core_.ID_APPLY | |
226 | ID_YES = _core_.ID_YES | |
227 | ID_NO = _core_.ID_NO | |
228 | ID_STATIC = _core_.ID_STATIC | |
229 | ID_FORWARD = _core_.ID_FORWARD | |
230 | ID_BACKWARD = _core_.ID_BACKWARD | |
231 | ID_DEFAULT = _core_.ID_DEFAULT | |
232 | ID_MORE = _core_.ID_MORE | |
233 | ID_SETUP = _core_.ID_SETUP | |
234 | ID_RESET = _core_.ID_RESET | |
235 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
236 | ID_YESTOALL = _core_.ID_YESTOALL | |
237 | ID_NOTOALL = _core_.ID_NOTOALL | |
238 | ID_ABORT = _core_.ID_ABORT | |
239 | ID_RETRY = _core_.ID_RETRY | |
240 | ID_IGNORE = _core_.ID_IGNORE | |
241 | ID_ADD = _core_.ID_ADD | |
242 | ID_REMOVE = _core_.ID_REMOVE | |
243 | ID_UP = _core_.ID_UP | |
244 | ID_DOWN = _core_.ID_DOWN | |
245 | ID_HOME = _core_.ID_HOME | |
246 | ID_REFRESH = _core_.ID_REFRESH | |
247 | ID_STOP = _core_.ID_STOP | |
248 | ID_INDEX = _core_.ID_INDEX | |
249 | ID_BOLD = _core_.ID_BOLD | |
250 | ID_ITALIC = _core_.ID_ITALIC | |
251 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
252 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
253 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
254 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
255 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
256 | ID_INDENT = _core_.ID_INDENT | |
257 | ID_UNINDENT = _core_.ID_UNINDENT | |
258 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
259 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
260 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
261 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
262 | ID_UNDELETE = _core_.ID_UNDELETE | |
263 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
264 | ID_HIGHEST = _core_.ID_HIGHEST | |
265 | OPEN = _core_.OPEN | |
266 | SAVE = _core_.SAVE | |
267 | HIDE_READONLY = _core_.HIDE_READONLY | |
268 | OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT | |
269 | FILE_MUST_EXIST = _core_.FILE_MUST_EXIST | |
270 | MULTIPLE = _core_.MULTIPLE | |
271 | CHANGE_DIR = _core_.CHANGE_DIR | |
272 | ACCEL_ALT = _core_.ACCEL_ALT | |
273 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
274 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
275 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
276 | PD_AUTO_HIDE = _core_.PD_AUTO_HIDE | |
277 | PD_APP_MODAL = _core_.PD_APP_MODAL | |
278 | PD_CAN_ABORT = _core_.PD_CAN_ABORT | |
279 | PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME | |
280 | PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME | |
281 | PD_REMAINING_TIME = _core_.PD_REMAINING_TIME | |
282 | PD_SMOOTH = _core_.PD_SMOOTH | |
283 | PD_CAN_SKIP = _core_.PD_CAN_SKIP | |
284 | DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON | |
285 | DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE | |
286 | MENU_TEAROFF = _core_.MENU_TEAROFF | |
287 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
288 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
289 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
290 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
291 | LI_VERTICAL = _core_.LI_VERTICAL | |
292 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
293 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
294 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
295 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
296 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
297 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
298 | MM_TEXT = _core_.MM_TEXT | |
299 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
300 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
301 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
302 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
303 | MM_TWIPS = _core_.MM_TWIPS | |
304 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
305 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
306 | MM_POINTS = _core_.MM_POINTS | |
307 | MM_METRIC = _core_.MM_METRIC | |
308 | CENTRE = _core_.CENTRE | |
309 | CENTER = _core_.CENTER | |
310 | HORIZONTAL = _core_.HORIZONTAL | |
311 | VERTICAL = _core_.VERTICAL | |
312 | BOTH = _core_.BOTH | |
313 | LEFT = _core_.LEFT | |
314 | RIGHT = _core_.RIGHT | |
315 | UP = _core_.UP | |
316 | DOWN = _core_.DOWN | |
317 | TOP = _core_.TOP | |
318 | BOTTOM = _core_.BOTTOM | |
319 | NORTH = _core_.NORTH | |
320 | SOUTH = _core_.SOUTH | |
321 | WEST = _core_.WEST | |
322 | EAST = _core_.EAST | |
323 | ALL = _core_.ALL | |
324 | ALIGN_NOT = _core_.ALIGN_NOT | |
325 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
326 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
327 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
328 | ALIGN_TOP = _core_.ALIGN_TOP | |
329 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
330 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
331 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
332 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
333 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
334 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
335 | ALIGN_MASK = _core_.ALIGN_MASK | |
336 | STRETCH_NOT = _core_.STRETCH_NOT | |
337 | SHRINK = _core_.SHRINK | |
338 | GROW = _core_.GROW | |
339 | EXPAND = _core_.EXPAND | |
340 | SHAPED = _core_.SHAPED | |
341 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
342 | TILE = _core_.TILE | |
343 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
344 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
345 | BORDER_NONE = _core_.BORDER_NONE | |
346 | BORDER_STATIC = _core_.BORDER_STATIC | |
347 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
348 | BORDER_RAISED = _core_.BORDER_RAISED | |
349 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
350 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
351 | BORDER_MASK = _core_.BORDER_MASK | |
352 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM | |
353 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
354 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
355 | DEFAULT = _core_.DEFAULT | |
356 | DECORATIVE = _core_.DECORATIVE | |
357 | ROMAN = _core_.ROMAN | |
358 | SCRIPT = _core_.SCRIPT | |
359 | SWISS = _core_.SWISS | |
360 | MODERN = _core_.MODERN | |
361 | TELETYPE = _core_.TELETYPE | |
362 | VARIABLE = _core_.VARIABLE | |
363 | FIXED = _core_.FIXED | |
364 | NORMAL = _core_.NORMAL | |
365 | LIGHT = _core_.LIGHT | |
366 | BOLD = _core_.BOLD | |
367 | ITALIC = _core_.ITALIC | |
368 | SLANT = _core_.SLANT | |
369 | SOLID = _core_.SOLID | |
370 | DOT = _core_.DOT | |
371 | LONG_DASH = _core_.LONG_DASH | |
372 | SHORT_DASH = _core_.SHORT_DASH | |
373 | DOT_DASH = _core_.DOT_DASH | |
374 | USER_DASH = _core_.USER_DASH | |
375 | TRANSPARENT = _core_.TRANSPARENT | |
376 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
377 | STIPPLE_MASK = _core_.STIPPLE_MASK |
378 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
5b5c9bc7 RD |
379 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH |
380 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
381 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
382 | CROSS_HATCH = _core_.CROSS_HATCH | |
383 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
384 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
385 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
386 | JOIN_MITER = _core_.JOIN_MITER | |
387 | JOIN_ROUND = _core_.JOIN_ROUND | |
388 | CAP_ROUND = _core_.CAP_ROUND | |
389 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
390 | CAP_BUTT = _core_.CAP_BUTT | |
391 | CLEAR = _core_.CLEAR | |
392 | XOR = _core_.XOR | |
393 | INVERT = _core_.INVERT | |
394 | OR_REVERSE = _core_.OR_REVERSE | |
395 | AND_REVERSE = _core_.AND_REVERSE | |
396 | COPY = _core_.COPY | |
397 | AND = _core_.AND | |
398 | AND_INVERT = _core_.AND_INVERT | |
399 | NO_OP = _core_.NO_OP | |
400 | NOR = _core_.NOR | |
401 | EQUIV = _core_.EQUIV | |
402 | SRC_INVERT = _core_.SRC_INVERT | |
403 | OR_INVERT = _core_.OR_INVERT | |
404 | NAND = _core_.NAND | |
405 | OR = _core_.OR | |
406 | SET = _core_.SET | |
407 | WXK_BACK = _core_.WXK_BACK | |
408 | WXK_TAB = _core_.WXK_TAB | |
409 | WXK_RETURN = _core_.WXK_RETURN | |
410 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
411 | WXK_SPACE = _core_.WXK_SPACE | |
412 | WXK_DELETE = _core_.WXK_DELETE | |
413 | WXK_START = _core_.WXK_START | |
414 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
415 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
416 | WXK_CANCEL = _core_.WXK_CANCEL | |
417 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
418 | WXK_CLEAR = _core_.WXK_CLEAR | |
419 | WXK_SHIFT = _core_.WXK_SHIFT | |
420 | WXK_ALT = _core_.WXK_ALT | |
421 | WXK_CONTROL = _core_.WXK_CONTROL | |
422 | WXK_MENU = _core_.WXK_MENU | |
423 | WXK_PAUSE = _core_.WXK_PAUSE | |
424 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
425 | WXK_PRIOR = _core_.WXK_PRIOR | |
426 | WXK_NEXT = _core_.WXK_NEXT | |
427 | WXK_END = _core_.WXK_END | |
428 | WXK_HOME = _core_.WXK_HOME | |
429 | WXK_LEFT = _core_.WXK_LEFT | |
430 | WXK_UP = _core_.WXK_UP | |
431 | WXK_RIGHT = _core_.WXK_RIGHT | |
432 | WXK_DOWN = _core_.WXK_DOWN | |
433 | WXK_SELECT = _core_.WXK_SELECT | |
434 | WXK_PRINT = _core_.WXK_PRINT | |
435 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
436 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
437 | WXK_INSERT = _core_.WXK_INSERT | |
438 | WXK_HELP = _core_.WXK_HELP | |
439 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
440 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
441 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
442 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
443 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
444 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
445 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
446 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
447 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
448 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
449 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
450 | WXK_ADD = _core_.WXK_ADD | |
451 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
452 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
453 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
454 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
455 | WXK_F1 = _core_.WXK_F1 | |
456 | WXK_F2 = _core_.WXK_F2 | |
457 | WXK_F3 = _core_.WXK_F3 | |
458 | WXK_F4 = _core_.WXK_F4 | |
459 | WXK_F5 = _core_.WXK_F5 | |
460 | WXK_F6 = _core_.WXK_F6 | |
461 | WXK_F7 = _core_.WXK_F7 | |
462 | WXK_F8 = _core_.WXK_F8 | |
463 | WXK_F9 = _core_.WXK_F9 | |
464 | WXK_F10 = _core_.WXK_F10 | |
465 | WXK_F11 = _core_.WXK_F11 | |
466 | WXK_F12 = _core_.WXK_F12 | |
467 | WXK_F13 = _core_.WXK_F13 | |
468 | WXK_F14 = _core_.WXK_F14 | |
469 | WXK_F15 = _core_.WXK_F15 | |
470 | WXK_F16 = _core_.WXK_F16 | |
471 | WXK_F17 = _core_.WXK_F17 | |
472 | WXK_F18 = _core_.WXK_F18 | |
473 | WXK_F19 = _core_.WXK_F19 | |
474 | WXK_F20 = _core_.WXK_F20 | |
475 | WXK_F21 = _core_.WXK_F21 | |
476 | WXK_F22 = _core_.WXK_F22 | |
477 | WXK_F23 = _core_.WXK_F23 | |
478 | WXK_F24 = _core_.WXK_F24 | |
479 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
480 | WXK_SCROLL = _core_.WXK_SCROLL | |
481 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
482 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
483 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
484 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
485 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
486 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
487 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
488 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
489 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
490 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
491 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
492 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
493 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
494 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
495 | WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR | |
496 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
497 | WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT | |
498 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
499 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
500 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
501 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
502 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
503 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
504 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
505 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
506 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
507 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
508 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
509 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
510 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
511 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
512 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
513 | WXK_COMMAND = _core_.WXK_COMMAND | |
514 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
515 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
516 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
517 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
518 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
519 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
520 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
521 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
522 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
523 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
524 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
525 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
526 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
527 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
528 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
529 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
530 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
531 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
532 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
533 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
534 | PAPER_NONE = _core_.PAPER_NONE | |
535 | PAPER_LETTER = _core_.PAPER_LETTER | |
536 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
537 | PAPER_A4 = _core_.PAPER_A4 | |
538 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
539 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
540 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
541 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
542 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
543 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
544 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
545 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
546 | PAPER_A3 = _core_.PAPER_A3 | |
547 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
548 | PAPER_A5 = _core_.PAPER_A5 | |
549 | PAPER_B4 = _core_.PAPER_B4 | |
550 | PAPER_B5 = _core_.PAPER_B5 | |
551 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
552 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
553 | PAPER_10X14 = _core_.PAPER_10X14 | |
554 | PAPER_11X17 = _core_.PAPER_11X17 | |
555 | PAPER_NOTE = _core_.PAPER_NOTE | |
556 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
557 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
558 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
559 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
560 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
561 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
562 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
563 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
564 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
565 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
566 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
567 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
568 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
569 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
570 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
571 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
572 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
573 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
574 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
575 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
576 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
577 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
578 | PAPER_9X11 = _core_.PAPER_9X11 | |
579 | PAPER_10X11 = _core_.PAPER_10X11 | |
580 | PAPER_15X11 = _core_.PAPER_15X11 | |
581 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
582 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
583 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
584 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
585 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
586 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
587 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
588 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
589 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
590 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
591 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
592 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
593 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
594 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
595 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
596 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
597 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
598 | PAPER_A2 = _core_.PAPER_A2 | |
599 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
600 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
034e3677 RD |
601 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD |
602 | PAPER_A6 = _core_.PAPER_A6 | |
603 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
604 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
605 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
606 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
607 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
608 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
609 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
610 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
611 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
612 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
613 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
614 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
615 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
616 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
617 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
618 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
619 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
620 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
621 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
622 | PAPER_12X11 = _core_.PAPER_12X11 | |
623 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
624 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
625 | PAPER_P16K = _core_.PAPER_P16K | |
626 | PAPER_P32K = _core_.PAPER_P32K | |
627 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
628 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
629 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
630 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
631 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
632 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
633 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
634 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
635 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
636 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
637 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
638 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
639 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
640 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
641 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
642 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
643 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
644 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
645 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
646 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
647 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
648 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
649 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
650 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
5b5c9bc7 RD |
651 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX |
652 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
653 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
654 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
655 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
656 | ITEM_CHECK = _core_.ITEM_CHECK | |
657 | ITEM_RADIO = _core_.ITEM_RADIO | |
658 | ITEM_MAX = _core_.ITEM_MAX | |
659 | HT_NOWHERE = _core_.HT_NOWHERE | |
660 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
661 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
662 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
663 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
664 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
665 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
666 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
667 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
668 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
669 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
670 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
671 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
672 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
673 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
674 | HT_MAX = _core_.HT_MAX | |
675 | MOD_NONE = _core_.MOD_NONE | |
676 | MOD_ALT = _core_.MOD_ALT | |
677 | MOD_CONTROL = _core_.MOD_CONTROL | |
943e8dfd | 678 | MOD_ALTGR = _core_.MOD_ALTGR |
5b5c9bc7 | 679 | MOD_SHIFT = _core_.MOD_SHIFT |
943e8dfd | 680 | MOD_META = _core_.MOD_META |
5b5c9bc7 | 681 | MOD_WIN = _core_.MOD_WIN |
943e8dfd RD |
682 | MOD_CMD = _core_.MOD_CMD |
683 | MOD_ALL = _core_.MOD_ALL | |
5b5c9bc7 RD |
684 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE |
685 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
686 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
d55e5bfc RD |
687 | #--------------------------------------------------------------------------- |
688 | ||
5b5c9bc7 | 689 | class Object(object): |
d55e5bfc RD |
690 | """ |
691 | The base class for most wx objects, although in wxPython not | |
692 | much functionality is needed nor exposed. | |
693 | """ | |
694 | def __init__(self): raise RuntimeError, "No constructor defined" | |
695 | def __repr__(self): | |
696 | return "<%s.%s; proxy of C++ wxObject instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
697 | def GetClassName(*args, **kwargs): | |
698 | """ | |
5b5c9bc7 | 699 | GetClassName(self) -> String |
d55e5bfc RD |
700 | |
701 | Returns the class name of the C++ class using wxRTTI. | |
702 | """ | |
5b5c9bc7 | 703 | return _core_.Object_GetClassName(*args, **kwargs) |
d55e5bfc RD |
704 | |
705 | def Destroy(*args, **kwargs): | |
706 | """ | |
707 | Destroy(self) | |
708 | ||
709 | Deletes the C++ object this Python object is a proxy for. | |
710 | """ | |
5b5c9bc7 | 711 | return _core_.Object_Destroy(*args, **kwargs) |
d55e5bfc RD |
712 | |
713 | ||
5b5c9bc7 | 714 | class ObjectPtr(Object): |
d55e5bfc RD |
715 | def __init__(self, this): |
716 | self.this = this | |
717 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
718 | self.__class__ = Object |
719 | _core_.Object_swigregister(ObjectPtr) | |
720 | _wxPySetDictionary = _core_._wxPySetDictionary | |
d55e5bfc | 721 | |
5b5c9bc7 | 722 | _wxPyFixStockObjects = _core_._wxPyFixStockObjects |
d55e5bfc | 723 | |
5b5c9bc7 | 724 | cvar = _core_.cvar |
d55e5bfc RD |
725 | EmptyString = cvar.EmptyString |
726 | ||
727 | #--------------------------------------------------------------------------- | |
728 | ||
5b5c9bc7 RD |
729 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID |
730 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
731 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
732 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
733 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
734 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
735 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
736 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
737 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
738 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
739 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
740 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
741 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
742 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
743 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
744 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
745 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
746 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
747 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
748 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
749 | CURSOR_NONE = _core_.CURSOR_NONE | |
750 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
751 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
752 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
753 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
754 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
755 | CURSOR_HAND = _core_.CURSOR_HAND | |
756 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
757 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
758 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
759 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
760 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
761 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
762 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
763 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
764 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
765 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
766 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
767 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
768 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
769 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
770 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
771 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
772 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
773 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
774 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
775 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
776 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
777 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
778 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
779 | CURSOR_MAX = _core_.CURSOR_MAX | |
d55e5bfc RD |
780 | #--------------------------------------------------------------------------- |
781 | ||
5b5c9bc7 | 782 | class Size(object): |
d55e5bfc | 783 | """ |
15817c7e | 784 | wx.Size is a useful data structure used to represent the size of |
36ed4f51 RD |
785 | something. It simply contians integer width and height |
786 | proprtites. In most places in wxPython where a wx.Size is | |
787 | expected a (width, height) tuple can be used instead. | |
d55e5bfc RD |
788 | """ |
789 | def __repr__(self): | |
790 | return "<%s.%s; proxy of C++ wxSize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 RD |
791 | width = property(_core_.Size_width_get, _core_.Size_width_set) |
792 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
d55e5bfc RD |
793 | x = width; y = height |
794 | def __init__(self, *args, **kwargs): | |
795 | """ | |
5b5c9bc7 | 796 | __init__(self, int w=0, int h=0) -> Size |
d55e5bfc RD |
797 | |
798 | Creates a size object. | |
799 | """ | |
5b5c9bc7 | 800 | newobj = _core_.new_Size(*args, **kwargs) |
d55e5bfc RD |
801 | self.this = newobj.this |
802 | self.thisown = 1 | |
803 | del newobj.thisown | |
5b5c9bc7 | 804 | def __del__(self, destroy=_core_.delete_Size): |
d55e5bfc RD |
805 | """__del__(self)""" |
806 | try: | |
807 | if self.thisown: destroy(self) | |
808 | except: pass | |
809 | ||
810 | def __eq__(*args, **kwargs): | |
811 | """ | |
5b5c9bc7 | 812 | __eq__(self, Size sz) -> bool |
d55e5bfc RD |
813 | |
814 | Test for equality of wx.Size objects. | |
815 | """ | |
5b5c9bc7 | 816 | return _core_.Size___eq__(*args, **kwargs) |
d55e5bfc RD |
817 | |
818 | def __ne__(*args, **kwargs): | |
819 | """ | |
5b5c9bc7 | 820 | __ne__(self, Size sz) -> bool |
d55e5bfc RD |
821 | |
822 | Test for inequality. | |
823 | """ | |
5b5c9bc7 | 824 | return _core_.Size___ne__(*args, **kwargs) |
d55e5bfc RD |
825 | |
826 | def __add__(*args, **kwargs): | |
827 | """ | |
5b5c9bc7 | 828 | __add__(self, Size sz) -> Size |
d55e5bfc RD |
829 | |
830 | Add sz's proprties to this and return the result. | |
831 | """ | |
5b5c9bc7 | 832 | return _core_.Size___add__(*args, **kwargs) |
d55e5bfc RD |
833 | |
834 | def __sub__(*args, **kwargs): | |
835 | """ | |
5b5c9bc7 | 836 | __sub__(self, Size sz) -> Size |
d55e5bfc RD |
837 | |
838 | Subtract sz's properties from this and return the result. | |
839 | """ | |
5b5c9bc7 | 840 | return _core_.Size___sub__(*args, **kwargs) |
d55e5bfc RD |
841 | |
842 | def IncTo(*args, **kwargs): | |
843 | """ | |
5b5c9bc7 | 844 | IncTo(self, Size sz) |
d55e5bfc RD |
845 | |
846 | Increments this object so that both of its dimensions are not less | |
847 | than the corresponding dimensions of the size. | |
848 | """ | |
5b5c9bc7 | 849 | return _core_.Size_IncTo(*args, **kwargs) |
d55e5bfc RD |
850 | |
851 | def DecTo(*args, **kwargs): | |
852 | """ | |
5b5c9bc7 | 853 | DecTo(self, Size sz) |
d55e5bfc RD |
854 | |
855 | Decrements this object so that both of its dimensions are not greater | |
856 | than the corresponding dimensions of the size. | |
857 | """ | |
5b5c9bc7 | 858 | return _core_.Size_DecTo(*args, **kwargs) |
d55e5bfc RD |
859 | |
860 | def Set(*args, **kwargs): | |
861 | """ | |
862 | Set(self, int w, int h) | |
863 | ||
864 | Set both width and height. | |
865 | """ | |
5b5c9bc7 | 866 | return _core_.Size_Set(*args, **kwargs) |
d55e5bfc RD |
867 | |
868 | def SetWidth(*args, **kwargs): | |
869 | """SetWidth(self, int w)""" | |
5b5c9bc7 | 870 | return _core_.Size_SetWidth(*args, **kwargs) |
d55e5bfc RD |
871 | |
872 | def SetHeight(*args, **kwargs): | |
873 | """SetHeight(self, int h)""" | |
5b5c9bc7 | 874 | return _core_.Size_SetHeight(*args, **kwargs) |
d55e5bfc RD |
875 | |
876 | def GetWidth(*args, **kwargs): | |
877 | """GetWidth(self) -> int""" | |
5b5c9bc7 | 878 | return _core_.Size_GetWidth(*args, **kwargs) |
d55e5bfc RD |
879 | |
880 | def GetHeight(*args, **kwargs): | |
881 | """GetHeight(self) -> int""" | |
5b5c9bc7 | 882 | return _core_.Size_GetHeight(*args, **kwargs) |
d55e5bfc RD |
883 | |
884 | def IsFullySpecified(*args, **kwargs): | |
885 | """ | |
886 | IsFullySpecified(self) -> bool | |
887 | ||
888 | Returns True if both components of the size are non-default values. | |
889 | """ | |
5b5c9bc7 | 890 | return _core_.Size_IsFullySpecified(*args, **kwargs) |
d55e5bfc RD |
891 | |
892 | def SetDefaults(*args, **kwargs): | |
893 | """ | |
5b5c9bc7 | 894 | SetDefaults(self, Size size) |
d55e5bfc | 895 | |
15817c7e RD |
896 | Combine this size with the other one replacing the default components |
897 | of this object (i.e. equal to -1) with those of the other. | |
d55e5bfc | 898 | """ |
5b5c9bc7 | 899 | return _core_.Size_SetDefaults(*args, **kwargs) |
d55e5bfc RD |
900 | |
901 | def Get(*args, **kwargs): | |
902 | """ | |
903 | Get() -> (width,height) | |
904 | ||
905 | Returns the width and height properties as a tuple. | |
906 | """ | |
5b5c9bc7 | 907 | return _core_.Size_Get(*args, **kwargs) |
d55e5bfc | 908 | |
15817c7e | 909 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
910 | def __str__(self): return str(self.Get()) |
911 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
912 | def __len__(self): return len(self.Get()) | |
913 | def __getitem__(self, index): return self.Get()[index] | |
914 | def __setitem__(self, index, val): | |
915 | if index == 0: self.width = val | |
916 | elif index == 1: self.height = val | |
917 | else: raise IndexError | |
918 | def __nonzero__(self): return self.Get() != (0,0) | |
919 | __safe_for_unpickling__ = True | |
920 | def __reduce__(self): return (wx.Size, self.Get()) | |
921 | ||
922 | ||
5b5c9bc7 | 923 | class SizePtr(Size): |
d55e5bfc RD |
924 | def __init__(self, this): |
925 | self.this = this | |
926 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
927 | self.__class__ = Size |
928 | _core_.Size_swigregister(SizePtr) | |
d55e5bfc RD |
929 | |
930 | #--------------------------------------------------------------------------- | |
931 | ||
5b5c9bc7 | 932 | class RealPoint(object): |
d55e5bfc | 933 | """ |
15817c7e RD |
934 | A data structure for representing a point or position with floating |
935 | point x and y properties. In wxPython most places that expect a | |
936 | wx.RealPoint can also accept a (x,y) tuple. | |
d55e5bfc RD |
937 | """ |
938 | def __repr__(self): | |
939 | return "<%s.%s; proxy of C++ wxRealPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 RD |
940 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
941 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
d55e5bfc RD |
942 | def __init__(self, *args, **kwargs): |
943 | """ | |
5b5c9bc7 | 944 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
d55e5bfc RD |
945 | |
946 | Create a wx.RealPoint object | |
947 | """ | |
5b5c9bc7 | 948 | newobj = _core_.new_RealPoint(*args, **kwargs) |
d55e5bfc RD |
949 | self.this = newobj.this |
950 | self.thisown = 1 | |
951 | del newobj.thisown | |
5b5c9bc7 | 952 | def __del__(self, destroy=_core_.delete_RealPoint): |
d55e5bfc RD |
953 | """__del__(self)""" |
954 | try: | |
955 | if self.thisown: destroy(self) | |
956 | except: pass | |
957 | ||
958 | def __eq__(*args, **kwargs): | |
959 | """ | |
5b5c9bc7 | 960 | __eq__(self, RealPoint pt) -> bool |
d55e5bfc RD |
961 | |
962 | Test for equality of wx.RealPoint objects. | |
963 | """ | |
5b5c9bc7 | 964 | return _core_.RealPoint___eq__(*args, **kwargs) |
d55e5bfc RD |
965 | |
966 | def __ne__(*args, **kwargs): | |
967 | """ | |
5b5c9bc7 | 968 | __ne__(self, RealPoint pt) -> bool |
d55e5bfc RD |
969 | |
970 | Test for inequality of wx.RealPoint objects. | |
971 | """ | |
5b5c9bc7 | 972 | return _core_.RealPoint___ne__(*args, **kwargs) |
d55e5bfc RD |
973 | |
974 | def __add__(*args, **kwargs): | |
975 | """ | |
5b5c9bc7 | 976 | __add__(self, RealPoint pt) -> RealPoint |
d55e5bfc RD |
977 | |
978 | Add pt's proprties to this and return the result. | |
979 | """ | |
5b5c9bc7 | 980 | return _core_.RealPoint___add__(*args, **kwargs) |
d55e5bfc RD |
981 | |
982 | def __sub__(*args, **kwargs): | |
983 | """ | |
5b5c9bc7 | 984 | __sub__(self, RealPoint pt) -> RealPoint |
d55e5bfc RD |
985 | |
986 | Subtract pt's proprties from this and return the result | |
987 | """ | |
5b5c9bc7 | 988 | return _core_.RealPoint___sub__(*args, **kwargs) |
d55e5bfc RD |
989 | |
990 | def Set(*args, **kwargs): | |
991 | """ | |
992 | Set(self, double x, double y) | |
993 | ||
994 | Set both the x and y properties | |
995 | """ | |
5b5c9bc7 | 996 | return _core_.RealPoint_Set(*args, **kwargs) |
d55e5bfc RD |
997 | |
998 | def Get(*args, **kwargs): | |
999 | """ | |
1000 | Get() -> (x,y) | |
1001 | ||
1002 | Return the x and y properties as a tuple. | |
1003 | """ | |
5b5c9bc7 | 1004 | return _core_.RealPoint_Get(*args, **kwargs) |
d55e5bfc | 1005 | |
15817c7e | 1006 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1007 | def __str__(self): return str(self.Get()) |
1008 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
1009 | def __len__(self): return len(self.Get()) | |
1010 | def __getitem__(self, index): return self.Get()[index] | |
1011 | def __setitem__(self, index, val): | |
1012 | if index == 0: self.x = val | |
1013 | elif index == 1: self.y = val | |
1014 | else: raise IndexError | |
1015 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1016 | __safe_for_unpickling__ = True | |
1017 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
1018 | ||
1019 | ||
5b5c9bc7 | 1020 | class RealPointPtr(RealPoint): |
d55e5bfc RD |
1021 | def __init__(self, this): |
1022 | self.this = this | |
1023 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1024 | self.__class__ = RealPoint |
1025 | _core_.RealPoint_swigregister(RealPointPtr) | |
d55e5bfc RD |
1026 | |
1027 | #--------------------------------------------------------------------------- | |
1028 | ||
5b5c9bc7 | 1029 | class Point(object): |
d55e5bfc | 1030 | """ |
15817c7e RD |
1031 | A data structure for representing a point or position with integer x |
1032 | and y properties. Most places in wxPython that expect a wx.Point can | |
1033 | also accept a (x,y) tuple. | |
d55e5bfc RD |
1034 | """ |
1035 | def __repr__(self): | |
1036 | return "<%s.%s; proxy of C++ wxPoint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 RD |
1037 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1038 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
d55e5bfc RD |
1039 | def __init__(self, *args, **kwargs): |
1040 | """ | |
5b5c9bc7 | 1041 | __init__(self, int x=0, int y=0) -> Point |
d55e5bfc RD |
1042 | |
1043 | Create a wx.Point object | |
1044 | """ | |
5b5c9bc7 | 1045 | newobj = _core_.new_Point(*args, **kwargs) |
d55e5bfc RD |
1046 | self.this = newobj.this |
1047 | self.thisown = 1 | |
1048 | del newobj.thisown | |
5b5c9bc7 | 1049 | def __del__(self, destroy=_core_.delete_Point): |
d55e5bfc RD |
1050 | """__del__(self)""" |
1051 | try: | |
1052 | if self.thisown: destroy(self) | |
1053 | except: pass | |
1054 | ||
1055 | def __eq__(*args, **kwargs): | |
1056 | """ | |
5b5c9bc7 | 1057 | __eq__(self, Point pt) -> bool |
d55e5bfc RD |
1058 | |
1059 | Test for equality of wx.Point objects. | |
1060 | """ | |
5b5c9bc7 | 1061 | return _core_.Point___eq__(*args, **kwargs) |
d55e5bfc RD |
1062 | |
1063 | def __ne__(*args, **kwargs): | |
1064 | """ | |
5b5c9bc7 | 1065 | __ne__(self, Point pt) -> bool |
d55e5bfc RD |
1066 | |
1067 | Test for inequality of wx.Point objects. | |
1068 | """ | |
5b5c9bc7 | 1069 | return _core_.Point___ne__(*args, **kwargs) |
d55e5bfc RD |
1070 | |
1071 | def __add__(*args, **kwargs): | |
1072 | """ | |
5b5c9bc7 | 1073 | __add__(self, Point pt) -> Point |
d55e5bfc RD |
1074 | |
1075 | Add pt's proprties to this and return the result. | |
1076 | """ | |
5b5c9bc7 | 1077 | return _core_.Point___add__(*args, **kwargs) |
d55e5bfc RD |
1078 | |
1079 | def __sub__(*args, **kwargs): | |
1080 | """ | |
5b5c9bc7 | 1081 | __sub__(self, Point pt) -> Point |
d55e5bfc RD |
1082 | |
1083 | Subtract pt's proprties from this and return the result | |
1084 | """ | |
5b5c9bc7 | 1085 | return _core_.Point___sub__(*args, **kwargs) |
d55e5bfc RD |
1086 | |
1087 | def __iadd__(*args, **kwargs): | |
1088 | """ | |
5b5c9bc7 | 1089 | __iadd__(self, Point pt) -> Point |
d55e5bfc RD |
1090 | |
1091 | Add pt to this object. | |
1092 | """ | |
5b5c9bc7 | 1093 | return _core_.Point___iadd__(*args, **kwargs) |
d55e5bfc RD |
1094 | |
1095 | def __isub__(*args, **kwargs): | |
1096 | """ | |
5b5c9bc7 | 1097 | __isub__(self, Point pt) -> Point |
d55e5bfc RD |
1098 | |
1099 | Subtract pt from this object. | |
1100 | """ | |
5b5c9bc7 | 1101 | return _core_.Point___isub__(*args, **kwargs) |
d55e5bfc RD |
1102 | |
1103 | def Set(*args, **kwargs): | |
1104 | """ | |
1105 | Set(self, long x, long y) | |
1106 | ||
1107 | Set both the x and y properties | |
1108 | """ | |
5b5c9bc7 | 1109 | return _core_.Point_Set(*args, **kwargs) |
d55e5bfc RD |
1110 | |
1111 | def Get(*args, **kwargs): | |
1112 | """ | |
1113 | Get() -> (x,y) | |
1114 | ||
1115 | Return the x and y properties as a tuple. | |
1116 | """ | |
5b5c9bc7 | 1117 | return _core_.Point_Get(*args, **kwargs) |
d55e5bfc | 1118 | |
15817c7e | 1119 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1120 | def __str__(self): return str(self.Get()) |
1121 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1122 | def __len__(self): return len(self.Get()) | |
1123 | def __getitem__(self, index): return self.Get()[index] | |
1124 | def __setitem__(self, index, val): | |
1125 | if index == 0: self.x = val | |
1126 | elif index == 1: self.y = val | |
1127 | else: raise IndexError | |
1128 | def __nonzero__(self): return self.Get() != (0,0) | |
1129 | __safe_for_unpickling__ = True | |
1130 | def __reduce__(self): return (wx.Point, self.Get()) | |
1131 | ||
1132 | ||
5b5c9bc7 | 1133 | class PointPtr(Point): |
d55e5bfc RD |
1134 | def __init__(self, this): |
1135 | self.this = this | |
1136 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1137 | self.__class__ = Point |
1138 | _core_.Point_swigregister(PointPtr) | |
d55e5bfc RD |
1139 | |
1140 | #--------------------------------------------------------------------------- | |
1141 | ||
5b5c9bc7 | 1142 | class Rect(object): |
d55e5bfc | 1143 | """ |
15817c7e RD |
1144 | A class for representing and manipulating rectangles. It has x, y, |
1145 | width and height properties. In wxPython most palces that expect a | |
1146 | wx.Rect can also accept a (x,y,width,height) tuple. | |
d55e5bfc RD |
1147 | """ |
1148 | def __repr__(self): | |
1149 | return "<%s.%s; proxy of C++ wxRect instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1150 | def __init__(self, *args, **kwargs): | |
1151 | """ | |
5b5c9bc7 | 1152 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
d55e5bfc RD |
1153 | |
1154 | Create a new Rect object. | |
1155 | """ | |
5b5c9bc7 | 1156 | newobj = _core_.new_Rect(*args, **kwargs) |
d55e5bfc RD |
1157 | self.this = newobj.this |
1158 | self.thisown = 1 | |
1159 | del newobj.thisown | |
5b5c9bc7 | 1160 | def __del__(self, destroy=_core_.delete_Rect): |
d55e5bfc RD |
1161 | """__del__(self)""" |
1162 | try: | |
1163 | if self.thisown: destroy(self) | |
1164 | except: pass | |
1165 | ||
1166 | def GetX(*args, **kwargs): | |
1167 | """GetX(self) -> int""" | |
5b5c9bc7 | 1168 | return _core_.Rect_GetX(*args, **kwargs) |
d55e5bfc RD |
1169 | |
1170 | def SetX(*args, **kwargs): | |
1171 | """SetX(self, int x)""" | |
5b5c9bc7 | 1172 | return _core_.Rect_SetX(*args, **kwargs) |
d55e5bfc RD |
1173 | |
1174 | def GetY(*args, **kwargs): | |
1175 | """GetY(self) -> int""" | |
5b5c9bc7 | 1176 | return _core_.Rect_GetY(*args, **kwargs) |
d55e5bfc RD |
1177 | |
1178 | def SetY(*args, **kwargs): | |
1179 | """SetY(self, int y)""" | |
5b5c9bc7 | 1180 | return _core_.Rect_SetY(*args, **kwargs) |
d55e5bfc RD |
1181 | |
1182 | def GetWidth(*args, **kwargs): | |
1183 | """GetWidth(self) -> int""" | |
5b5c9bc7 | 1184 | return _core_.Rect_GetWidth(*args, **kwargs) |
d55e5bfc RD |
1185 | |
1186 | def SetWidth(*args, **kwargs): | |
1187 | """SetWidth(self, int w)""" | |
5b5c9bc7 | 1188 | return _core_.Rect_SetWidth(*args, **kwargs) |
d55e5bfc RD |
1189 | |
1190 | def GetHeight(*args, **kwargs): | |
1191 | """GetHeight(self) -> int""" | |
5b5c9bc7 | 1192 | return _core_.Rect_GetHeight(*args, **kwargs) |
d55e5bfc RD |
1193 | |
1194 | def SetHeight(*args, **kwargs): | |
1195 | """SetHeight(self, int h)""" | |
5b5c9bc7 | 1196 | return _core_.Rect_SetHeight(*args, **kwargs) |
d55e5bfc RD |
1197 | |
1198 | def GetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
1199 | """GetPosition(self) -> Point""" |
1200 | return _core_.Rect_GetPosition(*args, **kwargs) | |
d55e5bfc RD |
1201 | |
1202 | def SetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
1203 | """SetPosition(self, Point p)""" |
1204 | return _core_.Rect_SetPosition(*args, **kwargs) | |
d55e5bfc RD |
1205 | |
1206 | def GetSize(*args, **kwargs): | |
5b5c9bc7 RD |
1207 | """GetSize(self) -> Size""" |
1208 | return _core_.Rect_GetSize(*args, **kwargs) | |
d55e5bfc RD |
1209 | |
1210 | def SetSize(*args, **kwargs): | |
5b5c9bc7 RD |
1211 | """SetSize(self, Size s)""" |
1212 | return _core_.Rect_SetSize(*args, **kwargs) | |
d55e5bfc | 1213 | |
aff4cc5c RD |
1214 | def IsEmpty(*args, **kwargs): |
1215 | """IsEmpty(self) -> bool""" | |
5b5c9bc7 | 1216 | return _core_.Rect_IsEmpty(*args, **kwargs) |
aff4cc5c | 1217 | |
d55e5bfc | 1218 | def GetTopLeft(*args, **kwargs): |
5b5c9bc7 RD |
1219 | """GetTopLeft(self) -> Point""" |
1220 | return _core_.Rect_GetTopLeft(*args, **kwargs) | |
d55e5bfc RD |
1221 | |
1222 | def SetTopLeft(*args, **kwargs): | |
5b5c9bc7 RD |
1223 | """SetTopLeft(self, Point p)""" |
1224 | return _core_.Rect_SetTopLeft(*args, **kwargs) | |
d55e5bfc RD |
1225 | |
1226 | def GetBottomRight(*args, **kwargs): | |
5b5c9bc7 RD |
1227 | """GetBottomRight(self) -> Point""" |
1228 | return _core_.Rect_GetBottomRight(*args, **kwargs) | |
d55e5bfc RD |
1229 | |
1230 | def SetBottomRight(*args, **kwargs): | |
5b5c9bc7 RD |
1231 | """SetBottomRight(self, Point p)""" |
1232 | return _core_.Rect_SetBottomRight(*args, **kwargs) | |
d55e5bfc RD |
1233 | |
1234 | def GetLeft(*args, **kwargs): | |
1235 | """GetLeft(self) -> int""" | |
5b5c9bc7 | 1236 | return _core_.Rect_GetLeft(*args, **kwargs) |
d55e5bfc RD |
1237 | |
1238 | def GetTop(*args, **kwargs): | |
1239 | """GetTop(self) -> int""" | |
5b5c9bc7 | 1240 | return _core_.Rect_GetTop(*args, **kwargs) |
d55e5bfc RD |
1241 | |
1242 | def GetBottom(*args, **kwargs): | |
1243 | """GetBottom(self) -> int""" | |
5b5c9bc7 | 1244 | return _core_.Rect_GetBottom(*args, **kwargs) |
d55e5bfc RD |
1245 | |
1246 | def GetRight(*args, **kwargs): | |
1247 | """GetRight(self) -> int""" | |
5b5c9bc7 | 1248 | return _core_.Rect_GetRight(*args, **kwargs) |
d55e5bfc RD |
1249 | |
1250 | def SetLeft(*args, **kwargs): | |
1251 | """SetLeft(self, int left)""" | |
5b5c9bc7 | 1252 | return _core_.Rect_SetLeft(*args, **kwargs) |
d55e5bfc RD |
1253 | |
1254 | def SetRight(*args, **kwargs): | |
1255 | """SetRight(self, int right)""" | |
5b5c9bc7 | 1256 | return _core_.Rect_SetRight(*args, **kwargs) |
d55e5bfc RD |
1257 | |
1258 | def SetTop(*args, **kwargs): | |
1259 | """SetTop(self, int top)""" | |
5b5c9bc7 | 1260 | return _core_.Rect_SetTop(*args, **kwargs) |
d55e5bfc RD |
1261 | |
1262 | def SetBottom(*args, **kwargs): | |
1263 | """SetBottom(self, int bottom)""" | |
5b5c9bc7 | 1264 | return _core_.Rect_SetBottom(*args, **kwargs) |
d55e5bfc RD |
1265 | |
1266 | position = property(GetPosition, SetPosition) | |
1267 | size = property(GetSize, SetSize) | |
1268 | left = property(GetLeft, SetLeft) | |
1269 | right = property(GetRight, SetRight) | |
1270 | top = property(GetTop, SetTop) | |
1271 | bottom = property(GetBottom, SetBottom) | |
1272 | ||
1273 | def Inflate(*args, **kwargs): | |
1274 | """ | |
5b5c9bc7 | 1275 | Inflate(self, int dx, int dy) -> Rect |
d55e5bfc | 1276 | |
091fdbfa RD |
1277 | Increases the size of the rectangle. |
1278 | ||
1279 | The left border is moved farther left and the right border is moved | |
1280 | farther right by ``dx``. The upper border is moved farther up and the | |
1281 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1282 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1283 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1284 | opposite happens: the rectangle size decreases in the respective | |
1285 | direction. | |
1286 | ||
1287 | The change is made to the rectangle inplace, if instead you need a | |
1288 | copy that is inflated, preserving the original then make the copy | |
1289 | first:: | |
1290 | ||
1291 | copy = wx.Rect(*original) | |
1292 | copy.Inflate(10,15) | |
1293 | ||
1294 | ||
d55e5bfc | 1295 | """ |
5b5c9bc7 | 1296 | return _core_.Rect_Inflate(*args, **kwargs) |
d55e5bfc RD |
1297 | |
1298 | def Deflate(*args, **kwargs): | |
1299 | """ | |
5b5c9bc7 | 1300 | Deflate(self, int dx, int dy) -> Rect |
d55e5bfc | 1301 | |
091fdbfa RD |
1302 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1303 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1304 | `Inflate` for a full description. | |
d55e5bfc | 1305 | """ |
5b5c9bc7 | 1306 | return _core_.Rect_Deflate(*args, **kwargs) |
d55e5bfc RD |
1307 | |
1308 | def OffsetXY(*args, **kwargs): | |
1309 | """ | |
1310 | OffsetXY(self, int dx, int dy) | |
1311 | ||
15817c7e RD |
1312 | Moves the rectangle by the specified offset. If dx is positive, the |
1313 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1314 | bottom, otherwise it is moved to the left or top respectively. | |
d55e5bfc | 1315 | """ |
5b5c9bc7 | 1316 | return _core_.Rect_OffsetXY(*args, **kwargs) |
d55e5bfc RD |
1317 | |
1318 | def Offset(*args, **kwargs): | |
1319 | """ | |
5b5c9bc7 | 1320 | Offset(self, Point pt) |
d55e5bfc RD |
1321 | |
1322 | Same as OffsetXY but uses dx,dy from Point | |
1323 | """ | |
5b5c9bc7 | 1324 | return _core_.Rect_Offset(*args, **kwargs) |
d55e5bfc RD |
1325 | |
1326 | def Intersect(*args, **kwargs): | |
1327 | """ | |
5b5c9bc7 | 1328 | Intersect(self, Rect rect) -> Rect |
d55e5bfc | 1329 | |
5cbf236d | 1330 | Returns the intersectsion of this rectangle and rect. |
d55e5bfc | 1331 | """ |
5b5c9bc7 | 1332 | return _core_.Rect_Intersect(*args, **kwargs) |
d55e5bfc | 1333 | |
5cbf236d RD |
1334 | def Union(*args, **kwargs): |
1335 | """ | |
5b5c9bc7 | 1336 | Union(self, Rect rect) -> Rect |
5cbf236d RD |
1337 | |
1338 | Returns the union of this rectangle and rect. | |
1339 | """ | |
5b5c9bc7 | 1340 | return _core_.Rect_Union(*args, **kwargs) |
5cbf236d | 1341 | |
d55e5bfc RD |
1342 | def __add__(*args, **kwargs): |
1343 | """ | |
5b5c9bc7 | 1344 | __add__(self, Rect rect) -> Rect |
d55e5bfc RD |
1345 | |
1346 | Add the properties of rect to this rectangle and return the result. | |
1347 | """ | |
5b5c9bc7 | 1348 | return _core_.Rect___add__(*args, **kwargs) |
d55e5bfc RD |
1349 | |
1350 | def __iadd__(*args, **kwargs): | |
1351 | """ | |
5b5c9bc7 | 1352 | __iadd__(self, Rect rect) -> Rect |
d55e5bfc RD |
1353 | |
1354 | Add the properties of rect to this rectangle, updating this rectangle. | |
1355 | """ | |
5b5c9bc7 | 1356 | return _core_.Rect___iadd__(*args, **kwargs) |
d55e5bfc RD |
1357 | |
1358 | def __eq__(*args, **kwargs): | |
1359 | """ | |
5b5c9bc7 | 1360 | __eq__(self, Rect rect) -> bool |
d55e5bfc RD |
1361 | |
1362 | Test for equality. | |
1363 | """ | |
5b5c9bc7 | 1364 | return _core_.Rect___eq__(*args, **kwargs) |
d55e5bfc RD |
1365 | |
1366 | def __ne__(*args, **kwargs): | |
1367 | """ | |
5b5c9bc7 | 1368 | __ne__(self, Rect rect) -> bool |
d55e5bfc RD |
1369 | |
1370 | Test for inequality. | |
1371 | """ | |
5b5c9bc7 | 1372 | return _core_.Rect___ne__(*args, **kwargs) |
d55e5bfc RD |
1373 | |
1374 | def InsideXY(*args, **kwargs): | |
1375 | """ | |
1376 | InsideXY(self, int x, int y) -> bool | |
1377 | ||
1378 | Return True if the point is (not strcitly) inside the rect. | |
1379 | """ | |
5b5c9bc7 | 1380 | return _core_.Rect_InsideXY(*args, **kwargs) |
d55e5bfc RD |
1381 | |
1382 | def Inside(*args, **kwargs): | |
1383 | """ | |
5b5c9bc7 | 1384 | Inside(self, Point pt) -> bool |
d55e5bfc RD |
1385 | |
1386 | Return True if the point is (not strcitly) inside the rect. | |
1387 | """ | |
5b5c9bc7 | 1388 | return _core_.Rect_Inside(*args, **kwargs) |
d55e5bfc RD |
1389 | |
1390 | def Intersects(*args, **kwargs): | |
1391 | """ | |
5b5c9bc7 | 1392 | Intersects(self, Rect rect) -> bool |
d55e5bfc RD |
1393 | |
1394 | Returns True if the rectangles have a non empty intersection. | |
1395 | """ | |
5b5c9bc7 | 1396 | return _core_.Rect_Intersects(*args, **kwargs) |
d55e5bfc | 1397 | |
5b5c9bc7 RD |
1398 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) |
1399 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1400 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1401 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
d55e5bfc RD |
1402 | def Set(*args, **kwargs): |
1403 | """ | |
1404 | Set(self, int x=0, int y=0, int width=0, int height=0) | |
1405 | ||
1406 | Set all rectangle properties. | |
1407 | """ | |
5b5c9bc7 | 1408 | return _core_.Rect_Set(*args, **kwargs) |
d55e5bfc RD |
1409 | |
1410 | def Get(*args, **kwargs): | |
1411 | """ | |
1412 | Get() -> (x,y,width,height) | |
1413 | ||
1414 | Return the rectangle properties as a tuple. | |
1415 | """ | |
5b5c9bc7 | 1416 | return _core_.Rect_Get(*args, **kwargs) |
d55e5bfc | 1417 | |
15817c7e | 1418 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1419 | def __str__(self): return str(self.Get()) |
1420 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1421 | def __len__(self): return len(self.Get()) | |
1422 | def __getitem__(self, index): return self.Get()[index] | |
1423 | def __setitem__(self, index, val): | |
1424 | if index == 0: self.x = val | |
1425 | elif index == 1: self.y = val | |
1426 | elif index == 2: self.width = val | |
1427 | elif index == 3: self.height = val | |
1428 | else: raise IndexError | |
1429 | def __nonzero__(self): return self.Get() != (0,0,0,0) | |
1430 | __safe_for_unpickling__ = True | |
1431 | def __reduce__(self): return (wx.Rect, self.Get()) | |
1432 | ||
1433 | ||
5b5c9bc7 | 1434 | class RectPtr(Rect): |
d55e5bfc RD |
1435 | def __init__(self, this): |
1436 | self.this = this | |
1437 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1438 | self.__class__ = Rect |
1439 | _core_.Rect_swigregister(RectPtr) | |
d55e5bfc RD |
1440 | |
1441 | def RectPP(*args, **kwargs): | |
1442 | """ | |
5b5c9bc7 | 1443 | RectPP(Point topLeft, Point bottomRight) -> Rect |
d55e5bfc RD |
1444 | |
1445 | Create a new Rect object from Points representing two corners. | |
1446 | """ | |
5b5c9bc7 | 1447 | val = _core_.new_RectPP(*args, **kwargs) |
d55e5bfc RD |
1448 | val.thisown = 1 |
1449 | return val | |
1450 | ||
1451 | def RectPS(*args, **kwargs): | |
1452 | """ | |
5b5c9bc7 | 1453 | RectPS(Point pos, Size size) -> Rect |
d55e5bfc RD |
1454 | |
1455 | Create a new Rect from a position and size. | |
1456 | """ | |
5b5c9bc7 | 1457 | val = _core_.new_RectPS(*args, **kwargs) |
d55e5bfc RD |
1458 | val.thisown = 1 |
1459 | return val | |
1460 | ||
070c48b4 RD |
1461 | def RectS(*args, **kwargs): |
1462 | """ | |
5b5c9bc7 | 1463 | RectS(Size size) -> Rect |
070c48b4 RD |
1464 | |
1465 | Create a new Rect from a size only. | |
1466 | """ | |
5b5c9bc7 | 1467 | val = _core_.new_RectS(*args, **kwargs) |
070c48b4 RD |
1468 | val.thisown = 1 |
1469 | return val | |
1470 | ||
d55e5bfc | 1471 | |
5b5c9bc7 | 1472 | def IntersectRect(*args, **kwargs): |
d55e5bfc RD |
1473 | """ |
1474 | IntersectRect(Rect r1, Rect r2) -> Rect | |
1475 | ||
1476 | Calculate and return the intersection of r1 and r2. | |
1477 | """ | |
5b5c9bc7 | 1478 | return _core_.IntersectRect(*args, **kwargs) |
d55e5bfc RD |
1479 | #--------------------------------------------------------------------------- |
1480 | ||
5b5c9bc7 | 1481 | class Point2D(object): |
15817c7e RD |
1482 | """ |
1483 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1484 | with floating point values. | |
1485 | """ | |
d55e5bfc RD |
1486 | def __repr__(self): |
1487 | return "<%s.%s; proxy of C++ wxPoint2D instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1488 | def __init__(self, *args, **kwargs): | |
1489 | """ | |
5b5c9bc7 | 1490 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
d55e5bfc RD |
1491 | |
1492 | Create a w.Point2D object. | |
1493 | """ | |
5b5c9bc7 | 1494 | newobj = _core_.new_Point2D(*args, **kwargs) |
d55e5bfc RD |
1495 | self.this = newobj.this |
1496 | self.thisown = 1 | |
1497 | del newobj.thisown | |
1498 | def GetFloor(*args, **kwargs): | |
fd2dc343 RD |
1499 | """ |
1500 | GetFloor() -> (x,y) | |
1501 | ||
1502 | Convert to integer | |
1503 | """ | |
5b5c9bc7 | 1504 | return _core_.Point2D_GetFloor(*args, **kwargs) |
d55e5bfc RD |
1505 | |
1506 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1507 | """ |
1508 | GetRounded() -> (x,y) | |
1509 | ||
1510 | Convert to integer | |
1511 | """ | |
5b5c9bc7 | 1512 | return _core_.Point2D_GetRounded(*args, **kwargs) |
d55e5bfc RD |
1513 | |
1514 | def GetVectorLength(*args, **kwargs): | |
1515 | """GetVectorLength(self) -> double""" | |
5b5c9bc7 | 1516 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
d55e5bfc RD |
1517 | |
1518 | def GetVectorAngle(*args, **kwargs): | |
1519 | """GetVectorAngle(self) -> double""" | |
5b5c9bc7 | 1520 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
d55e5bfc RD |
1521 | |
1522 | def SetVectorLength(*args, **kwargs): | |
1523 | """SetVectorLength(self, double length)""" | |
5b5c9bc7 | 1524 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
d55e5bfc RD |
1525 | |
1526 | def SetVectorAngle(*args, **kwargs): | |
1527 | """SetVectorAngle(self, double degrees)""" | |
5b5c9bc7 | 1528 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
d55e5bfc RD |
1529 | |
1530 | def SetPolarCoordinates(self, angle, length): | |
1531 | self.SetVectorLength(length) | |
1532 | self.SetVectorAngle(angle) | |
1533 | def Normalize(self): | |
1534 | self.SetVectorLength(1.0) | |
1535 | ||
1536 | def GetDistance(*args, **kwargs): | |
5b5c9bc7 RD |
1537 | """GetDistance(self, Point2D pt) -> double""" |
1538 | return _core_.Point2D_GetDistance(*args, **kwargs) | |
d55e5bfc RD |
1539 | |
1540 | def GetDistanceSquare(*args, **kwargs): | |
5b5c9bc7 RD |
1541 | """GetDistanceSquare(self, Point2D pt) -> double""" |
1542 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) | |
d55e5bfc RD |
1543 | |
1544 | def GetDotProduct(*args, **kwargs): | |
5b5c9bc7 RD |
1545 | """GetDotProduct(self, Point2D vec) -> double""" |
1546 | return _core_.Point2D_GetDotProduct(*args, **kwargs) | |
d55e5bfc RD |
1547 | |
1548 | def GetCrossProduct(*args, **kwargs): | |
5b5c9bc7 RD |
1549 | """GetCrossProduct(self, Point2D vec) -> double""" |
1550 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) | |
d55e5bfc RD |
1551 | |
1552 | def __neg__(*args, **kwargs): | |
1553 | """ | |
5b5c9bc7 | 1554 | __neg__(self) -> Point2D |
d55e5bfc RD |
1555 | |
1556 | the reflection of this point | |
1557 | """ | |
5b5c9bc7 | 1558 | return _core_.Point2D___neg__(*args, **kwargs) |
d55e5bfc RD |
1559 | |
1560 | def __iadd__(*args, **kwargs): | |
5b5c9bc7 RD |
1561 | """__iadd__(self, Point2D pt) -> Point2D""" |
1562 | return _core_.Point2D___iadd__(*args, **kwargs) | |
d55e5bfc RD |
1563 | |
1564 | def __isub__(*args, **kwargs): | |
5b5c9bc7 RD |
1565 | """__isub__(self, Point2D pt) -> Point2D""" |
1566 | return _core_.Point2D___isub__(*args, **kwargs) | |
d55e5bfc RD |
1567 | |
1568 | def __imul__(*args, **kwargs): | |
5b5c9bc7 RD |
1569 | """__imul__(self, Point2D pt) -> Point2D""" |
1570 | return _core_.Point2D___imul__(*args, **kwargs) | |
d55e5bfc RD |
1571 | |
1572 | def __idiv__(*args, **kwargs): | |
5b5c9bc7 RD |
1573 | """__idiv__(self, Point2D pt) -> Point2D""" |
1574 | return _core_.Point2D___idiv__(*args, **kwargs) | |
d55e5bfc RD |
1575 | |
1576 | def __eq__(*args, **kwargs): | |
1577 | """ | |
5b5c9bc7 | 1578 | __eq__(self, Point2D pt) -> bool |
d55e5bfc RD |
1579 | |
1580 | Test for equality | |
1581 | """ | |
5b5c9bc7 | 1582 | return _core_.Point2D___eq__(*args, **kwargs) |
d55e5bfc RD |
1583 | |
1584 | def __ne__(*args, **kwargs): | |
1585 | """ | |
5b5c9bc7 | 1586 | __ne__(self, Point2D pt) -> bool |
d55e5bfc RD |
1587 | |
1588 | Test for inequality | |
1589 | """ | |
5b5c9bc7 | 1590 | return _core_.Point2D___ne__(*args, **kwargs) |
d55e5bfc | 1591 | |
5b5c9bc7 RD |
1592 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1593 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
d55e5bfc RD |
1594 | def Set(*args, **kwargs): |
1595 | """Set(self, double x=0, double y=0)""" | |
5b5c9bc7 | 1596 | return _core_.Point2D_Set(*args, **kwargs) |
d55e5bfc RD |
1597 | |
1598 | def Get(*args, **kwargs): | |
1599 | """ | |
1600 | Get() -> (x,y) | |
1601 | ||
1602 | Return x and y properties as a tuple. | |
1603 | """ | |
5b5c9bc7 | 1604 | return _core_.Point2D_Get(*args, **kwargs) |
d55e5bfc | 1605 | |
15817c7e | 1606 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
1607 | def __str__(self): return str(self.Get()) |
1608 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1609 | def __len__(self): return len(self.Get()) | |
1610 | def __getitem__(self, index): return self.Get()[index] | |
1611 | def __setitem__(self, index, val): | |
1612 | if index == 0: self.x = val | |
1613 | elif index == 1: self.y = val | |
1614 | else: raise IndexError | |
1615 | def __nonzero__(self): return self.Get() != (0.0, 0.0) | |
1616 | __safe_for_unpickling__ = True | |
1617 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
1618 | ||
1619 | ||
5b5c9bc7 | 1620 | class Point2DPtr(Point2D): |
d55e5bfc RD |
1621 | def __init__(self, this): |
1622 | self.this = this | |
1623 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1624 | self.__class__ = Point2D |
1625 | _core_.Point2D_swigregister(Point2DPtr) | |
d55e5bfc RD |
1626 | |
1627 | def Point2DCopy(*args, **kwargs): | |
1628 | """ | |
5b5c9bc7 | 1629 | Point2DCopy(Point2D pt) -> Point2D |
d55e5bfc RD |
1630 | |
1631 | Create a w.Point2D object. | |
1632 | """ | |
5b5c9bc7 | 1633 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d55e5bfc RD |
1634 | val.thisown = 1 |
1635 | return val | |
1636 | ||
1637 | def Point2DFromPoint(*args, **kwargs): | |
1638 | """ | |
5b5c9bc7 | 1639 | Point2DFromPoint(Point pt) -> Point2D |
d55e5bfc RD |
1640 | |
1641 | Create a w.Point2D object. | |
1642 | """ | |
5b5c9bc7 | 1643 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d55e5bfc RD |
1644 | val.thisown = 1 |
1645 | return val | |
1646 | ||
1647 | #--------------------------------------------------------------------------- | |
1648 | ||
5b5c9bc7 RD |
1649 | FromStart = _core_.FromStart |
1650 | FromCurrent = _core_.FromCurrent | |
1651 | FromEnd = _core_.FromEnd | |
d55e5bfc | 1652 | class InputStream(object): |
36ed4f51 | 1653 | """Proxy of C++ InputStream class""" |
d55e5bfc RD |
1654 | def __repr__(self): |
1655 | return "<%s.%s; proxy of C++ wxPyInputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1656 | def __init__(self, *args, **kwargs): | |
1657 | """__init__(self, PyObject p) -> InputStream""" | |
5b5c9bc7 | 1658 | newobj = _core_.new_InputStream(*args, **kwargs) |
d55e5bfc RD |
1659 | self.this = newobj.this |
1660 | self.thisown = 1 | |
1661 | del newobj.thisown | |
5b5c9bc7 | 1662 | def __del__(self, destroy=_core_.delete_InputStream): |
8fb0e70a RD |
1663 | """__del__(self)""" |
1664 | try: | |
1665 | if self.thisown: destroy(self) | |
1666 | except: pass | |
1667 | ||
d55e5bfc RD |
1668 | def close(*args, **kwargs): |
1669 | """close(self)""" | |
5b5c9bc7 | 1670 | return _core_.InputStream_close(*args, **kwargs) |
d55e5bfc RD |
1671 | |
1672 | def flush(*args, **kwargs): | |
1673 | """flush(self)""" | |
5b5c9bc7 | 1674 | return _core_.InputStream_flush(*args, **kwargs) |
d55e5bfc RD |
1675 | |
1676 | def eof(*args, **kwargs): | |
1677 | """eof(self) -> bool""" | |
5b5c9bc7 | 1678 | return _core_.InputStream_eof(*args, **kwargs) |
d55e5bfc RD |
1679 | |
1680 | def read(*args, **kwargs): | |
1681 | """read(self, int size=-1) -> PyObject""" | |
5b5c9bc7 | 1682 | return _core_.InputStream_read(*args, **kwargs) |
d55e5bfc RD |
1683 | |
1684 | def readline(*args, **kwargs): | |
1685 | """readline(self, int size=-1) -> PyObject""" | |
5b5c9bc7 | 1686 | return _core_.InputStream_readline(*args, **kwargs) |
d55e5bfc RD |
1687 | |
1688 | def readlines(*args, **kwargs): | |
1689 | """readlines(self, int sizehint=-1) -> PyObject""" | |
5b5c9bc7 | 1690 | return _core_.InputStream_readlines(*args, **kwargs) |
d55e5bfc RD |
1691 | |
1692 | def seek(*args, **kwargs): | |
1693 | """seek(self, int offset, int whence=0)""" | |
5b5c9bc7 | 1694 | return _core_.InputStream_seek(*args, **kwargs) |
d55e5bfc RD |
1695 | |
1696 | def tell(*args, **kwargs): | |
1697 | """tell(self) -> int""" | |
5b5c9bc7 | 1698 | return _core_.InputStream_tell(*args, **kwargs) |
d55e5bfc RD |
1699 | |
1700 | def Peek(*args, **kwargs): | |
1701 | """Peek(self) -> char""" | |
5b5c9bc7 | 1702 | return _core_.InputStream_Peek(*args, **kwargs) |
d55e5bfc RD |
1703 | |
1704 | def GetC(*args, **kwargs): | |
1705 | """GetC(self) -> char""" | |
5b5c9bc7 | 1706 | return _core_.InputStream_GetC(*args, **kwargs) |
d55e5bfc RD |
1707 | |
1708 | def LastRead(*args, **kwargs): | |
1709 | """LastRead(self) -> size_t""" | |
5b5c9bc7 | 1710 | return _core_.InputStream_LastRead(*args, **kwargs) |
d55e5bfc RD |
1711 | |
1712 | def CanRead(*args, **kwargs): | |
1713 | """CanRead(self) -> bool""" | |
5b5c9bc7 | 1714 | return _core_.InputStream_CanRead(*args, **kwargs) |
d55e5bfc RD |
1715 | |
1716 | def Eof(*args, **kwargs): | |
1717 | """Eof(self) -> bool""" | |
5b5c9bc7 | 1718 | return _core_.InputStream_Eof(*args, **kwargs) |
d55e5bfc RD |
1719 | |
1720 | def Ungetch(*args, **kwargs): | |
1721 | """Ungetch(self, char c) -> bool""" | |
5b5c9bc7 | 1722 | return _core_.InputStream_Ungetch(*args, **kwargs) |
d55e5bfc RD |
1723 | |
1724 | def SeekI(*args, **kwargs): | |
5b5c9bc7 RD |
1725 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
1726 | return _core_.InputStream_SeekI(*args, **kwargs) | |
d55e5bfc RD |
1727 | |
1728 | def TellI(*args, **kwargs): | |
1729 | """TellI(self) -> long""" | |
5b5c9bc7 | 1730 | return _core_.InputStream_TellI(*args, **kwargs) |
d55e5bfc RD |
1731 | |
1732 | ||
1733 | class InputStreamPtr(InputStream): | |
1734 | def __init__(self, this): | |
1735 | self.this = this | |
1736 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1737 | self.__class__ = InputStream | |
5b5c9bc7 RD |
1738 | _core_.InputStream_swigregister(InputStreamPtr) |
1739 | DefaultPosition = cvar.DefaultPosition | |
1740 | DefaultSize = cvar.DefaultSize | |
d55e5bfc | 1741 | |
5b5c9bc7 RD |
1742 | class OutputStream(object): |
1743 | """Proxy of C++ OutputStream class""" | |
d55e5bfc RD |
1744 | def __init__(self): raise RuntimeError, "No constructor defined" |
1745 | def __repr__(self): | |
1746 | return "<%s.%s; proxy of C++ wxOutputStream instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1747 | def write(*args, **kwargs): | |
1748 | """write(self, PyObject obj)""" | |
5b5c9bc7 | 1749 | return _core_.OutputStream_write(*args, **kwargs) |
d55e5bfc RD |
1750 | |
1751 | ||
5b5c9bc7 | 1752 | class OutputStreamPtr(OutputStream): |
d55e5bfc RD |
1753 | def __init__(self, this): |
1754 | self.this = this | |
1755 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1756 | self.__class__ = OutputStream |
1757 | _core_.OutputStream_swigregister(OutputStreamPtr) | |
d55e5bfc RD |
1758 | |
1759 | #--------------------------------------------------------------------------- | |
1760 | ||
5b5c9bc7 RD |
1761 | class FSFile(Object): |
1762 | """Proxy of C++ FSFile class""" | |
d55e5bfc RD |
1763 | def __repr__(self): |
1764 | return "<%s.%s; proxy of C++ wxFSFile instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1765 | def __init__(self, *args, **kwargs): | |
1766 | """ | |
5b5c9bc7 RD |
1767 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
1768 | DateTime modif) -> FSFile | |
d55e5bfc | 1769 | """ |
5b5c9bc7 | 1770 | newobj = _core_.new_FSFile(*args, **kwargs) |
d55e5bfc RD |
1771 | self.this = newobj.this |
1772 | self.thisown = 1 | |
1773 | del newobj.thisown | |
e2950dbb | 1774 | self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem |
4cf4100f | 1775 | |
5b5c9bc7 | 1776 | def __del__(self, destroy=_core_.delete_FSFile): |
d55e5bfc RD |
1777 | """__del__(self)""" |
1778 | try: | |
1779 | if self.thisown: destroy(self) | |
1780 | except: pass | |
1781 | ||
1782 | def GetStream(*args, **kwargs): | |
5b5c9bc7 RD |
1783 | """GetStream(self) -> InputStream""" |
1784 | return _core_.FSFile_GetStream(*args, **kwargs) | |
d55e5bfc RD |
1785 | |
1786 | def GetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
1787 | """GetMimeType(self) -> String""" |
1788 | return _core_.FSFile_GetMimeType(*args, **kwargs) | |
d55e5bfc RD |
1789 | |
1790 | def GetLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1791 | """GetLocation(self) -> String""" |
1792 | return _core_.FSFile_GetLocation(*args, **kwargs) | |
d55e5bfc RD |
1793 | |
1794 | def GetAnchor(*args, **kwargs): | |
5b5c9bc7 RD |
1795 | """GetAnchor(self) -> String""" |
1796 | return _core_.FSFile_GetAnchor(*args, **kwargs) | |
d55e5bfc RD |
1797 | |
1798 | def GetModificationTime(*args, **kwargs): | |
5b5c9bc7 RD |
1799 | """GetModificationTime(self) -> DateTime""" |
1800 | return _core_.FSFile_GetModificationTime(*args, **kwargs) | |
d55e5bfc RD |
1801 | |
1802 | ||
5b5c9bc7 | 1803 | class FSFilePtr(FSFile): |
d55e5bfc RD |
1804 | def __init__(self, this): |
1805 | self.this = this | |
1806 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1807 | self.__class__ = FSFile |
1808 | _core_.FSFile_swigregister(FSFilePtr) | |
d55e5bfc RD |
1809 | |
1810 | class CPPFileSystemHandler(object): | |
36ed4f51 | 1811 | """Proxy of C++ CPPFileSystemHandler class""" |
d55e5bfc RD |
1812 | def __init__(self): raise RuntimeError, "No constructor defined" |
1813 | def __repr__(self): | |
1814 | return "<%s.%s; proxy of C++ wxFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1815 | ||
1816 | class CPPFileSystemHandlerPtr(CPPFileSystemHandler): | |
1817 | def __init__(self, this): | |
1818 | self.this = this | |
1819 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1820 | self.__class__ = CPPFileSystemHandler | |
5b5c9bc7 | 1821 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandlerPtr) |
d55e5bfc RD |
1822 | |
1823 | class FileSystemHandler(CPPFileSystemHandler): | |
36ed4f51 | 1824 | """Proxy of C++ FileSystemHandler class""" |
d55e5bfc RD |
1825 | def __repr__(self): |
1826 | return "<%s.%s; proxy of C++ wxPyFileSystemHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1827 | def __init__(self, *args, **kwargs): | |
1828 | """__init__(self) -> FileSystemHandler""" | |
5b5c9bc7 | 1829 | newobj = _core_.new_FileSystemHandler(*args, **kwargs) |
d55e5bfc RD |
1830 | self.this = newobj.this |
1831 | self.thisown = 1 | |
1832 | del newobj.thisown | |
1833 | self._setCallbackInfo(self, FileSystemHandler) | |
1834 | ||
1835 | def _setCallbackInfo(*args, **kwargs): | |
1836 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
5b5c9bc7 | 1837 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
1838 | |
1839 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
1840 | """CanOpen(self, String location) -> bool""" |
1841 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1842 | |
1843 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1844 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1845 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1846 | |
1847 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
1848 | """FindFirst(self, String spec, int flags=0) -> String""" |
1849 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
1850 | |
1851 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
1852 | """FindNext(self) -> String""" |
1853 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) | |
d55e5bfc RD |
1854 | |
1855 | def GetProtocol(*args, **kwargs): | |
5b5c9bc7 RD |
1856 | """GetProtocol(self, String location) -> String""" |
1857 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) | |
d55e5bfc RD |
1858 | |
1859 | def GetLeftLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1860 | """GetLeftLocation(self, String location) -> String""" |
1861 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) | |
d55e5bfc RD |
1862 | |
1863 | def GetAnchor(*args, **kwargs): | |
5b5c9bc7 RD |
1864 | """GetAnchor(self, String location) -> String""" |
1865 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) | |
d55e5bfc RD |
1866 | |
1867 | def GetRightLocation(*args, **kwargs): | |
5b5c9bc7 RD |
1868 | """GetRightLocation(self, String location) -> String""" |
1869 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) | |
d55e5bfc RD |
1870 | |
1871 | def GetMimeTypeFromExt(*args, **kwargs): | |
5b5c9bc7 RD |
1872 | """GetMimeTypeFromExt(self, String location) -> String""" |
1873 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) | |
d55e5bfc RD |
1874 | |
1875 | ||
1876 | class FileSystemHandlerPtr(FileSystemHandler): | |
1877 | def __init__(self, this): | |
1878 | self.this = this | |
1879 | if not hasattr(self,"thisown"): self.thisown = 0 | |
1880 | self.__class__ = FileSystemHandler | |
5b5c9bc7 | 1881 | _core_.FileSystemHandler_swigregister(FileSystemHandlerPtr) |
d55e5bfc | 1882 | |
5b5c9bc7 RD |
1883 | class FileSystem(Object): |
1884 | """Proxy of C++ FileSystem class""" | |
d55e5bfc RD |
1885 | def __repr__(self): |
1886 | return "<%s.%s; proxy of C++ wxFileSystem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1887 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
1888 | """__init__(self) -> FileSystem""" |
1889 | newobj = _core_.new_FileSystem(*args, **kwargs) | |
d55e5bfc RD |
1890 | self.this = newobj.this |
1891 | self.thisown = 1 | |
1892 | del newobj.thisown | |
5b5c9bc7 | 1893 | def __del__(self, destroy=_core_.delete_FileSystem): |
d55e5bfc RD |
1894 | """__del__(self)""" |
1895 | try: | |
1896 | if self.thisown: destroy(self) | |
1897 | except: pass | |
1898 | ||
1899 | def ChangePathTo(*args, **kwargs): | |
5b5c9bc7 RD |
1900 | """ChangePathTo(self, String location, bool is_dir=False)""" |
1901 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) | |
d55e5bfc RD |
1902 | |
1903 | def GetPath(*args, **kwargs): | |
5b5c9bc7 RD |
1904 | """GetPath(self) -> String""" |
1905 | return _core_.FileSystem_GetPath(*args, **kwargs) | |
d55e5bfc RD |
1906 | |
1907 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1908 | """OpenFile(self, String location) -> FSFile""" |
1909 | return _core_.FileSystem_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1910 | |
1911 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
1912 | """FindFirst(self, String spec, int flags=0) -> String""" |
1913 | return _core_.FileSystem_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
1914 | |
1915 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
1916 | """FindNext(self) -> String""" |
1917 | return _core_.FileSystem_FindNext(*args, **kwargs) | |
d55e5bfc RD |
1918 | |
1919 | def AddHandler(*args, **kwargs): | |
d6c14a4c | 1920 | """AddHandler(CPPFileSystemHandler handler)""" |
5b5c9bc7 | 1921 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
d55e5bfc RD |
1922 | |
1923 | AddHandler = staticmethod(AddHandler) | |
1924 | def CleanUpHandlers(*args, **kwargs): | |
d6c14a4c | 1925 | """CleanUpHandlers()""" |
5b5c9bc7 | 1926 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
d55e5bfc RD |
1927 | |
1928 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1929 | def FileNameToURL(*args, **kwargs): | |
5b5c9bc7 RD |
1930 | """FileNameToURL(String filename) -> String""" |
1931 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d55e5bfc RD |
1932 | |
1933 | FileNameToURL = staticmethod(FileNameToURL) | |
b411df4a | 1934 | def URLToFileName(*args, **kwargs): |
5b5c9bc7 RD |
1935 | """URLToFileName(String url) -> String""" |
1936 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
b411df4a RD |
1937 | |
1938 | URLToFileName = staticmethod(URLToFileName) | |
d55e5bfc | 1939 | |
5b5c9bc7 | 1940 | class FileSystemPtr(FileSystem): |
d55e5bfc RD |
1941 | def __init__(self, this): |
1942 | self.this = this | |
1943 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1944 | self.__class__ = FileSystem |
1945 | _core_.FileSystem_swigregister(FileSystemPtr) | |
d55e5bfc | 1946 | |
5b5c9bc7 RD |
1947 | def FileSystem_AddHandler(*args, **kwargs): |
1948 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" | |
1949 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
d55e5bfc | 1950 | |
5b5c9bc7 RD |
1951 | def FileSystem_CleanUpHandlers(*args, **kwargs): |
1952 | """FileSystem_CleanUpHandlers()""" | |
1953 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) | |
d55e5bfc | 1954 | |
5b5c9bc7 RD |
1955 | def FileSystem_FileNameToURL(*args, **kwargs): |
1956 | """FileSystem_FileNameToURL(String filename) -> String""" | |
1957 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d55e5bfc | 1958 | |
5b5c9bc7 RD |
1959 | def FileSystem_URLToFileName(*args, **kwargs): |
1960 | """FileSystem_URLToFileName(String url) -> String""" | |
1961 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
b411df4a | 1962 | |
5b5c9bc7 RD |
1963 | class InternetFSHandler(CPPFileSystemHandler): |
1964 | """Proxy of C++ InternetFSHandler class""" | |
d55e5bfc RD |
1965 | def __repr__(self): |
1966 | return "<%s.%s; proxy of C++ wxInternetFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1967 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
1968 | """__init__(self) -> InternetFSHandler""" |
1969 | newobj = _core_.new_InternetFSHandler(*args, **kwargs) | |
d55e5bfc RD |
1970 | self.this = newobj.this |
1971 | self.thisown = 1 | |
1972 | del newobj.thisown | |
1973 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
1974 | """CanOpen(self, String location) -> bool""" |
1975 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
1976 | |
1977 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
1978 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
1979 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
1980 | |
1981 | ||
5b5c9bc7 | 1982 | class InternetFSHandlerPtr(InternetFSHandler): |
d55e5bfc RD |
1983 | def __init__(self, this): |
1984 | self.this = this | |
1985 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
1986 | self.__class__ = InternetFSHandler |
1987 | _core_.InternetFSHandler_swigregister(InternetFSHandlerPtr) | |
d55e5bfc | 1988 | |
5b5c9bc7 RD |
1989 | class ZipFSHandler(CPPFileSystemHandler): |
1990 | """Proxy of C++ ZipFSHandler class""" | |
d55e5bfc RD |
1991 | def __repr__(self): |
1992 | return "<%s.%s; proxy of C++ wxZipFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
1993 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
1994 | """__init__(self) -> ZipFSHandler""" |
1995 | newobj = _core_.new_ZipFSHandler(*args, **kwargs) | |
d55e5bfc RD |
1996 | self.this = newobj.this |
1997 | self.thisown = 1 | |
1998 | del newobj.thisown | |
1999 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
2000 | """CanOpen(self, String location) -> bool""" |
2001 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
2002 | |
2003 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
2004 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
2005 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
2006 | |
2007 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
2008 | """FindFirst(self, String spec, int flags=0) -> String""" |
2009 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
2010 | |
2011 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
2012 | """FindNext(self) -> String""" |
2013 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) | |
d55e5bfc RD |
2014 | |
2015 | ||
5b5c9bc7 | 2016 | class ZipFSHandlerPtr(ZipFSHandler): |
d55e5bfc RD |
2017 | def __init__(self, this): |
2018 | self.this = this | |
2019 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2020 | self.__class__ = ZipFSHandler |
2021 | _core_.ZipFSHandler_swigregister(ZipFSHandlerPtr) | |
d55e5bfc RD |
2022 | |
2023 | ||
2024 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): | |
5b5c9bc7 RD |
2025 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
2026 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
d55e5bfc RD |
2027 | |
2028 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
2029 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
2030 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
d55e5bfc RD |
2031 | |
2032 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): | |
5b5c9bc7 RD |
2033 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
2034 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
b411df4a RD |
2035 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
2036 | """ | |
2037 | Add 'file' to the memory filesystem. The dataItem parameter can | |
2038 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
2039 | arbitrary data. If a bitmap or image is used then the imgType | |
2040 | parameter should specify what kind of image file it should be | |
2041 | written as, wx.BITMAP_TYPE_PNG, etc. | |
2042 | """ | |
2043 | if isinstance(dataItem, wx.Image): | |
2044 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
2045 | elif isinstance(dataItem, wx.Bitmap): | |
2046 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
2047 | elif type(dataItem) == str: | |
2048 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
2049 | else: | |
2050 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d55e5bfc | 2051 | |
5b5c9bc7 RD |
2052 | class MemoryFSHandler(CPPFileSystemHandler): |
2053 | """Proxy of C++ MemoryFSHandler class""" | |
d55e5bfc RD |
2054 | def __repr__(self): |
2055 | return "<%s.%s; proxy of C++ wxMemoryFSHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2056 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
2057 | """__init__(self) -> MemoryFSHandler""" |
2058 | newobj = _core_.new_MemoryFSHandler(*args, **kwargs) | |
d55e5bfc RD |
2059 | self.this = newobj.this |
2060 | self.thisown = 1 | |
2061 | del newobj.thisown | |
2062 | def RemoveFile(*args, **kwargs): | |
5b5c9bc7 RD |
2063 | """RemoveFile(String filename)""" |
2064 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d55e5bfc RD |
2065 | |
2066 | RemoveFile = staticmethod(RemoveFile) | |
2067 | AddFile = staticmethod(MemoryFSHandler_AddFile) | |
2068 | def CanOpen(*args, **kwargs): | |
5b5c9bc7 RD |
2069 | """CanOpen(self, String location) -> bool""" |
2070 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) | |
d55e5bfc RD |
2071 | |
2072 | def OpenFile(*args, **kwargs): | |
5b5c9bc7 RD |
2073 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
2074 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) | |
d55e5bfc RD |
2075 | |
2076 | def FindFirst(*args, **kwargs): | |
5b5c9bc7 RD |
2077 | """FindFirst(self, String spec, int flags=0) -> String""" |
2078 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) | |
d55e5bfc RD |
2079 | |
2080 | def FindNext(*args, **kwargs): | |
5b5c9bc7 RD |
2081 | """FindNext(self) -> String""" |
2082 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) | |
d55e5bfc RD |
2083 | |
2084 | ||
5b5c9bc7 | 2085 | class MemoryFSHandlerPtr(MemoryFSHandler): |
d55e5bfc RD |
2086 | def __init__(self, this): |
2087 | self.this = this | |
2088 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2089 | self.__class__ = MemoryFSHandler |
2090 | _core_.MemoryFSHandler_swigregister(MemoryFSHandlerPtr) | |
d55e5bfc | 2091 | |
5b5c9bc7 RD |
2092 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
2093 | """MemoryFSHandler_RemoveFile(String filename)""" | |
2094 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d55e5bfc | 2095 | |
5b5c9bc7 RD |
2096 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
2097 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
2098 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
d55e5bfc RD |
2099 | #--------------------------------------------------------------------------- |
2100 | ||
5b5c9bc7 | 2101 | class ImageHandler(Object): |
27fb7603 RD |
2102 | """ |
2103 | This is the base class for implementing image file loading/saving, and | |
2104 | image creation from data. It is used within `wx.Image` and is not | |
2105 | normally seen by the application. | |
2106 | """ | |
d55e5bfc RD |
2107 | def __init__(self): raise RuntimeError, "No constructor defined" |
2108 | def __repr__(self): | |
2109 | return "<%s.%s; proxy of C++ wxImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2110 | def GetName(*args, **kwargs): | |
5b5c9bc7 RD |
2111 | """GetName(self) -> String""" |
2112 | return _core_.ImageHandler_GetName(*args, **kwargs) | |
d55e5bfc RD |
2113 | |
2114 | def GetExtension(*args, **kwargs): | |
5b5c9bc7 RD |
2115 | """GetExtension(self) -> String""" |
2116 | return _core_.ImageHandler_GetExtension(*args, **kwargs) | |
d55e5bfc RD |
2117 | |
2118 | def GetType(*args, **kwargs): | |
2119 | """GetType(self) -> long""" | |
5b5c9bc7 | 2120 | return _core_.ImageHandler_GetType(*args, **kwargs) |
d55e5bfc RD |
2121 | |
2122 | def GetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
2123 | """GetMimeType(self) -> String""" |
2124 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) | |
d55e5bfc RD |
2125 | |
2126 | def CanRead(*args, **kwargs): | |
5b5c9bc7 RD |
2127 | """CanRead(self, String name) -> bool""" |
2128 | return _core_.ImageHandler_CanRead(*args, **kwargs) | |
d55e5bfc RD |
2129 | |
2130 | def SetName(*args, **kwargs): | |
5b5c9bc7 RD |
2131 | """SetName(self, String name)""" |
2132 | return _core_.ImageHandler_SetName(*args, **kwargs) | |
d55e5bfc RD |
2133 | |
2134 | def SetExtension(*args, **kwargs): | |
5b5c9bc7 RD |
2135 | """SetExtension(self, String extension)""" |
2136 | return _core_.ImageHandler_SetExtension(*args, **kwargs) | |
d55e5bfc RD |
2137 | |
2138 | def SetType(*args, **kwargs): | |
2139 | """SetType(self, long type)""" | |
5b5c9bc7 | 2140 | return _core_.ImageHandler_SetType(*args, **kwargs) |
d55e5bfc RD |
2141 | |
2142 | def SetMimeType(*args, **kwargs): | |
5b5c9bc7 RD |
2143 | """SetMimeType(self, String mimetype)""" |
2144 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) | |
d55e5bfc RD |
2145 | |
2146 | ||
5b5c9bc7 | 2147 | class ImageHandlerPtr(ImageHandler): |
d55e5bfc RD |
2148 | def __init__(self, this): |
2149 | self.this = this | |
2150 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2151 | self.__class__ = ImageHandler |
2152 | _core_.ImageHandler_swigregister(ImageHandlerPtr) | |
d55e5bfc | 2153 | |
943e8dfd RD |
2154 | class PyImageHandler(ImageHandler): |
2155 | """ | |
2156 | This is the base class for implementing image file loading/saving, and | |
2157 | image creation from data, all written in Python. To create a custom | |
2158 | image handler derive a new class from wx.PyImageHandler and provide | |
2159 | the following methods:: | |
2160 | ||
2161 | def DoCanRead(self, stream) --> bool | |
2162 | '''Check if this handler can read the image on the stream''' | |
2163 | ||
2164 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2165 | '''Load image data from the stream and load it into image.''' | |
2166 | ||
2167 | def SaveFile(self, image, stream, verbose) --> bool | |
2168 | '''Save the iamge data in image to the stream using | |
2169 | this handler's image file format.''' | |
2170 | ||
2171 | def GetImageCount(self, stream) --> int | |
2172 | '''If this image format can hold more than one image, | |
2173 | how many does the image on the stream have?''' | |
2174 | ||
2175 | To activate your handler create an instance of it and pass it to | |
2176 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2177 | `SetExtension` from your constructor. | |
2178 | ||
2179 | """ | |
2180 | def __repr__(self): | |
2181 | return "<%s.%s; proxy of C++ wxPyImageHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2182 | def __init__(self, *args, **kwargs): | |
2183 | """ | |
2184 | __init__(self) -> PyImageHandler | |
2185 | ||
2186 | This is the base class for implementing image file loading/saving, and | |
2187 | image creation from data, all written in Python. To create a custom | |
2188 | image handler derive a new class from wx.PyImageHandler and provide | |
2189 | the following methods:: | |
2190 | ||
2191 | def DoCanRead(self, stream) --> bool | |
2192 | '''Check if this handler can read the image on the stream''' | |
2193 | ||
2194 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2195 | '''Load image data from the stream and load it into image.''' | |
2196 | ||
2197 | def SaveFile(self, image, stream, verbose) --> bool | |
2198 | '''Save the iamge data in image to the stream using | |
2199 | this handler's image file format.''' | |
2200 | ||
2201 | def GetImageCount(self, stream) --> int | |
2202 | '''If this image format can hold more than one image, | |
2203 | how many does the image on the stream have?''' | |
2204 | ||
2205 | To activate your handler create an instance of it and pass it to | |
2206 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2207 | `SetExtension` from your constructor. | |
2208 | ||
2209 | """ | |
2210 | newobj = _core_.new_PyImageHandler(*args, **kwargs) | |
2211 | self.this = newobj.this | |
2212 | self.thisown = 1 | |
2213 | del newobj.thisown | |
2214 | self._SetSelf(self) | |
2215 | ||
2216 | def _SetSelf(*args, **kwargs): | |
2217 | """_SetSelf(self, PyObject self)""" | |
2218 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2219 | ||
2220 | ||
2221 | class PyImageHandlerPtr(PyImageHandler): | |
2222 | def __init__(self, this): | |
2223 | self.this = this | |
2224 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2225 | self.__class__ = PyImageHandler | |
2226 | _core_.PyImageHandler_swigregister(PyImageHandlerPtr) | |
2227 | ||
5b5c9bc7 RD |
2228 | class ImageHistogram(object): |
2229 | """Proxy of C++ ImageHistogram class""" | |
d55e5bfc RD |
2230 | def __repr__(self): |
2231 | return "<%s.%s; proxy of C++ wxImageHistogram instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2232 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
2233 | """__init__(self) -> ImageHistogram""" |
2234 | newobj = _core_.new_ImageHistogram(*args, **kwargs) | |
d55e5bfc RD |
2235 | self.this = newobj.this |
2236 | self.thisown = 1 | |
2237 | del newobj.thisown | |
2238 | def MakeKey(*args, **kwargs): | |
2239 | """ | |
7a27cf7c | 2240 | MakeKey(byte r, byte g, byte b) -> unsigned long |
d55e5bfc RD |
2241 | |
2242 | Get the key in the histogram for the given RGB values | |
2243 | """ | |
5b5c9bc7 | 2244 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d55e5bfc RD |
2245 | |
2246 | MakeKey = staticmethod(MakeKey) | |
2247 | def FindFirstUnusedColour(*args, **kwargs): | |
fd2dc343 RD |
2248 | """ |
2249 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2250 | ||
2251 | Find first colour that is not used in the image and has higher RGB | |
2252 | values than startR, startG, startB. Returns a tuple consisting of a | |
2253 | success flag and rgb values. | |
2254 | """ | |
5b5c9bc7 | 2255 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
d55e5bfc | 2256 | |
f1cbd8fa RD |
2257 | def GetCount(*args, **kwargs): |
2258 | """ | |
2259 | GetCount(self, unsigned long key) -> unsigned long | |
2260 | ||
2261 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2262 | key value from a RGB tripple. | |
2263 | """ | |
5b5c9bc7 | 2264 | return _core_.ImageHistogram_GetCount(*args, **kwargs) |
f1cbd8fa RD |
2265 | |
2266 | def GetCountRGB(*args, **kwargs): | |
2267 | """ | |
7a27cf7c | 2268 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2269 | |
2270 | Returns the pixel count for the given RGB values. | |
2271 | """ | |
5b5c9bc7 | 2272 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) |
f1cbd8fa RD |
2273 | |
2274 | def GetCountColour(*args, **kwargs): | |
2275 | """ | |
5b5c9bc7 | 2276 | GetCountColour(self, Colour colour) -> unsigned long |
f1cbd8fa RD |
2277 | |
2278 | Returns the pixel count for the given `wx.Colour` value. | |
2279 | """ | |
5b5c9bc7 | 2280 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) |
f1cbd8fa | 2281 | |
d55e5bfc | 2282 | |
5b5c9bc7 | 2283 | class ImageHistogramPtr(ImageHistogram): |
d55e5bfc RD |
2284 | def __init__(self, this): |
2285 | self.this = this | |
2286 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
2287 | self.__class__ = ImageHistogram |
2288 | _core_.ImageHistogram_swigregister(ImageHistogramPtr) | |
d55e5bfc | 2289 | |
5b5c9bc7 | 2290 | def ImageHistogram_MakeKey(*args, **kwargs): |
d55e5bfc | 2291 | """ |
7a27cf7c | 2292 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
d55e5bfc RD |
2293 | |
2294 | Get the key in the histogram for the given RGB values | |
2295 | """ | |
5b5c9bc7 | 2296 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d55e5bfc | 2297 | |
943e8dfd RD |
2298 | class Image_RGBValue(object): |
2299 | """ | |
2300 | An object that contains values for red, green and blue which represent | |
2301 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2302 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2303 | color space. | |
2304 | """ | |
2305 | def __repr__(self): | |
2306 | return "<%s.%s; proxy of C++ wxImage_RGBValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2307 | def __init__(self, *args, **kwargs): | |
2308 | """ | |
2309 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2310 | ||
2311 | Constructor. | |
2312 | """ | |
2313 | newobj = _core_.new_Image_RGBValue(*args, **kwargs) | |
2314 | self.this = newobj.this | |
2315 | self.thisown = 1 | |
2316 | del newobj.thisown | |
2317 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) | |
2318 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2319 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2320 | ||
2321 | class Image_RGBValuePtr(Image_RGBValue): | |
2322 | def __init__(self, this): | |
2323 | self.this = this | |
2324 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2325 | self.__class__ = Image_RGBValue | |
2326 | _core_.Image_RGBValue_swigregister(Image_RGBValuePtr) | |
2327 | ||
2328 | class Image_HSVValue(object): | |
2329 | """ | |
2330 | An object that contains values for hue, saturation and value which | |
2331 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2332 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2333 | color space. | |
2334 | """ | |
2335 | def __repr__(self): | |
2336 | return "<%s.%s; proxy of C++ wxImage_HSVValue instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2337 | def __init__(self, *args, **kwargs): | |
2338 | """ | |
2339 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2340 | ||
2341 | Constructor. | |
2342 | """ | |
2343 | newobj = _core_.new_Image_HSVValue(*args, **kwargs) | |
2344 | self.this = newobj.this | |
2345 | self.thisown = 1 | |
2346 | del newobj.thisown | |
2347 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) | |
2348 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2349 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2350 | ||
2351 | class Image_HSVValuePtr(Image_HSVValue): | |
2352 | def __init__(self, this): | |
2353 | self.this = this | |
2354 | if not hasattr(self,"thisown"): self.thisown = 0 | |
2355 | self.__class__ = Image_HSVValue | |
2356 | _core_.Image_HSVValue_swigregister(Image_HSVValuePtr) | |
2357 | ||
5b5c9bc7 | 2358 | class Image(Object): |
7a27cf7c RD |
2359 | """ |
2360 | A platform-independent image class. An image can be created from | |
2361 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2362 | variety of formats. Functions are available to set and get image | |
2363 | bits, so it can be used for basic image manipulation. | |
2364 | ||
2365 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2366 | platform-specific `wx.Bitmap` object must be created from it using the | |
2367 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2368 | device context, using `wx.DC.DrawBitmap`. | |
2369 | ||
2370 | One colour value of the image may be used as a mask colour which will | |
2371 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2372 | bitmap object. | |
2373 | ||
2374 | wx.Image supports alpha channel data, that is in addition to a byte | |
2375 | for the red, green and blue colour components for each pixel it also | |
2376 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2377 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2378 | means that the pixel is 100% opaque. | |
2379 | ||
2380 | Unlike RGB data, not all images have an alpha channel and before using | |
2381 | `GetAlpha` you should check if this image contains an alpha channel | |
2382 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2383 | with transparency information will have an alpha channel. | |
2384 | """ | |
d55e5bfc RD |
2385 | def __repr__(self): |
2386 | return "<%s.%s; proxy of C++ wxImage instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
2387 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2388 | """ |
2389 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2390 | ||
2391 | Loads an image from a file. | |
2392 | """ | |
5b5c9bc7 | 2393 | newobj = _core_.new_Image(*args, **kwargs) |
d55e5bfc RD |
2394 | self.this = newobj.this |
2395 | self.thisown = 1 | |
2396 | del newobj.thisown | |
5b5c9bc7 | 2397 | def __del__(self, destroy=_core_.delete_Image): |
d55e5bfc RD |
2398 | """__del__(self)""" |
2399 | try: | |
2400 | if self.thisown: destroy(self) | |
2401 | except: pass | |
2402 | ||
2403 | def Create(*args, **kwargs): | |
7a27cf7c RD |
2404 | """ |
2405 | Create(self, int width, int height, bool clear=True) | |
2406 | ||
2407 | Creates a fresh image. If clear is ``True``, the new image will be | |
2408 | initialized to black. Otherwise, the image data will be uninitialized. | |
2409 | """ | |
5b5c9bc7 | 2410 | return _core_.Image_Create(*args, **kwargs) |
d55e5bfc RD |
2411 | |
2412 | def Destroy(*args, **kwargs): | |
2413 | """ | |
2414 | Destroy(self) | |
2415 | ||
7a27cf7c | 2416 | Destroys the image data. |
d55e5bfc | 2417 | """ |
5b5c9bc7 | 2418 | return _core_.Image_Destroy(*args, **kwargs) |
d55e5bfc RD |
2419 | |
2420 | def Scale(*args, **kwargs): | |
7a27cf7c RD |
2421 | """ |
2422 | Scale(self, int width, int height) -> Image | |
2423 | ||
2424 | Returns a scaled version of the image. This is also useful for scaling | |
2425 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
2426 | `wx.MemoryDC` into another `wx.MemoryDC`. | |
2427 | """ | |
5b5c9bc7 | 2428 | return _core_.Image_Scale(*args, **kwargs) |
d55e5bfc RD |
2429 | |
2430 | def ShrinkBy(*args, **kwargs): | |
7a27cf7c RD |
2431 | """ |
2432 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2433 | ||
2434 | Return a version of the image scaled smaller by the given factors. | |
2435 | """ | |
5b5c9bc7 | 2436 | return _core_.Image_ShrinkBy(*args, **kwargs) |
d55e5bfc RD |
2437 | |
2438 | def Rescale(*args, **kwargs): | |
7a27cf7c RD |
2439 | """ |
2440 | Rescale(self, int width, int height) -> Image | |
2441 | ||
2442 | Changes the size of the image in-place by scaling it: after a call to | |
2443 | this function, the image will have the given width and height. | |
2444 | ||
2445 | Returns the (modified) image itself. | |
2446 | """ | |
5b5c9bc7 | 2447 | return _core_.Image_Rescale(*args, **kwargs) |
d55e5bfc | 2448 | |
aff4cc5c | 2449 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2450 | """ |
2451 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2452 | ||
2453 | Changes the size of the image in-place without scaling it, by adding | |
2454 | either a border with the given colour or cropping as necessary. The | |
2455 | image is pasted into a new image with the given size and background | |
2456 | colour at the position pos relative to the upper left of the new | |
2457 | image. If red = green = blue = -1 then use either the current mask | |
2458 | colour if set or find, use, and set a suitable mask colour for any | |
2459 | newly exposed areas. | |
2460 | ||
2461 | Returns the (modified) image itself. | |
2462 | """ | |
5b5c9bc7 | 2463 | return _core_.Image_Resize(*args, **kwargs) |
aff4cc5c | 2464 | |
d55e5bfc | 2465 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2466 | """ |
2467 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2468 | ||
2469 | Sets the pixel at the given coordinate. This routine performs | |
2470 | bounds-checks for the coordinate so it can be considered a safe way to | |
2471 | manipulate the data, but in some cases this might be too slow so that | |
2472 | the data will have to be set directly. In that case you will have to | |
2473 | get access to the image data using the `GetData` method. | |
2474 | """ | |
5b5c9bc7 | 2475 | return _core_.Image_SetRGB(*args, **kwargs) |
d55e5bfc | 2476 | |
aff4cc5c | 2477 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2478 | """ |
2479 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2480 | ||
2481 | Sets the colour of the pixels within the given rectangle. This routine | |
2482 | performs bounds-checks for the rectangle so it can be considered a | |
2483 | safe way to manipulate the data. | |
2484 | """ | |
5b5c9bc7 | 2485 | return _core_.Image_SetRGBRect(*args, **kwargs) |
aff4cc5c | 2486 | |
d55e5bfc | 2487 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2488 | """ |
2489 | GetRed(self, int x, int y) -> byte | |
2490 | ||
2491 | Returns the red intensity at the given coordinate. | |
2492 | """ | |
5b5c9bc7 | 2493 | return _core_.Image_GetRed(*args, **kwargs) |
d55e5bfc RD |
2494 | |
2495 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2496 | """ |
2497 | GetGreen(self, int x, int y) -> byte | |
2498 | ||
2499 | Returns the green intensity at the given coordinate. | |
2500 | """ | |
5b5c9bc7 | 2501 | return _core_.Image_GetGreen(*args, **kwargs) |
d55e5bfc RD |
2502 | |
2503 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2504 | """ |
2505 | GetBlue(self, int x, int y) -> byte | |
2506 | ||
2507 | Returns the blue intensity at the given coordinate. | |
2508 | """ | |
5b5c9bc7 | 2509 | return _core_.Image_GetBlue(*args, **kwargs) |
d55e5bfc RD |
2510 | |
2511 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2512 | """ |
2513 | SetAlpha(self, int x, int y, byte alpha) | |
2514 | ||
2515 | Sets the alpha value for the given pixel. This function should only be | |
2516 | called if the image has alpha channel data, use `HasAlpha` to check | |
2517 | for this. | |
2518 | """ | |
5b5c9bc7 | 2519 | return _core_.Image_SetAlpha(*args, **kwargs) |
d55e5bfc RD |
2520 | |
2521 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2522 | """ |
2523 | GetAlpha(self, int x, int y) -> byte | |
2524 | ||
2525 | Returns the alpha value for the given pixel. This function may only be | |
2526 | called for the images with alpha channel, use `HasAlpha` to check for | |
2527 | this. | |
2528 | ||
2529 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2530 | corresponds to the fully transparent pixels while the value of 255 to | |
2531 | the fully opaque pixels. | |
2532 | """ | |
5b5c9bc7 | 2533 | return _core_.Image_GetAlpha(*args, **kwargs) |
d55e5bfc RD |
2534 | |
2535 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2536 | """ |
2537 | HasAlpha(self) -> bool | |
2538 | ||
2539 | Returns true if this image has alpha channel, false otherwise. | |
2540 | """ | |
5b5c9bc7 | 2541 | return _core_.Image_HasAlpha(*args, **kwargs) |
d55e5bfc | 2542 | |
68350608 RD |
2543 | def InitAlpha(*args, **kwargs): |
2544 | """ | |
2545 | InitAlpha(self) | |
2546 | ||
2547 | Initializes the image alpha channel data. It is an error to call it if | |
2548 | the image already has alpha data. If it doesn't, alpha data will be by | |
2549 | default initialized to all pixels being fully opaque. But if the image | |
2550 | has a a mask colour, all mask pixels will be completely transparent. | |
2551 | """ | |
5b5c9bc7 RD |
2552 | return _core_.Image_InitAlpha(*args, **kwargs) |
2553 | ||
2554 | def IsTransparent(*args, **kwargs): | |
2555 | """ | |
7a27cf7c | 2556 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
5b5c9bc7 | 2557 | |
7a27cf7c RD |
2558 | Returns ``True`` if this pixel is masked or has an alpha value less |
2559 | than the spcified threshold. | |
5b5c9bc7 RD |
2560 | """ |
2561 | return _core_.Image_IsTransparent(*args, **kwargs) | |
68350608 | 2562 | |
d55e5bfc | 2563 | def FindFirstUnusedColour(*args, **kwargs): |
fd2dc343 RD |
2564 | """ |
2565 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2566 | ||
2567 | Find first colour that is not used in the image and has higher RGB | |
2568 | values than startR, startG, startB. Returns a tuple consisting of a | |
2569 | success flag and rgb values. | |
2570 | """ | |
5b5c9bc7 | 2571 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
d55e5bfc | 2572 | |
4cf4100f RD |
2573 | def ConvertAlphaToMask(*args, **kwargs): |
2574 | """ | |
5b5c9bc7 | 2575 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2576 | |
7a27cf7c RD |
2577 | If the image has alpha channel, this method converts it to mask. All |
2578 | pixels with alpha value less than ``threshold`` are replaced with the | |
2579 | mask colour and the alpha channel is removed. The mask colour is | |
2580 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2581 | |
2582 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2583 | nothing. | |
2584 | """ | |
5b5c9bc7 | 2585 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) |
4cf4100f | 2586 | |
8fb0e70a RD |
2587 | def ConvertColourToAlpha(*args, **kwargs): |
2588 | """ | |
7a27cf7c | 2589 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2590 | |
2591 | This method converts an image where the original alpha information is | |
2592 | only available as a shades of a colour (actually shades of grey) | |
2593 | typically when you draw anti-aliased text into a bitmap. The DC | |
2594 | drawing routines draw grey values on the black background although | |
2595 | they actually mean to draw white with differnt alpha values. This | |
2596 | method reverses it, assuming a black (!) background and white text. | |
2597 | The method will then fill up the whole image with the colour given. | |
2598 | """ | |
5b5c9bc7 | 2599 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) |
8fb0e70a | 2600 | |
d55e5bfc | 2601 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2602 | """ |
2603 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2604 | ||
2605 | Sets the image's mask so that the pixels that have RGB value of | |
2606 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2607 | by first finding an unused colour in the image, setting this colour as | |
2608 | the mask colour and then using this colour to draw all pixels in the | |
2609 | image who corresponding pixel in mask has given RGB value. | |
2610 | ||
2611 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2612 | image or if there is no unused colour left. Returns ``True`` if the | |
2613 | mask was successfully applied. | |
2614 | ||
2615 | Note that this method involves computing the histogram, which is | |
2616 | computationally intensive operation. | |
2617 | """ | |
5b5c9bc7 | 2618 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
d55e5bfc RD |
2619 | |
2620 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2621 | """ |
2622 | CanRead(String filename) -> bool | |
2623 | ||
2624 | Returns True if the image handlers can read this file. | |
2625 | """ | |
5b5c9bc7 | 2626 | return _core_.Image_CanRead(*args, **kwargs) |
d55e5bfc RD |
2627 | |
2628 | CanRead = staticmethod(CanRead) | |
2629 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2630 | """ |
2631 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2632 | ||
2633 | If the image file contains more than one image and the image handler | |
2634 | is capable of retrieving these individually, this function will return | |
2635 | the number of available images. | |
2636 | """ | |
5b5c9bc7 | 2637 | return _core_.Image_GetImageCount(*args, **kwargs) |
d55e5bfc RD |
2638 | |
2639 | GetImageCount = staticmethod(GetImageCount) | |
2640 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2641 | """ |
2642 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2643 | ||
2644 | Loads an image from a file. If no handler type is provided, the | |
2645 | library will try to autodetect the format. | |
2646 | """ | |
5b5c9bc7 | 2647 | return _core_.Image_LoadFile(*args, **kwargs) |
d55e5bfc RD |
2648 | |
2649 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2650 | """ |
2651 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2652 | ||
2653 | Loads an image from a file, specifying the image type with a MIME type | |
2654 | string. | |
2655 | """ | |
5b5c9bc7 | 2656 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
d55e5bfc RD |
2657 | |
2658 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2659 | """ |
2660 | SaveFile(self, String name, int type) -> bool | |
2661 | ||
2662 | Saves an image in the named file. | |
2663 | """ | |
5b5c9bc7 | 2664 | return _core_.Image_SaveFile(*args, **kwargs) |
d55e5bfc RD |
2665 | |
2666 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2667 | """ |
2668 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2669 | ||
2670 | Saves an image in the named file. | |
2671 | """ | |
5b5c9bc7 | 2672 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
d55e5bfc RD |
2673 | |
2674 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2675 | """ |
2676 | CanReadStream(InputStream stream) -> bool | |
2677 | ||
2678 | Returns True if the image handlers can read an image file from the | |
2679 | data currently on the input stream, or a readable Python file-like | |
2680 | object. | |
2681 | """ | |
5b5c9bc7 | 2682 | return _core_.Image_CanReadStream(*args, **kwargs) |
d55e5bfc RD |
2683 | |
2684 | CanReadStream = staticmethod(CanReadStream) | |
2685 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2686 | """ |
2687 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2688 | ||
2689 | Loads an image from an input stream or a readable Python file-like | |
2690 | object. If no handler type is provided, the library will try to | |
2691 | autodetect the format. | |
2692 | """ | |
5b5c9bc7 | 2693 | return _core_.Image_LoadStream(*args, **kwargs) |
d55e5bfc RD |
2694 | |
2695 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2696 | """ |
2697 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2698 | ||
2699 | Loads an image from an input stream or a readable Python file-like | |
2700 | object, using a MIME type string to specify the image file format. | |
2701 | """ | |
5b5c9bc7 | 2702 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
d55e5bfc RD |
2703 | |
2704 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2705 | """ |
2706 | Ok(self) -> bool | |
2707 | ||
2708 | Returns true if image data is present. | |
2709 | """ | |
5b5c9bc7 | 2710 | return _core_.Image_Ok(*args, **kwargs) |
d55e5bfc RD |
2711 | |
2712 | def GetWidth(*args, **kwargs): | |
7a27cf7c RD |
2713 | """ |
2714 | GetWidth(self) -> int | |
2715 | ||
2716 | Gets the width of the image in pixels. | |
2717 | """ | |
5b5c9bc7 | 2718 | return _core_.Image_GetWidth(*args, **kwargs) |
d55e5bfc RD |
2719 | |
2720 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
2721 | """ |
2722 | GetHeight(self) -> int | |
2723 | ||
2724 | Gets the height of the image in pixels. | |
2725 | """ | |
5b5c9bc7 | 2726 | return _core_.Image_GetHeight(*args, **kwargs) |
d55e5bfc RD |
2727 | |
2728 | def GetSize(*args, **kwargs): | |
7a27cf7c RD |
2729 | """ |
2730 | GetSize(self) -> Size | |
2731 | ||
2732 | Returns the size of the image in pixels. | |
2733 | """ | |
5b5c9bc7 | 2734 | return _core_.Image_GetSize(*args, **kwargs) |
d55e5bfc RD |
2735 | |
2736 | def GetSubImage(*args, **kwargs): | |
7a27cf7c RD |
2737 | """ |
2738 | GetSubImage(self, Rect rect) -> Image | |
2739 | ||
2740 | Returns a sub image of the current one as long as the rect belongs | |
2741 | entirely to the image. | |
2742 | """ | |
5b5c9bc7 | 2743 | return _core_.Image_GetSubImage(*args, **kwargs) |
d55e5bfc | 2744 | |
aff4cc5c | 2745 | def Size(*args, **kwargs): |
7a27cf7c RD |
2746 | """ |
2747 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2748 | ||
2749 | Returns a resized version of this image without scaling it by adding | |
2750 | either a border with the given colour or cropping as necessary. The | |
2751 | image is pasted into a new image with the given size and background | |
2752 | colour at the position ``pos`` relative to the upper left of the new | |
2753 | image. If red = green = blue = -1 then use either the current mask | |
2754 | colour if set or find, use, and set a suitable mask colour for any | |
2755 | newly exposed areas. | |
2756 | """ | |
5b5c9bc7 | 2757 | return _core_.Image_Size(*args, **kwargs) |
aff4cc5c | 2758 | |
d55e5bfc | 2759 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2760 | """ |
2761 | Copy(self) -> Image | |
2762 | ||
2763 | Returns an identical copy of the image. | |
2764 | """ | |
5b5c9bc7 | 2765 | return _core_.Image_Copy(*args, **kwargs) |
d55e5bfc RD |
2766 | |
2767 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
2768 | """ |
2769 | Paste(self, Image image, int x, int y) | |
2770 | ||
2771 | Pastes ``image`` into this instance and takes care of the mask colour | |
2772 | and any out of bounds problems. | |
2773 | """ | |
5b5c9bc7 | 2774 | return _core_.Image_Paste(*args, **kwargs) |
d55e5bfc RD |
2775 | |
2776 | def GetData(*args, **kwargs): | |
bb2ef2cc RD |
2777 | """ |
2778 | GetData(self) -> PyObject | |
2779 | ||
2780 | Returns a string containing a copy of the RGB bytes of the image. | |
2781 | """ | |
5b5c9bc7 | 2782 | return _core_.Image_GetData(*args, **kwargs) |
d55e5bfc RD |
2783 | |
2784 | def SetData(*args, **kwargs): | |
bb2ef2cc RD |
2785 | """ |
2786 | SetData(self, buffer data) | |
2787 | ||
2788 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2789 | either a string or a buffer object holding the data and the length of | |
2790 | the data must be width*height*3. | |
2791 | """ | |
5b5c9bc7 | 2792 | return _core_.Image_SetData(*args, **kwargs) |
d55e5bfc RD |
2793 | |
2794 | def GetDataBuffer(*args, **kwargs): | |
bb2ef2cc RD |
2795 | """ |
2796 | GetDataBuffer(self) -> PyObject | |
2797 | ||
2798 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
2799 | image data buffer inside the wx.Image. You need to ensure that you do |
2800 | not use this buffer object after the image has been destroyed. | |
bb2ef2cc | 2801 | """ |
5b5c9bc7 | 2802 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
d55e5bfc RD |
2803 | |
2804 | def SetDataBuffer(*args, **kwargs): | |
bb2ef2cc RD |
2805 | """ |
2806 | SetDataBuffer(self, buffer data) | |
2807 | ||
2808 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
2809 | object. This can save making an extra copy of the data but you must |
2810 | ensure that the buffer object lives longer than the wx.Image does. | |
bb2ef2cc | 2811 | """ |
5b5c9bc7 | 2812 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
d55e5bfc RD |
2813 | |
2814 | def GetAlphaData(*args, **kwargs): | |
bb2ef2cc RD |
2815 | """ |
2816 | GetAlphaData(self) -> PyObject | |
2817 | ||
2818 | Returns a string containing a copy of the alpha bytes of the image. | |
2819 | """ | |
5b5c9bc7 | 2820 | return _core_.Image_GetAlphaData(*args, **kwargs) |
d55e5bfc RD |
2821 | |
2822 | def SetAlphaData(*args, **kwargs): | |
bb2ef2cc RD |
2823 | """ |
2824 | SetAlphaData(self, buffer alpha) | |
2825 | ||
2826 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2827 | a string or a buffer object holding the data and the length of the | |
2828 | data must be width*height. | |
2829 | """ | |
5b5c9bc7 | 2830 | return _core_.Image_SetAlphaData(*args, **kwargs) |
d55e5bfc RD |
2831 | |
2832 | def GetAlphaBuffer(*args, **kwargs): | |
2833 | """GetAlphaBuffer(self) -> PyObject""" | |
5b5c9bc7 | 2834 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
d55e5bfc RD |
2835 | |
2836 | def SetAlphaBuffer(*args, **kwargs): | |
bb2ef2cc | 2837 | """SetAlphaBuffer(self, buffer alpha)""" |
5b5c9bc7 | 2838 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
d55e5bfc RD |
2839 | |
2840 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
2841 | """ |
2842 | SetMaskColour(self, byte r, byte g, byte b) | |
2843 | ||
2844 | Sets the mask colour for this image (and tells the image to use the | |
2845 | mask). | |
2846 | """ | |
5b5c9bc7 | 2847 | return _core_.Image_SetMaskColour(*args, **kwargs) |
d55e5bfc | 2848 | |
aff4cc5c RD |
2849 | def GetOrFindMaskColour(*args, **kwargs): |
2850 | """ | |
2851 | GetOrFindMaskColour() -> (r,g,b) | |
2852 | ||
2853 | Get the current mask colour or find a suitable colour. | |
2854 | """ | |
5b5c9bc7 | 2855 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) |
aff4cc5c | 2856 | |
d55e5bfc | 2857 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2858 | """ |
2859 | GetMaskRed(self) -> byte | |
2860 | ||
2861 | Gets the red component of the mask colour. | |
2862 | """ | |
5b5c9bc7 | 2863 | return _core_.Image_GetMaskRed(*args, **kwargs) |
d55e5bfc RD |
2864 | |
2865 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
2866 | """ |
2867 | GetMaskGreen(self) -> byte | |
2868 | ||
2869 | Gets the green component of the mask colour. | |
2870 | """ | |
5b5c9bc7 | 2871 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
d55e5bfc RD |
2872 | |
2873 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
2874 | """ |
2875 | GetMaskBlue(self) -> byte | |
2876 | ||
2877 | Gets the blue component of the mask colour. | |
2878 | """ | |
5b5c9bc7 | 2879 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
d55e5bfc RD |
2880 | |
2881 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
2882 | """ |
2883 | SetMask(self, bool mask=True) | |
2884 | ||
2885 | Specifies whether there is a mask or not. The area of the mask is | |
2886 | determined by the current mask colour. | |
2887 | """ | |
5b5c9bc7 | 2888 | return _core_.Image_SetMask(*args, **kwargs) |
d55e5bfc RD |
2889 | |
2890 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
2891 | """ |
2892 | HasMask(self) -> bool | |
2893 | ||
2894 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
2895 | """ | |
5b5c9bc7 | 2896 | return _core_.Image_HasMask(*args, **kwargs) |
d55e5bfc RD |
2897 | |
2898 | def Rotate(*args, **kwargs): | |
2899 | """ | |
5b5c9bc7 RD |
2900 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
2901 | Point offset_after_rotation=None) -> Image | |
7a27cf7c RD |
2902 | |
2903 | Rotates the image about the given point, by ``angle`` radians. Passing | |
2904 | ``True`` to ``interpolating`` results in better image quality, but is | |
2905 | slower. If the image has a mask, then the mask colour is used for the | |
2906 | uncovered pixels in the rotated image background. Otherwise, black | |
2907 | will be used as the fill colour. | |
2908 | ||
2909 | Returns the rotated image, leaving this image intact. | |
d55e5bfc | 2910 | """ |
5b5c9bc7 | 2911 | return _core_.Image_Rotate(*args, **kwargs) |
d55e5bfc RD |
2912 | |
2913 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
2914 | """ |
2915 | Rotate90(self, bool clockwise=True) -> Image | |
2916 | ||
2917 | Returns a copy of the image rotated 90 degrees in the direction | |
2918 | indicated by ``clockwise``. | |
2919 | """ | |
5b5c9bc7 | 2920 | return _core_.Image_Rotate90(*args, **kwargs) |
d55e5bfc RD |
2921 | |
2922 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
2923 | """ |
2924 | Mirror(self, bool horizontally=True) -> Image | |
2925 | ||
2926 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
2927 | indicates the orientation. | |
2928 | """ | |
5b5c9bc7 | 2929 | return _core_.Image_Mirror(*args, **kwargs) |
d55e5bfc RD |
2930 | |
2931 | def Replace(*args, **kwargs): | |
2932 | """ | |
7a27cf7c RD |
2933 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
2934 | ||
2935 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
2936 | ``(r2,g2,b2)``. | |
d55e5bfc | 2937 | """ |
5b5c9bc7 | 2938 | return _core_.Image_Replace(*args, **kwargs) |
d55e5bfc RD |
2939 | |
2940 | def ConvertToMono(*args, **kwargs): | |
7a27cf7c RD |
2941 | """ |
2942 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
2943 | ||
2944 | Returns monochromatic version of the image. The returned image has | |
2945 | white colour where the original has ``(r,g,b)`` colour and black | |
2946 | colour everywhere else. | |
2947 | """ | |
5b5c9bc7 | 2948 | return _core_.Image_ConvertToMono(*args, **kwargs) |
d55e5bfc RD |
2949 | |
2950 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
2951 | """ |
2952 | SetOption(self, String name, String value) | |
2953 | ||
2954 | Sets an image handler defined option. For example, when saving as a | |
2955 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
2956 | number between 0 and 100 (0 is terrible, 100 is very good). | |
2957 | """ | |
5b5c9bc7 | 2958 | return _core_.Image_SetOption(*args, **kwargs) |
d55e5bfc RD |
2959 | |
2960 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2961 | """ |
2962 | SetOptionInt(self, String name, int value) | |
2963 | ||
2964 | Sets an image option as an integer. | |
2965 | """ | |
5b5c9bc7 | 2966 | return _core_.Image_SetOptionInt(*args, **kwargs) |
d55e5bfc RD |
2967 | |
2968 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
2969 | """ |
2970 | GetOption(self, String name) -> String | |
2971 | ||
2972 | Gets the value of an image handler option. | |
2973 | """ | |
5b5c9bc7 | 2974 | return _core_.Image_GetOption(*args, **kwargs) |
d55e5bfc RD |
2975 | |
2976 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2977 | """ |
2978 | GetOptionInt(self, String name) -> int | |
2979 | ||
2980 | Gets the value of an image handler option as an integer. If the given | |
2981 | option is not present, the function returns 0. | |
2982 | """ | |
5b5c9bc7 | 2983 | return _core_.Image_GetOptionInt(*args, **kwargs) |
d55e5bfc RD |
2984 | |
2985 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
2986 | """ |
2987 | HasOption(self, String name) -> bool | |
2988 | ||
2989 | Returns true if the given option is present. | |
2990 | """ | |
5b5c9bc7 | 2991 | return _core_.Image_HasOption(*args, **kwargs) |
d55e5bfc RD |
2992 | |
2993 | def CountColours(*args, **kwargs): | |
2994 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" | |
5b5c9bc7 | 2995 | return _core_.Image_CountColours(*args, **kwargs) |
d55e5bfc RD |
2996 | |
2997 | def ComputeHistogram(*args, **kwargs): | |
5b5c9bc7 RD |
2998 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
2999 | return _core_.Image_ComputeHistogram(*args, **kwargs) | |
d55e5bfc RD |
3000 | |
3001 | def AddHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3002 | """AddHandler(ImageHandler handler)""" |
3003 | return _core_.Image_AddHandler(*args, **kwargs) | |
d55e5bfc RD |
3004 | |
3005 | AddHandler = staticmethod(AddHandler) | |
3006 | def InsertHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3007 | """InsertHandler(ImageHandler handler)""" |
3008 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d55e5bfc RD |
3009 | |
3010 | InsertHandler = staticmethod(InsertHandler) | |
3011 | def RemoveHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3012 | """RemoveHandler(String name) -> bool""" |
3013 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d55e5bfc RD |
3014 | |
3015 | RemoveHandler = staticmethod(RemoveHandler) | |
3016 | def GetImageExtWildcard(*args, **kwargs): | |
7a27cf7c RD |
3017 | """ |
3018 | GetImageExtWildcard() -> String | |
3019 | ||
3020 | Iterates all registered wxImageHandler objects, and returns a string | |
3021 | containing file extension masks suitable for passing to file open/save | |
3022 | dialog boxes. | |
3023 | """ | |
5b5c9bc7 | 3024 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
d55e5bfc RD |
3025 | |
3026 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
3027 | def ConvertToBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
3028 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
3029 | return _core_.Image_ConvertToBitmap(*args, **kwargs) | |
d55e5bfc RD |
3030 | |
3031 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 3032 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
5b5c9bc7 | 3033 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
d55e5bfc | 3034 | |
943e8dfd RD |
3035 | def RotateHue(*args, **kwargs): |
3036 | """ | |
3037 | RotateHue(self, double angle) | |
3038 | ||
3039 | Rotates the hue of each pixel of the image. Hue is a double in the | |
3040 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
3041 | """ | |
3042 | return _core_.Image_RotateHue(*args, **kwargs) | |
3043 | ||
3044 | def RGBtoHSV(*args, **kwargs): | |
3045 | """ | |
3046 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
3047 | ||
3048 | Converts a color in RGB color space to HSV color space. | |
3049 | """ | |
3050 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
3051 | ||
3052 | RGBtoHSV = staticmethod(RGBtoHSV) | |
3053 | def HSVtoRGB(*args, **kwargs): | |
3054 | """ | |
3055 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
3056 | ||
3057 | Converts a color in HSV color space to RGB color space. | |
3058 | """ | |
3059 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
3060 | ||
3061 | HSVtoRGB = staticmethod(HSVtoRGB) | |
d55e5bfc RD |
3062 | def __nonzero__(self): return self.Ok() |
3063 | ||
5b5c9bc7 | 3064 | class ImagePtr(Image): |
d55e5bfc RD |
3065 | def __init__(self, this): |
3066 | self.this = this | |
3067 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3068 | self.__class__ = Image |
3069 | _core_.Image_swigregister(ImagePtr) | |
d55e5bfc RD |
3070 | |
3071 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
3072 | """ |
3073 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
3074 | ||
3075 | Loads an image from a file, using a MIME type string (such as | |
3076 | 'image/jpeg') to specify image type. | |
3077 | """ | |
5b5c9bc7 | 3078 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d55e5bfc RD |
3079 | val.thisown = 1 |
3080 | return val | |
3081 | ||
3082 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
3083 | """ |
3084 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
3085 | ||
3086 | Loads an image from an input stream, or any readable Python file-like | |
3087 | object. | |
3088 | """ | |
5b5c9bc7 | 3089 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d55e5bfc RD |
3090 | val.thisown = 1 |
3091 | return val | |
3092 | ||
3093 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
3094 | """ |
3095 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
3096 | ||
3097 | Loads an image from an input stream, or any readable Python file-like | |
3098 | object, specifying the image format with a MIME type string. | |
3099 | """ | |
5b5c9bc7 | 3100 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d55e5bfc RD |
3101 | val.thisown = 1 |
3102 | return val | |
3103 | ||
d6c14a4c | 3104 | def EmptyImage(*args, **kwargs): |
bb2ef2cc | 3105 | """ |
5b5c9bc7 | 3106 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image |
bb2ef2cc RD |
3107 | |
3108 | Construct an empty image of a given size, optionally setting all | |
3109 | pixels to black. | |
3110 | """ | |
5b5c9bc7 | 3111 | val = _core_.new_EmptyImage(*args, **kwargs) |
d55e5bfc RD |
3112 | val.thisown = 1 |
3113 | return val | |
3114 | ||
3115 | def ImageFromBitmap(*args, **kwargs): | |
bb2ef2cc | 3116 | """ |
5b5c9bc7 | 3117 | ImageFromBitmap(Bitmap bitmap) -> Image |
bb2ef2cc RD |
3118 | |
3119 | Construct an Image from a `wx.Bitmap`. | |
3120 | """ | |
5b5c9bc7 | 3121 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d55e5bfc RD |
3122 | val.thisown = 1 |
3123 | return val | |
3124 | ||
3125 | def ImageFromData(*args, **kwargs): | |
bb2ef2cc | 3126 | """ |
5b5c9bc7 | 3127 | ImageFromData(int width, int height, buffer data) -> Image |
bb2ef2cc RD |
3128 | |
3129 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
3130 | string or a buffer object holding the data and the length of the data | |
3131 | must be width*height*3. | |
3132 | """ | |
5b5c9bc7 | 3133 | val = _core_.new_ImageFromData(*args, **kwargs) |
d55e5bfc RD |
3134 | val.thisown = 1 |
3135 | return val | |
3136 | ||
03e46024 | 3137 | def ImageFromDataWithAlpha(*args, **kwargs): |
bb2ef2cc | 3138 | """ |
5b5c9bc7 | 3139 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image |
bb2ef2cc RD |
3140 | |
3141 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
3142 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
3143 | length of the data must be width*height*3 bytes, and the length of the |
3144 | alpha data must be width*height bytes. | |
bb2ef2cc | 3145 | """ |
5b5c9bc7 | 3146 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
03e46024 RD |
3147 | val.thisown = 1 |
3148 | return val | |
3149 | ||
5b5c9bc7 | 3150 | def Image_CanRead(*args, **kwargs): |
7a27cf7c RD |
3151 | """ |
3152 | Image_CanRead(String filename) -> bool | |
3153 | ||
3154 | Returns True if the image handlers can read this file. | |
3155 | """ | |
5b5c9bc7 | 3156 | return _core_.Image_CanRead(*args, **kwargs) |
d55e5bfc | 3157 | |
5b5c9bc7 | 3158 | def Image_GetImageCount(*args, **kwargs): |
7a27cf7c RD |
3159 | """ |
3160 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
3161 | ||
3162 | If the image file contains more than one image and the image handler | |
3163 | is capable of retrieving these individually, this function will return | |
3164 | the number of available images. | |
3165 | """ | |
5b5c9bc7 | 3166 | return _core_.Image_GetImageCount(*args, **kwargs) |
d55e5bfc | 3167 | |
5b5c9bc7 | 3168 | def Image_CanReadStream(*args, **kwargs): |
7a27cf7c RD |
3169 | """ |
3170 | Image_CanReadStream(InputStream stream) -> bool | |
3171 | ||
3172 | Returns True if the image handlers can read an image file from the | |
3173 | data currently on the input stream, or a readable Python file-like | |
3174 | object. | |
3175 | """ | |
5b5c9bc7 | 3176 | return _core_.Image_CanReadStream(*args, **kwargs) |
d55e5bfc | 3177 | |
5b5c9bc7 RD |
3178 | def Image_AddHandler(*args, **kwargs): |
3179 | """Image_AddHandler(ImageHandler handler)""" | |
3180 | return _core_.Image_AddHandler(*args, **kwargs) | |
d55e5bfc | 3181 | |
5b5c9bc7 RD |
3182 | def Image_InsertHandler(*args, **kwargs): |
3183 | """Image_InsertHandler(ImageHandler handler)""" | |
3184 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d55e5bfc | 3185 | |
5b5c9bc7 RD |
3186 | def Image_RemoveHandler(*args, **kwargs): |
3187 | """Image_RemoveHandler(String name) -> bool""" | |
3188 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d55e5bfc | 3189 | |
5b5c9bc7 | 3190 | def Image_GetImageExtWildcard(*args, **kwargs): |
7a27cf7c RD |
3191 | """ |
3192 | Image_GetImageExtWildcard() -> String | |
3193 | ||
3194 | Iterates all registered wxImageHandler objects, and returns a string | |
3195 | containing file extension masks suitable for passing to file open/save | |
3196 | dialog boxes. | |
3197 | """ | |
5b5c9bc7 | 3198 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
d55e5bfc | 3199 | |
943e8dfd RD |
3200 | def Image_RGBtoHSV(*args, **kwargs): |
3201 | """ | |
3202 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
3203 | ||
3204 | Converts a color in RGB color space to HSV color space. | |
3205 | """ | |
3206 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
3207 | ||
3208 | def Image_HSVtoRGB(*args, **kwargs): | |
3209 | """ | |
3210 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
3211 | ||
3212 | Converts a color in HSV color space to RGB color space. | |
3213 | """ | |
3214 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
3215 | ||
68e533f8 RD |
3216 | def InitAllImageHandlers(): |
3217 | """ | |
3218 | The former functionality of InitAllImageHanders is now done internal to | |
3219 | the _core_ extension module and so this function has become a simple NOP. | |
3220 | """ | |
3221 | pass | |
d55e5bfc | 3222 | |
5b5c9bc7 RD |
3223 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3224 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
3225 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR | |
3226 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3227 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
3228 | BMP_24BPP = _core_.BMP_24BPP | |
3229 | BMP_8BPP = _core_.BMP_8BPP | |
3230 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3231 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3232 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3233 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3234 | BMP_4BPP = _core_.BMP_4BPP | |
3235 | BMP_1BPP = _core_.BMP_1BPP | |
3236 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
3237 | class BMPHandler(ImageHandler): | |
27fb7603 | 3238 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
d55e5bfc RD |
3239 | def __repr__(self): |
3240 | return "<%s.%s; proxy of C++ wxBMPHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3241 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3242 | """ |
3243 | __init__(self) -> BMPHandler | |
3244 | ||
3245 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3246 | """ | |
5b5c9bc7 | 3247 | newobj = _core_.new_BMPHandler(*args, **kwargs) |
d55e5bfc RD |
3248 | self.this = newobj.this |
3249 | self.thisown = 1 | |
3250 | del newobj.thisown | |
3251 | ||
5b5c9bc7 | 3252 | class BMPHandlerPtr(BMPHandler): |
d55e5bfc RD |
3253 | def __init__(self, this): |
3254 | self.this = this | |
3255 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3256 | self.__class__ = BMPHandler |
3257 | _core_.BMPHandler_swigregister(BMPHandlerPtr) | |
3258 | NullImage = cvar.NullImage | |
68350608 | 3259 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d55e5bfc RD |
3260 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3261 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3262 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3263 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
68350608 RD |
3264 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3265 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d55e5bfc | 3266 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3267 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
68350608 RD |
3268 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3269 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3270 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3271 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
7fbf8399 RD |
3272 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3273 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d55e5bfc | 3274 | |
5b5c9bc7 | 3275 | class ICOHandler(BMPHandler): |
27fb7603 | 3276 | """A `wx.ImageHandler` for \*.ico icon files.""" |
d55e5bfc RD |
3277 | def __repr__(self): |
3278 | return "<%s.%s; proxy of C++ wxICOHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3279 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3280 | """ |
3281 | __init__(self) -> ICOHandler | |
3282 | ||
3283 | A `wx.ImageHandler` for \*.ico icon files. | |
3284 | """ | |
5b5c9bc7 | 3285 | newobj = _core_.new_ICOHandler(*args, **kwargs) |
d55e5bfc RD |
3286 | self.this = newobj.this |
3287 | self.thisown = 1 | |
3288 | del newobj.thisown | |
3289 | ||
5b5c9bc7 | 3290 | class ICOHandlerPtr(ICOHandler): |
d55e5bfc RD |
3291 | def __init__(self, this): |
3292 | self.this = this | |
3293 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3294 | self.__class__ = ICOHandler |
3295 | _core_.ICOHandler_swigregister(ICOHandlerPtr) | |
d55e5bfc | 3296 | |
5b5c9bc7 | 3297 | class CURHandler(ICOHandler): |
27fb7603 | 3298 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
d55e5bfc RD |
3299 | def __repr__(self): |
3300 | return "<%s.%s; proxy of C++ wxCURHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3301 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3302 | """ |
3303 | __init__(self) -> CURHandler | |
3304 | ||
3305 | A `wx.ImageHandler` for \*.cur cursor files. | |
3306 | """ | |
5b5c9bc7 | 3307 | newobj = _core_.new_CURHandler(*args, **kwargs) |
d55e5bfc RD |
3308 | self.this = newobj.this |
3309 | self.thisown = 1 | |
3310 | del newobj.thisown | |
3311 | ||
5b5c9bc7 | 3312 | class CURHandlerPtr(CURHandler): |
d55e5bfc RD |
3313 | def __init__(self, this): |
3314 | self.this = this | |
3315 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3316 | self.__class__ = CURHandler |
3317 | _core_.CURHandler_swigregister(CURHandlerPtr) | |
d55e5bfc | 3318 | |
5b5c9bc7 | 3319 | class ANIHandler(CURHandler): |
27fb7603 | 3320 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
d55e5bfc RD |
3321 | def __repr__(self): |
3322 | return "<%s.%s; proxy of C++ wxANIHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3323 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3324 | """ |
3325 | __init__(self) -> ANIHandler | |
3326 | ||
3327 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3328 | """ | |
5b5c9bc7 | 3329 | newobj = _core_.new_ANIHandler(*args, **kwargs) |
d55e5bfc RD |
3330 | self.this = newobj.this |
3331 | self.thisown = 1 | |
3332 | del newobj.thisown | |
3333 | ||
5b5c9bc7 | 3334 | class ANIHandlerPtr(ANIHandler): |
d55e5bfc RD |
3335 | def __init__(self, this): |
3336 | self.this = this | |
3337 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3338 | self.__class__ = ANIHandler |
3339 | _core_.ANIHandler_swigregister(ANIHandlerPtr) | |
d55e5bfc | 3340 | |
5b5c9bc7 | 3341 | class PNGHandler(ImageHandler): |
27fb7603 | 3342 | """A `wx.ImageHandler` for PNG image files.""" |
d55e5bfc RD |
3343 | def __repr__(self): |
3344 | return "<%s.%s; proxy of C++ wxPNGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3345 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3346 | """ |
3347 | __init__(self) -> PNGHandler | |
3348 | ||
3349 | A `wx.ImageHandler` for PNG image files. | |
3350 | """ | |
5b5c9bc7 | 3351 | newobj = _core_.new_PNGHandler(*args, **kwargs) |
d55e5bfc RD |
3352 | self.this = newobj.this |
3353 | self.thisown = 1 | |
3354 | del newobj.thisown | |
3355 | ||
5b5c9bc7 | 3356 | class PNGHandlerPtr(PNGHandler): |
d55e5bfc RD |
3357 | def __init__(self, this): |
3358 | self.this = this | |
3359 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3360 | self.__class__ = PNGHandler |
3361 | _core_.PNGHandler_swigregister(PNGHandlerPtr) | |
d55e5bfc | 3362 | |
5b5c9bc7 | 3363 | class GIFHandler(ImageHandler): |
27fb7603 | 3364 | """A `wx.ImageHandler` for GIF image files.""" |
d55e5bfc RD |
3365 | def __repr__(self): |
3366 | return "<%s.%s; proxy of C++ wxGIFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3367 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3368 | """ |
3369 | __init__(self) -> GIFHandler | |
3370 | ||
3371 | A `wx.ImageHandler` for GIF image files. | |
3372 | """ | |
5b5c9bc7 | 3373 | newobj = _core_.new_GIFHandler(*args, **kwargs) |
d55e5bfc RD |
3374 | self.this = newobj.this |
3375 | self.thisown = 1 | |
3376 | del newobj.thisown | |
3377 | ||
5b5c9bc7 | 3378 | class GIFHandlerPtr(GIFHandler): |
d55e5bfc RD |
3379 | def __init__(self, this): |
3380 | self.this = this | |
3381 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3382 | self.__class__ = GIFHandler |
3383 | _core_.GIFHandler_swigregister(GIFHandlerPtr) | |
d55e5bfc | 3384 | |
5b5c9bc7 | 3385 | class PCXHandler(ImageHandler): |
27fb7603 | 3386 | """A `wx.ImageHandler` for PCX imager files.""" |
d55e5bfc RD |
3387 | def __repr__(self): |
3388 | return "<%s.%s; proxy of C++ wxPCXHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3389 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3390 | """ |
3391 | __init__(self) -> PCXHandler | |
3392 | ||
3393 | A `wx.ImageHandler` for PCX imager files. | |
3394 | """ | |
5b5c9bc7 | 3395 | newobj = _core_.new_PCXHandler(*args, **kwargs) |
d55e5bfc RD |
3396 | self.this = newobj.this |
3397 | self.thisown = 1 | |
3398 | del newobj.thisown | |
3399 | ||
5b5c9bc7 | 3400 | class PCXHandlerPtr(PCXHandler): |
d55e5bfc RD |
3401 | def __init__(self, this): |
3402 | self.this = this | |
3403 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3404 | self.__class__ = PCXHandler |
3405 | _core_.PCXHandler_swigregister(PCXHandlerPtr) | |
d55e5bfc | 3406 | |
5b5c9bc7 | 3407 | class JPEGHandler(ImageHandler): |
27fb7603 | 3408 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
d55e5bfc RD |
3409 | def __repr__(self): |
3410 | return "<%s.%s; proxy of C++ wxJPEGHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3411 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3412 | """ |
3413 | __init__(self) -> JPEGHandler | |
3414 | ||
3415 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3416 | """ | |
5b5c9bc7 | 3417 | newobj = _core_.new_JPEGHandler(*args, **kwargs) |
d55e5bfc RD |
3418 | self.this = newobj.this |
3419 | self.thisown = 1 | |
3420 | del newobj.thisown | |
3421 | ||
5b5c9bc7 | 3422 | class JPEGHandlerPtr(JPEGHandler): |
d55e5bfc RD |
3423 | def __init__(self, this): |
3424 | self.this = this | |
3425 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3426 | self.__class__ = JPEGHandler |
3427 | _core_.JPEGHandler_swigregister(JPEGHandlerPtr) | |
d55e5bfc | 3428 | |
5b5c9bc7 | 3429 | class PNMHandler(ImageHandler): |
27fb7603 | 3430 | """A `wx.ImageHandler` for PNM image files.""" |
d55e5bfc RD |
3431 | def __repr__(self): |
3432 | return "<%s.%s; proxy of C++ wxPNMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3433 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3434 | """ |
3435 | __init__(self) -> PNMHandler | |
3436 | ||
3437 | A `wx.ImageHandler` for PNM image files. | |
3438 | """ | |
5b5c9bc7 | 3439 | newobj = _core_.new_PNMHandler(*args, **kwargs) |
d55e5bfc RD |
3440 | self.this = newobj.this |
3441 | self.thisown = 1 | |
3442 | del newobj.thisown | |
3443 | ||
5b5c9bc7 | 3444 | class PNMHandlerPtr(PNMHandler): |
d55e5bfc RD |
3445 | def __init__(self, this): |
3446 | self.this = this | |
3447 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3448 | self.__class__ = PNMHandler |
3449 | _core_.PNMHandler_swigregister(PNMHandlerPtr) | |
d55e5bfc | 3450 | |
5b5c9bc7 | 3451 | class XPMHandler(ImageHandler): |
27fb7603 | 3452 | """A `wx.ImageHandler` for XPM image.""" |
d55e5bfc RD |
3453 | def __repr__(self): |
3454 | return "<%s.%s; proxy of C++ wxXPMHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3455 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3456 | """ |
3457 | __init__(self) -> XPMHandler | |
3458 | ||
3459 | A `wx.ImageHandler` for XPM image. | |
3460 | """ | |
5b5c9bc7 | 3461 | newobj = _core_.new_XPMHandler(*args, **kwargs) |
d55e5bfc RD |
3462 | self.this = newobj.this |
3463 | self.thisown = 1 | |
3464 | del newobj.thisown | |
3465 | ||
5b5c9bc7 | 3466 | class XPMHandlerPtr(XPMHandler): |
d55e5bfc RD |
3467 | def __init__(self, this): |
3468 | self.this = this | |
3469 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3470 | self.__class__ = XPMHandler |
3471 | _core_.XPMHandler_swigregister(XPMHandlerPtr) | |
d55e5bfc | 3472 | |
5b5c9bc7 | 3473 | class TIFFHandler(ImageHandler): |
27fb7603 | 3474 | """A `wx.ImageHandler` for TIFF image files.""" |
d55e5bfc RD |
3475 | def __repr__(self): |
3476 | return "<%s.%s; proxy of C++ wxTIFFHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3477 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3478 | """ |
3479 | __init__(self) -> TIFFHandler | |
3480 | ||
3481 | A `wx.ImageHandler` for TIFF image files. | |
3482 | """ | |
5b5c9bc7 | 3483 | newobj = _core_.new_TIFFHandler(*args, **kwargs) |
d55e5bfc RD |
3484 | self.this = newobj.this |
3485 | self.thisown = 1 | |
3486 | del newobj.thisown | |
3487 | ||
5b5c9bc7 | 3488 | class TIFFHandlerPtr(TIFFHandler): |
d55e5bfc RD |
3489 | def __init__(self, this): |
3490 | self.this = this | |
3491 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3492 | self.__class__ = TIFFHandler |
3493 | _core_.TIFFHandler_swigregister(TIFFHandlerPtr) | |
d55e5bfc | 3494 | |
5b5c9bc7 RD |
3495 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3496 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3497 | class Quantize(object): | |
c0de73ae RD |
3498 | """Performs quantization, or colour reduction, on a wxImage.""" |
3499 | def __init__(self): raise RuntimeError, "No constructor defined" | |
3500 | def __repr__(self): | |
3501 | return "<%s.%s; proxy of C++ wxQuantize instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3502 | def Quantize(*args, **kwargs): | |
3503 | """ | |
5b5c9bc7 | 3504 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
c0de73ae RD |
3505 | |
3506 | Reduce the colours in the source image and put the result into the | |
3507 | destination image, setting the palette in the destination if | |
3508 | needed. Both images may be the same, to overwrite the source image. | |
3509 | """ | |
5b5c9bc7 | 3510 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae RD |
3511 | |
3512 | Quantize = staticmethod(Quantize) | |
3513 | ||
5b5c9bc7 | 3514 | class QuantizePtr(Quantize): |
c0de73ae RD |
3515 | def __init__(self, this): |
3516 | self.this = this | |
3517 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3518 | self.__class__ = Quantize |
3519 | _core_.Quantize_swigregister(QuantizePtr) | |
c0de73ae | 3520 | |
5b5c9bc7 | 3521 | def Quantize_Quantize(*args, **kwargs): |
c0de73ae | 3522 | """ |
5b5c9bc7 | 3523 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
c0de73ae RD |
3524 | |
3525 | Reduce the colours in the source image and put the result into the | |
3526 | destination image, setting the palette in the destination if | |
3527 | needed. Both images may be the same, to overwrite the source image. | |
3528 | """ | |
5b5c9bc7 | 3529 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae | 3530 | |
d55e5bfc RD |
3531 | #--------------------------------------------------------------------------- |
3532 | ||
5b5c9bc7 RD |
3533 | class EvtHandler(Object): |
3534 | """Proxy of C++ EvtHandler class""" | |
d55e5bfc RD |
3535 | def __repr__(self): |
3536 | return "<%s.%s; proxy of C++ wxEvtHandler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
3537 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
3538 | """__init__(self) -> EvtHandler""" |
3539 | newobj = _core_.new_EvtHandler(*args, **kwargs) | |
d55e5bfc RD |
3540 | self.this = newobj.this |
3541 | self.thisown = 1 | |
3542 | del newobj.thisown | |
3543 | def GetNextHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3544 | """GetNextHandler(self) -> EvtHandler""" |
3545 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) | |
d55e5bfc RD |
3546 | |
3547 | def GetPreviousHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3548 | """GetPreviousHandler(self) -> EvtHandler""" |
3549 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) | |
d55e5bfc RD |
3550 | |
3551 | def SetNextHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3552 | """SetNextHandler(self, EvtHandler handler)""" |
3553 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) | |
d55e5bfc RD |
3554 | |
3555 | def SetPreviousHandler(*args, **kwargs): | |
5b5c9bc7 RD |
3556 | """SetPreviousHandler(self, EvtHandler handler)""" |
3557 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) | |
d55e5bfc RD |
3558 | |
3559 | def GetEvtHandlerEnabled(*args, **kwargs): | |
3560 | """GetEvtHandlerEnabled(self) -> bool""" | |
5b5c9bc7 | 3561 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
d55e5bfc RD |
3562 | |
3563 | def SetEvtHandlerEnabled(*args, **kwargs): | |
3564 | """SetEvtHandlerEnabled(self, bool enabled)""" | |
5b5c9bc7 | 3565 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
d55e5bfc RD |
3566 | |
3567 | def ProcessEvent(*args, **kwargs): | |
5b5c9bc7 RD |
3568 | """ProcessEvent(self, Event event) -> bool""" |
3569 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) | |
d55e5bfc RD |
3570 | |
3571 | def AddPendingEvent(*args, **kwargs): | |
5b5c9bc7 RD |
3572 | """AddPendingEvent(self, Event event)""" |
3573 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) | |
d55e5bfc RD |
3574 | |
3575 | def ProcessPendingEvents(*args, **kwargs): | |
3576 | """ProcessPendingEvents(self)""" | |
5b5c9bc7 | 3577 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
d55e5bfc RD |
3578 | |
3579 | def Connect(*args, **kwargs): | |
3580 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" | |
5b5c9bc7 | 3581 | return _core_.EvtHandler_Connect(*args, **kwargs) |
d55e5bfc RD |
3582 | |
3583 | def Disconnect(*args, **kwargs): | |
3584 | """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool""" | |
5b5c9bc7 | 3585 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
d55e5bfc RD |
3586 | |
3587 | def _setOORInfo(*args, **kwargs): | |
36ed4f51 | 3588 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
5b5c9bc7 | 3589 | return _core_.EvtHandler__setOORInfo(*args, **kwargs) |
d55e5bfc RD |
3590 | |
3591 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): | |
3592 | """ | |
3593 | Bind an event to an event handler. | |
3594 | ||
a5ee0656 RD |
3595 | :param event: One of the EVT_* objects that specifies the |
3596 | type of event to bind, | |
d55e5bfc | 3597 | |
a5ee0656 RD |
3598 | :param handler: A callable object to be invoked when the |
3599 | event is delivered to self. Pass None to | |
3600 | disconnect an event handler. | |
d55e5bfc | 3601 | |
a5ee0656 RD |
3602 | :param source: Sometimes the event originates from a |
3603 | different window than self, but you still | |
3604 | want to catch it in self. (For example, a | |
3605 | button event delivered to a frame.) By | |
3606 | passing the source of the event, the event | |
3607 | handling system is able to differentiate | |
3608 | between the same event type from different | |
3609 | controls. | |
d55e5bfc | 3610 | |
a5ee0656 RD |
3611 | :param id: Used to spcify the event source by ID instead |
3612 | of instance. | |
3613 | ||
3614 | :param id2: Used when it is desirable to bind a handler | |
3615 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d55e5bfc RD |
3616 | """ |
3617 | if source is not None: | |
3618 | id = source.GetId() | |
3619 | event.Bind(self, id, id2, handler) | |
3620 | ||
d6c14a4c RD |
3621 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3622 | """ | |
3623 | Disconencts the event handler binding for event from self. | |
3624 | Returns True if successful. | |
3625 | """ | |
3626 | if source is not None: | |
3627 | id = source.GetId() | |
3628 | return event.Unbind(self, id, id2) | |
d55e5bfc RD |
3629 | |
3630 | ||
5b5c9bc7 | 3631 | class EvtHandlerPtr(EvtHandler): |
d55e5bfc RD |
3632 | def __init__(self, this): |
3633 | self.this = this | |
3634 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
3635 | self.__class__ = EvtHandler |
3636 | _core_.EvtHandler_swigregister(EvtHandlerPtr) | |
d55e5bfc RD |
3637 | |
3638 | #--------------------------------------------------------------------------- | |
3639 | ||
3640 | class PyEventBinder(object): | |
3641 | """ | |
3642 | Instances of this class are used to bind specific events to event | |
3643 | handlers. | |
3644 | """ | |
3645 | def __init__(self, evtType, expectedIDs=0): | |
3646 | if expectedIDs not in [0, 1, 2]: | |
3647 | raise ValueError, "Invalid number of expectedIDs" | |
3648 | self.expectedIDs = expectedIDs | |
3649 | ||
3650 | if type(evtType) == list or type(evtType) == tuple: | |
3651 | self.evtType = evtType | |
3652 | else: | |
3653 | self.evtType = [evtType] | |
3654 | ||
3655 | ||
3656 | def Bind(self, target, id1, id2, function): | |
3657 | """Bind this set of event types to target.""" | |
3658 | for et in self.evtType: | |
3659 | target.Connect(id1, id2, et, function) | |
3660 | ||
d6c14a4c RD |
3661 | |
3662 | def Unbind(self, target, id1, id2): | |
3663 | """Remove an event binding.""" | |
3664 | success = 0 | |
3665 | for et in self.evtType: | |
3666 | success += target.Disconnect(id1, id2, et) | |
3667 | return success != 0 | |
3668 | ||
d55e5bfc RD |
3669 | |
3670 | def __call__(self, *args): | |
3671 | """ | |
3672 | For backwards compatibility with the old EVT_* functions. | |
3673 | Should be called with either (window, func), (window, ID, | |
3674 | func) or (window, ID1, ID2, func) parameters depending on the | |
3675 | type of the event. | |
3676 | """ | |
3677 | assert len(args) == 2 + self.expectedIDs | |
3678 | id1 = wx.ID_ANY | |
3679 | id2 = wx.ID_ANY | |
3680 | target = args[0] | |
3681 | if self.expectedIDs == 0: | |
3682 | func = args[1] | |
3683 | elif self.expectedIDs == 1: | |
3684 | id1 = args[1] | |
3685 | func = args[2] | |
3686 | elif self.expectedIDs == 2: | |
3687 | id1 = args[1] | |
3688 | id2 = args[2] | |
3689 | func = args[3] | |
3690 | else: | |
3691 | raise ValueError, "Unexpected number of IDs" | |
3692 | ||
3693 | self.Bind(target, id1, id2, func) | |
3694 | ||
3695 | ||
3696 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3697 | def EVT_COMMAND(win, id, cmd, func): | |
3698 | win.Connect(id, -1, cmd, func) | |
3699 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3700 | win.Connect(id1, id2, cmd, func) | |
3701 | ||
3702 | ||
3703 | #--------------------------------------------------------------------------- | |
3704 | ||
3705 | #--------------------------------------------------------------------------- | |
3706 | ||
5b5c9bc7 RD |
3707 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3708 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
3709 | ||
3710 | def NewEventType(*args, **kwargs): | |
3711 | """NewEventType() -> wxEventType""" | |
3712 | return _core_.NewEventType(*args, **kwargs) | |
3713 | wxEVT_NULL = _core_.wxEVT_NULL | |
3714 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3715 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3716 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3717 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3718 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3719 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3720 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3721 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3722 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3723 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3724 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3725 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3726 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3727 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3728 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3729 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3730 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3731 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3732 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3733 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3734 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3735 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3736 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3737 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3738 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3739 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3740 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3741 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3742 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3743 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3744 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3745 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3746 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3747 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3748 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3749 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3750 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3751 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3752 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3753 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3754 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3755 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3756 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3757 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3758 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3759 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3760 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3761 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3762 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3763 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3764 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3765 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3766 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3767 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3768 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3769 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3770 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3771 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3772 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3773 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3774 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
4f433fef RD |
3775 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
3776 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
5b5c9bc7 RD |
3777 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
3778 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3779 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3780 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3781 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3782 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3783 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3784 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3785 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3786 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3787 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3788 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3789 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3790 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
3791 | wxEVT_POWER = _core_.wxEVT_POWER | |
3792 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE | |
3793 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3794 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3795 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3796 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3797 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3798 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
3799 | wxEVT_PAINT = _core_.wxEVT_PAINT | |
3800 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3801 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3802 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3803 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3804 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3805 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3806 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3807 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3808 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3809 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3810 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3811 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3812 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3813 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3814 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3815 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3816 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3817 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3818 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3819 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3820 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
3821 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE | |
3822 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK | |
3823 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3824 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3825 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3826 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3827 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3828 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d55e5bfc RD |
3829 | # |
3830 | # Create some event binders | |
3831 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3832 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3833 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3834 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3835 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3836 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3837 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3838 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3839 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3840 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3841 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3842 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3843 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
3844 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) | |
3845 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) | |
3846 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3847 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3848 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3849 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3850 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3851 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3852 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3853 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3854 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
88c6b281 | 3855 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d55e5bfc RD |
3856 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3857 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3858 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3859 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3860 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3861 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3862 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3863 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3864 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3865 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3866 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3867 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3868 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3869 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3870 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3871 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
3872 | ||
3873 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3874 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3875 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3876 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3877 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3878 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3879 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3880 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3881 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3882 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3883 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3884 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3885 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3886 | ||
3887 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3888 | wxEVT_LEFT_UP, | |
3889 | wxEVT_MIDDLE_DOWN, | |
3890 | wxEVT_MIDDLE_UP, | |
3891 | wxEVT_RIGHT_DOWN, | |
3892 | wxEVT_RIGHT_UP, | |
3893 | wxEVT_MOTION, | |
3894 | wxEVT_LEFT_DCLICK, | |
3895 | wxEVT_MIDDLE_DCLICK, | |
3896 | wxEVT_RIGHT_DCLICK, | |
3897 | wxEVT_ENTER_WINDOW, | |
3898 | wxEVT_LEAVE_WINDOW, | |
3899 | wxEVT_MOUSEWHEEL | |
3900 | ]) | |
3901 | ||
3902 | ||
3903 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
3904 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, | |
3905 | wxEVT_SCROLLWIN_BOTTOM, | |
3906 | wxEVT_SCROLLWIN_LINEUP, | |
3907 | wxEVT_SCROLLWIN_LINEDOWN, | |
3908 | wxEVT_SCROLLWIN_PAGEUP, | |
3909 | wxEVT_SCROLLWIN_PAGEDOWN, | |
3910 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3911 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3912 | ]) | |
3913 | ||
3914 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3915 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3916 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3917 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3918 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3919 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3920 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3921 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3922 | ||
27fb7603 | 3923 | # Scrolling from wx.Slider and wx.ScrollBar |
d55e5bfc RD |
3924 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3925 | wxEVT_SCROLL_BOTTOM, | |
3926 | wxEVT_SCROLL_LINEUP, | |
3927 | wxEVT_SCROLL_LINEDOWN, | |
3928 | wxEVT_SCROLL_PAGEUP, | |
3929 | wxEVT_SCROLL_PAGEDOWN, | |
3930 | wxEVT_SCROLL_THUMBTRACK, | |
3931 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3932 | wxEVT_SCROLL_CHANGED, |
d55e5bfc RD |
3933 | ]) |
3934 | ||
3935 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3936 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3937 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3938 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3939 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3940 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3941 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3942 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4f433fef RD |
3943 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
3944 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
3945 | ||
27fb7603 | 3946 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
d55e5bfc RD |
3947 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3948 | wxEVT_SCROLL_BOTTOM, | |
3949 | wxEVT_SCROLL_LINEUP, | |
3950 | wxEVT_SCROLL_LINEDOWN, | |
3951 | wxEVT_SCROLL_PAGEUP, | |
3952 | wxEVT_SCROLL_PAGEDOWN, | |
3953 | wxEVT_SCROLL_THUMBTRACK, | |
3954 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3955 | wxEVT_SCROLL_CHANGED, |
d55e5bfc RD |
3956 | ], 1) |
3957 | ||
3958 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3959 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3960 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3961 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3962 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3963 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3964 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3965 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4f433fef RD |
3966 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
3967 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d55e5bfc RD |
3968 | |
3969 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) | |
3970 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3971 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3972 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3973 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3974 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3975 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3976 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3977 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3978 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3979 | ||
3980 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3981 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3982 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3983 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3984 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3985 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3986 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3987 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3988 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3989 | ||
3990 | ||
3991 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3992 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3993 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3994 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3995 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3996 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3997 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3998 | ||
3999 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
4000 | ||
4001 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
4002 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
4003 | ||
4004 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
4005 | ||
4006 | ||
4007 | ||
4008 | #--------------------------------------------------------------------------- | |
4009 | ||
5b5c9bc7 | 4010 | class Event(Object): |
27fb7603 RD |
4011 | """ |
4012 | An event is a structure holding information about an event passed to a | |
4013 | callback or member function. wx.Event is an abstract base class for | |
4014 | other event classes | |
4015 | """ | |
d55e5bfc RD |
4016 | def __init__(self): raise RuntimeError, "No constructor defined" |
4017 | def __repr__(self): | |
4018 | return "<%s.%s; proxy of C++ wxEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 | 4019 | def __del__(self, destroy=_core_.delete_Event): |
d55e5bfc RD |
4020 | """__del__(self)""" |
4021 | try: | |
4022 | if self.thisown: destroy(self) | |
4023 | except: pass | |
4024 | ||
4025 | def SetEventType(*args, **kwargs): | |
27fb7603 RD |
4026 | """ |
4027 | SetEventType(self, wxEventType typ) | |
4028 | ||
4029 | Sets the specific type of the event. | |
4030 | """ | |
5b5c9bc7 | 4031 | return _core_.Event_SetEventType(*args, **kwargs) |
d55e5bfc RD |
4032 | |
4033 | def GetEventType(*args, **kwargs): | |
27fb7603 RD |
4034 | """ |
4035 | GetEventType(self) -> wxEventType | |
4036 | ||
4037 | Returns the identifier of the given event type, such as | |
4038 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
4039 | """ | |
5b5c9bc7 | 4040 | return _core_.Event_GetEventType(*args, **kwargs) |
d55e5bfc RD |
4041 | |
4042 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
4043 | """ |
4044 | GetEventObject(self) -> Object | |
4045 | ||
4046 | Returns the object (usually a window) associated with the event, if | |
4047 | any. | |
4048 | """ | |
5b5c9bc7 | 4049 | return _core_.Event_GetEventObject(*args, **kwargs) |
d55e5bfc RD |
4050 | |
4051 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
4052 | """ |
4053 | SetEventObject(self, Object obj) | |
4054 | ||
4055 | Sets the originating object, or in other words, obj is normally the | |
4056 | object that is sending the event. | |
4057 | """ | |
5b5c9bc7 | 4058 | return _core_.Event_SetEventObject(*args, **kwargs) |
d55e5bfc RD |
4059 | |
4060 | def GetTimestamp(*args, **kwargs): | |
4061 | """GetTimestamp(self) -> long""" | |
5b5c9bc7 | 4062 | return _core_.Event_GetTimestamp(*args, **kwargs) |
d55e5bfc RD |
4063 | |
4064 | def SetTimestamp(*args, **kwargs): | |
4065 | """SetTimestamp(self, long ts=0)""" | |
5b5c9bc7 | 4066 | return _core_.Event_SetTimestamp(*args, **kwargs) |
d55e5bfc RD |
4067 | |
4068 | def GetId(*args, **kwargs): | |
27fb7603 RD |
4069 | """ |
4070 | GetId(self) -> int | |
4071 | ||
4072 | Returns the identifier associated with this event, such as a button | |
4073 | command id. | |
4074 | """ | |
5b5c9bc7 | 4075 | return _core_.Event_GetId(*args, **kwargs) |
d55e5bfc RD |
4076 | |
4077 | def SetId(*args, **kwargs): | |
27fb7603 RD |
4078 | """ |
4079 | SetId(self, int Id) | |
4080 | ||
4081 | Set's the ID for the event. This is usually the ID of the window that | |
4082 | is sending the event, but it can also be a command id from a menu | |
4083 | item, etc. | |
4084 | """ | |
5b5c9bc7 | 4085 | return _core_.Event_SetId(*args, **kwargs) |
d55e5bfc RD |
4086 | |
4087 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
4088 | """ |
4089 | IsCommandEvent(self) -> bool | |
4090 | ||
4091 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
4092 | it returns false. Note: Exists only for optimization purposes. | |
4093 | """ | |
5b5c9bc7 | 4094 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
d55e5bfc RD |
4095 | |
4096 | def Skip(*args, **kwargs): | |
51b83b37 RD |
4097 | """ |
4098 | Skip(self, bool skip=True) | |
4099 | ||
4100 | Called by an event handler, it controls whether additional event | |
4101 | handlers bound to this event will be called after the current event | |
4102 | handler returns. Skip(false) (the default setting) will prevent | |
4103 | additional event handlers from being called and control will be | |
4104 | returned to the sender of the event immediately after the current | |
4105 | handler has finished. Skip(True) will cause the event processing | |
4106 | system to continue searching for a handler function for this event. | |
4107 | ||
4108 | """ | |
5b5c9bc7 | 4109 | return _core_.Event_Skip(*args, **kwargs) |
d55e5bfc RD |
4110 | |
4111 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
4112 | """ |
4113 | GetSkipped(self) -> bool | |
4114 | ||
4115 | Returns true if the event handler should be skipped, false otherwise. | |
4116 | :see: `Skip` | |
4117 | """ | |
5b5c9bc7 | 4118 | return _core_.Event_GetSkipped(*args, **kwargs) |
d55e5bfc RD |
4119 | |
4120 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
4121 | """ |
4122 | ShouldPropagate(self) -> bool | |
4123 | ||
4124 | Test if this event should be propagated to the parent window or not, | |
4125 | i.e. if the propagation level is currently greater than 0. | |
4126 | """ | |
5b5c9bc7 | 4127 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
d55e5bfc RD |
4128 | |
4129 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
4130 | """ |
4131 | StopPropagation(self) -> int | |
4132 | ||
4133 | Stop the event from propagating to its parent window. Returns the old | |
4134 | propagation level value which may be later passed to | |
4135 | `ResumePropagation` to allow propagating the event again. | |
4136 | """ | |
5b5c9bc7 | 4137 | return _core_.Event_StopPropagation(*args, **kwargs) |
d55e5bfc RD |
4138 | |
4139 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
4140 | """ |
4141 | ResumePropagation(self, int propagationLevel) | |
4142 | ||
4143 | Resume the event propagation by restoring the propagation level. (For | |
4144 | example, you can use the value returned by an earlier call to | |
4145 | `StopPropagation`.) | |
4146 | ||
4147 | """ | |
5b5c9bc7 | 4148 | return _core_.Event_ResumePropagation(*args, **kwargs) |
d55e5bfc RD |
4149 | |
4150 | def Clone(*args, **kwargs): | |
5b5c9bc7 RD |
4151 | """Clone(self) -> Event""" |
4152 | return _core_.Event_Clone(*args, **kwargs) | |
d55e5bfc RD |
4153 | |
4154 | ||
5b5c9bc7 | 4155 | class EventPtr(Event): |
d55e5bfc RD |
4156 | def __init__(self, this): |
4157 | self.this = this | |
4158 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4159 | self.__class__ = Event |
4160 | _core_.Event_swigregister(EventPtr) | |
d55e5bfc RD |
4161 | |
4162 | #--------------------------------------------------------------------------- | |
4163 | ||
5b5c9bc7 | 4164 | class PropagationDisabler(object): |
27fb7603 RD |
4165 | """ |
4166 | Helper class to temporarily change an event not to propagate. Simply | |
4167 | create an instance of this class and then whe it is destroyed the | |
4168 | propogation of the event will be restored. | |
4169 | """ | |
d55e5bfc RD |
4170 | def __repr__(self): |
4171 | return "<%s.%s; proxy of C++ wxPropagationDisabler instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4172 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4173 | """ |
4174 | __init__(self, Event event) -> PropagationDisabler | |
4175 | ||
4176 | Helper class to temporarily change an event not to propagate. Simply | |
4177 | create an instance of this class and then whe it is destroyed the | |
4178 | propogation of the event will be restored. | |
4179 | """ | |
5b5c9bc7 | 4180 | newobj = _core_.new_PropagationDisabler(*args, **kwargs) |
d55e5bfc RD |
4181 | self.this = newobj.this |
4182 | self.thisown = 1 | |
4183 | del newobj.thisown | |
5b5c9bc7 | 4184 | def __del__(self, destroy=_core_.delete_PropagationDisabler): |
d55e5bfc RD |
4185 | """__del__(self)""" |
4186 | try: | |
4187 | if self.thisown: destroy(self) | |
4188 | except: pass | |
4189 | ||
4190 | ||
5b5c9bc7 | 4191 | class PropagationDisablerPtr(PropagationDisabler): |
d55e5bfc RD |
4192 | def __init__(self, this): |
4193 | self.this = this | |
4194 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4195 | self.__class__ = PropagationDisabler |
4196 | _core_.PropagationDisabler_swigregister(PropagationDisablerPtr) | |
d55e5bfc | 4197 | |
5b5c9bc7 | 4198 | class PropagateOnce(object): |
27fb7603 RD |
4199 | """ |
4200 | A helper class that will temporarily lower propagation level of an | |
4201 | event. Simply create an instance of this class and then whe it is | |
4202 | destroyed the propogation of the event will be restored. | |
4203 | """ | |
d55e5bfc RD |
4204 | def __repr__(self): |
4205 | return "<%s.%s; proxy of C++ wxPropagateOnce instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4206 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4207 | """ |
4208 | __init__(self, Event event) -> PropagateOnce | |
4209 | ||
4210 | A helper class that will temporarily lower propagation level of an | |
4211 | event. Simply create an instance of this class and then whe it is | |
4212 | destroyed the propogation of the event will be restored. | |
4213 | """ | |
5b5c9bc7 | 4214 | newobj = _core_.new_PropagateOnce(*args, **kwargs) |
d55e5bfc RD |
4215 | self.this = newobj.this |
4216 | self.thisown = 1 | |
4217 | del newobj.thisown | |
5b5c9bc7 | 4218 | def __del__(self, destroy=_core_.delete_PropagateOnce): |
d55e5bfc RD |
4219 | """__del__(self)""" |
4220 | try: | |
4221 | if self.thisown: destroy(self) | |
4222 | except: pass | |
4223 | ||
4224 | ||
5b5c9bc7 | 4225 | class PropagateOncePtr(PropagateOnce): |
d55e5bfc RD |
4226 | def __init__(self, this): |
4227 | self.this = this | |
4228 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4229 | self.__class__ = PropagateOnce |
4230 | _core_.PropagateOnce_swigregister(PropagateOncePtr) | |
d55e5bfc RD |
4231 | |
4232 | #--------------------------------------------------------------------------- | |
4233 | ||
5b5c9bc7 | 4234 | class CommandEvent(Event): |
27fb7603 RD |
4235 | """ |
4236 | This event class contains information about command events, which | |
4237 | originate from a variety of simple controls, as well as menus and | |
4238 | toolbars. | |
4239 | """ | |
d55e5bfc RD |
4240 | def __repr__(self): |
4241 | return "<%s.%s; proxy of C++ wxCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4242 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4243 | """ |
4244 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent | |
4245 | ||
4246 | This event class contains information about command events, which | |
4247 | originate from a variety of simple controls, as well as menus and | |
4248 | toolbars. | |
4249 | """ | |
5b5c9bc7 | 4250 | newobj = _core_.new_CommandEvent(*args, **kwargs) |
d55e5bfc RD |
4251 | self.this = newobj.this |
4252 | self.thisown = 1 | |
4253 | del newobj.thisown | |
4254 | def GetSelection(*args, **kwargs): | |
27fb7603 RD |
4255 | """ |
4256 | GetSelection(self) -> int | |
4257 | ||
4258 | Returns item index for a listbox or choice selection event (not valid | |
4259 | for a deselection). | |
4260 | """ | |
5b5c9bc7 | 4261 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
d55e5bfc RD |
4262 | |
4263 | def SetString(*args, **kwargs): | |
5b5c9bc7 RD |
4264 | """SetString(self, String s)""" |
4265 | return _core_.CommandEvent_SetString(*args, **kwargs) | |
d55e5bfc RD |
4266 | |
4267 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4268 | """ |
4269 | GetString(self) -> String | |
4270 | ||
4271 | Returns item string for a listbox or choice selection event (not valid | |
4272 | for a deselection). | |
4273 | """ | |
5b5c9bc7 | 4274 | return _core_.CommandEvent_GetString(*args, **kwargs) |
d55e5bfc RD |
4275 | |
4276 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4277 | """ |
4278 | IsChecked(self) -> bool | |
4279 | ||
4280 | This method can be used with checkbox and menu events: for the | |
4281 | checkboxes, the method returns true for a selection event and false | |
4282 | for a deselection one. For the menu events, this method indicates if | |
4283 | the menu item just has become checked or unchecked (and thus only | |
4284 | makes sense for checkable menu items). | |
4285 | """ | |
5b5c9bc7 | 4286 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
d55e5bfc RD |
4287 | |
4288 | Checked = IsChecked | |
4289 | def IsSelection(*args, **kwargs): | |
27fb7603 RD |
4290 | """ |
4291 | IsSelection(self) -> bool | |
4292 | ||
4293 | For a listbox or similar event, returns true if it is a selection, | |
4294 | false if it is a deselection. | |
4295 | """ | |
5b5c9bc7 | 4296 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
d55e5bfc RD |
4297 | |
4298 | def SetExtraLong(*args, **kwargs): | |
4299 | """SetExtraLong(self, long extraLong)""" | |
5b5c9bc7 | 4300 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
d55e5bfc RD |
4301 | |
4302 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4303 | """ |
4304 | GetExtraLong(self) -> long | |
4305 | ||
5ba5649b RD |
4306 | Returns extra information dependant on the event objects type. If the |
4307 | event comes from a listbox selection, it is a boolean determining | |
4308 | whether the event was a selection (true) or a deselection (false). A | |
4309 | listbox deselection only occurs for multiple-selection boxes, and in | |
4310 | this case the index and string values are indeterminate and the | |
4311 | listbox must be examined by the application. | |
27fb7603 | 4312 | """ |
5b5c9bc7 | 4313 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
d55e5bfc RD |
4314 | |
4315 | def SetInt(*args, **kwargs): | |
4316 | """SetInt(self, int i)""" | |
5b5c9bc7 | 4317 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
d55e5bfc RD |
4318 | |
4319 | def GetInt(*args, **kwargs): | |
27fb7603 RD |
4320 | """ |
4321 | GetInt(self) -> long | |
4322 | ||
5ba5649b RD |
4323 | Returns the integer identifier corresponding to a listbox, choice or |
4324 | radiobox selection (only if the event was a selection, not a | |
4325 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4326 | """ |
5b5c9bc7 | 4327 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
d55e5bfc RD |
4328 | |
4329 | def Clone(*args, **kwargs): | |
5b5c9bc7 RD |
4330 | """Clone(self) -> Event""" |
4331 | return _core_.CommandEvent_Clone(*args, **kwargs) | |
d55e5bfc RD |
4332 | |
4333 | ||
5b5c9bc7 | 4334 | class CommandEventPtr(CommandEvent): |
d55e5bfc RD |
4335 | def __init__(self, this): |
4336 | self.this = this | |
4337 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4338 | self.__class__ = CommandEvent |
4339 | _core_.CommandEvent_swigregister(CommandEventPtr) | |
d55e5bfc RD |
4340 | |
4341 | #--------------------------------------------------------------------------- | |
4342 | ||
5b5c9bc7 | 4343 | class NotifyEvent(CommandEvent): |
27fb7603 RD |
4344 | """ |
4345 | An instance of this class (or one of its derived classes) is sent from | |
4346 | a control when the control's state is being changed and the control | |
4347 | allows that change to be prevented from happening. The event handler | |
4348 | can call `Veto` or `Allow` to tell the control what to do. | |
4349 | """ | |
d55e5bfc RD |
4350 | def __repr__(self): |
4351 | return "<%s.%s; proxy of C++ wxNotifyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4352 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4353 | """ |
4354 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent | |
4355 | ||
4356 | An instance of this class (or one of its derived classes) is sent from | |
4357 | a control when the control's state is being changed and the control | |
4358 | allows that change to be prevented from happening. The event handler | |
4359 | can call `Veto` or `Allow` to tell the control what to do. | |
4360 | """ | |
5b5c9bc7 | 4361 | newobj = _core_.new_NotifyEvent(*args, **kwargs) |
d55e5bfc RD |
4362 | self.this = newobj.this |
4363 | self.thisown = 1 | |
4364 | del newobj.thisown | |
4365 | def Veto(*args, **kwargs): | |
27fb7603 RD |
4366 | """ |
4367 | Veto(self) | |
4368 | ||
4369 | Prevents the change announced by this event from happening. | |
4370 | ||
4371 | It is in general a good idea to notify the user about the reasons for | |
4372 | vetoing the change because otherwise the applications behaviour (which | |
4373 | just refuses to do what the user wants) might be quite surprising. | |
4374 | """ | |
5b5c9bc7 | 4375 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
d55e5bfc RD |
4376 | |
4377 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4378 | """ |
4379 | Allow(self) | |
4380 | ||
4381 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4382 | processed. For most events it is not necessary to call this method as | |
4383 | the events are allowed anyhow but some are forbidden by default (this | |
4384 | will be mentioned in the corresponding event description). | |
4385 | """ | |
5b5c9bc7 | 4386 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
d55e5bfc RD |
4387 | |
4388 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4389 | """ |
4390 | IsAllowed(self) -> bool | |
4391 | ||
4392 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4393 | false otherwise (if it was). | |
4394 | """ | |
5b5c9bc7 | 4395 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
d55e5bfc RD |
4396 | |
4397 | ||
5b5c9bc7 | 4398 | class NotifyEventPtr(NotifyEvent): |
d55e5bfc RD |
4399 | def __init__(self, this): |
4400 | self.this = this | |
4401 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4402 | self.__class__ = NotifyEvent |
4403 | _core_.NotifyEvent_swigregister(NotifyEventPtr) | |
d55e5bfc RD |
4404 | |
4405 | #--------------------------------------------------------------------------- | |
4406 | ||
5b5c9bc7 | 4407 | class ScrollEvent(CommandEvent): |
27fb7603 RD |
4408 | """ |
4409 | A scroll event holds information about events sent from stand-alone | |
4410 | scrollbars and sliders. Note that scrolled windows do not send | |
4411 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4412 | instead. | |
4413 | """ | |
d55e5bfc RD |
4414 | def __repr__(self): |
4415 | return "<%s.%s; proxy of C++ wxScrollEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4416 | def __init__(self, *args, **kwargs): | |
4417 | """ | |
4418 | __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0, | |
5b5c9bc7 | 4419 | int orient=0) -> ScrollEvent |
d55e5bfc | 4420 | """ |
5b5c9bc7 | 4421 | newobj = _core_.new_ScrollEvent(*args, **kwargs) |
d55e5bfc RD |
4422 | self.this = newobj.this |
4423 | self.thisown = 1 | |
4424 | del newobj.thisown | |
4425 | def GetOrientation(*args, **kwargs): | |
27fb7603 RD |
4426 | """ |
4427 | GetOrientation(self) -> int | |
4428 | ||
4429 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4430 | the scrollbar. | |
4431 | """ | |
5b5c9bc7 | 4432 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
4433 | |
4434 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4435 | """ |
4436 | GetPosition(self) -> int | |
4437 | ||
4438 | Returns the position of the scrollbar. | |
4439 | """ | |
5b5c9bc7 | 4440 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4441 | |
4442 | def SetOrientation(*args, **kwargs): | |
4443 | """SetOrientation(self, int orient)""" | |
5b5c9bc7 | 4444 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
d55e5bfc RD |
4445 | |
4446 | def SetPosition(*args, **kwargs): | |
4447 | """SetPosition(self, int pos)""" | |
5b5c9bc7 | 4448 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
d55e5bfc RD |
4449 | |
4450 | ||
5b5c9bc7 | 4451 | class ScrollEventPtr(ScrollEvent): |
d55e5bfc RD |
4452 | def __init__(self, this): |
4453 | self.this = this | |
4454 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4455 | self.__class__ = ScrollEvent |
4456 | _core_.ScrollEvent_swigregister(ScrollEventPtr) | |
d55e5bfc RD |
4457 | |
4458 | #--------------------------------------------------------------------------- | |
4459 | ||
5b5c9bc7 | 4460 | class ScrollWinEvent(Event): |
27fb7603 RD |
4461 | """ |
4462 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4463 | scrolling windows. | |
4464 | """ | |
d55e5bfc RD |
4465 | def __repr__(self): |
4466 | return "<%s.%s; proxy of C++ wxScrollWinEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4467 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4468 | """ |
4469 | __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent | |
4470 | ||
4471 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4472 | scrolling windows. | |
4473 | """ | |
5b5c9bc7 | 4474 | newobj = _core_.new_ScrollWinEvent(*args, **kwargs) |
d55e5bfc RD |
4475 | self.this = newobj.this |
4476 | self.thisown = 1 | |
4477 | del newobj.thisown | |
4478 | def GetOrientation(*args, **kwargs): | |
27fb7603 RD |
4479 | """ |
4480 | GetOrientation(self) -> int | |
4481 | ||
4482 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4483 | the scrollbar. | |
4484 | """ | |
5b5c9bc7 | 4485 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
4486 | |
4487 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4488 | """ |
4489 | GetPosition(self) -> int | |
4490 | ||
4491 | Returns the position of the scrollbar for the thumb track and release | |
4492 | events. Note that this field can't be used for the other events, you | |
4493 | need to query the window itself for the current position in that case. | |
4494 | """ | |
5b5c9bc7 | 4495 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4496 | |
4497 | def SetOrientation(*args, **kwargs): | |
4498 | """SetOrientation(self, int orient)""" | |
5b5c9bc7 | 4499 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
d55e5bfc RD |
4500 | |
4501 | def SetPosition(*args, **kwargs): | |
4502 | """SetPosition(self, int pos)""" | |
5b5c9bc7 | 4503 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
d55e5bfc RD |
4504 | |
4505 | ||
5b5c9bc7 | 4506 | class ScrollWinEventPtr(ScrollWinEvent): |
d55e5bfc RD |
4507 | def __init__(self, this): |
4508 | self.this = this | |
4509 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4510 | self.__class__ = ScrollWinEvent |
4511 | _core_.ScrollWinEvent_swigregister(ScrollWinEventPtr) | |
d55e5bfc RD |
4512 | |
4513 | #--------------------------------------------------------------------------- | |
4514 | ||
5b5c9bc7 RD |
4515 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4516 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4517 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4518 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4519 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
4520 | class MouseEvent(Event): | |
27fb7603 RD |
4521 | """ |
4522 | This event class contains information about the events generated by | |
4523 | the mouse: they include mouse buttons press and release events and | |
4524 | mouse move events. | |
4525 | ||
4526 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4527 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4528 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4529 | a middle button so a portable application should avoid relying on the | |
4530 | events from it. | |
4531 | ||
4532 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4533 | the former returns true when the event corresponds to the left mouse | |
4534 | button click while the latter returns true if the left mouse button is | |
4535 | currently being pressed. For example, when the user is dragging the | |
4536 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4537 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4538 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4539 | underlying GUI behaviour is (which is platform-dependent). The same | |
4540 | applies, of course, to other mouse buttons as well. | |
4541 | """ | |
d55e5bfc RD |
4542 | def __repr__(self): |
4543 | return "<%s.%s; proxy of C++ wxMouseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4544 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4545 | """ |
4546 | __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent | |
4547 | ||
4548 | Constructs a wx.MouseEvent. Valid event types are: | |
4549 | ||
4550 | * wxEVT_ENTER_WINDOW | |
4551 | * wxEVT_LEAVE_WINDOW | |
4552 | * wxEVT_LEFT_DOWN | |
4553 | * wxEVT_LEFT_UP | |
4554 | * wxEVT_LEFT_DCLICK | |
4555 | * wxEVT_MIDDLE_DOWN | |
4556 | * wxEVT_MIDDLE_UP | |
4557 | * wxEVT_MIDDLE_DCLICK | |
4558 | * wxEVT_RIGHT_DOWN | |
4559 | * wxEVT_RIGHT_UP | |
4560 | * wxEVT_RIGHT_DCLICK | |
4561 | * wxEVT_MOTION | |
4562 | * wxEVT_MOUSEWHEEL | |
4563 | """ | |
5b5c9bc7 | 4564 | newobj = _core_.new_MouseEvent(*args, **kwargs) |
d55e5bfc RD |
4565 | self.this = newobj.this |
4566 | self.thisown = 1 | |
4567 | del newobj.thisown | |
4568 | def IsButton(*args, **kwargs): | |
27fb7603 RD |
4569 | """ |
4570 | IsButton(self) -> bool | |
4571 | ||
4572 | Returns true if the event was a mouse button event (not necessarily a | |
4573 | button down event - that may be tested using `ButtonDown`). | |
4574 | """ | |
5b5c9bc7 | 4575 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
d55e5bfc RD |
4576 | |
4577 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4578 | """ |
4579 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4580 | ||
5ba5649b RD |
4581 | If the argument is omitted, this returns true if the event was any |
4582 | mouse button down event. Otherwise the argument specifies which | |
4583 | button-down event shold be checked for (see `Button` for the possible | |
4584 | values). | |
27fb7603 | 4585 | """ |
5b5c9bc7 | 4586 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
d55e5bfc RD |
4587 | |
4588 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4589 | """ |
4590 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4591 | ||
4592 | If the argument is omitted, this returns true if the event was any | |
4593 | mouse double click event. Otherwise the argument specifies which | |
4594 | double click event to check for (see `Button` for the possible | |
4595 | values). | |
4596 | """ | |
5b5c9bc7 | 4597 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
d55e5bfc RD |
4598 | |
4599 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4600 | """ |
4601 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4602 | ||
4603 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4604 | mouse button up event. Otherwise the argument specifies which button |
4605 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4606 | """ |
5b5c9bc7 | 4607 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
d55e5bfc RD |
4608 | |
4609 | def Button(*args, **kwargs): | |
27fb7603 RD |
4610 | """ |
4611 | Button(self, int button) -> bool | |
4612 | ||
4613 | Returns true if the identified mouse button is changing state. Valid | |
4614 | values of button are: | |
4615 | ||
4616 | ==================== ===================================== | |
4617 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4618 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4619 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4620 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4621 | ==================== ===================================== | |
4622 | ||
4623 | """ | |
5b5c9bc7 | 4624 | return _core_.MouseEvent_Button(*args, **kwargs) |
d55e5bfc RD |
4625 | |
4626 | def ButtonIsDown(*args, **kwargs): | |
4627 | """ButtonIsDown(self, int but) -> bool""" | |
5b5c9bc7 | 4628 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
d55e5bfc RD |
4629 | |
4630 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4631 | """ |
4632 | GetButton(self) -> int | |
4633 | ||
4634 | Returns the mouse button which generated this event or | |
4635 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4636 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4637 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4638 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4639 | right buttons respectively. | |
4640 | """ | |
5b5c9bc7 | 4641 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
d55e5bfc RD |
4642 | |
4643 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4644 | """ |
4645 | ControlDown(self) -> bool | |
4646 | ||
4647 | Returns true if the control key was down at the time of the event. | |
4648 | """ | |
5b5c9bc7 | 4649 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
d55e5bfc RD |
4650 | |
4651 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4652 | """ |
4653 | MetaDown(self) -> bool | |
4654 | ||
4655 | Returns true if the Meta key was down at the time of the event. | |
4656 | """ | |
5b5c9bc7 | 4657 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
d55e5bfc RD |
4658 | |
4659 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4660 | """ |
4661 | AltDown(self) -> bool | |
4662 | ||
4663 | Returns true if the Alt key was down at the time of the event. | |
4664 | """ | |
5b5c9bc7 | 4665 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
d55e5bfc RD |
4666 | |
4667 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4668 | """ |
4669 | ShiftDown(self) -> bool | |
4670 | ||
4671 | Returns true if the Shift key was down at the time of the event. | |
4672 | """ | |
5b5c9bc7 | 4673 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
d55e5bfc | 4674 | |
412d302d RD |
4675 | def CmdDown(*args, **kwargs): |
4676 | """ | |
4677 | CmdDown(self) -> bool | |
4678 | ||
4679 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4680 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4681 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4682 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4683 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4684 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4685 | and Macs this is the same as `MetaDown`. | |
4686 | """ | |
5b5c9bc7 | 4687 | return _core_.MouseEvent_CmdDown(*args, **kwargs) |
412d302d | 4688 | |
d55e5bfc | 4689 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4690 | """ |
4691 | LeftDown(self) -> bool | |
4692 | ||
4693 | Returns true if the left mouse button state changed to down. | |
4694 | """ | |
5b5c9bc7 | 4695 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
d55e5bfc RD |
4696 | |
4697 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4698 | """ |
4699 | MiddleDown(self) -> bool | |
4700 | ||
4701 | Returns true if the middle mouse button state changed to down. | |
4702 | """ | |
5b5c9bc7 | 4703 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
d55e5bfc RD |
4704 | |
4705 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4706 | """ |
4707 | RightDown(self) -> bool | |
4708 | ||
4709 | Returns true if the right mouse button state changed to down. | |
4710 | """ | |
5b5c9bc7 | 4711 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
d55e5bfc RD |
4712 | |
4713 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4714 | """ |
4715 | LeftUp(self) -> bool | |
4716 | ||
4717 | Returns true if the left mouse button state changed to up. | |
4718 | """ | |
5b5c9bc7 | 4719 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
d55e5bfc RD |
4720 | |
4721 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4722 | """ |
4723 | MiddleUp(self) -> bool | |
4724 | ||
4725 | Returns true if the middle mouse button state changed to up. | |
4726 | """ | |
5b5c9bc7 | 4727 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
d55e5bfc RD |
4728 | |
4729 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4730 | """ |
4731 | RightUp(self) -> bool | |
4732 | ||
4733 | Returns true if the right mouse button state changed to up. | |
4734 | """ | |
5b5c9bc7 | 4735 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
d55e5bfc RD |
4736 | |
4737 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4738 | """ |
4739 | LeftDClick(self) -> bool | |
4740 | ||
4741 | Returns true if the event was a left button double click. | |
4742 | """ | |
5b5c9bc7 | 4743 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
d55e5bfc RD |
4744 | |
4745 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4746 | """ |
4747 | MiddleDClick(self) -> bool | |
4748 | ||
4749 | Returns true if the event was a middle button double click. | |
4750 | """ | |
5b5c9bc7 | 4751 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
d55e5bfc RD |
4752 | |
4753 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4754 | """ |
4755 | RightDClick(self) -> bool | |
4756 | ||
4757 | Returns true if the event was a right button double click. | |
4758 | """ | |
5b5c9bc7 | 4759 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
d55e5bfc RD |
4760 | |
4761 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4762 | """ |
4763 | LeftIsDown(self) -> bool | |
4764 | ||
4765 | Returns true if the left mouse button is currently down, independent | |
4766 | of the current event type. | |
4767 | ||
4768 | Please notice that it is not the same as LeftDown which returns true | |
4769 | if the left mouse button was just pressed. Rather, it describes the | |
4770 | state of the mouse button before the event happened. | |
4771 | ||
4772 | This event is usually used in the mouse event handlers which process | |
4773 | "move mouse" messages to determine whether the user is (still) | |
4774 | dragging the mouse. | |
4775 | """ | |
5b5c9bc7 | 4776 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
d55e5bfc RD |
4777 | |
4778 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4779 | """ |
4780 | MiddleIsDown(self) -> bool | |
4781 | ||
4782 | Returns true if the middle mouse button is currently down, independent | |
4783 | of the current event type. | |
4784 | """ | |
5b5c9bc7 | 4785 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
d55e5bfc RD |
4786 | |
4787 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4788 | """ |
4789 | RightIsDown(self) -> bool | |
4790 | ||
4791 | Returns true if the right mouse button is currently down, independent | |
4792 | of the current event type. | |
4793 | """ | |
5b5c9bc7 | 4794 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
d55e5bfc RD |
4795 | |
4796 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4797 | """ |
4798 | Dragging(self) -> bool | |
4799 | ||
4800 | Returns true if this was a dragging event (motion while a button is | |
4801 | depressed). | |
4802 | """ | |
5b5c9bc7 | 4803 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
d55e5bfc RD |
4804 | |
4805 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4806 | """ |
4807 | Moving(self) -> bool | |
4808 | ||
4809 | Returns true if this was a motion event and no mouse buttons were | |
4810 | pressed. If any mouse button is held pressed, then this method returns | |
4811 | false and Dragging returns true. | |
4812 | """ | |
5b5c9bc7 | 4813 | return _core_.MouseEvent_Moving(*args, **kwargs) |
d55e5bfc RD |
4814 | |
4815 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4816 | """ |
4817 | Entering(self) -> bool | |
4818 | ||
4819 | Returns true if the mouse was entering the window. | |
4820 | """ | |
5b5c9bc7 | 4821 | return _core_.MouseEvent_Entering(*args, **kwargs) |
d55e5bfc RD |
4822 | |
4823 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4824 | """ |
4825 | Leaving(self) -> bool | |
4826 | ||
4827 | Returns true if the mouse was leaving the window. | |
4828 | """ | |
5b5c9bc7 | 4829 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
d55e5bfc RD |
4830 | |
4831 | def GetPosition(*args, **kwargs): | |
4832 | """ | |
5b5c9bc7 | 4833 | GetPosition(self) -> Point |
d55e5bfc | 4834 | |
27fb7603 RD |
4835 | Returns the pixel position of the mouse in window coordinates when the |
4836 | event happened. | |
d55e5bfc | 4837 | """ |
5b5c9bc7 | 4838 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
4839 | |
4840 | def GetPositionTuple(*args, **kwargs): | |
4841 | """ | |
4842 | GetPositionTuple() -> (x,y) | |
4843 | ||
27fb7603 RD |
4844 | Returns the pixel position of the mouse in window coordinates when the |
4845 | event happened. | |
d55e5bfc | 4846 | """ |
5b5c9bc7 | 4847 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
d55e5bfc RD |
4848 | |
4849 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4850 | """ |
4851 | GetLogicalPosition(self, DC dc) -> Point | |
4852 | ||
4853 | Returns the logical mouse position in pixels (i.e. translated | |
4854 | according to the translation set for the DC, which usually indicates | |
4855 | that the window has been scrolled). | |
4856 | """ | |
5b5c9bc7 | 4857 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
d55e5bfc RD |
4858 | |
4859 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4860 | """ |
4861 | GetX(self) -> int | |
4862 | ||
4863 | Returns X coordinate of the physical mouse event position. | |
4864 | """ | |
5b5c9bc7 | 4865 | return _core_.MouseEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
4866 | |
4867 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4868 | """ |
4869 | GetY(self) -> int | |
4870 | ||
4871 | Returns Y coordinate of the physical mouse event position. | |
4872 | """ | |
5b5c9bc7 | 4873 | return _core_.MouseEvent_GetY(*args, **kwargs) |
d55e5bfc RD |
4874 | |
4875 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4876 | """ |
4877 | GetWheelRotation(self) -> int | |
4878 | ||
4879 | Get wheel rotation, positive or negative indicates direction of | |
4880 | rotation. Current devices all send an event when rotation is equal to | |
4881 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4882 | created in the future. Because of this you shouldn't assume that one | |
4883 | event is equal to 1 line or whatever, but you should be able to either | |
4884 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4885 | have been accumulated before scrolling. | |
4886 | """ | |
5b5c9bc7 | 4887 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
d55e5bfc RD |
4888 | |
4889 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4890 | """ |
4891 | GetWheelDelta(self) -> int | |
4892 | ||
4893 | Get wheel delta, normally 120. This is the threshold for action to be | |
4894 | taken, and one such action (for example, scrolling one increment) | |
4895 | should occur for each delta. | |
4896 | """ | |
5b5c9bc7 | 4897 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
d55e5bfc RD |
4898 | |
4899 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4900 | """ |
4901 | GetLinesPerAction(self) -> int | |
4902 | ||
4903 | Returns the configured number of lines (or whatever) to be scrolled | |
4904 | per wheel action. Defaults to three. | |
4905 | """ | |
5b5c9bc7 | 4906 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
d55e5bfc RD |
4907 | |
4908 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4909 | """ |
4910 | IsPageScroll(self) -> bool | |
4911 | ||
4912 | Returns true if the system has been setup to do page scrolling with | |
4913 | the mouse wheel instead of line scrolling. | |
4914 | """ | |
5b5c9bc7 RD |
4915 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4916 | ||
4917 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4918 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4919 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4920 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4921 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4922 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4923 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4924 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4925 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4926 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4927 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4928 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
4929 | ||
4930 | class MouseEventPtr(MouseEvent): | |
d55e5bfc RD |
4931 | def __init__(self, this): |
4932 | self.this = this | |
4933 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
4934 | self.__class__ = MouseEvent |
4935 | _core_.MouseEvent_swigregister(MouseEventPtr) | |
d55e5bfc RD |
4936 | |
4937 | #--------------------------------------------------------------------------- | |
4938 | ||
5b5c9bc7 | 4939 | class SetCursorEvent(Event): |
5ba5649b RD |
4940 | """ |
4941 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4942 | as a result of mouse motion. This event gives the application the | |
4943 | chance to perform specific mouse cursor processing based on the | |
4944 | current position of the mouse within the window. Use the `SetCursor` | |
4945 | method to specify the cursor you want to be displayed. | |
4946 | """ | |
d55e5bfc RD |
4947 | def __repr__(self): |
4948 | return "<%s.%s; proxy of C++ wxSetCursorEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
4949 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4950 | """ |
4951 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4952 | ||
4953 | Construct a new `wx.SetCursorEvent`. | |
4954 | """ | |
5b5c9bc7 | 4955 | newobj = _core_.new_SetCursorEvent(*args, **kwargs) |
d55e5bfc RD |
4956 | self.this = newobj.this |
4957 | self.thisown = 1 | |
4958 | del newobj.thisown | |
4959 | def GetX(*args, **kwargs): | |
5ba5649b RD |
4960 | """ |
4961 | GetX(self) -> int | |
4962 | ||
4963 | Returns the X coordinate of the mouse in client coordinates. | |
4964 | """ | |
5b5c9bc7 | 4965 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
4966 | |
4967 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4968 | """ |
4969 | GetY(self) -> int | |
4970 | ||
4971 | Returns the Y coordinate of the mouse in client coordinates. | |
4972 | """ | |
5b5c9bc7 | 4973 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
d55e5bfc RD |
4974 | |
4975 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4976 | """ |
4977 | SetCursor(self, Cursor cursor) | |
4978 | ||
4979 | Sets the cursor associated with this event. | |
4980 | """ | |
5b5c9bc7 | 4981 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
d55e5bfc RD |
4982 | |
4983 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4984 | """ |
4985 | GetCursor(self) -> Cursor | |
4986 | ||
4987 | Returns a reference to the cursor specified by this event. | |
4988 | """ | |
5b5c9bc7 | 4989 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
d55e5bfc RD |
4990 | |
4991 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
4992 | """ |
4993 | HasCursor(self) -> bool | |
4994 | ||
4995 | Returns true if the cursor specified by this event is a valid cursor. | |
4996 | """ | |
5b5c9bc7 | 4997 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
d55e5bfc RD |
4998 | |
4999 | ||
5b5c9bc7 | 5000 | class SetCursorEventPtr(SetCursorEvent): |
d55e5bfc RD |
5001 | def __init__(self, this): |
5002 | self.this = this | |
5003 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5004 | self.__class__ = SetCursorEvent |
5005 | _core_.SetCursorEvent_swigregister(SetCursorEventPtr) | |
d55e5bfc RD |
5006 | |
5007 | #--------------------------------------------------------------------------- | |
5008 | ||
5b5c9bc7 | 5009 | class KeyEvent(Event): |
5ba5649b RD |
5010 | """ |
5011 | This event class contains information about keypress and character | |
5012 | events. These events are only sent to the widget that currently has | |
5013 | the keyboard focus. | |
5014 | ||
5015 | Notice that there are three different kinds of keyboard events in | |
5016 | wxWidgets: key down and up events and char events. The difference | |
5017 | between the first two is clear - the first corresponds to a key press | |
5018 | and the second to a key release - otherwise they are identical. Just | |
5019 | note that if the key is maintained in a pressed state you will | |
5020 | typically get a lot of (automatically generated) down events but only | |
5021 | one up so it is wrong to assume that there is one up event | |
5022 | corresponding to each down one. | |
5023 | ||
5024 | Both key events provide untranslated key codes while the char event | |
5025 | carries the translated one. The untranslated code for alphanumeric | |
5026 | keys is always an upper case value. For the other keys it is one of | |
5027 | WXK_XXX values from the keycodes table. The translated key is, in | |
5028 | general, the character the user expects to appear as the result of the | |
5029 | key combination when typing the text into a text entry zone, for | |
5030 | example. | |
5031 | ||
5032 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
5033 | and the standard US keyboard): when the 'A' key is pressed, the key | |
5034 | down event key code is equal to ASCII A == 65. But the char event key | |
5035 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
5036 | 'A' keys simultaneously , the key code in key down event will still be | |
5037 | just 'A' while the char event key code parameter will now be 'A' as | |
5038 | well. | |
5039 | ||
5040 | Although in this simple case it is clear that the correct key code | |
5041 | could be found in the key down event handler by checking the value | |
5042 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
5043 | as for non alphanumeric keys or non-US keyboard layouts the | |
5044 | translation is keyboard-layout dependent and can only be done properly | |
5045 | by the system itself. | |
5046 | ||
5047 | Another kind of translation is done when the control key is pressed: | |
5048 | for example, for CTRL-A key press the key down event still carries the | |
5049 | same key code 'A' as usual but the char event will have key code of 1, | |
5050 | the ASCII value of this key combination. | |
5051 | ||
5052 | You may discover how the other keys on your system behave | |
5053 | interactively by running the KeyEvents sample in the wxPython demo and | |
5054 | pressing some keys while the blue box at the top has the keyboard | |
5055 | focus. | |
5056 | ||
5057 | **Note**: If a key down event is caught and the event handler does not | |
5058 | call event.Skip() then the coresponding char event will not | |
5059 | happen. This is by design and enables the programs that handle both | |
5060 | types of events to be a bit simpler. | |
5061 | ||
5062 | **Note for Windows programmers**: The key and char events in wxWidgets | |
5063 | are similar to but slightly different from Windows WM_KEYDOWN and | |
5064 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
5065 | event in wxWidgets (unless it is used as an accelerator). | |
5066 | ||
5067 | **Tip**: be sure to call event.Skip() for events that you don't | |
5068 | process in key event function, otherwise menu shortcuts may cease to | |
5069 | work under Windows. | |
5070 | ||
5071 | """ | |
d55e5bfc RD |
5072 | def __repr__(self): |
5073 | return "<%s.%s; proxy of C++ wxKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5074 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5075 | """ |
5076 | __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent | |
5077 | ||
5078 | Construct a new `wx.KeyEvent`. Valid event types are: | |
5079 | * | |
5080 | """ | |
5b5c9bc7 | 5081 | newobj = _core_.new_KeyEvent(*args, **kwargs) |
d55e5bfc RD |
5082 | self.this = newobj.this |
5083 | self.thisown = 1 | |
5084 | del newobj.thisown | |
5085 | def ControlDown(*args, **kwargs): | |
5ba5649b RD |
5086 | """ |
5087 | ControlDown(self) -> bool | |
5088 | ||
5089 | Returns ``True`` if the Control key was down at the time of the event. | |
5090 | """ | |
5b5c9bc7 | 5091 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
d55e5bfc RD |
5092 | |
5093 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
5094 | """ |
5095 | MetaDown(self) -> bool | |
5096 | ||
5097 | Returns ``True`` if the Meta key was down at the time of the event. | |
5098 | """ | |
5b5c9bc7 | 5099 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
d55e5bfc RD |
5100 | |
5101 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
5102 | """ |
5103 | AltDown(self) -> bool | |
5104 | ||
5105 | Returns ``True`` if the Alt key was down at the time of the event. | |
5106 | """ | |
5b5c9bc7 | 5107 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
d55e5bfc RD |
5108 | |
5109 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
5110 | """ |
5111 | ShiftDown(self) -> bool | |
5112 | ||
5113 | Returns ``True`` if the Shift key was down at the time of the event. | |
5114 | """ | |
5b5c9bc7 | 5115 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
d55e5bfc | 5116 | |
412d302d RD |
5117 | def CmdDown(*args, **kwargs): |
5118 | """ | |
5119 | CmdDown(self) -> bool | |
5120 | ||
5121 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
5122 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 5123 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
5124 | because Cmd key is used for the same thing under Mac as Ctrl |
5125 | elsewhere. The Ctrl still exists, it's just not used for this | |
5126 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
5127 | and Macs this is the same as `MetaDown`. | |
5128 | """ | |
5b5c9bc7 | 5129 | return _core_.KeyEvent_CmdDown(*args, **kwargs) |
412d302d | 5130 | |
d55e5bfc | 5131 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
5132 | """ |
5133 | HasModifiers(self) -> bool | |
5134 | ||
5135 | Returns true if either CTRL or ALT keys was down at the time of the | |
5136 | key event. Note that this function does not take into account neither | |
5137 | SHIFT nor META key states (the reason for ignoring the latter is that | |
5138 | it is common for NUMLOCK key to be configured as META under X but the | |
5139 | key presses even while NUMLOCK is on should be still processed | |
5140 | normally). | |
5141 | """ | |
5b5c9bc7 | 5142 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
d55e5bfc RD |
5143 | |
5144 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
5145 | """ |
5146 | GetKeyCode(self) -> int | |
5147 | ||
5148 | Returns the virtual key code. ASCII events return normal ASCII values, | |
5149 | while non-ASCII events return values such as WXK_LEFT for the left | |
5150 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
5151 | codes. | |
5152 | ||
5153 | Note that in Unicode build, the returned value is meaningful only if | |
5154 | the user entered a character that can be represented in current | |
5155 | locale's default charset. You can obtain the corresponding Unicode | |
5156 | character using `GetUnicodeKey`. | |
5157 | """ | |
5b5c9bc7 | 5158 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
d55e5bfc RD |
5159 | |
5160 | KeyCode = GetKeyCode | |
bb4524c4 | 5161 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
5162 | """ |
5163 | GetUnicodeKey(self) -> int | |
5164 | ||
5165 | Returns the Unicode character corresponding to this key event. This | |
5166 | function is only meaningfule in a Unicode build of wxPython. | |
5167 | """ | |
5b5c9bc7 | 5168 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
d55e5bfc | 5169 | |
bb4524c4 | 5170 | GetUniChar = GetUnicodeKey |
d55e5bfc | 5171 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
5172 | """ |
5173 | GetRawKeyCode(self) -> unsigned int | |
5174 | ||
5175 | Returns the raw key code for this event. This is a platform-dependent | |
5176 | scan code which should only be used in advanced | |
5177 | applications. Currently the raw key codes are not supported by all | |
5178 | ports. | |
5179 | """ | |
5b5c9bc7 | 5180 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
d55e5bfc RD |
5181 | |
5182 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
5183 | """ |
5184 | GetRawKeyFlags(self) -> unsigned int | |
5185 | ||
5186 | Returns the low level key flags for this event. The flags are | |
5187 | platform-dependent and should only be used in advanced applications. | |
5188 | Currently the raw key flags are not supported by all ports. | |
5189 | """ | |
5b5c9bc7 | 5190 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
d55e5bfc RD |
5191 | |
5192 | def GetPosition(*args, **kwargs): | |
5193 | """ | |
5b5c9bc7 | 5194 | GetPosition(self) -> Point |
d55e5bfc | 5195 | |
5ba5649b | 5196 | Find the position of the event, if applicable. |
d55e5bfc | 5197 | """ |
5b5c9bc7 | 5198 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
5199 | |
5200 | def GetPositionTuple(*args, **kwargs): | |
5201 | """ | |
5202 | GetPositionTuple() -> (x,y) | |
5203 | ||
5ba5649b | 5204 | Find the position of the event, if applicable. |
d55e5bfc | 5205 | """ |
5b5c9bc7 | 5206 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
d55e5bfc RD |
5207 | |
5208 | def GetX(*args, **kwargs): | |
5ba5649b RD |
5209 | """ |
5210 | GetX(self) -> int | |
5211 | ||
5212 | Returns the X position (in client coordinates) of the event, if | |
5213 | applicable. | |
5214 | """ | |
5b5c9bc7 | 5215 | return _core_.KeyEvent_GetX(*args, **kwargs) |
d55e5bfc RD |
5216 | |
5217 | def GetY(*args, **kwargs): | |
5ba5649b RD |
5218 | """ |
5219 | GetY(self) -> int | |
5220 | ||
5221 | Returns the Y position (in client coordinates) of the event, if | |
5222 | applicable. | |
5223 | """ | |
5b5c9bc7 RD |
5224 | return _core_.KeyEvent_GetY(*args, **kwargs) |
5225 | ||
5226 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
5227 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
5228 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
5229 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
5230 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
5231 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
5232 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
5233 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
5234 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
5235 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
5236 | ||
5237 | class KeyEventPtr(KeyEvent): | |
d55e5bfc RD |
5238 | def __init__(self, this): |
5239 | self.this = this | |
5240 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5241 | self.__class__ = KeyEvent |
5242 | _core_.KeyEvent_swigregister(KeyEventPtr) | |
d55e5bfc RD |
5243 | |
5244 | #--------------------------------------------------------------------------- | |
5245 | ||
5b5c9bc7 | 5246 | class SizeEvent(Event): |
5ba5649b RD |
5247 | """ |
5248 | A size event holds information about size change events. The EVT_SIZE | |
5249 | handler function will be called when the window it is bound to has | |
5250 | been resized. | |
5251 | ||
5252 | Note that the size passed is of the whole window: call | |
5253 | `wx.Window.GetClientSize` for the area which may be used by the | |
5254 | application. | |
5255 | ||
5256 | When a window is resized, usually only a small part of the window is | |
5257 | damaged and and that area is all that is in the update region for the | |
5258 | next paint event. However, if your drawing depends on the size of the | |
5259 | window, you may need to clear the DC explicitly and repaint the whole | |
5260 | window. In which case, you may need to call `wx.Window.Refresh` to | |
5261 | invalidate the entire window. | |
5262 | ||
5263 | """ | |
d55e5bfc RD |
5264 | def __repr__(self): |
5265 | return "<%s.%s; proxy of C++ wxSizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5266 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5267 | """ |
5268 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
5269 | ||
5270 | Construct a new ``wx.SizeEvent``. | |
5271 | """ | |
5b5c9bc7 | 5272 | newobj = _core_.new_SizeEvent(*args, **kwargs) |
d55e5bfc RD |
5273 | self.this = newobj.this |
5274 | self.thisown = 1 | |
5275 | del newobj.thisown | |
5276 | def GetSize(*args, **kwargs): | |
5ba5649b RD |
5277 | """ |
5278 | GetSize(self) -> Size | |
5279 | ||
5280 | Returns the entire size of the window generating the size change | |
5281 | event. | |
5282 | """ | |
5b5c9bc7 | 5283 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
d55e5bfc RD |
5284 | |
5285 | def GetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5286 | """GetRect(self) -> Rect""" |
5287 | return _core_.SizeEvent_GetRect(*args, **kwargs) | |
d55e5bfc RD |
5288 | |
5289 | def SetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5290 | """SetRect(self, Rect rect)""" |
5291 | return _core_.SizeEvent_SetRect(*args, **kwargs) | |
d55e5bfc RD |
5292 | |
5293 | def SetSize(*args, **kwargs): | |
5b5c9bc7 RD |
5294 | """SetSize(self, Size size)""" |
5295 | return _core_.SizeEvent_SetSize(*args, **kwargs) | |
d55e5bfc | 5296 | |
5b5c9bc7 RD |
5297 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
5298 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
d55e5bfc | 5299 | |
5b5c9bc7 | 5300 | class SizeEventPtr(SizeEvent): |
d55e5bfc RD |
5301 | def __init__(self, this): |
5302 | self.this = this | |
5303 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5304 | self.__class__ = SizeEvent |
5305 | _core_.SizeEvent_swigregister(SizeEventPtr) | |
d55e5bfc RD |
5306 | |
5307 | #--------------------------------------------------------------------------- | |
5308 | ||
5b5c9bc7 | 5309 | class MoveEvent(Event): |
5ba5649b RD |
5310 | """ |
5311 | This event object is sent for EVT_MOVE event bindings when a window is | |
5312 | moved to a new position. | |
5313 | """ | |
d55e5bfc RD |
5314 | def __repr__(self): |
5315 | return "<%s.%s; proxy of C++ wxMoveEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5316 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5317 | """ |
5318 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5319 | ||
5320 | Constructor. | |
5321 | """ | |
5b5c9bc7 | 5322 | newobj = _core_.new_MoveEvent(*args, **kwargs) |
d55e5bfc RD |
5323 | self.this = newobj.this |
5324 | self.thisown = 1 | |
5325 | del newobj.thisown | |
5326 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
5327 | """ |
5328 | GetPosition(self) -> Point | |
5329 | ||
5330 | Returns the position of the window generating the move change event. | |
5331 | """ | |
5b5c9bc7 | 5332 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
5333 | |
5334 | def GetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5335 | """GetRect(self) -> Rect""" |
5336 | return _core_.MoveEvent_GetRect(*args, **kwargs) | |
d55e5bfc RD |
5337 | |
5338 | def SetRect(*args, **kwargs): | |
5b5c9bc7 RD |
5339 | """SetRect(self, Rect rect)""" |
5340 | return _core_.MoveEvent_SetRect(*args, **kwargs) | |
d55e5bfc RD |
5341 | |
5342 | def SetPosition(*args, **kwargs): | |
5b5c9bc7 RD |
5343 | """SetPosition(self, Point pos)""" |
5344 | return _core_.MoveEvent_SetPosition(*args, **kwargs) | |
d55e5bfc | 5345 | |
fef4c27a RD |
5346 | m_pos = property(GetPosition, SetPosition) |
5347 | m_rect = property(GetRect, SetRect) | |
5348 | ||
d55e5bfc | 5349 | |
5b5c9bc7 | 5350 | class MoveEventPtr(MoveEvent): |
d55e5bfc RD |
5351 | def __init__(self, this): |
5352 | self.this = this | |
5353 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5354 | self.__class__ = MoveEvent |
5355 | _core_.MoveEvent_swigregister(MoveEventPtr) | |
d55e5bfc RD |
5356 | |
5357 | #--------------------------------------------------------------------------- | |
5358 | ||
5b5c9bc7 | 5359 | class PaintEvent(Event): |
5ba5649b RD |
5360 | """ |
5361 | A paint event is sent when a window's contents needs to be repainted. | |
5362 | Note that in an EVT_PAINT handler the application must *always* create | |
5363 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5364 | Windows assumes that the window has not been painted yet and will send | |
5365 | the event again, causing endless refreshes. | |
5366 | ||
5367 | You can optimize painting by retrieving the rectangles that have been | |
5368 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5369 | and only repainting these rectangles. The rectangles are in terms of | |
5370 | the client area, and are unscrolled, so you will need to do some | |
5371 | calculations using the current view position to obtain logical, | |
5372 | scrolled units. | |
5373 | ||
5374 | """ | |
d55e5bfc RD |
5375 | def __repr__(self): |
5376 | return "<%s.%s; proxy of C++ wxPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5377 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
5378 | """__init__(self, int Id=0) -> PaintEvent""" |
5379 | newobj = _core_.new_PaintEvent(*args, **kwargs) | |
d55e5bfc RD |
5380 | self.this = newobj.this |
5381 | self.thisown = 1 | |
5382 | del newobj.thisown | |
5383 | ||
5b5c9bc7 | 5384 | class PaintEventPtr(PaintEvent): |
d55e5bfc RD |
5385 | def __init__(self, this): |
5386 | self.this = this | |
5387 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5388 | self.__class__ = PaintEvent |
5389 | _core_.PaintEvent_swigregister(PaintEventPtr) | |
d55e5bfc | 5390 | |
5b5c9bc7 RD |
5391 | class NcPaintEvent(Event): |
5392 | """Proxy of C++ NcPaintEvent class""" | |
d55e5bfc RD |
5393 | def __repr__(self): |
5394 | return "<%s.%s; proxy of C++ wxNcPaintEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5395 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
5396 | """__init__(self, int winid=0) -> NcPaintEvent""" |
5397 | newobj = _core_.new_NcPaintEvent(*args, **kwargs) | |
d55e5bfc RD |
5398 | self.this = newobj.this |
5399 | self.thisown = 1 | |
5400 | del newobj.thisown | |
5401 | ||
5b5c9bc7 | 5402 | class NcPaintEventPtr(NcPaintEvent): |
d55e5bfc RD |
5403 | def __init__(self, this): |
5404 | self.this = this | |
5405 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5406 | self.__class__ = NcPaintEvent |
5407 | _core_.NcPaintEvent_swigregister(NcPaintEventPtr) | |
d55e5bfc RD |
5408 | |
5409 | #--------------------------------------------------------------------------- | |
5410 | ||
5b5c9bc7 | 5411 | class EraseEvent(Event): |
5ba5649b RD |
5412 | """ |
5413 | An erase event is sent whenever the background of a window needs to be | |
5414 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5415 | binder. On some platforms, such as GTK+, this event is simulated | |
5416 | (simply generated just before the paint event) and may cause flicker. | |
5417 | ||
5418 | To paint a custom background use the `GetDC` method and use the returned | |
5419 | device context if it is not ``None``, otherwise create a temporary | |
5420 | `wx.ClientDC` and draw on that. | |
5421 | ||
5422 | """ | |
d55e5bfc RD |
5423 | def __repr__(self): |
5424 | return "<%s.%s; proxy of C++ wxEraseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5425 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5426 | """ |
5427 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5428 | ||
5429 | Constructor | |
5430 | """ | |
5b5c9bc7 | 5431 | newobj = _core_.new_EraseEvent(*args, **kwargs) |
d55e5bfc RD |
5432 | self.this = newobj.this |
5433 | self.thisown = 1 | |
5434 | del newobj.thisown | |
5435 | def GetDC(*args, **kwargs): | |
5ba5649b RD |
5436 | """ |
5437 | GetDC(self) -> DC | |
5438 | ||
5439 | Returns the device context the event handler should draw upon. If | |
5440 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5441 | that instead. | |
5442 | """ | |
5b5c9bc7 | 5443 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
d55e5bfc RD |
5444 | |
5445 | ||
5b5c9bc7 | 5446 | class EraseEventPtr(EraseEvent): |
d55e5bfc RD |
5447 | def __init__(self, this): |
5448 | self.this = this | |
5449 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5450 | self.__class__ = EraseEvent |
5451 | _core_.EraseEvent_swigregister(EraseEventPtr) | |
d55e5bfc RD |
5452 | |
5453 | #--------------------------------------------------------------------------- | |
5454 | ||
5b5c9bc7 | 5455 | class FocusEvent(Event): |
5ba5649b RD |
5456 | """ |
5457 | A focus event is sent when a window's focus changes. The window losing | |
5458 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5459 | gets an EVT_SET_FOCUS event. | |
5460 | ||
5461 | Notice that the set focus event happens both when the user gives focus | |
5462 | to the window (whether using the mouse or keyboard) and when it is | |
5463 | done from the program itself using `wx.Window.SetFocus`. | |
5464 | ||
5465 | """ | |
d55e5bfc RD |
5466 | def __repr__(self): |
5467 | return "<%s.%s; proxy of C++ wxFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5468 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5469 | """ |
5470 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent | |
5471 | ||
5472 | Constructor | |
5473 | """ | |
5b5c9bc7 | 5474 | newobj = _core_.new_FocusEvent(*args, **kwargs) |
d55e5bfc RD |
5475 | self.this = newobj.this |
5476 | self.thisown = 1 | |
5477 | del newobj.thisown | |
5478 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
5479 | """ |
5480 | GetWindow(self) -> Window | |
5481 | ||
5482 | Returns the other window associated with this event, that is the | |
5483 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5484 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5485 | ||
5486 | Warning: the window returned may be None! | |
5487 | """ | |
5b5c9bc7 | 5488 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
5489 | |
5490 | def SetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
5491 | """SetWindow(self, Window win)""" |
5492 | return _core_.FocusEvent_SetWindow(*args, **kwargs) | |
d55e5bfc RD |
5493 | |
5494 | ||
5b5c9bc7 | 5495 | class FocusEventPtr(FocusEvent): |
d55e5bfc RD |
5496 | def __init__(self, this): |
5497 | self.this = this | |
5498 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5499 | self.__class__ = FocusEvent |
5500 | _core_.FocusEvent_swigregister(FocusEventPtr) | |
d55e5bfc RD |
5501 | |
5502 | #--------------------------------------------------------------------------- | |
5503 | ||
5b5c9bc7 | 5504 | class ChildFocusEvent(CommandEvent): |
5ba5649b RD |
5505 | """ |
5506 | wx.ChildFocusEvent notifies the parent that a child has received the | |
5507 | focus. Unlike `wx.FocusEvent` it is propagated up the window | |
5508 | heirarchy. | |
5509 | """ | |
d55e5bfc RD |
5510 | def __repr__(self): |
5511 | return "<%s.%s; proxy of C++ wxChildFocusEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5512 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5513 | """ |
5514 | __init__(self, Window win=None) -> ChildFocusEvent | |
5515 | ||
5516 | Constructor | |
5517 | """ | |
5b5c9bc7 | 5518 | newobj = _core_.new_ChildFocusEvent(*args, **kwargs) |
d55e5bfc RD |
5519 | self.this = newobj.this |
5520 | self.thisown = 1 | |
5521 | del newobj.thisown | |
5522 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
5523 | """ |
5524 | GetWindow(self) -> Window | |
5525 | ||
5526 | The window which has just received the focus. | |
5527 | """ | |
5b5c9bc7 | 5528 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
5529 | |
5530 | ||
5b5c9bc7 | 5531 | class ChildFocusEventPtr(ChildFocusEvent): |
d55e5bfc RD |
5532 | def __init__(self, this): |
5533 | self.this = this | |
5534 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5535 | self.__class__ = ChildFocusEvent |
5536 | _core_.ChildFocusEvent_swigregister(ChildFocusEventPtr) | |
d55e5bfc RD |
5537 | |
5538 | #--------------------------------------------------------------------------- | |
5539 | ||
5b5c9bc7 | 5540 | class ActivateEvent(Event): |
5ba5649b RD |
5541 | """ |
5542 | An activate event is sent when a top-level window or the entire | |
5543 | application is being activated or deactivated. | |
5544 | ||
5545 | A top-level window (a dialog or frame) receives an activate event when | |
5546 | is being activated or deactivated. This is indicated visually by the | |
5547 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5548 | An application is activated or deactivated when one of its frames | |
5549 | becomes activated, or a frame becomes inactivate resulting in all | |
5550 | application frames being inactive. | |
5551 | ||
5552 | Please note that usually you should call event.Skip() in your handlers | |
5553 | for these events so the default handlers will still be called, as not | |
5554 | doing so can result in strange effects. | |
5555 | ||
5556 | """ | |
d55e5bfc RD |
5557 | def __repr__(self): |
5558 | return "<%s.%s; proxy of C++ wxActivateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5559 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5560 | """ |
5561 | __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent | |
5562 | ||
5563 | Constructor | |
5564 | """ | |
5b5c9bc7 | 5565 | newobj = _core_.new_ActivateEvent(*args, **kwargs) |
d55e5bfc RD |
5566 | self.this = newobj.this |
5567 | self.thisown = 1 | |
5568 | del newobj.thisown | |
5569 | def GetActive(*args, **kwargs): | |
5ba5649b RD |
5570 | """ |
5571 | GetActive(self) -> bool | |
5572 | ||
5573 | Returns true if the application or window is being activated, false | |
5574 | otherwise. | |
5575 | """ | |
5b5c9bc7 | 5576 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
d55e5bfc RD |
5577 | |
5578 | ||
5b5c9bc7 | 5579 | class ActivateEventPtr(ActivateEvent): |
d55e5bfc RD |
5580 | def __init__(self, this): |
5581 | self.this = this | |
5582 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5583 | self.__class__ = ActivateEvent |
5584 | _core_.ActivateEvent_swigregister(ActivateEventPtr) | |
d55e5bfc RD |
5585 | |
5586 | #--------------------------------------------------------------------------- | |
5587 | ||
5b5c9bc7 | 5588 | class InitDialogEvent(Event): |
5ba5649b RD |
5589 | """ |
5590 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5591 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5592 | event can transfer data to the window, or anything else that should be | |
5593 | done before the user begins editing the form. The default handler | |
5594 | calls `wx.Window.TransferDataToWindow`. | |
5595 | """ | |
d55e5bfc RD |
5596 | def __repr__(self): |
5597 | return "<%s.%s; proxy of C++ wxInitDialogEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5598 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5599 | """ |
5600 | __init__(self, int Id=0) -> InitDialogEvent | |
5601 | ||
5602 | Constructor | |
5603 | """ | |
5b5c9bc7 | 5604 | newobj = _core_.new_InitDialogEvent(*args, **kwargs) |
d55e5bfc RD |
5605 | self.this = newobj.this |
5606 | self.thisown = 1 | |
5607 | del newobj.thisown | |
5608 | ||
5b5c9bc7 | 5609 | class InitDialogEventPtr(InitDialogEvent): |
d55e5bfc RD |
5610 | def __init__(self, this): |
5611 | self.this = this | |
5612 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5613 | self.__class__ = InitDialogEvent |
5614 | _core_.InitDialogEvent_swigregister(InitDialogEventPtr) | |
d55e5bfc RD |
5615 | |
5616 | #--------------------------------------------------------------------------- | |
5617 | ||
5b5c9bc7 | 5618 | class MenuEvent(Event): |
5ba5649b RD |
5619 | """ |
5620 | This class is used for a variety of menu-related events. Note that | |
5621 | these do not include menu command events, which are handled by sending | |
5622 | `wx.CommandEvent` objects. | |
5623 | ||
5624 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5625 | text in the first field of the status bar. | |
5626 | """ | |
d55e5bfc RD |
5627 | def __repr__(self): |
5628 | return "<%s.%s; proxy of C++ wxMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5629 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5630 | """ |
5631 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent | |
5632 | ||
5633 | Constructor | |
5634 | """ | |
5b5c9bc7 | 5635 | newobj = _core_.new_MenuEvent(*args, **kwargs) |
d55e5bfc RD |
5636 | self.this = newobj.this |
5637 | self.thisown = 1 | |
5638 | del newobj.thisown | |
5639 | def GetMenuId(*args, **kwargs): | |
5ba5649b RD |
5640 | """ |
5641 | GetMenuId(self) -> int | |
5642 | ||
5643 | Returns the menu identifier associated with the event. This method | |
5644 | should be only used with the HIGHLIGHT events. | |
5645 | """ | |
5b5c9bc7 | 5646 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
d55e5bfc RD |
5647 | |
5648 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5649 | """ |
5650 | IsPopup(self) -> bool | |
5651 | ||
5652 | Returns ``True`` if the menu which is being opened or closed is a | |
5653 | popup menu, ``False`` if it is a normal one. This method should only | |
5654 | be used with the OPEN and CLOSE events. | |
5655 | """ | |
5b5c9bc7 | 5656 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
d55e5bfc RD |
5657 | |
5658 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5659 | """ |
5660 | GetMenu(self) -> Menu | |
5661 | ||
5662 | Returns the menu which is being opened or closed. This method should | |
5663 | only be used with the OPEN and CLOSE events. | |
5664 | """ | |
5b5c9bc7 | 5665 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
d55e5bfc RD |
5666 | |
5667 | ||
5b5c9bc7 | 5668 | class MenuEventPtr(MenuEvent): |
d55e5bfc RD |
5669 | def __init__(self, this): |
5670 | self.this = this | |
5671 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5672 | self.__class__ = MenuEvent |
5673 | _core_.MenuEvent_swigregister(MenuEventPtr) | |
d55e5bfc RD |
5674 | |
5675 | #--------------------------------------------------------------------------- | |
5676 | ||
5b5c9bc7 | 5677 | class CloseEvent(Event): |
5ba5649b RD |
5678 | """ |
5679 | This event class contains information about window and session close | |
5680 | events. | |
5681 | ||
5682 | The handler function for EVT_CLOSE is called when the user has tried | |
5683 | to close a a frame or dialog box using the window manager controls or | |
5684 | the system menu. It can also be invoked by the application itself | |
5685 | programmatically, for example by calling the `wx.Window.Close` | |
5686 | function. | |
5687 | ||
5688 | You should check whether the application is forcing the deletion of | |
5689 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5690 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5691 | it is up to you whether you respond by destroying the window or not. | |
5692 | For example you may wish to display a message dialog prompting to save | |
5693 | files or to cancel the close. | |
5694 | ||
5695 | If you don't destroy the window, you should call `Veto` to let the | |
5696 | calling code know that you did not destroy the window. This allows the | |
5697 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5698 | on whether the close instruction was honored or not. | |
5699 | """ | |
d55e5bfc RD |
5700 | def __repr__(self): |
5701 | return "<%s.%s; proxy of C++ wxCloseEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5702 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5703 | """ |
5704 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent | |
5705 | ||
5706 | Constructor. | |
5707 | """ | |
5b5c9bc7 | 5708 | newobj = _core_.new_CloseEvent(*args, **kwargs) |
d55e5bfc RD |
5709 | self.this = newobj.this |
5710 | self.thisown = 1 | |
5711 | del newobj.thisown | |
5712 | def SetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5713 | """ |
5714 | SetLoggingOff(self, bool logOff) | |
5715 | ||
5716 | Sets the 'logging off' flag. | |
5717 | """ | |
5b5c9bc7 | 5718 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
d55e5bfc RD |
5719 | |
5720 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5721 | """ |
5722 | GetLoggingOff(self) -> bool | |
5723 | ||
034e3677 RD |
5724 | Returns ``True`` if the user is logging off or ``False`` if the |
5725 | system is shutting down. This method can only be called for end | |
5726 | session and query end session events, it doesn't make sense for close | |
5727 | window event. | |
5ba5649b | 5728 | """ |
5b5c9bc7 | 5729 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
d55e5bfc RD |
5730 | |
5731 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5732 | """ |
5733 | Veto(self, bool veto=True) | |
5734 | ||
5735 | Call this from your event handler to veto a system shutdown or to | |
5736 | signal to the calling application that a window close did not happen. | |
5737 | ||
5738 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5739 | """ | |
5b5c9bc7 | 5740 | return _core_.CloseEvent_Veto(*args, **kwargs) |
d55e5bfc | 5741 | |
5ba5649b RD |
5742 | def GetVeto(*args, **kwargs): |
5743 | """GetVeto(self) -> bool""" | |
5744 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5745 | ||
d55e5bfc | 5746 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5747 | """ |
5748 | SetCanVeto(self, bool canVeto) | |
5749 | ||
5750 | Sets the 'can veto' flag. | |
5751 | """ | |
5b5c9bc7 | 5752 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
d55e5bfc RD |
5753 | |
5754 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5755 | """ |
5756 | CanVeto(self) -> bool | |
d55e5bfc | 5757 | |
5ba5649b RD |
5758 | Returns true if you can veto a system shutdown or a window close |
5759 | event. Vetoing a window close event is not possible if the calling | |
5760 | code wishes to force the application to exit, and so this function | |
5761 | must be called to check this. | |
5762 | """ | |
5763 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
d55e5bfc RD |
5764 | |
5765 | ||
5b5c9bc7 | 5766 | class CloseEventPtr(CloseEvent): |
d55e5bfc RD |
5767 | def __init__(self, this): |
5768 | self.this = this | |
5769 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5770 | self.__class__ = CloseEvent |
5771 | _core_.CloseEvent_swigregister(CloseEventPtr) | |
d55e5bfc RD |
5772 | |
5773 | #--------------------------------------------------------------------------- | |
5774 | ||
5b5c9bc7 | 5775 | class ShowEvent(Event): |
5ba5649b | 5776 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
d55e5bfc RD |
5777 | def __repr__(self): |
5778 | return "<%s.%s; proxy of C++ wxShowEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5779 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5780 | """ |
5781 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5782 | ||
5783 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5784 | """ | |
5b5c9bc7 | 5785 | newobj = _core_.new_ShowEvent(*args, **kwargs) |
d55e5bfc RD |
5786 | self.this = newobj.this |
5787 | self.thisown = 1 | |
5788 | del newobj.thisown | |
5789 | def SetShow(*args, **kwargs): | |
5790 | """SetShow(self, bool show)""" | |
5b5c9bc7 | 5791 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
d55e5bfc RD |
5792 | |
5793 | def GetShow(*args, **kwargs): | |
5794 | """GetShow(self) -> bool""" | |
5b5c9bc7 | 5795 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
d55e5bfc RD |
5796 | |
5797 | ||
5b5c9bc7 | 5798 | class ShowEventPtr(ShowEvent): |
d55e5bfc RD |
5799 | def __init__(self, this): |
5800 | self.this = this | |
5801 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5802 | self.__class__ = ShowEvent |
5803 | _core_.ShowEvent_swigregister(ShowEventPtr) | |
d55e5bfc RD |
5804 | |
5805 | #--------------------------------------------------------------------------- | |
5806 | ||
5b5c9bc7 | 5807 | class IconizeEvent(Event): |
5ba5649b RD |
5808 | """ |
5809 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5810 | restored. | |
5811 | """ | |
d55e5bfc RD |
5812 | def __repr__(self): |
5813 | return "<%s.%s; proxy of C++ wxIconizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5814 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5815 | """ |
5816 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5817 | ||
5818 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5819 | restored. | |
5820 | """ | |
5b5c9bc7 | 5821 | newobj = _core_.new_IconizeEvent(*args, **kwargs) |
d55e5bfc RD |
5822 | self.this = newobj.this |
5823 | self.thisown = 1 | |
5824 | del newobj.thisown | |
5825 | def Iconized(*args, **kwargs): | |
5ba5649b RD |
5826 | """ |
5827 | Iconized(self) -> bool | |
5828 | ||
5829 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5830 | been restored. | |
5831 | """ | |
5b5c9bc7 | 5832 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
d55e5bfc RD |
5833 | |
5834 | ||
5b5c9bc7 | 5835 | class IconizeEventPtr(IconizeEvent): |
d55e5bfc RD |
5836 | def __init__(self, this): |
5837 | self.this = this | |
5838 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5839 | self.__class__ = IconizeEvent |
5840 | _core_.IconizeEvent_swigregister(IconizeEventPtr) | |
d55e5bfc RD |
5841 | |
5842 | #--------------------------------------------------------------------------- | |
5843 | ||
5b5c9bc7 | 5844 | class MaximizeEvent(Event): |
5ba5649b | 5845 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
d55e5bfc RD |
5846 | def __repr__(self): |
5847 | return "<%s.%s; proxy of C++ wxMaximizeEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5848 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5849 | """ |
5850 | __init__(self, int id=0) -> MaximizeEvent | |
5851 | ||
5852 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5853 | """ | |
5b5c9bc7 | 5854 | newobj = _core_.new_MaximizeEvent(*args, **kwargs) |
d55e5bfc RD |
5855 | self.this = newobj.this |
5856 | self.thisown = 1 | |
5857 | del newobj.thisown | |
5858 | ||
5b5c9bc7 | 5859 | class MaximizeEventPtr(MaximizeEvent): |
d55e5bfc RD |
5860 | def __init__(self, this): |
5861 | self.this = this | |
5862 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5863 | self.__class__ = MaximizeEvent |
5864 | _core_.MaximizeEvent_swigregister(MaximizeEventPtr) | |
d55e5bfc RD |
5865 | |
5866 | #--------------------------------------------------------------------------- | |
5867 | ||
5b5c9bc7 | 5868 | class DropFilesEvent(Event): |
5ba5649b RD |
5869 | """ |
5870 | This class is used for drop files events, that is, when files have | |
5871 | been dropped onto the window. This functionality is only available | |
5872 | under Windows. The window must have previously been enabled for | |
5873 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5874 | ||
5875 | Important note: this is a separate implementation to the more general | |
5876 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5877 | implementation uses the older, Windows message-based approach of | |
5878 | dropping files. | |
5879 | ||
5880 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5881 | events. | |
5882 | ||
5883 | """ | |
d55e5bfc RD |
5884 | def __init__(self): raise RuntimeError, "No constructor defined" |
5885 | def __repr__(self): | |
5886 | return "<%s.%s; proxy of C++ wxDropFilesEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5887 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
5888 | """ |
5889 | GetPosition(self) -> Point | |
5890 | ||
5891 | Returns the position at which the files were dropped. | |
5892 | """ | |
5b5c9bc7 | 5893 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
5894 | |
5895 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5896 | """ |
5897 | GetNumberOfFiles(self) -> int | |
5898 | ||
5899 | Returns the number of files dropped. | |
5900 | """ | |
5b5c9bc7 | 5901 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
d55e5bfc RD |
5902 | |
5903 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5904 | """ |
5905 | GetFiles(self) -> PyObject | |
5906 | ||
5907 | Returns a list of the filenames that were dropped. | |
5908 | """ | |
5b5c9bc7 | 5909 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
d55e5bfc RD |
5910 | |
5911 | ||
5b5c9bc7 | 5912 | class DropFilesEventPtr(DropFilesEvent): |
d55e5bfc RD |
5913 | def __init__(self, this): |
5914 | self.this = this | |
5915 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
5916 | self.__class__ = DropFilesEvent |
5917 | _core_.DropFilesEvent_swigregister(DropFilesEventPtr) | |
d55e5bfc RD |
5918 | |
5919 | #--------------------------------------------------------------------------- | |
5920 | ||
5b5c9bc7 RD |
5921 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
5922 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
5923 | class UpdateUIEvent(CommandEvent): | |
5ba5649b RD |
5924 | """ |
5925 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5926 | wxWidgets to give an application the chance to update various user | |
5927 | interface elements. | |
5928 | ||
5929 | Without update UI events, an application has to work hard to | |
5930 | check/uncheck, enable/disable, and set the text for elements such as | |
5931 | menu items and toolbar buttons. The code for doing this has to be | |
5932 | mixed up with the code that is invoked when an action is invoked for a | |
5933 | menu item or button. | |
5934 | ||
5935 | With update UI events, you define an event handler to look at the | |
5936 | state of the application and change UI elements accordingly. wxWidgets | |
5937 | will call your handler functions in idle time, so you don't have to | |
5938 | worry where to call this code. In addition to being a clearer and more | |
5939 | declarative method, it also means you don't have to worry whether | |
5940 | you're updating a toolbar or menubar identifier. The same handler can | |
5941 | update a menu item and toolbar button, if the ID values are the same. | |
5942 | ||
5943 | Instead of directly manipulating the menu or button, you call | |
5944 | functions in the event object, such as `Check`. wxWidgets will | |
5945 | determine whether such a call has been made, and which UI element to | |
5946 | update. | |
5947 | ||
5948 | These events will work for popup menus as well as menubars. Just | |
5949 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5950 | any UI events for the window that owns the menu. | |
5951 | ||
5952 | If you find that the overhead of UI update processing is affecting | |
5953 | your application, you can do one or both of the following: | |
5954 | ||
5955 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5956 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5957 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5958 | receive update events. No other windows will receive update | |
5959 | events. | |
5960 | ||
5961 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5962 | value to set the delay between updates. You may need to call | |
5963 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5964 | a dialog is about to be shown, in case the user sees a slight | |
5965 | delay before windows are updated. | |
5966 | ||
5967 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5968 | handler for a window does not affect this because the events are sent | |
5969 | from an internal idle handler. | |
5970 | ||
5971 | wxWidgets tries to optimize update events on some platforms. On | |
5972 | Windows and GTK+, events for menubar items are only sent when the menu | |
5973 | is about to be shown, and not in idle time. | |
5974 | ||
5975 | """ | |
d55e5bfc RD |
5976 | def __repr__(self): |
5977 | return "<%s.%s; proxy of C++ wxUpdateUIEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5978 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5979 | """ |
5980 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5981 | ||
5982 | Constructor | |
5983 | """ | |
5b5c9bc7 | 5984 | newobj = _core_.new_UpdateUIEvent(*args, **kwargs) |
d55e5bfc RD |
5985 | self.this = newobj.this |
5986 | self.thisown = 1 | |
5987 | del newobj.thisown | |
5988 | def GetChecked(*args, **kwargs): | |
5ba5649b RD |
5989 | """ |
5990 | GetChecked(self) -> bool | |
5991 | ||
5992 | Returns ``True`` if the UI element should be checked. | |
5993 | """ | |
5b5c9bc7 | 5994 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
d55e5bfc RD |
5995 | |
5996 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
5997 | """ |
5998 | GetEnabled(self) -> bool | |
5999 | ||
6000 | Returns ``True`` if the UI element should be enabled. | |
6001 | """ | |
5b5c9bc7 | 6002 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
d55e5bfc RD |
6003 | |
6004 | def GetText(*args, **kwargs): | |
5ba5649b RD |
6005 | """ |
6006 | GetText(self) -> String | |
6007 | ||
6008 | Returns the text that should be set for the UI element. | |
6009 | """ | |
5b5c9bc7 | 6010 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
d55e5bfc RD |
6011 | |
6012 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
6013 | """ |
6014 | GetSetText(self) -> bool | |
6015 | ||
6016 | Returns ``True`` if the application has called `SetText`. For | |
6017 | wxWidgets internal use only. | |
6018 | """ | |
5b5c9bc7 | 6019 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
d55e5bfc RD |
6020 | |
6021 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
6022 | """ |
6023 | GetSetChecked(self) -> bool | |
6024 | ||
6025 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
6026 | internal use only. | |
6027 | """ | |
5b5c9bc7 | 6028 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
d55e5bfc RD |
6029 | |
6030 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
6031 | """ |
6032 | GetSetEnabled(self) -> bool | |
6033 | ||
6034 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
6035 | internal use only. | |
6036 | """ | |
5b5c9bc7 | 6037 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
d55e5bfc RD |
6038 | |
6039 | def Check(*args, **kwargs): | |
5ba5649b RD |
6040 | """ |
6041 | Check(self, bool check) | |
6042 | ||
6043 | Check or uncheck the UI element. | |
6044 | """ | |
5b5c9bc7 | 6045 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
d55e5bfc RD |
6046 | |
6047 | def Enable(*args, **kwargs): | |
5ba5649b RD |
6048 | """ |
6049 | Enable(self, bool enable) | |
6050 | ||
6051 | Enable or disable the UI element. | |
6052 | """ | |
5b5c9bc7 | 6053 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
d55e5bfc RD |
6054 | |
6055 | def SetText(*args, **kwargs): | |
5ba5649b RD |
6056 | """ |
6057 | SetText(self, String text) | |
6058 | ||
6059 | Sets the text for this UI element. | |
6060 | """ | |
5b5c9bc7 | 6061 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
d55e5bfc RD |
6062 | |
6063 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
6064 | """ |
6065 | SetUpdateInterval(long updateInterval) | |
6066 | ||
6067 | Sets the interval between updates in milliseconds. Set to -1 to | |
6068 | disable updates, or to 0 to update as frequently as possible. The | |
6069 | default is 0. | |
6070 | ||
6071 | Use this to reduce the overhead of UI update events if your | |
6072 | application has a lot of windows. If you set the value to -1 or | |
6073 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
6074 | at appropriate points in your application, such as when a dialog is | |
6075 | about to be shown. | |
6076 | """ | |
5b5c9bc7 | 6077 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d55e5bfc RD |
6078 | |
6079 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
6080 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
6081 | """ |
6082 | GetUpdateInterval() -> long | |
6083 | ||
6084 | Returns the current interval between updates in milliseconds. -1 | |
6085 | disables updates, 0 updates as frequently as possible. | |
6086 | """ | |
5b5c9bc7 | 6087 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
d55e5bfc RD |
6088 | |
6089 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
6090 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
6091 | """ |
6092 | CanUpdate(Window win) -> bool | |
6093 | ||
6094 | Returns ``True`` if it is appropriate to update (send UI update events | |
6095 | to) this window. | |
6096 | ||
6097 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6098 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6099 | events were last sent in idle time, and the update interval, to | |
6100 | determine whether events should be sent to this window now. By default | |
6101 | this will always return true because the update mode is initially | |
6102 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6103 | events will be sent as often as possible. You can reduce the frequency | |
6104 | that events are sent by changing the mode and/or setting an update | |
6105 | interval. | |
6106 | ||
6107 | """ | |
5b5c9bc7 | 6108 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d55e5bfc RD |
6109 | |
6110 | CanUpdate = staticmethod(CanUpdate) | |
6111 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
6112 | """ |
6113 | ResetUpdateTime() | |
6114 | ||
6115 | Used internally to reset the last-updated time to the current time. It | |
6116 | is assumed that update events are normally sent in idle time, so this | |
6117 | is called at the end of idle processing. | |
6118 | """ | |
5b5c9bc7 | 6119 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
d55e5bfc RD |
6120 | |
6121 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
6122 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6123 | """ |
6124 | SetMode(int mode) | |
6125 | ||
6126 | Specify how wxWidgets will send update events: to all windows, or only | |
6127 | to those which specify that they will process the events. | |
6128 | ||
6129 | The mode may be one of the following values: | |
6130 | ||
6131 | ============================= ========================================== | |
6132 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6133 | is the default setting. | |
6134 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6135 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6136 | style set. | |
6137 | ============================= ========================================== | |
6138 | ||
6139 | """ | |
5b5c9bc7 | 6140 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d55e5bfc RD |
6141 | |
6142 | SetMode = staticmethod(SetMode) | |
6143 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6144 | """ |
6145 | GetMode() -> int | |
6146 | ||
6147 | Returns a value specifying how wxWidgets will send update events: to | |
6148 | all windows, or only to those which specify that they will process the | |
6149 | events. | |
6150 | """ | |
5b5c9bc7 | 6151 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
d55e5bfc RD |
6152 | |
6153 | GetMode = staticmethod(GetMode) | |
6154 | ||
5b5c9bc7 | 6155 | class UpdateUIEventPtr(UpdateUIEvent): |
d55e5bfc RD |
6156 | def __init__(self, this): |
6157 | self.this = this | |
6158 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6159 | self.__class__ = UpdateUIEvent |
6160 | _core_.UpdateUIEvent_swigregister(UpdateUIEventPtr) | |
d55e5bfc | 6161 | |
5b5c9bc7 | 6162 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
5ba5649b RD |
6163 | """ |
6164 | UpdateUIEvent_SetUpdateInterval(long updateInterval) | |
6165 | ||
6166 | Sets the interval between updates in milliseconds. Set to -1 to | |
6167 | disable updates, or to 0 to update as frequently as possible. The | |
6168 | default is 0. | |
6169 | ||
6170 | Use this to reduce the overhead of UI update events if your | |
6171 | application has a lot of windows. If you set the value to -1 or | |
6172 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
6173 | at appropriate points in your application, such as when a dialog is | |
6174 | about to be shown. | |
6175 | """ | |
5b5c9bc7 | 6176 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d55e5bfc | 6177 | |
5b5c9bc7 | 6178 | def UpdateUIEvent_GetUpdateInterval(*args, **kwargs): |
5ba5649b RD |
6179 | """ |
6180 | UpdateUIEvent_GetUpdateInterval() -> long | |
6181 | ||
6182 | Returns the current interval between updates in milliseconds. -1 | |
6183 | disables updates, 0 updates as frequently as possible. | |
6184 | """ | |
5b5c9bc7 | 6185 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
d55e5bfc | 6186 | |
5b5c9bc7 | 6187 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
5ba5649b RD |
6188 | """ |
6189 | UpdateUIEvent_CanUpdate(Window win) -> bool | |
6190 | ||
6191 | Returns ``True`` if it is appropriate to update (send UI update events | |
6192 | to) this window. | |
6193 | ||
6194 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6195 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6196 | events were last sent in idle time, and the update interval, to | |
6197 | determine whether events should be sent to this window now. By default | |
6198 | this will always return true because the update mode is initially | |
6199 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6200 | events will be sent as often as possible. You can reduce the frequency | |
6201 | that events are sent by changing the mode and/or setting an update | |
6202 | interval. | |
6203 | ||
6204 | """ | |
5b5c9bc7 | 6205 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d55e5bfc | 6206 | |
5b5c9bc7 | 6207 | def UpdateUIEvent_ResetUpdateTime(*args, **kwargs): |
5ba5649b RD |
6208 | """ |
6209 | UpdateUIEvent_ResetUpdateTime() | |
6210 | ||
6211 | Used internally to reset the last-updated time to the current time. It | |
6212 | is assumed that update events are normally sent in idle time, so this | |
6213 | is called at the end of idle processing. | |
6214 | """ | |
5b5c9bc7 | 6215 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
d55e5bfc | 6216 | |
5b5c9bc7 | 6217 | def UpdateUIEvent_SetMode(*args, **kwargs): |
5ba5649b RD |
6218 | """ |
6219 | UpdateUIEvent_SetMode(int mode) | |
6220 | ||
6221 | Specify how wxWidgets will send update events: to all windows, or only | |
6222 | to those which specify that they will process the events. | |
6223 | ||
6224 | The mode may be one of the following values: | |
6225 | ||
6226 | ============================= ========================================== | |
6227 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6228 | is the default setting. | |
6229 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6230 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6231 | style set. | |
6232 | ============================= ========================================== | |
6233 | ||
6234 | """ | |
5b5c9bc7 | 6235 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d55e5bfc | 6236 | |
5b5c9bc7 | 6237 | def UpdateUIEvent_GetMode(*args, **kwargs): |
5ba5649b RD |
6238 | """ |
6239 | UpdateUIEvent_GetMode() -> int | |
6240 | ||
6241 | Returns a value specifying how wxWidgets will send update events: to | |
6242 | all windows, or only to those which specify that they will process the | |
6243 | events. | |
6244 | """ | |
5b5c9bc7 | 6245 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
d55e5bfc RD |
6246 | |
6247 | #--------------------------------------------------------------------------- | |
6248 | ||
5b5c9bc7 | 6249 | class SysColourChangedEvent(Event): |
5ba5649b RD |
6250 | """ |
6251 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
6252 | when the user changes the colour settings using the control | |
6253 | panel. This is only applicable under Windows. | |
6254 | ||
6255 | The default event handler for this event propagates the event to child | |
6256 | windows, since Windows only sends the events to top-level windows. If | |
6257 | intercepting this event for a top-level window, remember to call | |
6258 | `Skip` so the the base class handler will still be executed, or to | |
6259 | pass the event on to the window's children explicitly. | |
6260 | ||
6261 | """ | |
d55e5bfc RD |
6262 | def __repr__(self): |
6263 | return "<%s.%s; proxy of C++ wxSysColourChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6264 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6265 | """ |
6266 | __init__(self) -> SysColourChangedEvent | |
6267 | ||
6268 | Constructor | |
6269 | """ | |
5b5c9bc7 | 6270 | newobj = _core_.new_SysColourChangedEvent(*args, **kwargs) |
d55e5bfc RD |
6271 | self.this = newobj.this |
6272 | self.thisown = 1 | |
6273 | del newobj.thisown | |
6274 | ||
5b5c9bc7 | 6275 | class SysColourChangedEventPtr(SysColourChangedEvent): |
d55e5bfc RD |
6276 | def __init__(self, this): |
6277 | self.this = this | |
6278 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6279 | self.__class__ = SysColourChangedEvent |
6280 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEventPtr) | |
d55e5bfc RD |
6281 | |
6282 | #--------------------------------------------------------------------------- | |
6283 | ||
5b5c9bc7 | 6284 | class MouseCaptureChangedEvent(Event): |
5ba5649b RD |
6285 | """ |
6286 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
6287 | a window that loses its mouse capture. This is called even if | |
6288 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
6289 | this event allows an application to cater for unexpected capture | |
6290 | releases which might otherwise confuse mouse handling code. | |
6291 | ||
6292 | This event is implemented under Windows only. | |
6293 | """ | |
d55e5bfc RD |
6294 | def __repr__(self): |
6295 | return "<%s.%s; proxy of C++ wxMouseCaptureChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6296 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6297 | """ |
6298 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
6299 | ||
6300 | Constructor | |
6301 | """ | |
5b5c9bc7 | 6302 | newobj = _core_.new_MouseCaptureChangedEvent(*args, **kwargs) |
d55e5bfc RD |
6303 | self.this = newobj.this |
6304 | self.thisown = 1 | |
6305 | del newobj.thisown | |
6306 | def GetCapturedWindow(*args, **kwargs): | |
5ba5649b RD |
6307 | """ |
6308 | GetCapturedWindow(self) -> Window | |
6309 | ||
6310 | Returns the window that gained the capture, or ``None`` if it was a | |
6311 | non-wxWidgets window. | |
6312 | """ | |
5b5c9bc7 | 6313 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
d55e5bfc RD |
6314 | |
6315 | ||
5b5c9bc7 | 6316 | class MouseCaptureChangedEventPtr(MouseCaptureChangedEvent): |
d55e5bfc RD |
6317 | def __init__(self, this): |
6318 | self.this = this | |
6319 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6320 | self.__class__ = MouseCaptureChangedEvent |
6321 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEventPtr) | |
d55e5bfc RD |
6322 | |
6323 | #--------------------------------------------------------------------------- | |
6324 | ||
5b5c9bc7 | 6325 | class DisplayChangedEvent(Event): |
5ba5649b RD |
6326 | """ |
6327 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
6328 | resolution has changed. | |
6329 | ||
6330 | This event is implemented under Windows only. | |
6331 | """ | |
d55e5bfc RD |
6332 | def __repr__(self): |
6333 | return "<%s.%s; proxy of C++ wxDisplayChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6334 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
6335 | """__init__(self) -> DisplayChangedEvent""" |
6336 | newobj = _core_.new_DisplayChangedEvent(*args, **kwargs) | |
d55e5bfc RD |
6337 | self.this = newobj.this |
6338 | self.thisown = 1 | |
6339 | del newobj.thisown | |
6340 | ||
5b5c9bc7 | 6341 | class DisplayChangedEventPtr(DisplayChangedEvent): |
d55e5bfc RD |
6342 | def __init__(self, this): |
6343 | self.this = this | |
6344 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6345 | self.__class__ = DisplayChangedEvent |
6346 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEventPtr) | |
d55e5bfc RD |
6347 | |
6348 | #--------------------------------------------------------------------------- | |
6349 | ||
5b5c9bc7 | 6350 | class PaletteChangedEvent(Event): |
5ba5649b RD |
6351 | """ |
6352 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6353 | changed, thereby giving each window a chance to redo their own to | |
6354 | match. | |
6355 | ||
6356 | This event is implemented under Windows only. | |
6357 | """ | |
d55e5bfc RD |
6358 | def __repr__(self): |
6359 | return "<%s.%s; proxy of C++ wxPaletteChangedEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6360 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6361 | """ |
6362 | __init__(self, int id=0) -> PaletteChangedEvent | |
6363 | ||
6364 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6365 | changed, thereby giving each window a chance to redo their own to | |
6366 | match. | |
6367 | ||
6368 | This event is implemented under Windows only. | |
6369 | """ | |
5b5c9bc7 | 6370 | newobj = _core_.new_PaletteChangedEvent(*args, **kwargs) |
d55e5bfc RD |
6371 | self.this = newobj.this |
6372 | self.thisown = 1 | |
6373 | del newobj.thisown | |
6374 | def SetChangedWindow(*args, **kwargs): | |
5b5c9bc7 RD |
6375 | """SetChangedWindow(self, Window win)""" |
6376 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) | |
d55e5bfc RD |
6377 | |
6378 | def GetChangedWindow(*args, **kwargs): | |
5b5c9bc7 RD |
6379 | """GetChangedWindow(self) -> Window""" |
6380 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) | |
d55e5bfc RD |
6381 | |
6382 | ||
5b5c9bc7 | 6383 | class PaletteChangedEventPtr(PaletteChangedEvent): |
d55e5bfc RD |
6384 | def __init__(self, this): |
6385 | self.this = this | |
6386 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6387 | self.__class__ = PaletteChangedEvent |
6388 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEventPtr) | |
d55e5bfc RD |
6389 | |
6390 | #--------------------------------------------------------------------------- | |
6391 | ||
5b5c9bc7 | 6392 | class QueryNewPaletteEvent(Event): |
5ba5649b RD |
6393 | """ |
6394 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6395 | focus and should re-do its palette. | |
6396 | ||
6397 | This event is implemented under Windows only. | |
6398 | """ | |
d55e5bfc RD |
6399 | def __repr__(self): |
6400 | return "<%s.%s; proxy of C++ wxQueryNewPaletteEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6401 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6402 | """ |
6403 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6404 | ||
6405 | Constructor. | |
6406 | """ | |
5b5c9bc7 | 6407 | newobj = _core_.new_QueryNewPaletteEvent(*args, **kwargs) |
d55e5bfc RD |
6408 | self.this = newobj.this |
6409 | self.thisown = 1 | |
6410 | del newobj.thisown | |
6411 | def SetPaletteRealized(*args, **kwargs): | |
5ba5649b RD |
6412 | """ |
6413 | SetPaletteRealized(self, bool realized) | |
6414 | ||
6415 | App should set this if it changes the palette. | |
6416 | """ | |
5b5c9bc7 | 6417 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
d55e5bfc RD |
6418 | |
6419 | def GetPaletteRealized(*args, **kwargs): | |
6420 | """GetPaletteRealized(self) -> bool""" | |
5b5c9bc7 | 6421 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
d55e5bfc RD |
6422 | |
6423 | ||
5b5c9bc7 | 6424 | class QueryNewPaletteEventPtr(QueryNewPaletteEvent): |
d55e5bfc RD |
6425 | def __init__(self, this): |
6426 | self.this = this | |
6427 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6428 | self.__class__ = QueryNewPaletteEvent |
6429 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEventPtr) | |
d55e5bfc RD |
6430 | |
6431 | #--------------------------------------------------------------------------- | |
6432 | ||
5b5c9bc7 | 6433 | class NavigationKeyEvent(Event): |
5ba5649b RD |
6434 | """ |
6435 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6436 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6437 | catch navigation events in applications as there are already | |
6438 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6439 | it useful to send navigation events in certain situations to change | |
6440 | the focus in certain ways, although it's probably easier to just call | |
6441 | `wx.Window.Navigate`. | |
6442 | """ | |
d55e5bfc RD |
6443 | def __repr__(self): |
6444 | return "<%s.%s; proxy of C++ wxNavigationKeyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6445 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
6446 | """__init__(self) -> NavigationKeyEvent""" |
6447 | newobj = _core_.new_NavigationKeyEvent(*args, **kwargs) | |
d55e5bfc RD |
6448 | self.this = newobj.this |
6449 | self.thisown = 1 | |
6450 | del newobj.thisown | |
6451 | def GetDirection(*args, **kwargs): | |
5ba5649b RD |
6452 | """ |
6453 | GetDirection(self) -> bool | |
6454 | ||
6455 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6456 | """ | |
5b5c9bc7 | 6457 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
d55e5bfc RD |
6458 | |
6459 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6460 | """ |
6461 | SetDirection(self, bool forward) | |
6462 | ||
6463 | Specify the direction that the navigation should take. Usually the | |
6464 | difference between using Tab and Shift-Tab. | |
6465 | """ | |
5b5c9bc7 | 6466 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
d55e5bfc RD |
6467 | |
6468 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6469 | """ |
6470 | IsWindowChange(self) -> bool | |
6471 | ||
6472 | Returns ``True`` if window change is allowed. | |
6473 | """ | |
5b5c9bc7 | 6474 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
d55e5bfc RD |
6475 | |
6476 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6477 | """ |
6478 | SetWindowChange(self, bool ischange) | |
6479 | ||
6480 | Specify if the navigation should be able to change parent windows. | |
6481 | For example, changing notebook pages, etc. This is usually implemented | |
6482 | by using Control-Tab. | |
6483 | """ | |
5b5c9bc7 | 6484 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
d55e5bfc | 6485 | |
68350608 | 6486 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6487 | """ |
6488 | IsFromTab(self) -> bool | |
6489 | ||
6490 | Returns ``True`` if the navigation event is originated from the Tab | |
6491 | key. | |
6492 | """ | |
5b5c9bc7 | 6493 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
68350608 RD |
6494 | |
6495 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6496 | """ |
6497 | SetFromTab(self, bool bIs) | |
6498 | ||
6499 | Set to true under MSW if the event was generated using the tab key. | |
6500 | This is required for proper navogation over radio buttons. | |
6501 | """ | |
5b5c9bc7 | 6502 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
68350608 | 6503 | |
908b74cd | 6504 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6505 | """ |
6506 | SetFlags(self, long flags) | |
6507 | ||
6508 | Set the navigation flags to a combination of the following: | |
6509 | ||
6510 | * wx.NavigationKeyEvent.IsBackward | |
6511 | * wx.NavigationKeyEvent.IsForward | |
6512 | * wx.NavigationKeyEvent.WinChange | |
6513 | * wx.NavigationKeyEvent.FromTab | |
6514 | ||
6515 | """ | |
5b5c9bc7 | 6516 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
908b74cd | 6517 | |
d55e5bfc | 6518 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6519 | """ |
6520 | GetCurrentFocus(self) -> Window | |
6521 | ||
6522 | Returns the child window which currenty has the focus. May be | |
6523 | ``None``. | |
6524 | """ | |
5b5c9bc7 | 6525 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
d55e5bfc RD |
6526 | |
6527 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6528 | """ |
6529 | SetCurrentFocus(self, Window win) | |
6530 | ||
6531 | Set the window that has the focus. | |
6532 | """ | |
5b5c9bc7 | 6533 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
d55e5bfc | 6534 | |
5b5c9bc7 RD |
6535 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
6536 | IsForward = _core_.NavigationKeyEvent_IsForward | |
6537 | WinChange = _core_.NavigationKeyEvent_WinChange | |
6538 | FromTab = _core_.NavigationKeyEvent_FromTab | |
d55e5bfc | 6539 | |
5b5c9bc7 | 6540 | class NavigationKeyEventPtr(NavigationKeyEvent): |
d55e5bfc RD |
6541 | def __init__(self, this): |
6542 | self.this = this | |
6543 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6544 | self.__class__ = NavigationKeyEvent |
6545 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEventPtr) | |
d55e5bfc RD |
6546 | |
6547 | #--------------------------------------------------------------------------- | |
6548 | ||
5b5c9bc7 | 6549 | class WindowCreateEvent(CommandEvent): |
5ba5649b RD |
6550 | """ |
6551 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6552 | underlying GUI object) exists. | |
6553 | """ | |
d55e5bfc RD |
6554 | def __repr__(self): |
6555 | return "<%s.%s; proxy of C++ wxWindowCreateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6556 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6557 | """ |
6558 | __init__(self, Window win=None) -> WindowCreateEvent | |
6559 | ||
6560 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6561 | underlying GUI object) exists. | |
6562 | """ | |
5b5c9bc7 | 6563 | newobj = _core_.new_WindowCreateEvent(*args, **kwargs) |
d55e5bfc RD |
6564 | self.this = newobj.this |
6565 | self.thisown = 1 | |
6566 | del newobj.thisown | |
6567 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
6568 | """ |
6569 | GetWindow(self) -> Window | |
6570 | ||
6571 | Returns the window that this event refers to. | |
6572 | """ | |
5b5c9bc7 | 6573 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
6574 | |
6575 | ||
5b5c9bc7 | 6576 | class WindowCreateEventPtr(WindowCreateEvent): |
d55e5bfc RD |
6577 | def __init__(self, this): |
6578 | self.this = this | |
6579 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6580 | self.__class__ = WindowCreateEvent |
6581 | _core_.WindowCreateEvent_swigregister(WindowCreateEventPtr) | |
d55e5bfc | 6582 | |
5b5c9bc7 | 6583 | class WindowDestroyEvent(CommandEvent): |
5ba5649b | 6584 | """ |
943e8dfd RD |
6585 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6586 | when the GUI window is destroyed. | |
6587 | ||
6588 | When a class derived from `wx.Window` is destroyed its destructor will | |
6589 | have already run by the time this event is sent. Therefore this event | |
6590 | will not usually be received at all by the window itself. Since it is | |
6591 | received after the destructor has run, an object should not try to | |
6592 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6593 | notification of the destruction of another window. | |
5ba5649b | 6594 | """ |
d55e5bfc RD |
6595 | def __repr__(self): |
6596 | return "<%s.%s; proxy of C++ wxWindowDestroyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6597 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6598 | """ |
6599 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6600 | ||
943e8dfd RD |
6601 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6602 | when the GUI window is destroyed. | |
6603 | ||
6604 | When a class derived from `wx.Window` is destroyed its destructor will | |
6605 | have already run by the time this event is sent. Therefore this event | |
6606 | will not usually be received at all by the window itself. Since it is | |
6607 | received after the destructor has run, an object should not try to | |
6608 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6609 | notification of the destruction of another window. | |
5ba5649b | 6610 | """ |
5b5c9bc7 | 6611 | newobj = _core_.new_WindowDestroyEvent(*args, **kwargs) |
d55e5bfc RD |
6612 | self.this = newobj.this |
6613 | self.thisown = 1 | |
6614 | del newobj.thisown | |
6615 | def GetWindow(*args, **kwargs): | |
5ba5649b RD |
6616 | """ |
6617 | GetWindow(self) -> Window | |
6618 | ||
6619 | Returns the window that this event refers to. | |
6620 | """ | |
5b5c9bc7 | 6621 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
d55e5bfc RD |
6622 | |
6623 | ||
5b5c9bc7 | 6624 | class WindowDestroyEventPtr(WindowDestroyEvent): |
d55e5bfc RD |
6625 | def __init__(self, this): |
6626 | self.this = this | |
6627 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6628 | self.__class__ = WindowDestroyEvent |
6629 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEventPtr) | |
d55e5bfc RD |
6630 | |
6631 | #--------------------------------------------------------------------------- | |
6632 | ||
5b5c9bc7 | 6633 | class ContextMenuEvent(CommandEvent): |
5ba5649b RD |
6634 | """ |
6635 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6636 | give the application a chance to show a context (popup) menu. | |
6637 | """ | |
d55e5bfc RD |
6638 | def __repr__(self): |
6639 | return "<%s.%s; proxy of C++ wxContextMenuEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6640 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6641 | """ |
6642 | __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent | |
6643 | ||
6644 | Constructor. | |
6645 | """ | |
5b5c9bc7 | 6646 | newobj = _core_.new_ContextMenuEvent(*args, **kwargs) |
d55e5bfc RD |
6647 | self.this = newobj.this |
6648 | self.thisown = 1 | |
6649 | del newobj.thisown | |
6650 | def GetPosition(*args, **kwargs): | |
5ba5649b RD |
6651 | """ |
6652 | GetPosition(self) -> Point | |
6653 | ||
6654 | Returns the position (in screen coordinants) at which the menu should | |
6655 | be shown. | |
6656 | """ | |
5b5c9bc7 | 6657 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
d55e5bfc RD |
6658 | |
6659 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6660 | """ |
6661 | SetPosition(self, Point pos) | |
6662 | ||
6663 | Sets the position at which the menu should be shown. | |
6664 | """ | |
5b5c9bc7 | 6665 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
d55e5bfc RD |
6666 | |
6667 | ||
5b5c9bc7 | 6668 | class ContextMenuEventPtr(ContextMenuEvent): |
d55e5bfc RD |
6669 | def __init__(self, this): |
6670 | self.this = this | |
6671 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6672 | self.__class__ = ContextMenuEvent |
6673 | _core_.ContextMenuEvent_swigregister(ContextMenuEventPtr) | |
d55e5bfc RD |
6674 | |
6675 | #--------------------------------------------------------------------------- | |
6676 | ||
5b5c9bc7 RD |
6677 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6678 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
6679 | class IdleEvent(Event): | |
5ba5649b RD |
6680 | """ |
6681 | This class is used for EVT_IDLE events, which are generated and sent | |
6682 | when the application *becomes* idle. In other words, the when the | |
6683 | event queue becomes empty then idle events are sent to all windows (by | |
6684 | default) and as long as none of them call `RequestMore` then there are | |
6685 | no more idle events until after the system event queue has some normal | |
6686 | events and then becomes empty again. | |
6687 | ||
6688 | By default, idle events are sent to all windows. If this is causing a | |
6689 | significant overhead in your application, you can call | |
6690 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6691 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6692 | which should receive idle events. Then idle events will only be sent | |
6693 | to those windows and not to any others. | |
6694 | """ | |
d55e5bfc RD |
6695 | def __repr__(self): |
6696 | return "<%s.%s; proxy of C++ wxIdleEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6697 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6698 | """ |
6699 | __init__(self) -> IdleEvent | |
6700 | ||
6701 | Constructor | |
6702 | """ | |
5b5c9bc7 | 6703 | newobj = _core_.new_IdleEvent(*args, **kwargs) |
d55e5bfc RD |
6704 | self.this = newobj.this |
6705 | self.thisown = 1 | |
6706 | del newobj.thisown | |
6707 | def RequestMore(*args, **kwargs): | |
5ba5649b RD |
6708 | """ |
6709 | RequestMore(self, bool needMore=True) | |
6710 | ||
6711 | Tells wxWidgets that more processing is required. This function can be | |
6712 | called by an EVT_IDLE handler for a window to indicate that the | |
6713 | application should forward the EVT_IDLE event once more to the | |
6714 | application windows. If no window calls this function during its | |
6715 | EVT_IDLE handler, then the application will remain in a passive event | |
6716 | loop until a new event is posted to the application by the windowing | |
6717 | system. | |
6718 | """ | |
5b5c9bc7 | 6719 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
d55e5bfc RD |
6720 | |
6721 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6722 | """ |
6723 | MoreRequested(self) -> bool | |
6724 | ||
6725 | Returns ``True`` if the OnIdle function processing this event | |
6726 | requested more processing time. | |
6727 | """ | |
5b5c9bc7 | 6728 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
d55e5bfc RD |
6729 | |
6730 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6731 | """ |
6732 | SetMode(int mode) | |
6733 | ||
6734 | Static method for specifying how wxWidgets will send idle events: to | |
6735 | all windows, or only to those which specify that they will process the | |
6736 | events. | |
6737 | ||
6738 | The mode can be one of the following values: | |
6739 | ||
6740 | ========================= ======================================== | |
6741 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6742 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6743 | the wx.WS_EX_PROCESS_IDLE extra style | |
6744 | flag set. | |
6745 | ========================= ======================================== | |
6746 | ||
6747 | """ | |
5b5c9bc7 | 6748 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d55e5bfc RD |
6749 | |
6750 | SetMode = staticmethod(SetMode) | |
6751 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6752 | """ |
6753 | GetMode() -> int | |
6754 | ||
6755 | Static method returning a value specifying how wxWidgets will send | |
6756 | idle events: to all windows, or only to those which specify that they | |
6757 | will process the events. | |
6758 | """ | |
5b5c9bc7 | 6759 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
d55e5bfc RD |
6760 | |
6761 | GetMode = staticmethod(GetMode) | |
6762 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6763 | """ |
6764 | CanSend(Window win) -> bool | |
6765 | ||
6766 | Returns ``True`` if it is appropriate to send idle events to this | |
6767 | window. | |
6768 | ||
6769 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6770 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6771 | events should be sent to this window now. By default this will always | |
6772 | return ``True`` because the update mode is initially | |
6773 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6774 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6775 | """ | |
5b5c9bc7 | 6776 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d55e5bfc RD |
6777 | |
6778 | CanSend = staticmethod(CanSend) | |
6779 | ||
5b5c9bc7 | 6780 | class IdleEventPtr(IdleEvent): |
d55e5bfc RD |
6781 | def __init__(self, this): |
6782 | self.this = this | |
6783 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6784 | self.__class__ = IdleEvent |
6785 | _core_.IdleEvent_swigregister(IdleEventPtr) | |
d55e5bfc | 6786 | |
5b5c9bc7 | 6787 | def IdleEvent_SetMode(*args, **kwargs): |
5ba5649b RD |
6788 | """ |
6789 | IdleEvent_SetMode(int mode) | |
6790 | ||
6791 | Static method for specifying how wxWidgets will send idle events: to | |
6792 | all windows, or only to those which specify that they will process the | |
6793 | events. | |
6794 | ||
6795 | The mode can be one of the following values: | |
6796 | ||
6797 | ========================= ======================================== | |
6798 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6799 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6800 | the wx.WS_EX_PROCESS_IDLE extra style | |
6801 | flag set. | |
6802 | ========================= ======================================== | |
6803 | ||
6804 | """ | |
5b5c9bc7 | 6805 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d55e5bfc | 6806 | |
5b5c9bc7 | 6807 | def IdleEvent_GetMode(*args, **kwargs): |
5ba5649b RD |
6808 | """ |
6809 | IdleEvent_GetMode() -> int | |
6810 | ||
6811 | Static method returning a value specifying how wxWidgets will send | |
6812 | idle events: to all windows, or only to those which specify that they | |
6813 | will process the events. | |
6814 | """ | |
5b5c9bc7 | 6815 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
d55e5bfc | 6816 | |
5b5c9bc7 | 6817 | def IdleEvent_CanSend(*args, **kwargs): |
5ba5649b RD |
6818 | """ |
6819 | IdleEvent_CanSend(Window win) -> bool | |
6820 | ||
6821 | Returns ``True`` if it is appropriate to send idle events to this | |
6822 | window. | |
6823 | ||
6824 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6825 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6826 | events should be sent to this window now. By default this will always | |
6827 | return ``True`` because the update mode is initially | |
6828 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6829 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6830 | """ | |
5b5c9bc7 | 6831 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d55e5bfc RD |
6832 | |
6833 | #--------------------------------------------------------------------------- | |
6834 | ||
5b5c9bc7 | 6835 | class PyEvent(Event): |
5ba5649b RD |
6836 | """ |
6837 | wx.PyEvent can be used as a base class for implementing custom event | |
6838 | types in Python. You should derived from this class instead of | |
6839 | `wx.Event` because this class is Python-aware and is able to transport | |
6840 | its Python bits safely through the wxWidgets event system and have | |
6841 | them still be there when the event handler is invoked. | |
6842 | ||
6843 | :see: `wx.PyCommandEvent` | |
6844 | ||
6845 | """ | |
d55e5bfc RD |
6846 | def __repr__(self): |
6847 | return "<%s.%s; proxy of C++ wxPyEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6848 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6849 | """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent""" |
5b5c9bc7 | 6850 | newobj = _core_.new_PyEvent(*args, **kwargs) |
d55e5bfc RD |
6851 | self.this = newobj.this |
6852 | self.thisown = 1 | |
6853 | del newobj.thisown | |
5ba5649b | 6854 | self._SetSelf(self) |
d55e5bfc | 6855 | |
5b5c9bc7 | 6856 | def __del__(self, destroy=_core_.delete_PyEvent): |
d55e5bfc RD |
6857 | """__del__(self)""" |
6858 | try: | |
6859 | if self.thisown: destroy(self) | |
6860 | except: pass | |
6861 | ||
5ba5649b RD |
6862 | def _SetSelf(*args, **kwargs): |
6863 | """_SetSelf(self, PyObject self)""" | |
6864 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
d55e5bfc | 6865 | |
5ba5649b RD |
6866 | def _GetSelf(*args, **kwargs): |
6867 | """_GetSelf(self) -> PyObject""" | |
6868 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
d55e5bfc RD |
6869 | |
6870 | ||
5b5c9bc7 | 6871 | class PyEventPtr(PyEvent): |
d55e5bfc RD |
6872 | def __init__(self, this): |
6873 | self.this = this | |
6874 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6875 | self.__class__ = PyEvent |
6876 | _core_.PyEvent_swigregister(PyEventPtr) | |
d55e5bfc | 6877 | |
5b5c9bc7 | 6878 | class PyCommandEvent(CommandEvent): |
5ba5649b RD |
6879 | """ |
6880 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6881 | event types in Python, where the event shoudl travel up to parent | |
6882 | windows looking for a handler. You should derived from this class | |
6883 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6884 | able to transport its Python bits safely through the wxWidgets event | |
6885 | system and have them still be there when the event handler is invoked. | |
6886 | ||
6887 | :see: `wx.PyEvent` | |
6888 | ||
6889 | """ | |
d55e5bfc RD |
6890 | def __repr__(self): |
6891 | return "<%s.%s; proxy of C++ wxPyCommandEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6892 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6893 | """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
5b5c9bc7 | 6894 | newobj = _core_.new_PyCommandEvent(*args, **kwargs) |
d55e5bfc RD |
6895 | self.this = newobj.this |
6896 | self.thisown = 1 | |
6897 | del newobj.thisown | |
5ba5649b | 6898 | self._SetSelf(self) |
d55e5bfc | 6899 | |
5b5c9bc7 | 6900 | def __del__(self, destroy=_core_.delete_PyCommandEvent): |
d55e5bfc RD |
6901 | """__del__(self)""" |
6902 | try: | |
6903 | if self.thisown: destroy(self) | |
6904 | except: pass | |
6905 | ||
5ba5649b RD |
6906 | def _SetSelf(*args, **kwargs): |
6907 | """_SetSelf(self, PyObject self)""" | |
6908 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
d55e5bfc | 6909 | |
5ba5649b RD |
6910 | def _GetSelf(*args, **kwargs): |
6911 | """_GetSelf(self) -> PyObject""" | |
6912 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
d55e5bfc RD |
6913 | |
6914 | ||
5b5c9bc7 | 6915 | class PyCommandEventPtr(PyCommandEvent): |
d55e5bfc RD |
6916 | def __init__(self, this): |
6917 | self.this = this | |
6918 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6919 | self.__class__ = PyCommandEvent |
6920 | _core_.PyCommandEvent_swigregister(PyCommandEventPtr) | |
d55e5bfc | 6921 | |
5b5c9bc7 | 6922 | class DateEvent(CommandEvent): |
5ba5649b RD |
6923 | """ |
6924 | This event class holds information about a date change event and is | |
6925 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6926 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6927 | EVT_DATE_CHANGED. | |
6928 | """ | |
53aa7709 RD |
6929 | def __repr__(self): |
6930 | return "<%s.%s; proxy of C++ wxDateEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6931 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
6932 | """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent""" |
6933 | newobj = _core_.new_DateEvent(*args, **kwargs) | |
53aa7709 RD |
6934 | self.this = newobj.this |
6935 | self.thisown = 1 | |
6936 | del newobj.thisown | |
6937 | def GetDate(*args, **kwargs): | |
5ba5649b RD |
6938 | """ |
6939 | GetDate(self) -> DateTime | |
6940 | ||
6941 | Returns the date. | |
6942 | """ | |
5b5c9bc7 | 6943 | return _core_.DateEvent_GetDate(*args, **kwargs) |
53aa7709 RD |
6944 | |
6945 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6946 | """ |
6947 | SetDate(self, DateTime date) | |
6948 | ||
6949 | Sets the date carried by the event, normally only used by the library | |
6950 | internally. | |
6951 | """ | |
5b5c9bc7 | 6952 | return _core_.DateEvent_SetDate(*args, **kwargs) |
53aa7709 RD |
6953 | |
6954 | ||
5b5c9bc7 | 6955 | class DateEventPtr(DateEvent): |
53aa7709 RD |
6956 | def __init__(self, this): |
6957 | self.this = this | |
6958 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
6959 | self.__class__ = DateEvent |
6960 | _core_.DateEvent_swigregister(DateEventPtr) | |
53aa7709 | 6961 | |
5b5c9bc7 | 6962 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED |
53aa7709 RD |
6963 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) |
6964 | ||
d55e5bfc RD |
6965 | #--------------------------------------------------------------------------- |
6966 | ||
5b5c9bc7 RD |
6967 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
6968 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6969 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6970 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6971 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6972 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
6973 | class PyApp(EvtHandler): | |
d6c14a4c RD |
6974 | """ |
6975 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6976 | `wx.App` class (or some other derived class) instead. | |
6977 | """ | |
d55e5bfc RD |
6978 | def __repr__(self): |
6979 | return "<%s.%s; proxy of C++ wxPyApp instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
6980 | def __init__(self, *args, **kwargs): | |
6981 | """ | |
5b5c9bc7 | 6982 | __init__(self) -> PyApp |
d55e5bfc RD |
6983 | |
6984 | Create a new application object, starting the bootstrap process. | |
6985 | """ | |
5b5c9bc7 | 6986 | newobj = _core_.new_PyApp(*args, **kwargs) |
d55e5bfc RD |
6987 | self.this = newobj.this |
6988 | self.thisown = 1 | |
6989 | del newobj.thisown | |
7993762b RD |
6990 | self._setCallbackInfo(self, PyApp, False) |
6991 | self._setOORInfo(self, False) | |
d55e5bfc | 6992 | |
5b5c9bc7 | 6993 | def __del__(self, destroy=_core_.delete_PyApp): |
d55e5bfc RD |
6994 | """__del__(self)""" |
6995 | try: | |
6996 | if self.thisown: destroy(self) | |
6997 | except: pass | |
6998 | ||
6999 | def _setCallbackInfo(*args, **kwargs): | |
7993762b | 7000 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
5b5c9bc7 | 7001 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
7002 | |
7003 | def GetAppName(*args, **kwargs): | |
7004 | """ | |
5b5c9bc7 | 7005 | GetAppName(self) -> String |
d55e5bfc RD |
7006 | |
7007 | Get the application name. | |
7008 | """ | |
5b5c9bc7 | 7009 | return _core_.PyApp_GetAppName(*args, **kwargs) |
d55e5bfc RD |
7010 | |
7011 | def SetAppName(*args, **kwargs): | |
7012 | """ | |
5b5c9bc7 | 7013 | SetAppName(self, String name) |
d55e5bfc | 7014 | |
d6c14a4c RD |
7015 | Set the application name. This value may be used automatically by |
7016 | `wx.Config` and such. | |
d55e5bfc | 7017 | """ |
5b5c9bc7 | 7018 | return _core_.PyApp_SetAppName(*args, **kwargs) |
d55e5bfc RD |
7019 | |
7020 | def GetClassName(*args, **kwargs): | |
7021 | """ | |
5b5c9bc7 | 7022 | GetClassName(self) -> String |
d55e5bfc RD |
7023 | |
7024 | Get the application's class name. | |
7025 | """ | |
5b5c9bc7 | 7026 | return _core_.PyApp_GetClassName(*args, **kwargs) |
d55e5bfc RD |
7027 | |
7028 | def SetClassName(*args, **kwargs): | |
7029 | """ | |
5b5c9bc7 | 7030 | SetClassName(self, String name) |
d55e5bfc | 7031 | |
d6c14a4c RD |
7032 | Set the application's class name. This value may be used for |
7033 | X-resources if applicable for the platform | |
d55e5bfc | 7034 | """ |
5b5c9bc7 | 7035 | return _core_.PyApp_SetClassName(*args, **kwargs) |
d55e5bfc RD |
7036 | |
7037 | def GetVendorName(*args, **kwargs): | |
7038 | """ | |
5b5c9bc7 | 7039 | GetVendorName(self) -> String |
d55e5bfc RD |
7040 | |
7041 | Get the application's vendor name. | |
7042 | """ | |
5b5c9bc7 | 7043 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
d55e5bfc RD |
7044 | |
7045 | def SetVendorName(*args, **kwargs): | |
7046 | """ | |
5b5c9bc7 | 7047 | SetVendorName(self, String name) |
d55e5bfc | 7048 | |
d6c14a4c RD |
7049 | Set the application's vendor name. This value may be used |
7050 | automatically by `wx.Config` and such. | |
d55e5bfc | 7051 | """ |
5b5c9bc7 | 7052 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
d55e5bfc RD |
7053 | |
7054 | def GetTraits(*args, **kwargs): | |
7055 | """ | |
7056 | GetTraits(self) -> wxAppTraits | |
7057 | ||
d6c14a4c RD |
7058 | Return (and create if necessary) the app traits object to which we |
7059 | delegate for everything which either should be configurable by the | |
7060 | user (then he can change the default behaviour simply by overriding | |
7061 | CreateTraits() and returning his own traits object) or which is | |
7062 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
7063 | differences behind the common facade. | |
7064 | ||
7065 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
d55e5bfc | 7066 | """ |
5b5c9bc7 | 7067 | return _core_.PyApp_GetTraits(*args, **kwargs) |
d55e5bfc RD |
7068 | |
7069 | def ProcessPendingEvents(*args, **kwargs): | |
7070 | """ | |
7071 | ProcessPendingEvents(self) | |
7072 | ||
d6c14a4c RD |
7073 | Process all events in the Pending Events list -- it is necessary to |
7074 | call this function to process posted events. This normally happens | |
7075 | during each event loop iteration. | |
d55e5bfc | 7076 | """ |
5b5c9bc7 | 7077 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
d55e5bfc RD |
7078 | |
7079 | def Yield(*args, **kwargs): | |
7080 | """ | |
7081 | Yield(self, bool onlyIfNeeded=False) -> bool | |
7082 | ||
d6c14a4c RD |
7083 | Process all currently pending events right now, instead of waiting |
7084 | until return to the event loop. It is an error to call ``Yield`` | |
7085 | recursively unless the value of ``onlyIfNeeded`` is True. | |
d55e5bfc | 7086 | |
d6c14a4c | 7087 | :warning: This function is dangerous as it can lead to unexpected |
15817c7e RD |
7088 | reentrancies (i.e. when called from an event handler it may |
7089 | result in calling the same event handler again), use with | |
7090 | extreme care or, better, don't use at all! | |
d55e5bfc | 7091 | |
d6c14a4c | 7092 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
15817c7e | 7093 | |
d55e5bfc | 7094 | """ |
5b5c9bc7 | 7095 | return _core_.PyApp_Yield(*args, **kwargs) |
d55e5bfc RD |
7096 | |
7097 | def WakeUpIdle(*args, **kwargs): | |
7098 | """ | |
7099 | WakeUpIdle(self) | |
7100 | ||
d6c14a4c RD |
7101 | Make sure that idle events are sent again. |
7102 | :see: `wx.WakeUpIdle` | |
d55e5bfc | 7103 | """ |
5b5c9bc7 | 7104 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
d55e5bfc | 7105 | |
84f85550 RD |
7106 | def IsMainLoopRunning(*args, **kwargs): |
7107 | """ | |
7108 | IsMainLoopRunning() -> bool | |
7109 | ||
7110 | Returns True if we're running the main loop, i.e. if the events can | |
7111 | currently be dispatched. | |
7112 | """ | |
5b5c9bc7 | 7113 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) |
84f85550 RD |
7114 | |
7115 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
d55e5bfc RD |
7116 | def MainLoop(*args, **kwargs): |
7117 | """ | |
7118 | MainLoop(self) -> int | |
7119 | ||
d6c14a4c RD |
7120 | Execute the main GUI loop, the function doesn't normally return until |
7121 | all top level windows have been closed and destroyed. | |
d55e5bfc | 7122 | """ |
5b5c9bc7 | 7123 | return _core_.PyApp_MainLoop(*args, **kwargs) |
d55e5bfc RD |
7124 | |
7125 | def Exit(*args, **kwargs): | |
7126 | """ | |
7127 | Exit(self) | |
7128 | ||
7129 | Exit the main loop thus terminating the application. | |
d6c14a4c | 7130 | :see: `wx.Exit` |
d55e5bfc | 7131 | """ |
5b5c9bc7 | 7132 | return _core_.PyApp_Exit(*args, **kwargs) |
d55e5bfc RD |
7133 | |
7134 | def ExitMainLoop(*args, **kwargs): | |
7135 | """ | |
7136 | ExitMainLoop(self) | |
7137 | ||
d6c14a4c RD |
7138 | Exit the main GUI loop during the next iteration of the main |
7139 | loop, (i.e. it does not stop the program immediately!) | |
d55e5bfc | 7140 | """ |
5b5c9bc7 | 7141 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
d55e5bfc RD |
7142 | |
7143 | def Pending(*args, **kwargs): | |
7144 | """ | |
7145 | Pending(self) -> bool | |
7146 | ||
7147 | Returns True if there are unprocessed events in the event queue. | |
7148 | """ | |
5b5c9bc7 | 7149 | return _core_.PyApp_Pending(*args, **kwargs) |
d55e5bfc RD |
7150 | |
7151 | def Dispatch(*args, **kwargs): | |
7152 | """ | |
7153 | Dispatch(self) -> bool | |
7154 | ||
7155 | Process the first event in the event queue (blocks until an event | |
7156 | appears if there are none currently) | |
7157 | """ | |
5b5c9bc7 | 7158 | return _core_.PyApp_Dispatch(*args, **kwargs) |
d55e5bfc RD |
7159 | |
7160 | def ProcessIdle(*args, **kwargs): | |
7161 | """ | |
7162 | ProcessIdle(self) -> bool | |
7163 | ||
d6c14a4c RD |
7164 | Called from the MainLoop when the application becomes idle (there are |
7165 | no pending events) and sends a `wx.IdleEvent` to all interested | |
7166 | parties. Returns True if more idle events are needed, False if not. | |
d55e5bfc | 7167 | """ |
5b5c9bc7 | 7168 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
d55e5bfc RD |
7169 | |
7170 | def SendIdleEvents(*args, **kwargs): | |
7171 | """ | |
5b5c9bc7 | 7172 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
d55e5bfc | 7173 | |
d6c14a4c RD |
7174 | Send idle event to window and all subwindows. Returns True if more |
7175 | idle time is requested. | |
d55e5bfc | 7176 | """ |
5b5c9bc7 | 7177 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
d55e5bfc RD |
7178 | |
7179 | def IsActive(*args, **kwargs): | |
7180 | """ | |
7181 | IsActive(self) -> bool | |
7182 | ||
7183 | Return True if our app has focus. | |
7184 | """ | |
5b5c9bc7 | 7185 | return _core_.PyApp_IsActive(*args, **kwargs) |
d55e5bfc RD |
7186 | |
7187 | def SetTopWindow(*args, **kwargs): | |
7188 | """ | |
5b5c9bc7 | 7189 | SetTopWindow(self, Window win) |
d55e5bfc | 7190 | |
d6c14a4c | 7191 | Set the *main* top level window |
d55e5bfc | 7192 | """ |
5b5c9bc7 | 7193 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
d55e5bfc RD |
7194 | |
7195 | def GetTopWindow(*args, **kwargs): | |
7196 | """ | |
5b5c9bc7 | 7197 | GetTopWindow(self) -> Window |
d55e5bfc | 7198 | |
d6c14a4c RD |
7199 | Return the *main* top level window (if it hadn't been set previously |
7200 | with SetTopWindow(), will return just some top level window and, if | |
7201 | there not any, will return None) | |
d55e5bfc | 7202 | """ |
5b5c9bc7 | 7203 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
d55e5bfc RD |
7204 | |
7205 | def SetExitOnFrameDelete(*args, **kwargs): | |
7206 | """ | |
7207 | SetExitOnFrameDelete(self, bool flag) | |
7208 | ||
d6c14a4c RD |
7209 | Control the exit behaviour: by default, the program will exit the main |
7210 | loop (and so, usually, terminate) when the last top-level program | |
7211 | window is deleted. Beware that if you disable this behaviour (with | |
7212 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
7213 | explicitly from somewhere. | |
d55e5bfc | 7214 | """ |
5b5c9bc7 | 7215 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
d55e5bfc RD |
7216 | |
7217 | def GetExitOnFrameDelete(*args, **kwargs): | |
7218 | """ | |
7219 | GetExitOnFrameDelete(self) -> bool | |
7220 | ||
7221 | Get the current exit behaviour setting. | |
7222 | """ | |
5b5c9bc7 | 7223 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
d55e5bfc RD |
7224 | |
7225 | def SetUseBestVisual(*args, **kwargs): | |
7226 | """ | |
7227 | SetUseBestVisual(self, bool flag) | |
7228 | ||
d6c14a4c RD |
7229 | Set whether the app should try to use the best available visual on |
7230 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
d55e5bfc | 7231 | """ |
5b5c9bc7 | 7232 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
d55e5bfc RD |
7233 | |
7234 | def GetUseBestVisual(*args, **kwargs): | |
7235 | """ | |
7236 | GetUseBestVisual(self) -> bool | |
7237 | ||
7238 | Get current UseBestVisual setting. | |
7239 | """ | |
5b5c9bc7 | 7240 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
d55e5bfc RD |
7241 | |
7242 | def SetPrintMode(*args, **kwargs): | |
7243 | """SetPrintMode(self, int mode)""" | |
5b5c9bc7 | 7244 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
d55e5bfc RD |
7245 | |
7246 | def GetPrintMode(*args, **kwargs): | |
7247 | """GetPrintMode(self) -> int""" | |
5b5c9bc7 | 7248 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
d55e5bfc RD |
7249 | |
7250 | def SetAssertMode(*args, **kwargs): | |
7251 | """ | |
7252 | SetAssertMode(self, int mode) | |
7253 | ||
15817c7e | 7254 | Set the OnAssert behaviour for debug and hybrid builds. |
d55e5bfc | 7255 | """ |
5b5c9bc7 | 7256 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
d55e5bfc RD |
7257 | |
7258 | def GetAssertMode(*args, **kwargs): | |
7259 | """ | |
7260 | GetAssertMode(self) -> int | |
7261 | ||
7262 | Get the current OnAssert behaviour setting. | |
7263 | """ | |
5b5c9bc7 | 7264 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
d55e5bfc RD |
7265 | |
7266 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): | |
d6c14a4c | 7267 | """GetMacSupportPCMenuShortcuts() -> bool""" |
5b5c9bc7 | 7268 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
d55e5bfc RD |
7269 | |
7270 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
7271 | def GetMacAboutMenuItemId(*args, **kwargs): | |
d6c14a4c | 7272 | """GetMacAboutMenuItemId() -> long""" |
5b5c9bc7 | 7273 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7274 | |
7275 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
7276 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
d6c14a4c | 7277 | """GetMacPreferencesMenuItemId() -> long""" |
5b5c9bc7 | 7278 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7279 | |
7280 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
7281 | def GetMacExitMenuItemId(*args, **kwargs): | |
d6c14a4c | 7282 | """GetMacExitMenuItemId() -> long""" |
5b5c9bc7 | 7283 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7284 | |
7285 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
7286 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
5b5c9bc7 RD |
7287 | """GetMacHelpMenuTitleName() -> String""" |
7288 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc RD |
7289 | |
7290 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
7291 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
d6c14a4c | 7292 | """SetMacSupportPCMenuShortcuts(bool val)""" |
5b5c9bc7 | 7293 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
d55e5bfc RD |
7294 | |
7295 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
7296 | def SetMacAboutMenuItemId(*args, **kwargs): | |
d6c14a4c | 7297 | """SetMacAboutMenuItemId(long val)""" |
5b5c9bc7 | 7298 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7299 | |
7300 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
7301 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
d6c14a4c | 7302 | """SetMacPreferencesMenuItemId(long val)""" |
5b5c9bc7 | 7303 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7304 | |
7305 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
7306 | def SetMacExitMenuItemId(*args, **kwargs): | |
d6c14a4c | 7307 | """SetMacExitMenuItemId(long val)""" |
5b5c9bc7 | 7308 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
d55e5bfc RD |
7309 | |
7310 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
7311 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
5b5c9bc7 RD |
7312 | """SetMacHelpMenuTitleName(String val)""" |
7313 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc RD |
7314 | |
7315 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
7316 | def _BootstrapApp(*args, **kwargs): | |
7317 | """ | |
7318 | _BootstrapApp(self) | |
7319 | ||
7320 | For internal use only | |
7321 | """ | |
5b5c9bc7 | 7322 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
d55e5bfc RD |
7323 | |
7324 | def GetComCtl32Version(*args, **kwargs): | |
7325 | """ | |
d6c14a4c | 7326 | GetComCtl32Version() -> int |
d55e5bfc | 7327 | |
d6c14a4c RD |
7328 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7329 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc | 7330 | """ |
5b5c9bc7 | 7331 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
d55e5bfc RD |
7332 | |
7333 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
7334 | ||
5b5c9bc7 | 7335 | class PyAppPtr(PyApp): |
d55e5bfc RD |
7336 | def __init__(self, this): |
7337 | self.this = this | |
7338 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7339 | self.__class__ = PyApp |
7340 | _core_.PyApp_swigregister(PyAppPtr) | |
d55e5bfc | 7341 | |
5b5c9bc7 | 7342 | def PyApp_IsMainLoopRunning(*args, **kwargs): |
84f85550 | 7343 | """ |
5b5c9bc7 | 7344 | PyApp_IsMainLoopRunning() -> bool |
84f85550 RD |
7345 | |
7346 | Returns True if we're running the main loop, i.e. if the events can | |
7347 | currently be dispatched. | |
7348 | """ | |
5b5c9bc7 | 7349 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) |
84f85550 | 7350 | |
5b5c9bc7 RD |
7351 | def PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs): |
7352 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
7353 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d55e5bfc | 7354 | |
5b5c9bc7 RD |
7355 | def PyApp_GetMacAboutMenuItemId(*args, **kwargs): |
7356 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
7357 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) | |
d55e5bfc | 7358 | |
5b5c9bc7 RD |
7359 | def PyApp_GetMacPreferencesMenuItemId(*args, **kwargs): |
7360 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
7361 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) | |
d55e5bfc | 7362 | |
5b5c9bc7 RD |
7363 | def PyApp_GetMacExitMenuItemId(*args, **kwargs): |
7364 | """PyApp_GetMacExitMenuItemId() -> long""" | |
7365 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) | |
d55e5bfc | 7366 | |
5b5c9bc7 RD |
7367 | def PyApp_GetMacHelpMenuTitleName(*args, **kwargs): |
7368 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
7369 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc | 7370 | |
5b5c9bc7 RD |
7371 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
7372 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" | |
7373 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d55e5bfc | 7374 | |
5b5c9bc7 RD |
7375 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
7376 | """PyApp_SetMacAboutMenuItemId(long val)""" | |
7377 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
d55e5bfc | 7378 | |
5b5c9bc7 RD |
7379 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
7380 | """PyApp_SetMacPreferencesMenuItemId(long val)""" | |
7381 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
d55e5bfc | 7382 | |
5b5c9bc7 RD |
7383 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
7384 | """PyApp_SetMacExitMenuItemId(long val)""" | |
7385 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
d55e5bfc | 7386 | |
5b5c9bc7 RD |
7387 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
7388 | """PyApp_SetMacHelpMenuTitleName(String val)""" | |
7389 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d55e5bfc | 7390 | |
5b5c9bc7 | 7391 | def PyApp_GetComCtl32Version(*args, **kwargs): |
d55e5bfc | 7392 | """ |
5b5c9bc7 | 7393 | PyApp_GetComCtl32Version() -> int |
d55e5bfc | 7394 | |
d6c14a4c RD |
7395 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7396 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
d55e5bfc | 7397 | """ |
5b5c9bc7 | 7398 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
d55e5bfc RD |
7399 | |
7400 | #--------------------------------------------------------------------------- | |
7401 | ||
7402 | ||
5b5c9bc7 | 7403 | def Exit(*args, **kwargs): |
d55e5bfc | 7404 | """ |
5b5c9bc7 | 7405 | Exit() |
d55e5bfc RD |
7406 | |
7407 | Force an exit of the application. Convenience for wx.GetApp().Exit() | |
7408 | """ | |
5b5c9bc7 | 7409 | return _core_.Exit(*args, **kwargs) |
d55e5bfc | 7410 | |
5b5c9bc7 | 7411 | def Yield(*args, **kwargs): |
d55e5bfc | 7412 | """ |
5b5c9bc7 | 7413 | Yield() -> bool |
d55e5bfc RD |
7414 | |
7415 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() | |
7416 | """ | |
5b5c9bc7 | 7417 | return _core_.Yield(*args, **kwargs) |
d55e5bfc | 7418 | |
5b5c9bc7 | 7419 | def YieldIfNeeded(*args, **kwargs): |
d55e5bfc | 7420 | """ |
5b5c9bc7 | 7421 | YieldIfNeeded() -> bool |
d55e5bfc RD |
7422 | |
7423 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) | |
7424 | """ | |
5b5c9bc7 | 7425 | return _core_.YieldIfNeeded(*args, **kwargs) |
d55e5bfc | 7426 | |
5b5c9bc7 | 7427 | def SafeYield(*args, **kwargs): |
d55e5bfc | 7428 | """ |
5b5c9bc7 | 7429 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool |
d55e5bfc | 7430 | |
d6c14a4c RD |
7431 | This function is similar to `wx.Yield`, except that it disables the |
7432 | user input to all program windows before calling `wx.Yield` and | |
7433 | re-enables it again afterwards. If ``win`` is not None, this window | |
7434 | will remain enabled, allowing the implementation of some limited user | |
7435 | interaction. | |
d55e5bfc | 7436 | |
d6c14a4c | 7437 | :Returns: the result of the call to `wx.Yield`. |
d55e5bfc | 7438 | """ |
5b5c9bc7 | 7439 | return _core_.SafeYield(*args, **kwargs) |
d55e5bfc | 7440 | |
5b5c9bc7 | 7441 | def WakeUpIdle(*args, **kwargs): |
d55e5bfc | 7442 | """ |
5b5c9bc7 | 7443 | WakeUpIdle() |
d55e5bfc | 7444 | |
d6c14a4c RD |
7445 | Cause the message queue to become empty again, so idle events will be |
7446 | sent. | |
d55e5bfc | 7447 | """ |
5b5c9bc7 | 7448 | return _core_.WakeUpIdle(*args, **kwargs) |
d55e5bfc | 7449 | |
5b5c9bc7 | 7450 | def PostEvent(*args, **kwargs): |
d55e5bfc | 7451 | """ |
5b5c9bc7 | 7452 | PostEvent(EvtHandler dest, Event event) |
d55e5bfc | 7453 | |
d6c14a4c RD |
7454 | Send an event to a window or other wx.EvtHandler to be processed |
7455 | later. | |
d55e5bfc | 7456 | """ |
5b5c9bc7 | 7457 | return _core_.PostEvent(*args, **kwargs) |
d55e5bfc | 7458 | |
5b5c9bc7 | 7459 | def App_CleanUp(*args, **kwargs): |
d55e5bfc | 7460 | """ |
5b5c9bc7 | 7461 | App_CleanUp() |
d55e5bfc | 7462 | |
15817c7e | 7463 | For internal use only, it is used to cleanup after wxWidgets when |
d6c14a4c | 7464 | Python shuts down. |
d55e5bfc | 7465 | """ |
5b5c9bc7 | 7466 | return _core_.App_CleanUp(*args, **kwargs) |
d55e5bfc RD |
7467 | |
7468 | def GetApp(*args, **kwargs): | |
7469 | """ | |
5b5c9bc7 | 7470 | GetApp() -> PyApp |
d55e5bfc RD |
7471 | |
7472 | Return a reference to the current wx.App object. | |
7473 | """ | |
5b5c9bc7 | 7474 | return _core_.GetApp(*args, **kwargs) |
5cbf236d | 7475 | |
5b5c9bc7 | 7476 | def SetDefaultPyEncoding(*args, **kwargs): |
5cbf236d RD |
7477 | """ |
7478 | SetDefaultPyEncoding(string encoding) | |
7479 | ||
7480 | Sets the encoding that wxPython will use when it needs to convert a | |
7481 | Python string or unicode object to or from a wxString. | |
62d32a5f RD |
7482 | |
7483 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7484 | but please be aware that the default encoding within the same locale | |
7485 | may be slightly different on different platforms. For example, please | |
7486 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7487 | between the common latin/roman encodings. | |
5cbf236d | 7488 | """ |
5b5c9bc7 | 7489 | return _core_.SetDefaultPyEncoding(*args, **kwargs) |
5cbf236d | 7490 | |
5b5c9bc7 | 7491 | def GetDefaultPyEncoding(*args, **kwargs): |
5cbf236d RD |
7492 | """ |
7493 | GetDefaultPyEncoding() -> string | |
7494 | ||
7495 | Gets the current encoding that wxPython will use when it needs to | |
7496 | convert a Python string or unicode object to or from a wxString. | |
7497 | """ | |
5b5c9bc7 | 7498 | return _core_.GetDefaultPyEncoding(*args, **kwargs) |
d55e5bfc RD |
7499 | #---------------------------------------------------------------------- |
7500 | ||
7501 | class PyOnDemandOutputWindow: | |
7502 | """ | |
7503 | A class that can be used for redirecting Python's stdout and | |
7504 | stderr streams. It will do nothing until something is wrriten to | |
7505 | the stream at which point it will create a Frame with a text area | |
7506 | and write the text there. | |
7507 | """ | |
7508 | def __init__(self, title = "wxPython: stdout/stderr"): | |
7509 | self.frame = None | |
7510 | self.title = title | |
412d302d RD |
7511 | self.pos = wx.DefaultPosition |
7512 | self.size = (450, 300) | |
d55e5bfc RD |
7513 | self.parent = None |
7514 | ||
7515 | def SetParent(self, parent): | |
7516 | """Set the window to be used as the popup Frame's parent.""" | |
7517 | self.parent = parent | |
7518 | ||
7519 | ||
7520 | def CreateOutputWindow(self, st): | |
412d302d RD |
7521 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7522 | style=wx.DEFAULT_FRAME_STYLE) | |
d55e5bfc | 7523 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7524 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d55e5bfc | 7525 | self.text.AppendText(st) |
d55e5bfc RD |
7526 | self.frame.Show(True) |
7527 | EVT_CLOSE(self.frame, self.OnCloseWindow) | |
7528 | ||
7529 | ||
7530 | def OnCloseWindow(self, event): | |
7531 | if self.frame is not None: | |
7532 | self.frame.Destroy() | |
7533 | self.frame = None | |
7534 | self.text = None | |
7535 | ||
7536 | ||
7537 | # These methods provide the file-like output behaviour. | |
7538 | def write(self, text): | |
7539 | """ | |
7540 | Create the output window if needed and write the string to it. | |
7541 | If not called in the context of the gui thread then uses | |
7542 | CallAfter to do the work there. | |
7543 | """ | |
7544 | if self.frame is None: | |
7545 | if not wx.Thread_IsMain(): | |
7546 | wx.CallAfter(self.CreateOutputWindow, text) | |
7547 | else: | |
7548 | self.CreateOutputWindow(text) | |
7549 | else: | |
7550 | if not wx.Thread_IsMain(): | |
7551 | wx.CallAfter(self.text.AppendText, text) | |
7552 | else: | |
7553 | self.text.AppendText(text) | |
7554 | ||
7555 | ||
7556 | def close(self): | |
7557 | if self.frame is not None: | |
7558 | wx.CallAfter(self.frame.Close) | |
7559 | ||
7560 | ||
bb4524c4 RD |
7561 | def flush(self): |
7562 | pass | |
7563 | ||
7564 | ||
d55e5bfc RD |
7565 | |
7566 | #---------------------------------------------------------------------- | |
7567 | ||
7568 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
7569 | ||
7570 | class App(wx.PyApp): | |
7571 | """ | |
d6c14a4c RD |
7572 | The ``wx.App`` class represents the application and is used to: |
7573 | ||
7574 | * bootstrap the wxPython system and initialize the underlying | |
7575 | gui toolkit | |
7576 | * set and get application-wide properties | |
7577 | * implement the windowing system main message or event loop, | |
7578 | and to dispatch events to window instances | |
7579 | * etc. | |
7580 | ||
7581 | Every application must have a ``wx.App`` instance, and all | |
7582 | creation of UI objects should be delayed until after the | |
7583 | ``wx.App`` object has been created in order to ensure that the gui | |
7584 | platform and wxWidgets have been fully initialized. | |
7585 | ||
7586 | Normally you would derive from this class and implement an | |
7587 | ``OnInit`` method that creates a frame and then calls | |
7588 | ``self.SetTopWindow(frame)``. | |
7589 | ||
7590 | :see: `wx.PySimpleApp` for a simpler app class that can be used | |
15817c7e | 7591 | directly. |
d55e5bfc | 7592 | """ |
d6c14a4c | 7593 | |
d55e5bfc RD |
7594 | outputWindowClass = PyOnDemandOutputWindow |
7595 | ||
d6c14a4c RD |
7596 | def __init__(self, redirect=_defRedirect, filename=None, |
7597 | useBestVisual=False, clearSigInt=True): | |
7598 | """ | |
7599 | Construct a ``wx.App`` object. | |
7600 | ||
7601 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be | |
7602 | redirected? Defaults to True on Windows and Mac, False | |
7603 | otherwise. If `filename` is None then output will be | |
7604 | redirected to a window that pops up as needed. (You can | |
7605 | control what kind of window is created for the output by | |
7606 | resetting the class variable ``outputWindowClass`` to a | |
7607 | class of your choosing.) | |
7608 | ||
7609 | :param filename: The name of a file to redirect output to, if | |
7610 | redirect is True. | |
7611 | ||
7612 | :param useBestVisual: Should the app try to use the best | |
7613 | available visual provided by the system (only relevant on | |
7614 | systems that have more than one visual.) This parameter | |
7615 | must be used instead of calling `SetUseBestVisual` later | |
7616 | on because it must be set before the underlying GUI | |
7617 | toolkit is initialized. | |
7618 | ||
7619 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7620 | app to terminate upon a Ctrl-C in the console like other | |
7621 | GUI apps will. | |
7622 | ||
7623 | :note: You should override OnInit to do applicaition | |
7624 | initialization to ensure that the system, toolkit and | |
7625 | wxWidgets are fully initialized. | |
7626 | """ | |
d55e5bfc RD |
7627 | wx.PyApp.__init__(self) |
7628 | ||
7629 | if wx.Platform == "__WXMAC__": | |
7630 | try: | |
7631 | import MacOS | |
7632 | if not MacOS.WMAvailable(): | |
7633 | print """\ | |
7634 | This program needs access to the screen. Please run with 'pythonw', | |
7635 | not 'python', and only when you are logged in on the main display of | |
7636 | your Mac.""" | |
7637 | _sys.exit(1) | |
0346c964 RD |
7638 | except SystemExit: |
7639 | raise | |
d55e5bfc RD |
7640 | except: |
7641 | pass | |
7642 | ||
7643 | # This has to be done before OnInit | |
7644 | self.SetUseBestVisual(useBestVisual) | |
7645 | ||
7646 | # Set the default handler for SIGINT. This fixes a problem | |
7647 | # where if Ctrl-C is pressed in the console that started this | |
7648 | # app then it will not appear to do anything, (not even send | |
7649 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7650 | # setting the default handler then the app will exit, as | |
7651 | # expected (depending on platform.) | |
d6c14a4c RD |
7652 | if clearSigInt: |
7653 | try: | |
7654 | import signal | |
7655 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7656 | except: | |
7657 | pass | |
d55e5bfc RD |
7658 | |
7659 | # Save and redirect the stdio to a window? | |
7660 | self.stdioWin = None | |
7661 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7662 | if redirect: | |
7663 | self.RedirectStdio(filename) | |
7664 | ||
8fb0e70a RD |
7665 | # Use Python's install prefix as the default |
7666 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7667 | ||
d55e5bfc RD |
7668 | # This finishes the initialization of wxWindows and then calls |
7669 | # the OnInit that should be present in the derived class | |
7670 | self._BootstrapApp() | |
7671 | ||
7672 | ||
66af7a75 RD |
7673 | def __del__(self, destroy=wx.PyApp.__del__): |
7674 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7675 | destroy(self) | |
d55e5bfc | 7676 | |
7993762b RD |
7677 | def Destroy(self): |
7678 | wx.PyApp.Destroy(self) | |
7679 | self.thisown = 0 | |
d55e5bfc RD |
7680 | |
7681 | def SetTopWindow(self, frame): | |
7682 | """Set the \"main\" top level window""" | |
7683 | if self.stdioWin: | |
7684 | self.stdioWin.SetParent(frame) | |
7685 | wx.PyApp.SetTopWindow(self, frame) | |
7686 | ||
7687 | ||
7688 | def MainLoop(self): | |
7689 | """Execute the main GUI event loop""" | |
7690 | wx.PyApp.MainLoop(self) | |
7691 | self.RestoreStdio() | |
7692 | ||
7693 | ||
7694 | def RedirectStdio(self, filename=None): | |
7695 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" | |
7696 | if filename: | |
7697 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7698 | else: | |
7699 | self.stdioWin = self.outputWindowClass() | |
7700 | _sys.stdout = _sys.stderr = self.stdioWin | |
7701 | ||
7702 | ||
7703 | def RestoreStdio(self): | |
66af7a75 RD |
7704 | try: |
7705 | _sys.stdout, _sys.stderr = self.saveStdio | |
7706 | except: | |
7707 | pass | |
d55e5bfc RD |
7708 | |
7709 | ||
412d302d RD |
7710 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7711 | """ | |
7712 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7713 | the stdio has been redirected. This should be called before |
7714 | any output would cause the output window to be created. | |
412d302d RD |
7715 | """ |
7716 | if self.stdioWin: | |
7717 | if title is not None: | |
7718 | self.stdioWin.title = title | |
7719 | if pos is not None: | |
7720 | self.stdioWin.pos = pos | |
7721 | if size is not None: | |
7722 | self.stdioWin.size = size | |
7723 | ||
7724 | ||
7725 | ||
d55e5bfc | 7726 | |
d6c14a4c | 7727 | # change from wx.PyApp_XX to wx.App_XX |
d55e5bfc RD |
7728 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7729 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7730 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7731 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7732 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7733 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7734 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7735 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7736 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7737 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7738 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
7739 | ||
7740 | #---------------------------------------------------------------------------- | |
7741 | ||
7742 | class PySimpleApp(wx.App): | |
7743 | """ | |
7744 | A simple application class. You can just create one of these and | |
7745 | then then make your top level windows later, and not have to worry | |
d6c14a4c | 7746 | about OnInit. For example:: |
d55e5bfc | 7747 | |
d6c14a4c RD |
7748 | app = wx.PySimpleApp() |
7749 | frame = wx.Frame(None, title='Hello World') | |
7750 | frame.Show() | |
7751 | app.MainLoop() | |
7752 | ||
7753 | :see: `wx.App` | |
7754 | """ | |
7755 | ||
7756 | def __init__(self, redirect=False, filename=None, | |
7757 | useBestVisual=False, clearSigInt=True): | |
7758 | """ | |
7759 | :see: `wx.App.__init__` | |
7760 | """ | |
7761 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) | |
d55e5bfc RD |
7762 | |
7763 | def OnInit(self): | |
d55e5bfc RD |
7764 | return True |
7765 | ||
7766 | ||
d6c14a4c | 7767 | |
d55e5bfc RD |
7768 | # Is anybody using this one? |
7769 | class PyWidgetTester(wx.App): | |
7770 | def __init__(self, size = (250, 100)): | |
7771 | self.size = size | |
7772 | wx.App.__init__(self, 0) | |
7773 | ||
7774 | def OnInit(self): | |
7775 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) | |
7776 | self.SetTopWindow(self.frame) | |
7777 | return True | |
7778 | ||
d6c14a4c RD |
7779 | def SetWidget(self, widgetClass, *args, **kwargs): |
7780 | w = widgetClass(self.frame, *args, **kwargs) | |
d55e5bfc RD |
7781 | self.frame.Show(True) |
7782 | ||
7783 | #---------------------------------------------------------------------------- | |
7784 | # DO NOT hold any other references to this object. This is how we | |
d6c14a4c | 7785 | # know when to cleanup system resources that wxWidgets is holding. When |
d55e5bfc | 7786 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
d6c14a4c | 7787 | # goes to zero and it calls the wx.App_CleanUp function. |
d55e5bfc RD |
7788 | |
7789 | class __wxPyCleanup: | |
7790 | def __init__(self): | |
7791 | self.cleanup = _core_.App_CleanUp | |
7792 | def __del__(self): | |
7793 | self.cleanup() | |
7794 | ||
7795 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7796 | ||
7797 | ## # another possible solution, but it gets called too early... | |
d6c14a4c RD |
7798 | ## import atexit |
7799 | ## atexit.register(_core_.wxApp_CleanUp) | |
d55e5bfc RD |
7800 | |
7801 | ||
7802 | #---------------------------------------------------------------------------- | |
7803 | ||
7804 | #--------------------------------------------------------------------------- | |
7805 | ||
5b5c9bc7 RD |
7806 | class EventLoop(object): |
7807 | """Proxy of C++ EventLoop class""" | |
b411df4a RD |
7808 | def __repr__(self): |
7809 | return "<%s.%s; proxy of C++ wxEventLoop instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7810 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
7811 | """__init__(self) -> EventLoop""" |
7812 | newobj = _core_.new_EventLoop(*args, **kwargs) | |
b411df4a RD |
7813 | self.this = newobj.this |
7814 | self.thisown = 1 | |
7815 | del newobj.thisown | |
5b5c9bc7 | 7816 | def __del__(self, destroy=_core_.delete_EventLoop): |
b411df4a RD |
7817 | """__del__(self)""" |
7818 | try: | |
7819 | if self.thisown: destroy(self) | |
7820 | except: pass | |
7821 | ||
7822 | def Run(*args, **kwargs): | |
7823 | """Run(self) -> int""" | |
5b5c9bc7 | 7824 | return _core_.EventLoop_Run(*args, **kwargs) |
b411df4a RD |
7825 | |
7826 | def Exit(*args, **kwargs): | |
7827 | """Exit(self, int rc=0)""" | |
5b5c9bc7 | 7828 | return _core_.EventLoop_Exit(*args, **kwargs) |
b411df4a RD |
7829 | |
7830 | def Pending(*args, **kwargs): | |
7831 | """Pending(self) -> bool""" | |
5b5c9bc7 | 7832 | return _core_.EventLoop_Pending(*args, **kwargs) |
b411df4a RD |
7833 | |
7834 | def Dispatch(*args, **kwargs): | |
7835 | """Dispatch(self) -> bool""" | |
5b5c9bc7 | 7836 | return _core_.EventLoop_Dispatch(*args, **kwargs) |
b411df4a RD |
7837 | |
7838 | def IsRunning(*args, **kwargs): | |
7839 | """IsRunning(self) -> bool""" | |
5b5c9bc7 | 7840 | return _core_.EventLoop_IsRunning(*args, **kwargs) |
b411df4a RD |
7841 | |
7842 | def GetActive(*args, **kwargs): | |
5b5c9bc7 RD |
7843 | """GetActive() -> EventLoop""" |
7844 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
b411df4a RD |
7845 | |
7846 | GetActive = staticmethod(GetActive) | |
7847 | def SetActive(*args, **kwargs): | |
5b5c9bc7 RD |
7848 | """SetActive(EventLoop loop)""" |
7849 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
b411df4a RD |
7850 | |
7851 | SetActive = staticmethod(SetActive) | |
7852 | ||
5b5c9bc7 | 7853 | class EventLoopPtr(EventLoop): |
b411df4a RD |
7854 | def __init__(self, this): |
7855 | self.this = this | |
7856 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7857 | self.__class__ = EventLoop |
7858 | _core_.EventLoop_swigregister(EventLoopPtr) | |
b411df4a | 7859 | |
5b5c9bc7 RD |
7860 | def EventLoop_GetActive(*args, **kwargs): |
7861 | """EventLoop_GetActive() -> EventLoop""" | |
7862 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
b411df4a | 7863 | |
5b5c9bc7 RD |
7864 | def EventLoop_SetActive(*args, **kwargs): |
7865 | """EventLoop_SetActive(EventLoop loop)""" | |
7866 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
b411df4a RD |
7867 | |
7868 | #--------------------------------------------------------------------------- | |
7869 | ||
5b5c9bc7 | 7870 | class AcceleratorEntry(object): |
d6c14a4c RD |
7871 | """ |
7872 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7873 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7874 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
15817c7e | 7875 | as well. See `__init__` for of the tuple values. |
d6c14a4c RD |
7876 | |
7877 | :see: `wx.AcceleratorTable` | |
7878 | """ | |
d55e5bfc RD |
7879 | def __repr__(self): |
7880 | return "<%s.%s; proxy of C++ wxAcceleratorEntry instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7881 | def __init__(self, *args, **kwargs): | |
d6c14a4c | 7882 | """ |
5b5c9bc7 | 7883 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry |
d6c14a4c RD |
7884 | |
7885 | Construct a wx.AcceleratorEntry. | |
d6c14a4c | 7886 | """ |
5b5c9bc7 | 7887 | newobj = _core_.new_AcceleratorEntry(*args, **kwargs) |
d55e5bfc RD |
7888 | self.this = newobj.this |
7889 | self.thisown = 1 | |
7890 | del newobj.thisown | |
5b5c9bc7 | 7891 | def __del__(self, destroy=_core_.delete_AcceleratorEntry): |
d55e5bfc RD |
7892 | """__del__(self)""" |
7893 | try: | |
7894 | if self.thisown: destroy(self) | |
7895 | except: pass | |
7896 | ||
7897 | def Set(*args, **kwargs): | |
d6c14a4c RD |
7898 | """ |
7899 | Set(self, int flags, int keyCode, int cmd) | |
d55e5bfc | 7900 | |
d6c14a4c RD |
7901 | (Re)set the attributes of a wx.AcceleratorEntry. |
7902 | :see `__init__` | |
7903 | """ | |
5b5c9bc7 | 7904 | return _core_.AcceleratorEntry_Set(*args, **kwargs) |
d55e5bfc RD |
7905 | |
7906 | def GetFlags(*args, **kwargs): | |
d6c14a4c RD |
7907 | """ |
7908 | GetFlags(self) -> int | |
7909 | ||
7910 | Get the AcceleratorEntry's flags. | |
7911 | """ | |
5b5c9bc7 | 7912 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
d55e5bfc RD |
7913 | |
7914 | def GetKeyCode(*args, **kwargs): | |
d6c14a4c RD |
7915 | """ |
7916 | GetKeyCode(self) -> int | |
7917 | ||
7918 | Get the AcceleratorEntry's keycode. | |
7919 | """ | |
5b5c9bc7 | 7920 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
d55e5bfc RD |
7921 | |
7922 | def GetCommand(*args, **kwargs): | |
d6c14a4c RD |
7923 | """ |
7924 | GetCommand(self) -> int | |
7925 | ||
7926 | Get the AcceleratorEntry's command ID. | |
7927 | """ | |
5b5c9bc7 | 7928 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
d55e5bfc RD |
7929 | |
7930 | ||
5b5c9bc7 | 7931 | class AcceleratorEntryPtr(AcceleratorEntry): |
d55e5bfc RD |
7932 | def __init__(self, this): |
7933 | self.this = this | |
7934 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7935 | self.__class__ = AcceleratorEntry |
7936 | _core_.AcceleratorEntry_swigregister(AcceleratorEntryPtr) | |
d55e5bfc | 7937 | |
5b5c9bc7 | 7938 | class AcceleratorTable(Object): |
d6c14a4c RD |
7939 | """ |
7940 | An accelerator table allows the application to specify a table of | |
7941 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7942 | button commands are supported; on GTK, only menu commands are | |
7943 | supported. | |
d6c14a4c | 7944 | """ |
d55e5bfc RD |
7945 | def __repr__(self): |
7946 | return "<%s.%s; proxy of C++ wxAcceleratorTable instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7947 | def __init__(self, *args, **kwargs): | |
7948 | """ | |
7949 | __init__(entries) -> AcceleratorTable | |
7950 | ||
d6c14a4c RD |
7951 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7952 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7953 | ||
7954 | :see: `wx.AcceleratorEntry` | |
d55e5bfc | 7955 | """ |
5b5c9bc7 | 7956 | newobj = _core_.new_AcceleratorTable(*args, **kwargs) |
d55e5bfc RD |
7957 | self.this = newobj.this |
7958 | self.thisown = 1 | |
7959 | del newobj.thisown | |
5b5c9bc7 | 7960 | def __del__(self, destroy=_core_.delete_AcceleratorTable): |
d55e5bfc RD |
7961 | """__del__(self)""" |
7962 | try: | |
7963 | if self.thisown: destroy(self) | |
7964 | except: pass | |
7965 | ||
7966 | def Ok(*args, **kwargs): | |
7967 | """Ok(self) -> bool""" | |
5b5c9bc7 | 7968 | return _core_.AcceleratorTable_Ok(*args, **kwargs) |
d55e5bfc RD |
7969 | |
7970 | ||
5b5c9bc7 | 7971 | class AcceleratorTablePtr(AcceleratorTable): |
d55e5bfc RD |
7972 | def __init__(self, this): |
7973 | self.this = this | |
7974 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
7975 | self.__class__ = AcceleratorTable |
7976 | _core_.AcceleratorTable_swigregister(AcceleratorTablePtr) | |
d55e5bfc RD |
7977 | |
7978 | ||
5b5c9bc7 RD |
7979 | def GetAccelFromString(*args, **kwargs): |
7980 | """GetAccelFromString(String label) -> AcceleratorEntry""" | |
7981 | return _core_.GetAccelFromString(*args, **kwargs) | |
d55e5bfc RD |
7982 | #--------------------------------------------------------------------------- |
7983 | ||
5b5c9bc7 | 7984 | class VisualAttributes(object): |
d55e5bfc RD |
7985 | """struct containing all the visual attributes of a control""" |
7986 | def __repr__(self): | |
7987 | return "<%s.%s; proxy of C++ wxVisualAttributes instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
7988 | def __init__(self, *args, **kwargs): | |
7989 | """ | |
5b5c9bc7 | 7990 | __init__(self) -> VisualAttributes |
d55e5bfc RD |
7991 | |
7992 | struct containing all the visual attributes of a control | |
7993 | """ | |
5b5c9bc7 | 7994 | newobj = _core_.new_VisualAttributes(*args, **kwargs) |
d55e5bfc RD |
7995 | self.this = newobj.this |
7996 | self.thisown = 1 | |
7997 | del newobj.thisown | |
5b5c9bc7 | 7998 | def __del__(self, destroy=_core_.delete_VisualAttributes): |
d55e5bfc RD |
7999 | """__del__(self)""" |
8000 | try: | |
8001 | if self.thisown: destroy(self) | |
8002 | except: pass | |
8003 | ||
5b5c9bc7 RD |
8004 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) |
8005 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
8006 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
d55e5bfc | 8007 | |
5b5c9bc7 | 8008 | class VisualAttributesPtr(VisualAttributes): |
d55e5bfc RD |
8009 | def __init__(self, this): |
8010 | self.this = this | |
8011 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
8012 | self.__class__ = VisualAttributes |
8013 | _core_.VisualAttributes_swigregister(VisualAttributesPtr) | |
8014 | NullAcceleratorTable = cvar.NullAcceleratorTable | |
d55e5bfc RD |
8015 | PanelNameStr = cvar.PanelNameStr |
8016 | ||
5b5c9bc7 RD |
8017 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
8018 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
8019 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
8020 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
8021 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
8022 | class Window(EvtHandler): | |
d55e5bfc RD |
8023 | """ |
8024 | wx.Window is the base class for all windows and represents any visible | |
8025 | object on the screen. All controls, top level windows and so on are | |
8026 | wx.Windows. Sizers and device contexts are not however, as they don't | |
8027 | appear on screen themselves. | |
8028 | ||
8029 | """ | |
8030 | def __repr__(self): | |
8031 | return "<%s.%s; proxy of C++ wxWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
8032 | def __init__(self, *args, **kwargs): | |
8033 | """ | |
5b5c9bc7 RD |
8034 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
8035 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window | |
d55e5bfc RD |
8036 | |
8037 | Construct and show a generic Window. | |
8038 | """ | |
5b5c9bc7 | 8039 | newobj = _core_.new_Window(*args, **kwargs) |
d55e5bfc RD |
8040 | self.this = newobj.this |
8041 | self.thisown = 1 | |
8042 | del newobj.thisown | |
8043 | self._setOORInfo(self) | |
8044 | ||
8045 | def Create(*args, **kwargs): | |
8046 | """ | |
5b5c9bc7 RD |
8047 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
8048 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool | |
d55e5bfc RD |
8049 | |
8050 | Create the GUI part of the Window for 2-phase creation mode. | |
8051 | """ | |
5b5c9bc7 | 8052 | return _core_.Window_Create(*args, **kwargs) |
d55e5bfc RD |
8053 | |
8054 | def Close(*args, **kwargs): | |
8055 | """ | |
8056 | Close(self, bool force=False) -> bool | |
8057 | ||
8058 | This function simply generates a EVT_CLOSE event whose handler usually | |
8059 | tries to close the window. It doesn't close the window itself, | |
8060 | however. If force is False (the default) then the window's close | |
8061 | handler will be allowed to veto the destruction of the window. | |
d55e5bfc | 8062 | """ |
5b5c9bc7 | 8063 | return _core_.Window_Close(*args, **kwargs) |
d55e5bfc RD |
8064 | |
8065 | def Destroy(*args, **kwargs): | |
8066 | """ | |
8067 | Destroy(self) -> bool | |
8068 | ||
8069 | Destroys the window safely. Frames and dialogs are not destroyed | |
8070 | immediately when this function is called -- they are added to a list | |
8071 | of windows to be deleted on idle time, when all the window's events | |
8072 | have been processed. This prevents problems with events being sent to | |
8073 | non-existent windows. | |
8074 | ||
8075 | Returns True if the window has either been successfully deleted, or it | |
8076 | has been added to the list of windows pending real deletion. | |
8077 | """ | |
5b5c9bc7 | 8078 | return _core_.Window_Destroy(*args, **kwargs) |
d55e5bfc RD |
8079 | |
8080 | def DestroyChildren(*args, **kwargs): | |
8081 | """ | |
8082 | DestroyChildren(self) -> bool | |
8083 | ||
15817c7e RD |
8084 | Destroys all children of a window. Called automatically by the |
8085 | destructor. | |
d55e5bfc | 8086 | """ |
5b5c9bc7 | 8087 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d55e5bfc RD |
8088 | |
8089 | def IsBeingDeleted(*args, **kwargs): | |
8090 | """ | |
8091 | IsBeingDeleted(self) -> bool | |
8092 | ||
8093 | Is the window in the process of being deleted? | |
8094 | """ | |
5b5c9bc7 | 8095 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d55e5bfc | 8096 | |
d55e5bfc RD |
8097 | def SetLabel(*args, **kwargs): |
8098 | """ | |
5b5c9bc7 | 8099 | SetLabel(self, String label) |
d55e5bfc RD |
8100 | |
8101 | Set the text which the window shows in its label if applicable. | |
8102 | """ | |
5b5c9bc7 | 8103 | return _core_.Window_SetLabel(*args, **kwargs) |
d55e5bfc RD |
8104 | |
8105 | def GetLabel(*args, **kwargs): | |
8106 | """ | |
5b5c9bc7 | 8107 | GetLabel(self) -> String |
d55e5bfc | 8108 | |
15817c7e RD |
8109 | Generic way of getting a label from any window, for identification |
8110 | purposes. The interpretation of this function differs from class to | |
8111 | class. For frames and dialogs, the value returned is the title. For | |
8112 | buttons or static text controls, it is the button text. This function | |
8113 | can be useful for meta-programs such as testing tools or special-needs | |
8114 | access programs)which need to identify windows by name. | |
d55e5bfc | 8115 | """ |
5b5c9bc7 | 8116 | return _core_.Window_GetLabel(*args, **kwargs) |
d55e5bfc RD |
8117 | |
8118 | def SetName(*args, **kwargs): | |
8119 | """ | |
5b5c9bc7 | 8120 | SetName(self, String name) |
d55e5bfc | 8121 | |
15817c7e RD |
8122 | Sets the window's name. The window name is used for ressource setting |
8123 | in X, it is not the same as the window title/label | |
d55e5bfc | 8124 | """ |
5b5c9bc7 | 8125 | return _core_.Window_SetName(*args, **kwargs) |
d55e5bfc RD |
8126 | |
8127 | def GetName(*args, **kwargs): | |
8128 | """ | |
5b5c9bc7 | 8129 | GetName(self) -> String |
d55e5bfc | 8130 | |
15817c7e RD |
8131 | Returns the windows name. This name is not guaranteed to be unique; |
8132 | it is up to the programmer to supply an appropriate name in the window | |
8133 | constructor or via wx.Window.SetName. | |
d55e5bfc | 8134 | """ |
5b5c9bc7 | 8135 | return _core_.Window_GetName(*args, **kwargs) |
d55e5bfc RD |
8136 | |
8137 | def SetWindowVariant(*args, **kwargs): | |
8138 | """ | |
8139 | SetWindowVariant(self, int variant) | |
8140 | ||
15817c7e RD |
8141 | Sets the variant of the window/font size to use for this window, if |
8142 | the platform supports variants, for example, wxMac. | |
d55e5bfc | 8143 | """ |
5b5c9bc7 | 8144 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
d55e5bfc RD |
8145 | |
8146 | def GetWindowVariant(*args, **kwargs): | |
8147 | """GetWindowVariant(self) -> int""" | |
5b5c9bc7 | 8148 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
d55e5bfc RD |
8149 | |
8150 | def SetId(*args, **kwargs): | |
8151 | """ | |
8152 | SetId(self, int winid) | |
8153 | ||
8154 | Sets the identifier of the window. Each window has an integer | |
8155 | identifier. If the application has not provided one, an identifier | |
8156 | will be generated. Normally, the identifier should be provided on | |
8157 | creation and should not be modified subsequently. | |
8158 | """ | |
5b5c9bc7 | 8159 | return _core_.Window_SetId(*args, **kwargs) |
d55e5bfc RD |
8160 | |
8161 | def GetId(*args, **kwargs): | |
8162 | """ | |
8163 | GetId(self) -> int | |
8164 | ||
8165 | Returns the identifier of the window. Each window has an integer | |
8166 | identifier. If the application has not provided one (or the default Id | |
8167 | -1 is used) then an unique identifier with a negative value will be | |
8168 | generated. | |
8169 | """ | |
5b5c9bc7 | 8170 | return _core_.Window_GetId(*args, **kwargs) |
d55e5bfc RD |
8171 | |
8172 | def NewControlId(*args, **kwargs): | |
8173 | """ | |
d6c14a4c | 8174 | NewControlId() -> int |
d55e5bfc RD |
8175 | |
8176 | Generate a control id for the controls which were not given one. | |
8177 | """ | |
5b5c9bc7 | 8178 | return _core_.Window_NewControlId(*args, **kwargs) |
d55e5bfc RD |
8179 | |
8180 | NewControlId = staticmethod(NewControlId) | |
8181 | def NextControlId(*args, **kwargs): | |
8182 | """ | |
d6c14a4c | 8183 | NextControlId(int winid) -> int |
d55e5bfc RD |
8184 | |
8185 | Get the id of the control following the one with the given | |
15817c7e | 8186 | autogenerated) id |
d55e5bfc | 8187 | """ |
5b5c9bc7 | 8188 | return _core_.Window_NextControlId(*args, **kwargs) |
d55e5bfc RD |
8189 | |
8190 | NextControlId = staticmethod(NextControlId) | |
8191 | def PrevControlId(*args, **kwargs): | |
8192 | """ | |
d6c14a4c | 8193 | PrevControlId(int winid) -> int |
d55e5bfc RD |
8194 | |
8195 | Get the id of the control preceding the one with the given | |
15817c7e | 8196 | autogenerated) id |
d55e5bfc | 8197 | """ |
5b5c9bc7 | 8198 | return _core_.Window_PrevControlId(*args, **kwargs) |
d55e5bfc RD |
8199 | |
8200 | PrevControlId = staticmethod(PrevControlId) | |
8201 | def SetSize(*args, **kwargs): | |
8202 | """ | |
5b5c9bc7 | 8203 | SetSize(self, Size size) |
d55e5bfc RD |
8204 | |
8205 | Sets the size of the window in pixels. | |
8206 | """ | |
5b5c9bc7 | 8207 | return _core_.Window_SetSize(*args, **kwargs) |
d55e5bfc RD |
8208 | |
8209 | def SetDimensions(*args, **kwargs): | |
8210 | """ | |
5b5c9bc7 | 8211 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
d55e5bfc RD |
8212 | |
8213 | Sets the position and size of the window in pixels. The sizeFlags | |
8214 | parameter indicates the interpretation of the other params if they are | |
62d32a5f RD |
8215 | equal to -1. |
8216 | ||
8217 | ======================== ====================================== | |
8218 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
8219 | default should be used. | |
8220 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
8221 | -1 values are supplied. | |
8222 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
8223 | interpreted as real dimensions, not | |
8224 | default values. | |
8225 | ======================== ====================================== | |
8226 | ||
d55e5bfc | 8227 | """ |
5b5c9bc7 | 8228 | return _core_.Window_SetDimensions(*args, **kwargs) |
d55e5bfc RD |
8229 | |
8230 | def SetRect(*args, **kwargs): | |
8231 | """ | |
5b5c9bc7 | 8232 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
d55e5bfc RD |
8233 | |
8234 | Sets the position and size of the window in pixels using a wx.Rect. | |
8235 | """ | |
5b5c9bc7 | 8236 | return _core_.Window_SetRect(*args, **kwargs) |
d55e5bfc RD |
8237 | |
8238 | def SetSizeWH(*args, **kwargs): | |
8239 | """ | |
8240 | SetSizeWH(self, int width, int height) | |
8241 | ||
8242 | Sets the size of the window in pixels. | |
8243 | """ | |
5b5c9bc7 | 8244 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d55e5bfc RD |
8245 | |
8246 | def Move(*args, **kwargs): | |
8247 | """ | |
5b5c9bc7 | 8248 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
d55e5bfc RD |
8249 | |
8250 | Moves the window to the given position. | |
8251 | """ | |
5b5c9bc7 | 8252 | return _core_.Window_Move(*args, **kwargs) |
d55e5bfc RD |
8253 | |
8254 | SetPosition = Move | |
8255 | def MoveXY(*args, **kwargs): | |
8256 | """ | |
5b5c9bc7 | 8257 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
d55e5bfc RD |
8258 | |
8259 | Moves the window to the given position. | |
8260 | """ | |
5b5c9bc7 | 8261 | return _core_.Window_MoveXY(*args, **kwargs) |
d55e5bfc | 8262 | |
f8167d6e RD |
8263 | def SetBestFittingSize(*args, **kwargs): |
8264 | """ | |
5b5c9bc7 | 8265 | SetBestFittingSize(self, Size size=DefaultSize) |
f8167d6e RD |
8266 | |
8267 | A 'Smart' SetSize that will fill in default size components with the | |
8268 | window's *best size* values. Also set's the minsize for use with sizers. | |
8269 | """ | |
5b5c9bc7 | 8270 | return _core_.Window_SetBestFittingSize(*args, **kwargs) |
f8167d6e | 8271 | |
d55e5bfc RD |
8272 | def Raise(*args, **kwargs): |
8273 | """ | |
8274 | Raise(self) | |
8275 | ||
943e8dfd RD |
8276 | Raises the window to the top of the window hierarchy. In current |
8277 | version of wxWidgets this works both for manage and child windows. | |
d55e5bfc | 8278 | """ |
5b5c9bc7 | 8279 | return _core_.Window_Raise(*args, **kwargs) |
d55e5bfc RD |
8280 | |
8281 | def Lower(*args, **kwargs): | |
8282 | """ | |
8283 | Lower(self) | |
8284 | ||
943e8dfd RD |
8285 | Lowers the window to the bottom of the window hierarchy. In current |
8286 | version of wxWidgets this works both for manage and child windows. | |
d55e5bfc | 8287 | """ |
5b5c9bc7 | 8288 | return _core_.Window_Lower(*args, **kwargs) |
d55e5bfc RD |
8289 | |
8290 | def SetClientSize(*args, **kwargs): | |
8291 | """ | |
5b5c9bc7 | 8292 | SetClientSize(self, Size size) |
d55e5bfc RD |
8293 | |
8294 | This sets the size of the window client area in pixels. Using this | |
8295 | function to size a window tends to be more device-independent than | |
8296 | wx.Window.SetSize, since the application need not worry about what | |
8297 | dimensions the border or title bar have when trying to fit the window | |
8298 | around panel items, for example. | |
8299 | """ | |
5b5c9bc7 | 8300 | return _core_.Window_SetClientSize(*args, **kwargs) |
d55e5bfc RD |
8301 | |
8302 | def SetClientSizeWH(*args, **kwargs): | |
8303 | """ | |
8304 | SetClientSizeWH(self, int width, int height) | |
8305 | ||
8306 | This sets the size of the window client area in pixels. Using this | |
8307 | function to size a window tends to be more device-independent than | |
8308 | wx.Window.SetSize, since the application need not worry about what | |
8309 | dimensions the border or title bar have when trying to fit the window | |
8310 | around panel items, for example. | |
8311 | """ | |
5b5c9bc7 | 8312 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
d55e5bfc RD |
8313 | |
8314 | def SetClientRect(*args, **kwargs): | |
8315 | """ | |
5b5c9bc7 | 8316 | SetClientRect(self, Rect rect) |
d55e5bfc RD |
8317 | |
8318 | This sets the size of the window client area in pixels. Using this | |
8319 | function to size a window tends to be more device-independent than | |
8320 | wx.Window.SetSize, since the application need not worry about what | |
8321 | dimensions the border or title bar have when trying to fit the window | |
8322 | around panel items, for example. | |
8323 | """ | |
5b5c9bc7 | 8324 | return _core_.Window_SetClientRect(*args, **kwargs) |
d55e5bfc RD |
8325 | |
8326 | def GetPosition(*args, **kwargs): | |
8327 | """ | |
5b5c9bc7 | 8328 | GetPosition(self) -> Point |
d55e5bfc RD |
8329 | |
8330 | Get the window's position. | |
8331 | """ | |
5b5c9bc7 | 8332 | return _core_.Window_GetPosition(*args, **kwargs) |
d55e5bfc RD |
8333 | |
8334 | def GetPositionTuple(*args, **kwargs): | |
8335 | """ | |
8336 | GetPositionTuple() -> (x,y) | |
8337 | ||
8338 | Get the window's position. | |
8339 | """ | |
5b5c9bc7 | 8340 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
d55e5bfc RD |
8341 | |
8342 | def GetSize(*args, **kwargs): | |
8343 | """ | |
5b5c9bc7 | 8344 | GetSize(self) -> Size |
d55e5bfc RD |
8345 | |
8346 | Get the window size. | |
8347 | """ | |
5b5c9bc7 | 8348 | return _core_.Window_GetSize(*args, **kwargs) |
d55e5bfc RD |
8349 | |
8350 | def GetSizeTuple(*args, **kwargs): | |
8351 | """ | |
8352 | GetSizeTuple() -> (width, height) | |
8353 | ||
8354 | Get the window size. | |
8355 | """ | |
5b5c9bc7 | 8356 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
d55e5bfc RD |
8357 | |
8358 | def GetRect(*args, **kwargs): | |
8359 | """ | |
5b5c9bc7 | 8360 | GetRect(self) -> Rect |
d55e5bfc RD |
8361 | |
8362 | Returns the size and position of the window as a wx.Rect object. | |
8363 | """ | |
5b5c9bc7 | 8364 | return _core_.Window_GetRect(*args, **kwargs) |
d55e5bfc RD |
8365 | |
8366 | def GetClientSize(*args, **kwargs): | |
8367 | """ | |
5b5c9bc7 | 8368 | GetClientSize(self) -> Size |
d55e5bfc RD |
8369 | |
8370 | This gets the size of the window's 'client area' in pixels. The client | |
8371 | area is the area which may be drawn on by the programmer, excluding | |
8372 | title bar, border, scrollbars, etc. | |
8373 | """ | |
5b5c9bc7 | 8374 | return _core_.Window_GetClientSize(*args, **kwargs) |
d55e5bfc RD |
8375 | |
8376 | def GetClientSizeTuple(*args, **kwargs): | |
8377 | """ | |
8378 | GetClientSizeTuple() -> (width, height) | |
8379 | ||
8380 | This gets the size of the window's 'client area' in pixels. The client | |
8381 | area is the area which may be drawn on by the programmer, excluding | |
8382 | title bar, border, scrollbars, etc. | |
8383 | """ | |
5b5c9bc7 | 8384 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
d55e5bfc RD |
8385 | |
8386 | def GetClientAreaOrigin(*args, **kwargs): | |
8387 | """ | |
5b5c9bc7 | 8388 | GetClientAreaOrigin(self) -> Point |
d55e5bfc RD |
8389 | |
8390 | Get the origin of the client area of the window relative to the | |
8391 | window's top left corner (the client area may be shifted because of | |
8392 | the borders, scrollbars, other decorations...) | |
8393 | """ | |
5b5c9bc7 | 8394 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
d55e5bfc RD |
8395 | |
8396 | def GetClientRect(*args, **kwargs): | |
8397 | """ | |
5b5c9bc7 | 8398 | GetClientRect(self) -> Rect |
d55e5bfc | 8399 | |
0439c23b | 8400 | Get the client area position and size as a `wx.Rect` object. |
d55e5bfc | 8401 | """ |
5b5c9bc7 | 8402 | return _core_.Window_GetClientRect(*args, **kwargs) |
d55e5bfc RD |
8403 | |
8404 | def GetBestSize(*args, **kwargs): | |
8405 | """ | |
5b5c9bc7 | 8406 | GetBestSize(self) -> Size |
d55e5bfc | 8407 | |
bfddbb17 | 8408 | This function returns the best acceptable minimal size for the |
15817c7e RD |
8409 | window, if applicable. For example, for a static text control, it will |
8410 | be the minimal size such that the control label is not truncated. For | |
8411 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8412 | this function will be the same as the size the window would have had | |
8413 | after calling Fit. | |
d55e5bfc | 8414 | """ |
5b5c9bc7 | 8415 | return _core_.Window_GetBestSize(*args, **kwargs) |
d55e5bfc RD |
8416 | |
8417 | def GetBestSizeTuple(*args, **kwargs): | |
8418 | """ | |
8419 | GetBestSizeTuple() -> (width, height) | |
8420 | ||
bfddbb17 | 8421 | This function returns the best acceptable minimal size for the |
15817c7e RD |
8422 | window, if applicable. For example, for a static text control, it will |
8423 | be the minimal size such that the control label is not truncated. For | |
8424 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8425 | this function will be the same as the size the window would have had | |
8426 | after calling Fit. | |
d55e5bfc | 8427 | """ |
5b5c9bc7 | 8428 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
d55e5bfc | 8429 | |
a001823c RD |
8430 | def InvalidateBestSize(*args, **kwargs): |
8431 | """ | |
8432 | InvalidateBestSize(self) | |
8433 | ||
8434 | Reset the cached best size value so it will be recalculated the next | |
8435 | time it is needed. | |
8436 | """ | |
5b5c9bc7 | 8437 | return _core_.Window_InvalidateBestSize(*args, **kwargs) |
a001823c | 8438 | |
e2813725 RD |
8439 | def CacheBestSize(*args, **kwargs): |
8440 | """ | |
8441 | CacheBestSize(self, Size size) | |
8442 | ||
8443 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8444 | some properties of the window change.) | |
8445 | """ | |
8446 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8447 | ||
a001823c RD |
8448 | def GetBestFittingSize(*args, **kwargs): |
8449 | """ | |
5b5c9bc7 | 8450 | GetBestFittingSize(self) -> Size |
a001823c RD |
8451 | |
8452 | This function will merge the window's best size into the window's | |
8453 | minimum size, giving priority to the min size components, and returns | |
8454 | the results. | |
8455 | ||
8456 | """ | |
5b5c9bc7 | 8457 | return _core_.Window_GetBestFittingSize(*args, **kwargs) |
a001823c | 8458 | |
d55e5bfc RD |
8459 | def GetAdjustedBestSize(*args, **kwargs): |
8460 | """ | |
5b5c9bc7 | 8461 | GetAdjustedBestSize(self) -> Size |
d55e5bfc RD |
8462 | |
8463 | This method is similar to GetBestSize, except in one | |
8464 | thing. GetBestSize should return the minimum untruncated size of the | |
8465 | window, while this method will return the largest of BestSize and any | |
8466 | user specified minimum size. ie. it is the minimum size the window | |
8467 | should currently be drawn at, not the minimal size it can possibly | |
8468 | tolerate. | |
8469 | """ | |
5b5c9bc7 | 8470 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) |
d55e5bfc RD |
8471 | |
8472 | def Center(*args, **kwargs): | |
8473 | """ | |
5b5c9bc7 | 8474 | Center(self, int direction=BOTH) |
d55e5bfc RD |
8475 | |
8476 | Centers the window. The parameter specifies the direction for | |
8477 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8478 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8479 | on the entire screen and not on its parent window. If it is a | |
8480 | top-level window and has no parent then it will always be centered | |
8481 | relative to the screen. | |
8482 | """ | |
5b5c9bc7 | 8483 | return _core_.Window_Center(*args, **kwargs) |
d55e5bfc RD |
8484 | |
8485 | Centre = Center | |
8486 | def CenterOnScreen(*args, **kwargs): | |
8487 | """ | |
5b5c9bc7 | 8488 | CenterOnScreen(self, int dir=BOTH) |
d55e5bfc RD |
8489 | |
8490 | Center on screen (only works for top level windows) | |
8491 | """ | |
5b5c9bc7 | 8492 | return _core_.Window_CenterOnScreen(*args, **kwargs) |
d55e5bfc RD |
8493 | |
8494 | CentreOnScreen = CenterOnScreen | |
8495 | def CenterOnParent(*args, **kwargs): | |
8496 | """ | |
5b5c9bc7 | 8497 | CenterOnParent(self, int dir=BOTH) |
d55e5bfc RD |
8498 | |
8499 | Center with respect to the the parent window | |
8500 | """ | |
5b5c9bc7 | 8501 | return _core_.Window_CenterOnParent(*args, **kwargs) |
d55e5bfc RD |
8502 | |
8503 | CentreOnParent = CenterOnParent | |
8504 | def Fit(*args, **kwargs): | |
8505 | """ | |
8506 | Fit(self) | |
8507 | ||
8508 | Sizes the window so that it fits around its subwindows. This function | |
8509 | won't do anything if there are no subwindows and will only really work | |
8510 | correctly if sizers are used for the subwindows layout. Also, if the | |
8511 | window has exactly one subwindow it is better (faster and the result | |
8512 | is more precise as Fit adds some margin to account for fuzziness of | |
8513 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8514 | instead of calling Fit. | |
8515 | """ | |
5b5c9bc7 | 8516 | return _core_.Window_Fit(*args, **kwargs) |
d55e5bfc RD |
8517 | |
8518 | def FitInside(*args, **kwargs): | |
8519 | """ | |
8520 | FitInside(self) | |
8521 | ||
8522 | Similar to Fit, but sizes the interior (virtual) size of a | |
8523 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8524 | sizing changes that do not trigger a size event, and/or scrolled | |
8525 | windows without an interior sizer. This function similarly won't do | |
8526 | anything if there are no subwindows. | |
8527 | """ | |
5b5c9bc7 | 8528 | return _core_.Window_FitInside(*args, **kwargs) |
d55e5bfc | 8529 | |
03837c5c | 8530 | def SetSizeHints(*args, **kwargs): |
d55e5bfc RD |
8531 | """ |
8532 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, | |
8533 | int incH=-1) | |
d55e5bfc RD |
8534 | |
8535 | Allows specification of minimum and maximum window sizes, and window | |
8536 | size increments. If a pair of values is not set (or set to -1), the | |
8537 | default values will be used. If this function is called, the user | |
908b74cd RD |
8538 | will not be able to size the window outside the given bounds (if it is |
8539 | a top-level window.) Sizers will also inspect the minimum window size | |
8540 | and will use that value if set when calculating layout. | |
8541 | ||
8542 | The resizing increments are only significant under Motif or Xt. | |
d55e5bfc | 8543 | """ |
5b5c9bc7 | 8544 | return _core_.Window_SetSizeHints(*args, **kwargs) |
d55e5bfc | 8545 | |
03837c5c RD |
8546 | def SetSizeHintsSz(*args, **kwargs): |
8547 | """ | |
5b5c9bc7 | 8548 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) |
03837c5c RD |
8549 | |
8550 | Allows specification of minimum and maximum window sizes, and window | |
8551 | size increments. If a pair of values is not set (or set to -1), the | |
8552 | default values will be used. If this function is called, the user | |
8553 | will not be able to size the window outside the given bounds (if it is | |
8554 | a top-level window.) Sizers will also inspect the minimum window size | |
8555 | and will use that value if set when calculating layout. | |
8556 | ||
8557 | The resizing increments are only significant under Motif or Xt. | |
8558 | """ | |
5b5c9bc7 | 8559 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) |
03837c5c RD |
8560 | |
8561 | def SetVirtualSizeHints(*args, **kwargs): | |
d55e5bfc | 8562 | """ |
908b74cd | 8563 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
d55e5bfc RD |
8564 | |
8565 | Allows specification of minimum and maximum virtual window sizes. If a | |
8566 | pair of values is not set (or set to -1), the default values will be | |
8567 | used. If this function is called, the user will not be able to size | |
8568 | the virtual area of the window outside the given bounds. | |
8569 | """ | |
5b5c9bc7 | 8570 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
03837c5c RD |
8571 | |
8572 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8573 | """ | |
5b5c9bc7 | 8574 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) |
03837c5c RD |
8575 | |
8576 | Allows specification of minimum and maximum virtual window sizes. If a | |
8577 | pair of values is not set (or set to -1), the default values will be | |
8578 | used. If this function is called, the user will not be able to size | |
8579 | the virtual area of the window outside the given bounds. | |
8580 | """ | |
5b5c9bc7 | 8581 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) |
d55e5bfc | 8582 | |
908b74cd | 8583 | def GetMaxSize(*args, **kwargs): |
5b5c9bc7 RD |
8584 | """GetMaxSize(self) -> Size""" |
8585 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
908b74cd RD |
8586 | |
8587 | def GetMinSize(*args, **kwargs): | |
5b5c9bc7 RD |
8588 | """GetMinSize(self) -> Size""" |
8589 | return _core_.Window_GetMinSize(*args, **kwargs) | |
908b74cd RD |
8590 | |
8591 | def SetMinSize(*args, **kwargs): | |
8592 | """ | |
5b5c9bc7 | 8593 | SetMinSize(self, Size minSize) |
908b74cd RD |
8594 | |
8595 | A more convenient method than `SetSizeHints` for setting just the | |
8596 | min size. | |
8597 | """ | |
5b5c9bc7 | 8598 | return _core_.Window_SetMinSize(*args, **kwargs) |
908b74cd RD |
8599 | |
8600 | def SetMaxSize(*args, **kwargs): | |
8601 | """ | |
5b5c9bc7 | 8602 | SetMaxSize(self, Size maxSize) |
908b74cd RD |
8603 | |
8604 | A more convenient method than `SetSizeHints` for setting just the | |
8605 | max size. | |
8606 | """ | |
5b5c9bc7 | 8607 | return _core_.Window_SetMaxSize(*args, **kwargs) |
908b74cd | 8608 | |
d55e5bfc RD |
8609 | def GetMinWidth(*args, **kwargs): |
8610 | """GetMinWidth(self) -> int""" | |
5b5c9bc7 | 8611 | return _core_.Window_GetMinWidth(*args, **kwargs) |
d55e5bfc RD |
8612 | |
8613 | def GetMinHeight(*args, **kwargs): | |
8614 | """GetMinHeight(self) -> int""" | |
5b5c9bc7 | 8615 | return _core_.Window_GetMinHeight(*args, **kwargs) |
d55e5bfc RD |
8616 | |
8617 | def GetMaxWidth(*args, **kwargs): | |
8618 | """GetMaxWidth(self) -> int""" | |
5b5c9bc7 | 8619 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
d55e5bfc RD |
8620 | |
8621 | def GetMaxHeight(*args, **kwargs): | |
8622 | """GetMaxHeight(self) -> int""" | |
5b5c9bc7 | 8623 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
d55e5bfc | 8624 | |
d55e5bfc RD |
8625 | def SetVirtualSize(*args, **kwargs): |
8626 | """ | |
5b5c9bc7 | 8627 | SetVirtualSize(self, Size size) |
d55e5bfc RD |
8628 | |
8629 | Set the the virtual size of a window in pixels. For most windows this | |
8630 | is just the client area of the window, but for some like scrolled | |
8631 | windows it is more or less independent of the screen window size. | |
8632 | """ | |
5b5c9bc7 | 8633 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8634 | |
8635 | def SetVirtualSizeWH(*args, **kwargs): | |
8636 | """ | |
8637 | SetVirtualSizeWH(self, int w, int h) | |
8638 | ||
8639 | Set the the virtual size of a window in pixels. For most windows this | |
8640 | is just the client area of the window, but for some like scrolled | |
8641 | windows it is more or less independent of the screen window size. | |
8642 | """ | |
5b5c9bc7 | 8643 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
d55e5bfc RD |
8644 | |
8645 | def GetVirtualSize(*args, **kwargs): | |
8646 | """ | |
5b5c9bc7 | 8647 | GetVirtualSize(self) -> Size |
d55e5bfc RD |
8648 | |
8649 | Get the the virtual size of the window in pixels. For most windows | |
8650 | this is just the client area of the window, but for some like scrolled | |
8651 | windows it is more or less independent of the screen window size. | |
8652 | """ | |
5b5c9bc7 | 8653 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8654 | |
8655 | def GetVirtualSizeTuple(*args, **kwargs): | |
8656 | """ | |
8657 | GetVirtualSizeTuple() -> (width, height) | |
8658 | ||
8659 | Get the the virtual size of the window in pixels. For most windows | |
8660 | this is just the client area of the window, but for some like scrolled | |
8661 | windows it is more or less independent of the screen window size. | |
8662 | """ | |
5b5c9bc7 | 8663 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
d55e5bfc RD |
8664 | |
8665 | def GetBestVirtualSize(*args, **kwargs): | |
8666 | """ | |
5b5c9bc7 | 8667 | GetBestVirtualSize(self) -> Size |
d55e5bfc RD |
8668 | |
8669 | Return the largest of ClientSize and BestSize (as determined by a | |
8670 | sizer, interior children, or other means) | |
8671 | """ | |
5b5c9bc7 | 8672 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
d55e5bfc RD |
8673 | |
8674 | def Show(*args, **kwargs): | |
8675 | """ | |
8676 | Show(self, bool show=True) -> bool | |
8677 | ||
8678 | Shows or hides the window. You may need to call Raise for a top level | |
8679 | window if you want to bring it to top, although this is not needed if | |
8680 | Show is called immediately after the frame creation. Returns True if | |
8681 | the window has been shown or hidden or False if nothing was done | |
8682 | because it already was in the requested state. | |
8683 | """ | |
5b5c9bc7 | 8684 | return _core_.Window_Show(*args, **kwargs) |
d55e5bfc RD |
8685 | |
8686 | def Hide(*args, **kwargs): | |
8687 | """ | |
8688 | Hide(self) -> bool | |
8689 | ||
8690 | Equivalent to calling Show(False). | |
8691 | """ | |
5b5c9bc7 | 8692 | return _core_.Window_Hide(*args, **kwargs) |
d55e5bfc RD |
8693 | |
8694 | def Enable(*args, **kwargs): | |
8695 | """ | |
8696 | Enable(self, bool enable=True) -> bool | |
8697 | ||
8698 | Enable or disable the window for user input. Note that when a parent | |
8699 | window is disabled, all of its children are disabled as well and they | |
8700 | are reenabled again when the parent is. Returns true if the window | |
8701 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8702 | window had already been in the specified state. | |
8703 | """ | |
5b5c9bc7 | 8704 | return _core_.Window_Enable(*args, **kwargs) |
d55e5bfc RD |
8705 | |
8706 | def Disable(*args, **kwargs): | |
8707 | """ | |
8708 | Disable(self) -> bool | |
8709 | ||
8710 | Disables the window, same as Enable(false). | |
8711 | """ | |
5b5c9bc7 | 8712 | return _core_.Window_Disable(*args, **kwargs) |
d55e5bfc RD |
8713 | |
8714 | def IsShown(*args, **kwargs): | |
8715 | """ | |
8716 | IsShown(self) -> bool | |
8717 | ||
8718 | Returns true if the window is shown, false if it has been hidden. | |
8719 | """ | |
5b5c9bc7 | 8720 | return _core_.Window_IsShown(*args, **kwargs) |
d55e5bfc RD |
8721 | |
8722 | def IsEnabled(*args, **kwargs): | |
8723 | """ | |
8724 | IsEnabled(self) -> bool | |
8725 | ||
8726 | Returns true if the window is enabled for input, false otherwise. | |
8727 | """ | |
5b5c9bc7 | 8728 | return _core_.Window_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
8729 | |
8730 | def SetWindowStyleFlag(*args, **kwargs): | |
8731 | """ | |
8732 | SetWindowStyleFlag(self, long style) | |
8733 | ||
15817c7e RD |
8734 | Sets the style of the window. Please note that some styles cannot be |
8735 | changed after the window creation and that Refresh() might need to be | |
8736 | called after changing the others for the change to take place | |
8737 | immediately. | |
d55e5bfc | 8738 | """ |
5b5c9bc7 | 8739 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
d55e5bfc RD |
8740 | |
8741 | def GetWindowStyleFlag(*args, **kwargs): | |
8742 | """ | |
8743 | GetWindowStyleFlag(self) -> long | |
8744 | ||
8745 | Gets the window style that was passed to the constructor or Create | |
8746 | method. | |
8747 | """ | |
5b5c9bc7 | 8748 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
d55e5bfc RD |
8749 | |
8750 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag | |
8751 | def HasFlag(*args, **kwargs): | |
8752 | """ | |
8753 | HasFlag(self, int flag) -> bool | |
8754 | ||
8755 | Test if the given style is set for this window. | |
8756 | """ | |
5b5c9bc7 | 8757 | return _core_.Window_HasFlag(*args, **kwargs) |
d55e5bfc RD |
8758 | |
8759 | def IsRetained(*args, **kwargs): | |
8760 | """ | |
8761 | IsRetained(self) -> bool | |
8762 | ||
8763 | Returns true if the window is retained, false otherwise. Retained | |
8764 | windows are only available on X platforms. | |
8765 | """ | |
5b5c9bc7 | 8766 | return _core_.Window_IsRetained(*args, **kwargs) |
d55e5bfc RD |
8767 | |
8768 | def SetExtraStyle(*args, **kwargs): | |
8769 | """ | |
8770 | SetExtraStyle(self, long exStyle) | |
8771 | ||
8772 | Sets the extra style bits for the window. Extra styles are the less | |
8773 | often used style bits which can't be set with the constructor or with | |
8774 | SetWindowStyleFlag() | |
8775 | """ | |
5b5c9bc7 | 8776 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
d55e5bfc RD |
8777 | |
8778 | def GetExtraStyle(*args, **kwargs): | |
8779 | """ | |
8780 | GetExtraStyle(self) -> long | |
8781 | ||
8782 | Returns the extra style bits for the window. | |
8783 | """ | |
5b5c9bc7 | 8784 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
d55e5bfc RD |
8785 | |
8786 | def MakeModal(*args, **kwargs): | |
8787 | """ | |
8788 | MakeModal(self, bool modal=True) | |
8789 | ||
8790 | Disables all other windows in the application so that the user can | |
8791 | only interact with this window. Passing False will reverse this | |
8792 | effect. | |
8793 | """ | |
5b5c9bc7 | 8794 | return _core_.Window_MakeModal(*args, **kwargs) |
d55e5bfc RD |
8795 | |
8796 | def SetThemeEnabled(*args, **kwargs): | |
8797 | """ | |
8798 | SetThemeEnabled(self, bool enableTheme) | |
8799 | ||
8800 | This function tells a window if it should use the system's "theme" | |
8801 | code to draw the windows' background instead if its own background | |
8802 | drawing code. This will only have an effect on platforms that support | |
8803 | the notion of themes in user defined windows. One such platform is | |
8804 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8805 | user's selected theme. | |
8806 | ||
8807 | Dialogs, notebook pages and the status bar have this flag set to true | |
8808 | by default so that the default look and feel is simulated best. | |
8809 | """ | |
5b5c9bc7 | 8810 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
d55e5bfc RD |
8811 | |
8812 | def GetThemeEnabled(*args, **kwargs): | |
8813 | """ | |
8814 | GetThemeEnabled(self) -> bool | |
8815 | ||
8816 | Return the themeEnabled flag. | |
8817 | """ | |
5b5c9bc7 | 8818 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
d55e5bfc RD |
8819 | |
8820 | def SetFocus(*args, **kwargs): | |
8821 | """ | |
8822 | SetFocus(self) | |
8823 | ||
8824 | Set's the focus to this window, allowing it to receive keyboard input. | |
8825 | """ | |
5b5c9bc7 | 8826 | return _core_.Window_SetFocus(*args, **kwargs) |
d55e5bfc RD |
8827 | |
8828 | def SetFocusFromKbd(*args, **kwargs): | |
8829 | """ | |
8830 | SetFocusFromKbd(self) | |
8831 | ||
8832 | Set focus to this window as the result of a keyboard action. Normally | |
8833 | only called internally. | |
8834 | """ | |
5b5c9bc7 | 8835 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
d55e5bfc RD |
8836 | |
8837 | def FindFocus(*args, **kwargs): | |
8838 | """ | |
5b5c9bc7 | 8839 | FindFocus() -> Window |
d55e5bfc RD |
8840 | |
8841 | Returns the window or control that currently has the keyboard focus, | |
8842 | or None. | |
8843 | """ | |
5b5c9bc7 | 8844 | return _core_.Window_FindFocus(*args, **kwargs) |
d55e5bfc RD |
8845 | |
8846 | FindFocus = staticmethod(FindFocus) | |
8847 | def AcceptsFocus(*args, **kwargs): | |
8848 | """ | |
8849 | AcceptsFocus(self) -> bool | |
8850 | ||
8851 | Can this window have focus? | |
8852 | """ | |
5b5c9bc7 | 8853 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
d55e5bfc RD |
8854 | |
8855 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
8856 | """ | |
8857 | AcceptsFocusFromKeyboard(self) -> bool | |
8858 | ||
8859 | Can this window be given focus by keyboard navigation? if not, the | |
8860 | only way to give it focus (provided it accepts it at all) is to click | |
8861 | it. | |
8862 | """ | |
5b5c9bc7 | 8863 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
d55e5bfc RD |
8864 | |
8865 | def GetDefaultItem(*args, **kwargs): | |
8866 | """ | |
5b5c9bc7 | 8867 | GetDefaultItem(self) -> Window |
d55e5bfc RD |
8868 | |
8869 | Get the default child of this parent, i.e. the one which is activated | |
8870 | by pressing <Enter> such as the OK button on a wx.Dialog. | |
8871 | """ | |
5b5c9bc7 | 8872 | return _core_.Window_GetDefaultItem(*args, **kwargs) |
d55e5bfc RD |
8873 | |
8874 | def SetDefaultItem(*args, **kwargs): | |
8875 | """ | |
5b5c9bc7 | 8876 | SetDefaultItem(self, Window child) -> Window |
d55e5bfc RD |
8877 | |
8878 | Set this child as default, return the old default. | |
8879 | """ | |
5b5c9bc7 | 8880 | return _core_.Window_SetDefaultItem(*args, **kwargs) |
d55e5bfc RD |
8881 | |
8882 | def SetTmpDefaultItem(*args, **kwargs): | |
8883 | """ | |
5b5c9bc7 | 8884 | SetTmpDefaultItem(self, Window win) |
d55e5bfc RD |
8885 | |
8886 | Set this child as temporary default | |
8887 | """ | |
5b5c9bc7 | 8888 | return _core_.Window_SetTmpDefaultItem(*args, **kwargs) |
d55e5bfc | 8889 | |
908b74cd RD |
8890 | def Navigate(*args, **kwargs): |
8891 | """ | |
8892 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8893 | ||
fd2dc343 RD |
8894 | Does keyboard navigation from this window to another, by sending a |
8895 | `wx.NavigationKeyEvent`. | |
908b74cd | 8896 | """ |
5b5c9bc7 | 8897 | return _core_.Window_Navigate(*args, **kwargs) |
908b74cd | 8898 | |
bf26d883 RD |
8899 | def MoveAfterInTabOrder(*args, **kwargs): |
8900 | """ | |
5b5c9bc7 | 8901 | MoveAfterInTabOrder(self, Window win) |
bf26d883 RD |
8902 | |
8903 | Moves this window in the tab navigation order after the specified | |
8904 | sibling window. This means that when the user presses the TAB key on | |
8905 | that other window, the focus switches to this window. | |
8906 | ||
8907 | The default tab order is the same as creation order. This function | |
8908 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8909 | windows. | |
8910 | ||
8911 | """ | |
5b5c9bc7 | 8912 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) |
bf26d883 RD |
8913 | |
8914 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8915 | """ | |
5b5c9bc7 | 8916 | MoveBeforeInTabOrder(self, Window win) |
bf26d883 RD |
8917 | |
8918 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8919 | before win instead of putting it right after it. | |
8920 | """ | |
5b5c9bc7 | 8921 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) |
bf26d883 | 8922 | |
d55e5bfc RD |
8923 | def GetChildren(*args, **kwargs): |
8924 | """ | |
8925 | GetChildren(self) -> PyObject | |
8926 | ||
8927 | Returns a list of the window's children. NOTE: Currently this is a | |
8928 | copy of the child window list maintained by the window, so the return | |
8929 | value of this function is only valid as long as the window's children | |
8930 | do not change. | |
8931 | """ | |
5b5c9bc7 | 8932 | return _core_.Window_GetChildren(*args, **kwargs) |
d55e5bfc RD |
8933 | |
8934 | def GetParent(*args, **kwargs): | |
8935 | """ | |
5b5c9bc7 | 8936 | GetParent(self) -> Window |
d55e5bfc RD |
8937 | |
8938 | Returns the parent window of this window, or None if there isn't one. | |
8939 | """ | |
5b5c9bc7 | 8940 | return _core_.Window_GetParent(*args, **kwargs) |
d55e5bfc RD |
8941 | |
8942 | def GetGrandParent(*args, **kwargs): | |
8943 | """ | |
5b5c9bc7 | 8944 | GetGrandParent(self) -> Window |
d55e5bfc | 8945 | |
15817c7e RD |
8946 | Returns the parent of the parent of this window, or None if there |
8947 | isn't one. | |
d55e5bfc | 8948 | """ |
5b5c9bc7 | 8949 | return _core_.Window_GetGrandParent(*args, **kwargs) |
d55e5bfc RD |
8950 | |
8951 | def IsTopLevel(*args, **kwargs): | |
8952 | """ | |
8953 | IsTopLevel(self) -> bool | |
8954 | ||
8955 | Returns true if the given window is a top-level one. Currently all | |
8956 | frames and dialogs are always considered to be top-level windows (even | |
8957 | if they have a parent window). | |
8958 | """ | |
5b5c9bc7 | 8959 | return _core_.Window_IsTopLevel(*args, **kwargs) |
d55e5bfc RD |
8960 | |
8961 | def Reparent(*args, **kwargs): | |
8962 | """ | |
5b5c9bc7 | 8963 | Reparent(self, Window newParent) -> bool |
d55e5bfc RD |
8964 | |
8965 | Reparents the window, i.e the window will be removed from its current | |
8966 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
8967 | re-inserted into another. Available on Windows and GTK. Returns True | |
8968 | if the parent was changed, False otherwise (error or newParent == | |
8969 | oldParent) | |
8970 | """ | |
5b5c9bc7 | 8971 | return _core_.Window_Reparent(*args, **kwargs) |
d55e5bfc RD |
8972 | |
8973 | def AddChild(*args, **kwargs): | |
8974 | """ | |
5b5c9bc7 | 8975 | AddChild(self, Window child) |
d55e5bfc RD |
8976 | |
8977 | Adds a child window. This is called automatically by window creation | |
8978 | functions so should not be required by the application programmer. | |
8979 | """ | |
5b5c9bc7 | 8980 | return _core_.Window_AddChild(*args, **kwargs) |
d55e5bfc RD |
8981 | |
8982 | def RemoveChild(*args, **kwargs): | |
8983 | """ | |
5b5c9bc7 | 8984 | RemoveChild(self, Window child) |
d55e5bfc RD |
8985 | |
8986 | Removes a child window. This is called automatically by window | |
8987 | deletion functions so should not be required by the application | |
8988 | programmer. | |
8989 | """ | |
5b5c9bc7 | 8990 | return _core_.Window_RemoveChild(*args, **kwargs) |
d55e5bfc RD |
8991 | |
8992 | def FindWindowById(*args, **kwargs): | |
8993 | """ | |
5b5c9bc7 | 8994 | FindWindowById(self, long winid) -> Window |
d55e5bfc RD |
8995 | |
8996 | Find a chld of this window by window ID | |
8997 | """ | |
5b5c9bc7 | 8998 | return _core_.Window_FindWindowById(*args, **kwargs) |
d55e5bfc RD |
8999 | |
9000 | def FindWindowByName(*args, **kwargs): | |
9001 | """ | |
5b5c9bc7 | 9002 | FindWindowByName(self, String name) -> Window |
d55e5bfc RD |
9003 | |
9004 | Find a child of this window by name | |
9005 | """ | |
5b5c9bc7 | 9006 | return _core_.Window_FindWindowByName(*args, **kwargs) |
d55e5bfc RD |
9007 | |
9008 | def GetEventHandler(*args, **kwargs): | |
9009 | """ | |
5b5c9bc7 | 9010 | GetEventHandler(self) -> EvtHandler |
d55e5bfc RD |
9011 | |
9012 | Returns the event handler for this window. By default, the window is | |
9013 | its own event handler. | |
9014 | """ | |
5b5c9bc7 | 9015 | return _core_.Window_GetEventHandler(*args, **kwargs) |
d55e5bfc RD |
9016 | |
9017 | def SetEventHandler(*args, **kwargs): | |
9018 | """ | |
5b5c9bc7 | 9019 | SetEventHandler(self, EvtHandler handler) |
d55e5bfc RD |
9020 | |
9021 | Sets the event handler for this window. An event handler is an object | |
9022 | that is capable of processing the events sent to a window. By default, | |
9023 | the window is its own event handler, but an application may wish to | |
9024 | substitute another, for example to allow central implementation of | |
9025 | event-handling for a variety of different window classes. | |
9026 | ||
15817c7e | 9027 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
d55e5bfc RD |
9028 | up a chain of event handlers, where an event not handled by one event |
9029 | handler is handed to the next one in the chain. | |
9030 | """ | |
5b5c9bc7 | 9031 | return _core_.Window_SetEventHandler(*args, **kwargs) |
d55e5bfc RD |
9032 | |
9033 | def PushEventHandler(*args, **kwargs): | |
9034 | """ | |
5b5c9bc7 | 9035 | PushEventHandler(self, EvtHandler handler) |
d55e5bfc RD |
9036 | |
9037 | Pushes this event handler onto the event handler stack for the window. | |
9038 | An event handler is an object that is capable of processing the events | |
9039 | sent to a window. By default, the window is its own event handler, but | |
9040 | an application may wish to substitute another, for example to allow | |
9041 | central implementation of event-handling for a variety of different | |
9042 | window classes. | |
9043 | ||
9044 | wx.Window.PushEventHandler allows an application to set up a chain of | |
9045 | event handlers, where an event not handled by one event handler is | |
15817c7e | 9046 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` to |
d55e5bfc RD |
9047 | remove the event handler. |
9048 | """ | |
5b5c9bc7 | 9049 | return _core_.Window_PushEventHandler(*args, **kwargs) |
d55e5bfc RD |
9050 | |
9051 | def PopEventHandler(*args, **kwargs): | |
9052 | """ | |
5b5c9bc7 | 9053 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
d55e5bfc RD |
9054 | |
9055 | Removes and returns the top-most event handler on the event handler | |
9056 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
9057 | destroyed after it is popped. | |
9058 | """ | |
5b5c9bc7 | 9059 | return _core_.Window_PopEventHandler(*args, **kwargs) |
d55e5bfc RD |
9060 | |
9061 | def RemoveEventHandler(*args, **kwargs): | |
9062 | """ | |
5b5c9bc7 | 9063 | RemoveEventHandler(self, EvtHandler handler) -> bool |
d55e5bfc | 9064 | |
15817c7e RD |
9065 | Find the given handler in the event handler chain and remove (but not |
9066 | delete) it from the event handler chain, return True if it was found | |
9067 | and False otherwise (this also results in an assert failure so this | |
9068 | function should only be called when the handler is supposed to be | |
9069 | there.) | |
d55e5bfc | 9070 | """ |
5b5c9bc7 | 9071 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
d55e5bfc RD |
9072 | |
9073 | def SetValidator(*args, **kwargs): | |
9074 | """ | |
5b5c9bc7 | 9075 | SetValidator(self, Validator validator) |
d55e5bfc RD |
9076 | |
9077 | Deletes the current validator (if any) and sets the window validator, | |
9078 | having called wx.Validator.Clone to create a new validator of this | |
9079 | type. | |
9080 | """ | |
5b5c9bc7 | 9081 | return _core_.Window_SetValidator(*args, **kwargs) |
d55e5bfc RD |
9082 | |
9083 | def GetValidator(*args, **kwargs): | |
9084 | """ | |
5b5c9bc7 | 9085 | GetValidator(self) -> Validator |
d55e5bfc RD |
9086 | |
9087 | Returns a pointer to the current validator for the window, or None if | |
9088 | there is none. | |
9089 | """ | |
5b5c9bc7 | 9090 | return _core_.Window_GetValidator(*args, **kwargs) |
d55e5bfc RD |
9091 | |
9092 | def Validate(*args, **kwargs): | |
9093 | """ | |
9094 | Validate(self) -> bool | |
9095 | ||
9096 | Validates the current values of the child controls using their | |
15817c7e RD |
9097 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
9098 | style flag set, the method will also call Validate() of all child | |
9099 | windows. Returns false if any of the validations failed. | |
d55e5bfc | 9100 | """ |
5b5c9bc7 | 9101 | return _core_.Window_Validate(*args, **kwargs) |
d55e5bfc RD |
9102 | |
9103 | def TransferDataToWindow(*args, **kwargs): | |
9104 | """ | |
9105 | TransferDataToWindow(self) -> bool | |
9106 | ||
15817c7e RD |
9107 | Transfers values to child controls from data areas specified by their |
9108 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
9109 | style flag set, the method will also call TransferDataToWindow() of | |
9110 | all child windows. | |
d55e5bfc | 9111 | """ |
5b5c9bc7 | 9112 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
d55e5bfc RD |
9113 | |
9114 | def TransferDataFromWindow(*args, **kwargs): | |
9115 | """ | |
9116 | TransferDataFromWindow(self) -> bool | |
9117 | ||
15817c7e RD |
9118 | Transfers values from child controls to data areas specified by their |
9119 | validators. Returns false if a transfer failed. If the window has | |
9120 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
9121 | also call TransferDataFromWindow() of all child windows. | |
d55e5bfc | 9122 | """ |
5b5c9bc7 | 9123 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
d55e5bfc RD |
9124 | |
9125 | def InitDialog(*args, **kwargs): | |
9126 | """ | |
9127 | InitDialog(self) | |
9128 | ||
15817c7e RD |
9129 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
9130 | to the dialog via validators. | |
d55e5bfc | 9131 | """ |
5b5c9bc7 | 9132 | return _core_.Window_InitDialog(*args, **kwargs) |
d55e5bfc RD |
9133 | |
9134 | def SetAcceleratorTable(*args, **kwargs): | |
9135 | """ | |
5b5c9bc7 | 9136 | SetAcceleratorTable(self, AcceleratorTable accel) |
d55e5bfc RD |
9137 | |
9138 | Sets the accelerator table for this window. | |
9139 | """ | |
5b5c9bc7 | 9140 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
d55e5bfc RD |
9141 | |
9142 | def GetAcceleratorTable(*args, **kwargs): | |
9143 | """ | |
5b5c9bc7 | 9144 | GetAcceleratorTable(self) -> AcceleratorTable |
d55e5bfc RD |
9145 | |
9146 | Gets the accelerator table for this window. | |
9147 | """ | |
5b5c9bc7 | 9148 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
d55e5bfc RD |
9149 | |
9150 | def RegisterHotKey(*args, **kwargs): | |
9151 | """ | |
9152 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool | |
9153 | ||
9154 | Registers a system wide hotkey. Every time the user presses the hotkey | |
9155 | registered here, this window will receive a hotkey event. It will | |
9156 | receive the event even if the application is in the background and | |
9157 | does not have the input focus because the user is working with some | |
9158 | other application. To bind an event handler function to this hotkey | |
9159 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
9160 | hotkey was registered successfully. | |
9161 | """ | |
5b5c9bc7 | 9162 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
d55e5bfc RD |
9163 | |
9164 | def UnregisterHotKey(*args, **kwargs): | |
9165 | """ | |
9166 | UnregisterHotKey(self, int hotkeyId) -> bool | |
9167 | ||
9168 | Unregisters a system wide hotkey. | |
9169 | """ | |
5b5c9bc7 | 9170 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
d55e5bfc RD |
9171 | |
9172 | def ConvertDialogPointToPixels(*args, **kwargs): | |
9173 | """ | |
5b5c9bc7 | 9174 | ConvertDialogPointToPixels(self, Point pt) -> Point |
d55e5bfc RD |
9175 | |
9176 | Converts a point or size from dialog units to pixels. Dialog units | |
9177 | are used for maintaining a dialog's proportions even if the font | |
9178 | changes. For the x dimension, the dialog units are multiplied by the | |
9179 | average character width and then divided by 4. For the y dimension, | |
9180 | the dialog units are multiplied by the average character height and | |
9181 | then divided by 8. | |
9182 | """ | |
5b5c9bc7 | 9183 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
d55e5bfc RD |
9184 | |
9185 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
9186 | """ | |
5b5c9bc7 | 9187 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
d55e5bfc RD |
9188 | |
9189 | Converts a point or size from dialog units to pixels. Dialog units | |
9190 | are used for maintaining a dialog's proportions even if the font | |
9191 | changes. For the x dimension, the dialog units are multiplied by the | |
9192 | average character width and then divided by 4. For the y dimension, | |
9193 | the dialog units are multiplied by the average character height and | |
9194 | then divided by 8. | |
9195 | """ | |
5b5c9bc7 | 9196 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
d55e5bfc RD |
9197 | |
9198 | def DLG_PNT(*args, **kwargs): | |
9199 | """ | |
5b5c9bc7 | 9200 | DLG_PNT(self, Point pt) -> Point |
d55e5bfc RD |
9201 | |
9202 | Converts a point or size from dialog units to pixels. Dialog units | |
9203 | are used for maintaining a dialog's proportions even if the font | |
9204 | changes. For the x dimension, the dialog units are multiplied by the | |
9205 | average character width and then divided by 4. For the y dimension, | |
9206 | the dialog units are multiplied by the average character height and | |
9207 | then divided by 8. | |
9208 | """ | |
5b5c9bc7 | 9209 | return _core_.Window_DLG_PNT(*args, **kwargs) |
d55e5bfc RD |
9210 | |
9211 | def DLG_SZE(*args, **kwargs): | |
9212 | """ | |
5b5c9bc7 | 9213 | DLG_SZE(self, Size sz) -> Size |
d55e5bfc RD |
9214 | |
9215 | Converts a point or size from dialog units to pixels. Dialog units | |
9216 | are used for maintaining a dialog's proportions even if the font | |
9217 | changes. For the x dimension, the dialog units are multiplied by the | |
9218 | average character width and then divided by 4. For the y dimension, | |
9219 | the dialog units are multiplied by the average character height and | |
9220 | then divided by 8. | |
9221 | """ | |
5b5c9bc7 | 9222 | return _core_.Window_DLG_SZE(*args, **kwargs) |
d55e5bfc RD |
9223 | |
9224 | def ConvertPixelPointToDialog(*args, **kwargs): | |
5b5c9bc7 RD |
9225 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
9226 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) | |
d55e5bfc RD |
9227 | |
9228 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
5b5c9bc7 RD |
9229 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
9230 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) | |
d55e5bfc RD |
9231 | |
9232 | def WarpPointer(*args, **kwargs): | |
9233 | """ | |
9234 | WarpPointer(self, int x, int y) | |
9235 | ||
9236 | Moves the pointer to the given position on the window. | |
9237 | ||
9238 | NOTE: This function is not supported under Mac because Apple Human | |
9239 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
9240 | """ | |
5b5c9bc7 | 9241 | return _core_.Window_WarpPointer(*args, **kwargs) |
d55e5bfc RD |
9242 | |
9243 | def CaptureMouse(*args, **kwargs): | |
9244 | """ | |
9245 | CaptureMouse(self) | |
9246 | ||
9247 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
9248 | release the capture. | |
9249 | ||
9250 | Note that wxWindows maintains the stack of windows having captured the | |
9251 | mouse and when the mouse is released the capture returns to the window | |
9252 | which had had captured it previously and it is only really released if | |
9253 | there were no previous window. In particular, this means that you must | |
9254 | release the mouse as many times as you capture it. | |
9255 | """ | |
5b5c9bc7 | 9256 | return _core_.Window_CaptureMouse(*args, **kwargs) |
d55e5bfc RD |
9257 | |
9258 | def ReleaseMouse(*args, **kwargs): | |
9259 | """ | |
9260 | ReleaseMouse(self) | |
9261 | ||
9262 | Releases mouse input captured with wx.Window.CaptureMouse. | |
9263 | """ | |
5b5c9bc7 | 9264 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
d55e5bfc RD |
9265 | |
9266 | def GetCapture(*args, **kwargs): | |
9267 | """ | |
5b5c9bc7 | 9268 | GetCapture() -> Window |
d55e5bfc RD |
9269 | |
9270 | Returns the window which currently captures the mouse or None | |
9271 | """ | |
5b5c9bc7 | 9272 | return _core_.Window_GetCapture(*args, **kwargs) |
d55e5bfc RD |
9273 | |
9274 | GetCapture = staticmethod(GetCapture) | |
9275 | def HasCapture(*args, **kwargs): | |
9276 | """ | |
9277 | HasCapture(self) -> bool | |
9278 | ||
9279 | Returns true if this window has the current mouse capture. | |
9280 | """ | |
5b5c9bc7 | 9281 | return _core_.Window_HasCapture(*args, **kwargs) |
d55e5bfc RD |
9282 | |
9283 | def Refresh(*args, **kwargs): | |
9284 | """ | |
5b5c9bc7 | 9285 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
d55e5bfc RD |
9286 | |
9287 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
9288 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
9289 | to the window. | |
9290 | """ | |
5b5c9bc7 | 9291 | return _core_.Window_Refresh(*args, **kwargs) |
d55e5bfc RD |
9292 | |
9293 | def RefreshRect(*args, **kwargs): | |
9294 | """ | |
5b5c9bc7 | 9295 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
d55e5bfc RD |
9296 | |
9297 | Redraws the contents of the given rectangle: the area inside it will | |
9298 | be repainted. This is the same as Refresh but has a nicer syntax. | |
9299 | """ | |
5b5c9bc7 | 9300 | return _core_.Window_RefreshRect(*args, **kwargs) |
d55e5bfc RD |
9301 | |
9302 | def Update(*args, **kwargs): | |
9303 | """ | |
9304 | Update(self) | |
9305 | ||
9306 | Calling this method immediately repaints the invalidated area of the | |
9307 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
9308 | this would usually only happen when the flow of control returns to the | |
9309 | event loop.) Notice that this function doesn't refresh the window and | |
9310 | does nothing if the window has been already repainted. Use Refresh | |
9311 | first if you want to immediately redraw the window (or some portion of | |
9312 | it) unconditionally. | |
9313 | """ | |
5b5c9bc7 | 9314 | return _core_.Window_Update(*args, **kwargs) |
d55e5bfc RD |
9315 | |
9316 | def ClearBackground(*args, **kwargs): | |
9317 | """ | |
9318 | ClearBackground(self) | |
9319 | ||
9320 | Clears the window by filling it with the current background | |
9321 | colour. Does not cause an erase background event to be generated. | |
9322 | """ | |
5b5c9bc7 | 9323 | return _core_.Window_ClearBackground(*args, **kwargs) |
d55e5bfc RD |
9324 | |
9325 | def Freeze(*args, **kwargs): | |
9326 | """ | |
9327 | Freeze(self) | |
9328 | ||
15817c7e RD |
9329 | Freezes the window or, in other words, prevents any updates from |
9330 | taking place on screen, the window is not redrawn at all. Thaw must be | |
9331 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
9332 | nested, with the actual Thaw being delayed until all the nesting has | |
9333 | been undone. | |
d55e5bfc RD |
9334 | |
9335 | This method is useful for visual appearance optimization (for example, | |
9336 | it is a good idea to use it before inserting large amount of text into | |
9337 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
9338 | for all controls so it is mostly just a hint to wxWindows and not a | |
9339 | mandatory directive. | |
9340 | """ | |
5b5c9bc7 | 9341 | return _core_.Window_Freeze(*args, **kwargs) |
d55e5bfc RD |
9342 | |
9343 | def Thaw(*args, **kwargs): | |
9344 | """ | |
9345 | Thaw(self) | |
9346 | ||
9347 | Reenables window updating after a previous call to Freeze. Calls to | |
15817c7e RD |
9348 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
9349 | times that Freeze was before the window will be updated. | |
d55e5bfc | 9350 | """ |
5b5c9bc7 | 9351 | return _core_.Window_Thaw(*args, **kwargs) |
d55e5bfc RD |
9352 | |
9353 | def PrepareDC(*args, **kwargs): | |
9354 | """ | |
5b5c9bc7 | 9355 | PrepareDC(self, DC dc) |
d55e5bfc RD |
9356 | |
9357 | Call this function to prepare the device context for drawing a | |
9358 | scrolled image. It sets the device origin according to the current | |
9359 | scroll position. | |
9360 | """ | |
5b5c9bc7 | 9361 | return _core_.Window_PrepareDC(*args, **kwargs) |
d55e5bfc RD |
9362 | |
9363 | def GetUpdateRegion(*args, **kwargs): | |
9364 | """ | |
5b5c9bc7 | 9365 | GetUpdateRegion(self) -> Region |
d55e5bfc RD |
9366 | |
9367 | Returns the region specifying which parts of the window have been | |
9368 | damaged. Should only be called within an EVT_PAINT handler. | |
9369 | """ | |
5b5c9bc7 | 9370 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
d55e5bfc RD |
9371 | |
9372 | def GetUpdateClientRect(*args, **kwargs): | |
9373 | """ | |
5b5c9bc7 | 9374 | GetUpdateClientRect(self) -> Rect |
d55e5bfc RD |
9375 | |
9376 | Get the update rectangle region bounding box in client coords. | |
9377 | """ | |
5b5c9bc7 | 9378 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
d55e5bfc RD |
9379 | |
9380 | def IsExposed(*args, **kwargs): | |
9381 | """ | |
9382 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool | |
9383 | ||
9384 | Returns true if the given point or rectangle area has been exposed | |
9385 | since the last repaint. Call this in an paint event handler to | |
9386 | optimize redrawing by only redrawing those areas, which have been | |
9387 | exposed. | |
9388 | """ | |
5b5c9bc7 | 9389 | return _core_.Window_IsExposed(*args, **kwargs) |
d55e5bfc RD |
9390 | |
9391 | def IsExposedPoint(*args, **kwargs): | |
9392 | """ | |
5b5c9bc7 | 9393 | IsExposedPoint(self, Point pt) -> bool |
d55e5bfc RD |
9394 | |
9395 | Returns true if the given point or rectangle area has been exposed | |
9396 | since the last repaint. Call this in an paint event handler to | |
9397 | optimize redrawing by only redrawing those areas, which have been | |
9398 | exposed. | |
9399 | """ | |
5b5c9bc7 | 9400 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
d55e5bfc RD |
9401 | |
9402 | def IsExposedRect(*args, **kwargs): | |
9403 | """ | |
5b5c9bc7 | 9404 | IsExposedRect(self, Rect rect) -> bool |
d55e5bfc RD |
9405 | |
9406 | Returns true if the given point or rectangle area has been exposed | |
9407 | since the last repaint. Call this in an paint event handler to | |
9408 | optimize redrawing by only redrawing those areas, which have been | |
9409 | exposed. | |
9410 | """ | |
5b5c9bc7 | 9411 | return _core_.Window_IsExposedRect(*args, **kwargs) |
d55e5bfc RD |
9412 | |
9413 | def GetDefaultAttributes(*args, **kwargs): | |
9414 | """ | |
5b5c9bc7 | 9415 | GetDefaultAttributes(self) -> VisualAttributes |
d55e5bfc | 9416 | |
15817c7e RD |
9417 | Get the default attributes for an instance of this class. This is |
9418 | useful if you want to use the same font or colour in your own control | |
9419 | as in a standard control -- which is a much better idea than hard | |
9420 | coding specific colours or fonts which might look completely out of | |
a5ee0656 | 9421 | place on the user's system, especially if it uses themes. |
d55e5bfc | 9422 | """ |
5b5c9bc7 | 9423 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
9424 | |
9425 | def GetClassDefaultAttributes(*args, **kwargs): | |
9426 | """ | |
5b5c9bc7 | 9427 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
d55e5bfc | 9428 | |
15817c7e RD |
9429 | Get the default attributes for this class. This is useful if you want |
9430 | to use the same font or colour in your own control as in a standard | |
9431 | control -- which is a much better idea than hard coding specific | |
a5ee0656 RD |
9432 | colours or fonts which might look completely out of place on the |
9433 | user's system, especially if it uses themes. | |
d55e5bfc RD |
9434 | |
9435 | The variant parameter is only relevant under Mac currently and is | |
15817c7e | 9436 | ignore under other platforms. Under Mac, it will change the size of |
a5ee0656 RD |
9437 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9438 | this. | |
d55e5bfc | 9439 | """ |
5b5c9bc7 | 9440 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
9441 | |
9442 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
9443 | def SetBackgroundColour(*args, **kwargs): | |
9444 | """ | |
5b5c9bc7 | 9445 | SetBackgroundColour(self, Colour colour) -> bool |
d55e5bfc RD |
9446 | |
9447 | Sets the background colour of the window. Returns True if the colour | |
9448 | was changed. The background colour is usually painted by the default | |
9449 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9450 | automatically under GTK. Using `wx.NullColour` will reset the window |
9451 | to the default background colour. | |
d55e5bfc | 9452 | |
a5ee0656 | 9453 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9454 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
d55e5bfc RD |
9455 | calling this function. |
9456 | ||
f8167d6e RD |
9457 | Using this function will disable attempts to use themes for this |
9458 | window, if the system supports them. Use with care since usually the | |
9459 | themes represent the appearance chosen by the user to be used for all | |
9460 | applications on the system. | |
d55e5bfc | 9461 | """ |
5b5c9bc7 | 9462 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
d55e5bfc | 9463 | |
412d302d | 9464 | def SetOwnBackgroundColour(*args, **kwargs): |
5b5c9bc7 RD |
9465 | """SetOwnBackgroundColour(self, Colour colour)""" |
9466 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
d55e5bfc RD |
9467 | |
9468 | def SetForegroundColour(*args, **kwargs): | |
9469 | """ | |
5b5c9bc7 | 9470 | SetForegroundColour(self, Colour colour) -> bool |
d55e5bfc RD |
9471 | |
9472 | Sets the foreground colour of the window. Returns True is the colour | |
9473 | was changed. The interpretation of foreground colour is dependent on | |
9474 | the window class; it may be the text colour or other colour, or it may | |
9475 | not be used at all. | |
9476 | """ | |
5b5c9bc7 | 9477 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
d55e5bfc | 9478 | |
fa47d7a7 | 9479 | def SetOwnForegroundColour(*args, **kwargs): |
5b5c9bc7 RD |
9480 | """SetOwnForegroundColour(self, Colour colour)""" |
9481 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
d55e5bfc RD |
9482 | |
9483 | def GetBackgroundColour(*args, **kwargs): | |
9484 | """ | |
5b5c9bc7 | 9485 | GetBackgroundColour(self) -> Colour |
d55e5bfc RD |
9486 | |
9487 | Returns the background colour of the window. | |
9488 | """ | |
5b5c9bc7 | 9489 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
d55e5bfc RD |
9490 | |
9491 | def GetForegroundColour(*args, **kwargs): | |
9492 | """ | |
5b5c9bc7 | 9493 | GetForegroundColour(self) -> Colour |
d55e5bfc RD |
9494 | |
9495 | Returns the foreground colour of the window. The interpretation of | |
9496 | foreground colour is dependent on the window class; it may be the text | |
9497 | colour or other colour, or it may not be used at all. | |
9498 | """ | |
5b5c9bc7 | 9499 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
d55e5bfc | 9500 | |
dcb8fc74 RD |
9501 | def InheritsBackgroundColour(*args, **kwargs): |
9502 | """InheritsBackgroundColour(self) -> bool""" | |
5b5c9bc7 | 9503 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) |
dcb8fc74 RD |
9504 | |
9505 | def UseBgCol(*args, **kwargs): | |
9506 | """UseBgCol(self) -> bool""" | |
5b5c9bc7 | 9507 | return _core_.Window_UseBgCol(*args, **kwargs) |
dcb8fc74 | 9508 | |
0f63ec68 RD |
9509 | def SetBackgroundStyle(*args, **kwargs): |
9510 | """ | |
9511 | SetBackgroundStyle(self, int style) -> bool | |
9512 | ||
9513 | Returns the background style of the window. The background style | |
9514 | indicates how the background of the window is drawn. | |
9515 | ||
9516 | ====================== ======================================== | |
9517 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9518 | be determined by the system | |
9519 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9520 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9521 | application. | |
9522 | ====================== ======================================== | |
9523 | ||
9524 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9525 | a custom background, such as a tiled bitmap. Currently the style has | |
9526 | no effect on other platforms. | |
9527 | ||
9528 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9529 | """ | |
5b5c9bc7 | 9530 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) |
0f63ec68 RD |
9531 | |
9532 | def GetBackgroundStyle(*args, **kwargs): | |
9533 | """ | |
9534 | GetBackgroundStyle(self) -> int | |
9535 | ||
9536 | Returns the background style of the window. | |
9537 | ||
9538 | :see: `SetBackgroundStyle` | |
9539 | """ | |
5b5c9bc7 | 9540 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) |
0f63ec68 | 9541 | |
51b83b37 RD |
9542 | def HasTransparentBackground(*args, **kwargs): |
9543 | """ | |
9544 | HasTransparentBackground(self) -> bool | |
9545 | ||
9546 | Returns True if this window's background is transparent (as, for | |
9547 | example, for `wx.StaticText`) and should show the parent window's | |
9548 | background. | |
9549 | ||
9550 | This method is mostly used internally by the library itself and you | |
9551 | normally shouldn't have to call it. You may, however, have to override | |
9552 | it in your custom control classes to ensure that background is painted | |
9553 | correctly. | |
9554 | """ | |
5b5c9bc7 | 9555 | return _core_.Window_HasTransparentBackground(*args, **kwargs) |
51b83b37 | 9556 | |
d55e5bfc RD |
9557 | def SetCursor(*args, **kwargs): |
9558 | """ | |
5b5c9bc7 | 9559 | SetCursor(self, Cursor cursor) -> bool |
d55e5bfc RD |
9560 | |
9561 | Sets the window's cursor. Notice that the window cursor also sets it | |
9562 | for the children of the window implicitly. | |
9563 | ||
9564 | The cursor may be wx.NullCursor in which case the window cursor will | |
9565 | be reset back to default. | |
9566 | """ | |
5b5c9bc7 | 9567 | return _core_.Window_SetCursor(*args, **kwargs) |
d55e5bfc RD |
9568 | |
9569 | def GetCursor(*args, **kwargs): | |
9570 | """ | |
5b5c9bc7 | 9571 | GetCursor(self) -> Cursor |
d55e5bfc RD |
9572 | |
9573 | Return the cursor associated with this window. | |
9574 | """ | |
5b5c9bc7 | 9575 | return _core_.Window_GetCursor(*args, **kwargs) |
d55e5bfc RD |
9576 | |
9577 | def SetFont(*args, **kwargs): | |
9578 | """ | |
5b5c9bc7 | 9579 | SetFont(self, Font font) -> bool |
d55e5bfc RD |
9580 | |
9581 | Sets the font for this window. | |
9582 | """ | |
5b5c9bc7 | 9583 | return _core_.Window_SetFont(*args, **kwargs) |
d55e5bfc | 9584 | |
fa47d7a7 | 9585 | def SetOwnFont(*args, **kwargs): |
5b5c9bc7 RD |
9586 | """SetOwnFont(self, Font font)""" |
9587 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
d55e5bfc RD |
9588 | |
9589 | def GetFont(*args, **kwargs): | |
9590 | """ | |
5b5c9bc7 | 9591 | GetFont(self) -> Font |
d55e5bfc RD |
9592 | |
9593 | Returns the default font used for this window. | |
9594 | """ | |
5b5c9bc7 | 9595 | return _core_.Window_GetFont(*args, **kwargs) |
d55e5bfc RD |
9596 | |
9597 | def SetCaret(*args, **kwargs): | |
9598 | """ | |
5b5c9bc7 | 9599 | SetCaret(self, Caret caret) |
d55e5bfc RD |
9600 | |
9601 | Sets the caret associated with the window. | |
9602 | """ | |
5b5c9bc7 | 9603 | return _core_.Window_SetCaret(*args, **kwargs) |
d55e5bfc RD |
9604 | |
9605 | def GetCaret(*args, **kwargs): | |
9606 | """ | |
5b5c9bc7 | 9607 | GetCaret(self) -> Caret |
d55e5bfc RD |
9608 | |
9609 | Returns the caret associated with the window. | |
9610 | """ | |
5b5c9bc7 | 9611 | return _core_.Window_GetCaret(*args, **kwargs) |
d55e5bfc RD |
9612 | |
9613 | def GetCharHeight(*args, **kwargs): | |
9614 | """ | |
9615 | GetCharHeight(self) -> int | |
9616 | ||
9617 | Get the (average) character size for the current font. | |
9618 | """ | |
5b5c9bc7 | 9619 | return _core_.Window_GetCharHeight(*args, **kwargs) |
d55e5bfc RD |
9620 | |
9621 | def GetCharWidth(*args, **kwargs): | |
9622 | """ | |
9623 | GetCharWidth(self) -> int | |
9624 | ||
9625 | Get the (average) character size for the current font. | |
9626 | """ | |
5b5c9bc7 | 9627 | return _core_.Window_GetCharWidth(*args, **kwargs) |
d55e5bfc RD |
9628 | |
9629 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9630 | """ |
9631 | GetTextExtent(String string) -> (width, height) | |
9632 | ||
9633 | Get the width and height of the text using the current font. | |
9634 | """ | |
5b5c9bc7 | 9635 | return _core_.Window_GetTextExtent(*args, **kwargs) |
d55e5bfc RD |
9636 | |
9637 | def GetFullTextExtent(*args, **kwargs): | |
9638 | """ | |
9639 | GetFullTextExtent(String string, Font font=None) -> | |
9640 | (width, height, descent, externalLeading) | |
9641 | ||
9642 | Get the width, height, decent and leading of the text using the | |
9643 | current or specified font. | |
9644 | """ | |
5b5c9bc7 | 9645 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
d55e5bfc RD |
9646 | |
9647 | def ClientToScreenXY(*args, **kwargs): | |
9648 | """ | |
9649 | ClientToScreenXY(int x, int y) -> (x,y) | |
9650 | ||
9651 | Converts to screen coordinates from coordinates relative to this window. | |
9652 | """ | |
5b5c9bc7 | 9653 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
d55e5bfc RD |
9654 | |
9655 | def ScreenToClientXY(*args, **kwargs): | |
9656 | """ | |
9657 | ScreenToClientXY(int x, int y) -> (x,y) | |
9658 | ||
9659 | Converts from screen to client window coordinates. | |
9660 | """ | |
5b5c9bc7 | 9661 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
d55e5bfc RD |
9662 | |
9663 | def ClientToScreen(*args, **kwargs): | |
9664 | """ | |
5b5c9bc7 | 9665 | ClientToScreen(self, Point pt) -> Point |
d55e5bfc RD |
9666 | |
9667 | Converts to screen coordinates from coordinates relative to this window. | |
9668 | """ | |
5b5c9bc7 | 9669 | return _core_.Window_ClientToScreen(*args, **kwargs) |
d55e5bfc RD |
9670 | |
9671 | def ScreenToClient(*args, **kwargs): | |
9672 | """ | |
5b5c9bc7 | 9673 | ScreenToClient(self, Point pt) -> Point |
d55e5bfc RD |
9674 | |
9675 | Converts from screen to client window coordinates. | |
9676 | """ | |
5b5c9bc7 | 9677 | return _core_.Window_ScreenToClient(*args, **kwargs) |
d55e5bfc RD |
9678 | |
9679 | def HitTestXY(*args, **kwargs): | |
9680 | """ | |
9681 | HitTestXY(self, int x, int y) -> int | |
9682 | ||
9683 | Test where the given (in client coords) point lies | |
9684 | """ | |
5b5c9bc7 | 9685 | return _core_.Window_HitTestXY(*args, **kwargs) |
d55e5bfc RD |
9686 | |
9687 | def HitTest(*args, **kwargs): | |
9688 | """ | |
5b5c9bc7 | 9689 | HitTest(self, Point pt) -> int |
d55e5bfc RD |
9690 | |
9691 | Test where the given (in client coords) point lies | |
9692 | """ | |
5b5c9bc7 | 9693 | return _core_.Window_HitTest(*args, **kwargs) |
d55e5bfc RD |
9694 | |
9695 | def GetBorder(*args): | |
9696 | """ | |
9697 | GetBorder(self, long flags) -> int | |
9698 | GetBorder(self) -> int | |
9699 | ||
9700 | Get border for the flags of this window | |
9701 | """ | |
5b5c9bc7 | 9702 | return _core_.Window_GetBorder(*args) |
d55e5bfc RD |
9703 | |
9704 | def UpdateWindowUI(*args, **kwargs): | |
9705 | """ | |
5b5c9bc7 | 9706 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
d55e5bfc RD |
9707 | |
9708 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9709 | implementation depends on the window; for example a wx.ToolBar will | |
9710 | send an update UI event for each toolbar button, and a wx.Frame will | |
9711 | send an update UI event for each menubar menu item. You can call this | |
9712 | function from your application to ensure that your UI is up-to-date at | |
9713 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9714 | concerned). This may be necessary if you have called | |
5ba5649b | 9715 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
d55e5bfc RD |
9716 | limit the overhead that wxWindows incurs by sending update UI events |
9717 | in idle time. | |
d55e5bfc | 9718 | """ |
5b5c9bc7 | 9719 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
d55e5bfc RD |
9720 | |
9721 | def PopupMenuXY(*args, **kwargs): | |
9722 | """ | |
5b5c9bc7 | 9723 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
d55e5bfc | 9724 | |
b0503257 RD |
9725 | Pops up the given menu at the specified coordinates, relative to this window, |
9726 | and returns control when the user has dismissed the menu. If a menu item is | |
9727 | selected, the corresponding menu event is generated and will be processed as | |
9728 | usual. If the default position is given then the current position of the | |
9729 | mouse cursor will be used. | |
d55e5bfc | 9730 | """ |
5b5c9bc7 | 9731 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
d55e5bfc RD |
9732 | |
9733 | def PopupMenu(*args, **kwargs): | |
9734 | """ | |
5b5c9bc7 | 9735 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
d55e5bfc | 9736 | |
b0503257 RD |
9737 | Pops up the given menu at the specified coordinates, relative to this window, |
9738 | and returns control when the user has dismissed the menu. If a menu item is | |
9739 | selected, the corresponding menu event is generated and will be processed as | |
9740 | usual. If the default position is given then the current position of the | |
9741 | mouse cursor will be used. | |
d55e5bfc | 9742 | """ |
5b5c9bc7 | 9743 | return _core_.Window_PopupMenu(*args, **kwargs) |
d55e5bfc RD |
9744 | |
9745 | def GetHandle(*args, **kwargs): | |
9746 | """ | |
9747 | GetHandle(self) -> long | |
9748 | ||
9749 | Returns the platform-specific handle (as a long integer) of the | |
9750 | physical window. Currently on wxMac it returns the handle of the | |
9751 | toplevel parent of the window. | |
9752 | """ | |
5b5c9bc7 | 9753 | return _core_.Window_GetHandle(*args, **kwargs) |
d55e5bfc | 9754 | |
629e65c2 RD |
9755 | def AssociateHandle(*args, **kwargs): |
9756 | """ | |
9757 | AssociateHandle(self, long handle) | |
9758 | ||
9759 | Associate the window with a new native handle | |
9760 | """ | |
5b5c9bc7 | 9761 | return _core_.Window_AssociateHandle(*args, **kwargs) |
629e65c2 RD |
9762 | |
9763 | def DissociateHandle(*args, **kwargs): | |
9764 | """ | |
9765 | DissociateHandle(self) | |
9766 | ||
9767 | Dissociate the current native handle from the window | |
9768 | """ | |
5b5c9bc7 | 9769 | return _core_.Window_DissociateHandle(*args, **kwargs) |
629e65c2 | 9770 | |
d55e5bfc RD |
9771 | def HasScrollbar(*args, **kwargs): |
9772 | """ | |
9773 | HasScrollbar(self, int orient) -> bool | |
9774 | ||
9775 | Does the window have the scrollbar for this orientation? | |
9776 | """ | |
5b5c9bc7 | 9777 | return _core_.Window_HasScrollbar(*args, **kwargs) |
d55e5bfc RD |
9778 | |
9779 | def SetScrollbar(*args, **kwargs): | |
9780 | """ | |
15817c7e | 9781 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
d55e5bfc RD |
9782 | bool refresh=True) |
9783 | ||
9784 | Sets the scrollbar properties of a built-in scrollbar. | |
d55e5bfc | 9785 | """ |
5b5c9bc7 | 9786 | return _core_.Window_SetScrollbar(*args, **kwargs) |
d55e5bfc RD |
9787 | |
9788 | def SetScrollPos(*args, **kwargs): | |
9789 | """ | |
9790 | SetScrollPos(self, int orientation, int pos, bool refresh=True) | |
9791 | ||
9792 | Sets the position of one of the built-in scrollbars. | |
9793 | """ | |
5b5c9bc7 | 9794 | return _core_.Window_SetScrollPos(*args, **kwargs) |
d55e5bfc RD |
9795 | |
9796 | def GetScrollPos(*args, **kwargs): | |
9797 | """ | |
9798 | GetScrollPos(self, int orientation) -> int | |
9799 | ||
9800 | Returns the built-in scrollbar position. | |
9801 | """ | |
5b5c9bc7 | 9802 | return _core_.Window_GetScrollPos(*args, **kwargs) |
d55e5bfc RD |
9803 | |
9804 | def GetScrollThumb(*args, **kwargs): | |
9805 | """ | |
9806 | GetScrollThumb(self, int orientation) -> int | |
9807 | ||
9808 | Returns the built-in scrollbar thumb size. | |
9809 | """ | |
5b5c9bc7 | 9810 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
d55e5bfc RD |
9811 | |
9812 | def GetScrollRange(*args, **kwargs): | |
9813 | """ | |
9814 | GetScrollRange(self, int orientation) -> int | |
9815 | ||
9816 | Returns the built-in scrollbar range. | |
9817 | """ | |
5b5c9bc7 | 9818 | return _core_.Window_GetScrollRange(*args, **kwargs) |
d55e5bfc RD |
9819 | |
9820 | def ScrollWindow(*args, **kwargs): | |
9821 | """ | |
5b5c9bc7 | 9822 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
d55e5bfc RD |
9823 | |
9824 | Physically scrolls the pixels in the window and move child windows | |
9825 | accordingly. Use this function to optimise your scrolling | |
9826 | implementations, to minimise the area that must be redrawn. Note that | |
9827 | it is rarely required to call this function from a user program. | |
d55e5bfc | 9828 | """ |
5b5c9bc7 | 9829 | return _core_.Window_ScrollWindow(*args, **kwargs) |
d55e5bfc RD |
9830 | |
9831 | def ScrollLines(*args, **kwargs): | |
9832 | """ | |
9833 | ScrollLines(self, int lines) -> bool | |
9834 | ||
9835 | If the platform and window class supports it, scrolls the window by | |
9836 | the given number of lines down, if lines is positive, or up if lines | |
9837 | is negative. Returns True if the window was scrolled, False if it was | |
9838 | already on top/bottom and nothing was done. | |
9839 | """ | |
5b5c9bc7 | 9840 | return _core_.Window_ScrollLines(*args, **kwargs) |
d55e5bfc RD |
9841 | |
9842 | def ScrollPages(*args, **kwargs): | |
9843 | """ | |
9844 | ScrollPages(self, int pages) -> bool | |
9845 | ||
15817c7e | 9846 | If the platform and window class supports it, scrolls the window by |
d55e5bfc RD |
9847 | the given number of pages down, if pages is positive, or up if pages |
9848 | is negative. Returns True if the window was scrolled, False if it was | |
9849 | already on top/bottom and nothing was done. | |
9850 | """ | |
5b5c9bc7 | 9851 | return _core_.Window_ScrollPages(*args, **kwargs) |
d55e5bfc RD |
9852 | |
9853 | def LineUp(*args, **kwargs): | |
9854 | """ | |
9855 | LineUp(self) -> bool | |
9856 | ||
9857 | This is just a wrapper for ScrollLines(-1). | |
9858 | """ | |
5b5c9bc7 | 9859 | return _core_.Window_LineUp(*args, **kwargs) |
d55e5bfc RD |
9860 | |
9861 | def LineDown(*args, **kwargs): | |
9862 | """ | |
9863 | LineDown(self) -> bool | |
9864 | ||
9865 | This is just a wrapper for ScrollLines(1). | |
9866 | """ | |
5b5c9bc7 | 9867 | return _core_.Window_LineDown(*args, **kwargs) |
d55e5bfc RD |
9868 | |
9869 | def PageUp(*args, **kwargs): | |
9870 | """ | |
9871 | PageUp(self) -> bool | |
9872 | ||
9873 | This is just a wrapper for ScrollPages(-1). | |
9874 | """ | |
5b5c9bc7 | 9875 | return _core_.Window_PageUp(*args, **kwargs) |
d55e5bfc RD |
9876 | |
9877 | def PageDown(*args, **kwargs): | |
9878 | """ | |
9879 | PageDown(self) -> bool | |
9880 | ||
9881 | This is just a wrapper for ScrollPages(1). | |
9882 | """ | |
5b5c9bc7 | 9883 | return _core_.Window_PageDown(*args, **kwargs) |
d55e5bfc RD |
9884 | |
9885 | def SetHelpText(*args, **kwargs): | |
9886 | """ | |
5b5c9bc7 | 9887 | SetHelpText(self, String text) |
d55e5bfc RD |
9888 | |
9889 | Sets the help text to be used as context-sensitive help for this | |
9890 | window. Note that the text is actually stored by the current | |
9891 | wxHelpProvider implementation, and not in the window object itself. | |
9892 | """ | |
5b5c9bc7 | 9893 | return _core_.Window_SetHelpText(*args, **kwargs) |
d55e5bfc RD |
9894 | |
9895 | def SetHelpTextForId(*args, **kwargs): | |
9896 | """ | |
5b5c9bc7 | 9897 | SetHelpTextForId(self, String text) |
d55e5bfc RD |
9898 | |
9899 | Associate this help text with all windows with the same id as this | |
9900 | one. | |
9901 | """ | |
5b5c9bc7 | 9902 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
d55e5bfc RD |
9903 | |
9904 | def GetHelpText(*args, **kwargs): | |
9905 | """ | |
5b5c9bc7 | 9906 | GetHelpText(self) -> String |
d55e5bfc RD |
9907 | |
9908 | Gets the help text to be used as context-sensitive help for this | |
9909 | window. Note that the text is actually stored by the current | |
9910 | wxHelpProvider implementation, and not in the window object itself. | |
9911 | """ | |
5b5c9bc7 | 9912 | return _core_.Window_GetHelpText(*args, **kwargs) |
d55e5bfc RD |
9913 | |
9914 | def SetToolTipString(*args, **kwargs): | |
9915 | """ | |
5b5c9bc7 | 9916 | SetToolTipString(self, String tip) |
d55e5bfc RD |
9917 | |
9918 | Attach a tooltip to the window. | |
9919 | """ | |
5b5c9bc7 | 9920 | return _core_.Window_SetToolTipString(*args, **kwargs) |
d55e5bfc RD |
9921 | |
9922 | def SetToolTip(*args, **kwargs): | |
9923 | """ | |
5b5c9bc7 | 9924 | SetToolTip(self, ToolTip tip) |
d55e5bfc RD |
9925 | |
9926 | Attach a tooltip to the window. | |
9927 | """ | |
5b5c9bc7 | 9928 | return _core_.Window_SetToolTip(*args, **kwargs) |
d55e5bfc RD |
9929 | |
9930 | def GetToolTip(*args, **kwargs): | |
9931 | """ | |
5b5c9bc7 | 9932 | GetToolTip(self) -> ToolTip |
d55e5bfc RD |
9933 | |
9934 | get the associated tooltip or None if none | |
9935 | """ | |
5b5c9bc7 | 9936 | return _core_.Window_GetToolTip(*args, **kwargs) |
d55e5bfc RD |
9937 | |
9938 | def SetDropTarget(*args, **kwargs): | |
9939 | """ | |
5b5c9bc7 | 9940 | SetDropTarget(self, DropTarget dropTarget) |
d55e5bfc RD |
9941 | |
9942 | Associates a drop target with this window. If the window already has | |
9943 | a drop target, it is deleted. | |
9944 | """ | |
5b5c9bc7 | 9945 | return _core_.Window_SetDropTarget(*args, **kwargs) |
d55e5bfc RD |
9946 | |
9947 | def GetDropTarget(*args, **kwargs): | |
9948 | """ | |
5b5c9bc7 | 9949 | GetDropTarget(self) -> DropTarget |
d55e5bfc RD |
9950 | |
9951 | Returns the associated drop target, which may be None. | |
9952 | """ | |
5b5c9bc7 | 9953 | return _core_.Window_GetDropTarget(*args, **kwargs) |
d55e5bfc | 9954 | |
5ba5649b RD |
9955 | def DragAcceptFiles(*args, **kwargs): |
9956 | """ | |
9957 | DragAcceptFiles(self, bool accept) | |
9958 | ||
9959 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
9960 | Only functional on Windows. | |
9961 | """ | |
9962 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
9963 | ||
d55e5bfc RD |
9964 | def SetConstraints(*args, **kwargs): |
9965 | """ | |
5b5c9bc7 | 9966 | SetConstraints(self, LayoutConstraints constraints) |
d55e5bfc RD |
9967 | |
9968 | Sets the window to have the given layout constraints. If an existing | |
9969 | layout constraints object is already owned by the window, it will be | |
9970 | deleted. Pass None to disassociate and delete the window's current | |
9971 | constraints. | |
9972 | ||
9973 | You must call SetAutoLayout to tell a window to use the constraints | |
9974 | automatically in its default EVT_SIZE handler; otherwise, you must | |
9975 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
9976 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
9977 | effect. | |
9978 | """ | |
5b5c9bc7 | 9979 | return _core_.Window_SetConstraints(*args, **kwargs) |
d55e5bfc RD |
9980 | |
9981 | def GetConstraints(*args, **kwargs): | |
9982 | """ | |
5b5c9bc7 | 9983 | GetConstraints(self) -> LayoutConstraints |
d55e5bfc RD |
9984 | |
9985 | Returns a pointer to the window's layout constraints, or None if there | |
9986 | are none. | |
9987 | """ | |
5b5c9bc7 | 9988 | return _core_.Window_GetConstraints(*args, **kwargs) |
d55e5bfc RD |
9989 | |
9990 | def SetAutoLayout(*args, **kwargs): | |
9991 | """ | |
9992 | SetAutoLayout(self, bool autoLayout) | |
9993 | ||
9994 | Determines whether the Layout function will be called automatically | |
9995 | when the window is resized. It is called implicitly by SetSizer but | |
9996 | if you use SetConstraints you should call it manually or otherwise the | |
9997 | window layout won't be correctly updated when its size changes. | |
9998 | """ | |
5b5c9bc7 | 9999 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
d55e5bfc RD |
10000 | |
10001 | def GetAutoLayout(*args, **kwargs): | |
10002 | """ | |
10003 | GetAutoLayout(self) -> bool | |
10004 | ||
10005 | Returns the current autoLayout setting | |
10006 | """ | |
5b5c9bc7 | 10007 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
d55e5bfc RD |
10008 | |
10009 | def Layout(*args, **kwargs): | |
10010 | """ | |
10011 | Layout(self) -> bool | |
10012 | ||
10013 | Invokes the constraint-based layout algorithm or the sizer-based | |
10014 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
10015 | this function gets called automatically by the default EVT_SIZE | |
10016 | handler when the window is resized. | |
10017 | """ | |
5b5c9bc7 | 10018 | return _core_.Window_Layout(*args, **kwargs) |
d55e5bfc RD |
10019 | |
10020 | def SetSizer(*args, **kwargs): | |
10021 | """ | |
5b5c9bc7 | 10022 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
d55e5bfc RD |
10023 | |
10024 | Sets the window to have the given layout sizer. The window will then | |
10025 | own the object, and will take care of its deletion. If an existing | |
10026 | layout sizer object is already owned by the window, it will be deleted | |
10027 | if the deleteOld parameter is true. Note that this function will also | |
10028 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
b411df4a | 10029 | non-None, and False otherwise. |
d55e5bfc | 10030 | """ |
5b5c9bc7 | 10031 | return _core_.Window_SetSizer(*args, **kwargs) |
d55e5bfc RD |
10032 | |
10033 | def SetSizerAndFit(*args, **kwargs): | |
10034 | """ | |
5b5c9bc7 | 10035 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
d55e5bfc RD |
10036 | |
10037 | The same as SetSizer, except it also sets the size hints for the | |
10038 | window based on the sizer's minimum size. | |
10039 | """ | |
5b5c9bc7 | 10040 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
d55e5bfc RD |
10041 | |
10042 | def GetSizer(*args, **kwargs): | |
10043 | """ | |
5b5c9bc7 | 10044 | GetSizer(self) -> Sizer |
d55e5bfc RD |
10045 | |
10046 | Return the sizer associated with the window by a previous call to | |
10047 | SetSizer or None if there isn't one. | |
10048 | """ | |
5b5c9bc7 | 10049 | return _core_.Window_GetSizer(*args, **kwargs) |
d55e5bfc RD |
10050 | |
10051 | def SetContainingSizer(*args, **kwargs): | |
10052 | """ | |
5b5c9bc7 | 10053 | SetContainingSizer(self, Sizer sizer) |
d55e5bfc RD |
10054 | |
10055 | This normally does not need to be called by application code. It is | |
10056 | called internally when a window is added to a sizer, and is used so | |
10057 | the window can remove itself from the sizer when it is destroyed. | |
10058 | """ | |
5b5c9bc7 | 10059 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
d55e5bfc RD |
10060 | |
10061 | def GetContainingSizer(*args, **kwargs): | |
10062 | """ | |
5b5c9bc7 | 10063 | GetContainingSizer(self) -> Sizer |
d55e5bfc RD |
10064 | |
10065 | Return the sizer that this window is a member of, if any, otherwise None. | |
10066 | """ | |
5b5c9bc7 | 10067 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
d55e5bfc RD |
10068 | |
10069 | def InheritAttributes(*args, **kwargs): | |
10070 | """ | |
10071 | InheritAttributes(self) | |
10072 | ||
15817c7e RD |
10073 | This function is (or should be, in case of custom controls) called |
10074 | during window creation to intelligently set up the window visual | |
10075 | attributes, that is the font and the foreground and background | |
10076 | colours. | |
10077 | ||
10078 | By 'intelligently' the following is meant: by default, all windows use | |
10079 | their own default attributes. However if some of the parent's | |
10080 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 10081 | SetOwnFont) and if the corresponding attribute hadn't been |
15817c7e RD |
10082 | explicitly set for this window itself, then this window takes the same |
10083 | value as used by the parent. In addition, if the window overrides | |
10084 | ShouldInheritColours to return false, the colours will not be changed | |
10085 | no matter what and only the font might. | |
10086 | ||
a7bb0a9d RD |
10087 | This rather complicated logic is necessary in order to accommodate the |
10088 | different usage scenarios. The most common one is when all default | |
15817c7e RD |
10089 | attributes are used and in this case, nothing should be inherited as |
10090 | in modern GUIs different controls use different fonts (and colours) | |
10091 | than their siblings so they can't inherit the same value from the | |
10092 | parent. However it was also deemed desirable to allow to simply change | |
10093 | the attributes of all children at once by just changing the font or | |
10094 | colour of their common parent, hence in this case we do inherit the | |
10095 | parents attributes. | |
10096 | ||
d55e5bfc | 10097 | """ |
5b5c9bc7 | 10098 | return _core_.Window_InheritAttributes(*args, **kwargs) |
d55e5bfc RD |
10099 | |
10100 | def ShouldInheritColours(*args, **kwargs): | |
10101 | """ | |
10102 | ShouldInheritColours(self) -> bool | |
10103 | ||
10104 | Return true from here to allow the colours of this window to be | |
15817c7e RD |
10105 | changed by InheritAttributes, returning false forbids inheriting them |
10106 | from the parent window. | |
d55e5bfc | 10107 | |
15817c7e RD |
10108 | The base class version returns false, but this method is overridden in |
10109 | wxControl where it returns true. | |
d55e5bfc | 10110 | """ |
5b5c9bc7 | 10111 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
d55e5bfc RD |
10112 | |
10113 | def PostCreate(self, pre): | |
10114 | """ | |
10115 | Phase 3 of the 2-phase create <wink!> | |
10116 | Call this method after precreating the window with the 2-phase create method. | |
10117 | """ | |
10118 | self.this = pre.this | |
10119 | self.thisown = pre.thisown | |
10120 | pre.thisown = 0 | |
10121 | if hasattr(self, '_setOORInfo'): | |
10122 | self._setOORInfo(self) | |
10123 | if hasattr(self, '_setCallbackInfo'): | |
10124 | self._setCallbackInfo(self, self.__class__) | |
10125 | ||
10126 | ||
5b5c9bc7 | 10127 | class WindowPtr(Window): |
d55e5bfc RD |
10128 | def __init__(self, this): |
10129 | self.this = this | |
10130 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10131 | self.__class__ = Window |
10132 | _core_.Window_swigregister(WindowPtr) | |
d55e5bfc RD |
10133 | |
10134 | def PreWindow(*args, **kwargs): | |
10135 | """ | |
5b5c9bc7 | 10136 | PreWindow() -> Window |
d55e5bfc RD |
10137 | |
10138 | Precreate a Window for 2-phase creation. | |
10139 | """ | |
5b5c9bc7 | 10140 | val = _core_.new_PreWindow(*args, **kwargs) |
d55e5bfc RD |
10141 | val.thisown = 1 |
10142 | return val | |
10143 | ||
5b5c9bc7 | 10144 | def Window_NewControlId(*args, **kwargs): |
d55e5bfc | 10145 | """ |
5b5c9bc7 | 10146 | Window_NewControlId() -> int |
d55e5bfc RD |
10147 | |
10148 | Generate a control id for the controls which were not given one. | |
10149 | """ | |
5b5c9bc7 | 10150 | return _core_.Window_NewControlId(*args, **kwargs) |
d55e5bfc | 10151 | |
5b5c9bc7 | 10152 | def Window_NextControlId(*args, **kwargs): |
d55e5bfc | 10153 | """ |
5b5c9bc7 | 10154 | Window_NextControlId(int winid) -> int |
d55e5bfc RD |
10155 | |
10156 | Get the id of the control following the one with the given | |
15817c7e | 10157 | autogenerated) id |
d55e5bfc | 10158 | """ |
5b5c9bc7 | 10159 | return _core_.Window_NextControlId(*args, **kwargs) |
d55e5bfc | 10160 | |
5b5c9bc7 | 10161 | def Window_PrevControlId(*args, **kwargs): |
d55e5bfc | 10162 | """ |
5b5c9bc7 | 10163 | Window_PrevControlId(int winid) -> int |
d55e5bfc RD |
10164 | |
10165 | Get the id of the control preceding the one with the given | |
15817c7e | 10166 | autogenerated) id |
d55e5bfc | 10167 | """ |
5b5c9bc7 | 10168 | return _core_.Window_PrevControlId(*args, **kwargs) |
d55e5bfc | 10169 | |
5b5c9bc7 | 10170 | def Window_FindFocus(*args, **kwargs): |
d55e5bfc | 10171 | """ |
5b5c9bc7 | 10172 | Window_FindFocus() -> Window |
d55e5bfc RD |
10173 | |
10174 | Returns the window or control that currently has the keyboard focus, | |
10175 | or None. | |
10176 | """ | |
5b5c9bc7 | 10177 | return _core_.Window_FindFocus(*args, **kwargs) |
d55e5bfc | 10178 | |
5b5c9bc7 | 10179 | def Window_GetCapture(*args, **kwargs): |
d55e5bfc | 10180 | """ |
5b5c9bc7 | 10181 | Window_GetCapture() -> Window |
d55e5bfc RD |
10182 | |
10183 | Returns the window which currently captures the mouse or None | |
10184 | """ | |
5b5c9bc7 | 10185 | return _core_.Window_GetCapture(*args, **kwargs) |
d55e5bfc | 10186 | |
5b5c9bc7 | 10187 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
d55e5bfc | 10188 | """ |
5b5c9bc7 | 10189 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
d55e5bfc | 10190 | |
15817c7e RD |
10191 | Get the default attributes for this class. This is useful if you want |
10192 | to use the same font or colour in your own control as in a standard | |
10193 | control -- which is a much better idea than hard coding specific | |
a5ee0656 RD |
10194 | colours or fonts which might look completely out of place on the |
10195 | user's system, especially if it uses themes. | |
d55e5bfc RD |
10196 | |
10197 | The variant parameter is only relevant under Mac currently and is | |
15817c7e | 10198 | ignore under other platforms. Under Mac, it will change the size of |
a5ee0656 RD |
10199 | the returned font. See `wx.Window.SetWindowVariant` for more about |
10200 | this. | |
d55e5bfc | 10201 | """ |
5b5c9bc7 | 10202 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
10203 | |
10204 | def DLG_PNT(win, point_or_x, y=None): | |
10205 | """ | |
10206 | Convenience function for converting a Point or (x,y) in | |
10207 | dialog units to pixel units. | |
10208 | """ | |
10209 | if y is None: | |
10210 | return win.ConvertDialogPointToPixels(point_or_x) | |
10211 | else: | |
10212 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) | |
10213 | ||
10214 | def DLG_SZE(win, size_width, height=None): | |
10215 | """ | |
10216 | Convenience function for converting a Size or (w,h) in | |
10217 | dialog units to pixel units. | |
10218 | """ | |
10219 | if height is None: | |
10220 | return win.ConvertDialogSizeToPixels(size_width) | |
10221 | else: | |
10222 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) | |
10223 | ||
10224 | ||
5b5c9bc7 | 10225 | def FindWindowById(*args, **kwargs): |
d55e5bfc | 10226 | """ |
5b5c9bc7 | 10227 | FindWindowById(long id, Window parent=None) -> Window |
d55e5bfc RD |
10228 | |
10229 | Find the first window in the application with the given id. If parent | |
10230 | is None, the search will start from all top-level frames and dialog | |
10231 | boxes; if non-None, the search will be limited to the given window | |
10232 | hierarchy. The search is recursive in both cases. | |
10233 | """ | |
5b5c9bc7 | 10234 | return _core_.FindWindowById(*args, **kwargs) |
d55e5bfc | 10235 | |
5b5c9bc7 | 10236 | def FindWindowByName(*args, **kwargs): |
d55e5bfc | 10237 | """ |
5b5c9bc7 | 10238 | FindWindowByName(String name, Window parent=None) -> Window |
d55e5bfc RD |
10239 | |
10240 | Find a window by its name (as given in a window constructor or Create | |
10241 | function call). If parent is None, the search will start from all | |
10242 | top-level frames and dialog boxes; if non-None, the search will be | |
10243 | limited to the given window hierarchy. The search is recursive in both | |
10244 | cases. | |
10245 | ||
10246 | If no window with such name is found, wx.FindWindowByLabel is called. | |
10247 | """ | |
5b5c9bc7 | 10248 | return _core_.FindWindowByName(*args, **kwargs) |
d55e5bfc | 10249 | |
5b5c9bc7 | 10250 | def FindWindowByLabel(*args, **kwargs): |
d55e5bfc | 10251 | """ |
5b5c9bc7 | 10252 | FindWindowByLabel(String label, Window parent=None) -> Window |
d55e5bfc RD |
10253 | |
10254 | Find a window by its label. Depending on the type of window, the label | |
10255 | may be a window title or panel item label. If parent is None, the | |
10256 | search will start from all top-level frames and dialog boxes; if | |
10257 | non-None, the search will be limited to the given window | |
10258 | hierarchy. The search is recursive in both cases. | |
10259 | """ | |
5b5c9bc7 | 10260 | return _core_.FindWindowByLabel(*args, **kwargs) |
d55e5bfc | 10261 | |
5b5c9bc7 RD |
10262 | def Window_FromHWND(*args, **kwargs): |
10263 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" | |
10264 | return _core_.Window_FromHWND(*args, **kwargs) | |
3215336e RD |
10265 | |
10266 | def GetTopLevelWindows(*args, **kwargs): | |
10267 | """ | |
10268 | GetTopLevelWindows() -> PyObject | |
10269 | ||
10270 | Returns a list of the the application's top-level windows, (frames, | |
10271 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
10272 | by wxWidgets, and so it is only valid as long as no top-level windows | |
10273 | are closed or new top-level windows are created. | |
10274 | ||
10275 | """ | |
10276 | return _core_.GetTopLevelWindows(*args, **kwargs) | |
d55e5bfc RD |
10277 | #--------------------------------------------------------------------------- |
10278 | ||
5b5c9bc7 RD |
10279 | class Validator(EvtHandler): |
10280 | """Proxy of C++ Validator class""" | |
d55e5bfc RD |
10281 | def __repr__(self): |
10282 | return "<%s.%s; proxy of C++ wxValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10283 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
10284 | """__init__(self) -> Validator""" |
10285 | newobj = _core_.new_Validator(*args, **kwargs) | |
d55e5bfc RD |
10286 | self.this = newobj.this |
10287 | self.thisown = 1 | |
10288 | del newobj.thisown | |
10289 | self._setOORInfo(self) | |
10290 | ||
10291 | def Clone(*args, **kwargs): | |
5b5c9bc7 RD |
10292 | """Clone(self) -> Validator""" |
10293 | return _core_.Validator_Clone(*args, **kwargs) | |
d55e5bfc RD |
10294 | |
10295 | def Validate(*args, **kwargs): | |
5b5c9bc7 RD |
10296 | """Validate(self, Window parent) -> bool""" |
10297 | return _core_.Validator_Validate(*args, **kwargs) | |
d55e5bfc RD |
10298 | |
10299 | def TransferToWindow(*args, **kwargs): | |
10300 | """TransferToWindow(self) -> bool""" | |
5b5c9bc7 | 10301 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
d55e5bfc RD |
10302 | |
10303 | def TransferFromWindow(*args, **kwargs): | |
10304 | """TransferFromWindow(self) -> bool""" | |
5b5c9bc7 | 10305 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
d55e5bfc RD |
10306 | |
10307 | def GetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10308 | """GetWindow(self) -> Window""" |
10309 | return _core_.Validator_GetWindow(*args, **kwargs) | |
d55e5bfc RD |
10310 | |
10311 | def SetWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10312 | """SetWindow(self, Window window)""" |
10313 | return _core_.Validator_SetWindow(*args, **kwargs) | |
d55e5bfc RD |
10314 | |
10315 | def IsSilent(*args, **kwargs): | |
d6c14a4c | 10316 | """IsSilent() -> bool""" |
5b5c9bc7 | 10317 | return _core_.Validator_IsSilent(*args, **kwargs) |
d55e5bfc RD |
10318 | |
10319 | IsSilent = staticmethod(IsSilent) | |
10320 | def SetBellOnError(*args, **kwargs): | |
d6c14a4c | 10321 | """SetBellOnError(int doIt=True)""" |
5b5c9bc7 | 10322 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
d55e5bfc RD |
10323 | |
10324 | SetBellOnError = staticmethod(SetBellOnError) | |
10325 | ||
5b5c9bc7 | 10326 | class ValidatorPtr(Validator): |
d55e5bfc RD |
10327 | def __init__(self, this): |
10328 | self.this = this | |
10329 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10330 | self.__class__ = Validator |
10331 | _core_.Validator_swigregister(ValidatorPtr) | |
d55e5bfc | 10332 | |
5b5c9bc7 RD |
10333 | def Validator_IsSilent(*args, **kwargs): |
10334 | """Validator_IsSilent() -> bool""" | |
10335 | return _core_.Validator_IsSilent(*args, **kwargs) | |
d55e5bfc | 10336 | |
5b5c9bc7 RD |
10337 | def Validator_SetBellOnError(*args, **kwargs): |
10338 | """Validator_SetBellOnError(int doIt=True)""" | |
10339 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
d55e5bfc | 10340 | |
5b5c9bc7 RD |
10341 | class PyValidator(Validator): |
10342 | """Proxy of C++ PyValidator class""" | |
d55e5bfc RD |
10343 | def __repr__(self): |
10344 | return "<%s.%s; proxy of C++ wxPyValidator instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10345 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
10346 | """__init__(self) -> PyValidator""" |
10347 | newobj = _core_.new_PyValidator(*args, **kwargs) | |
d55e5bfc RD |
10348 | self.this = newobj.this |
10349 | self.thisown = 1 | |
10350 | del newobj.thisown | |
10351 | ||
10352 | self._setCallbackInfo(self, PyValidator, 1) | |
10353 | self._setOORInfo(self) | |
10354 | ||
10355 | def _setCallbackInfo(*args, **kwargs): | |
10356 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" | |
5b5c9bc7 | 10357 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
10358 | |
10359 | ||
5b5c9bc7 | 10360 | class PyValidatorPtr(PyValidator): |
d55e5bfc RD |
10361 | def __init__(self, this): |
10362 | self.this = this | |
10363 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10364 | self.__class__ = PyValidator |
10365 | _core_.PyValidator_swigregister(PyValidatorPtr) | |
d55e5bfc RD |
10366 | |
10367 | #--------------------------------------------------------------------------- | |
10368 | ||
5b5c9bc7 RD |
10369 | class Menu(EvtHandler): |
10370 | """Proxy of C++ Menu class""" | |
d55e5bfc RD |
10371 | def __repr__(self): |
10372 | return "<%s.%s; proxy of C++ wxMenu instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10373 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
10374 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
10375 | newobj = _core_.new_Menu(*args, **kwargs) | |
d55e5bfc RD |
10376 | self.this = newobj.this |
10377 | self.thisown = 1 | |
10378 | del newobj.thisown | |
10379 | self._setOORInfo(self) | |
10380 | ||
10381 | def Append(*args, **kwargs): | |
5b5c9bc7 RD |
10382 | """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
10383 | return _core_.Menu_Append(*args, **kwargs) | |
d55e5bfc RD |
10384 | |
10385 | def AppendSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
10386 | """AppendSeparator(self) -> MenuItem""" |
10387 | return _core_.Menu_AppendSeparator(*args, **kwargs) | |
d55e5bfc RD |
10388 | |
10389 | def AppendCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
10390 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10391 | return _core_.Menu_AppendCheckItem(*args, **kwargs) | |
d55e5bfc RD |
10392 | |
10393 | def AppendRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
10394 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10395 | return _core_.Menu_AppendRadioItem(*args, **kwargs) | |
d55e5bfc RD |
10396 | |
10397 | def AppendMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10398 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
10399 | return _core_.Menu_AppendMenu(*args, **kwargs) | |
d55e5bfc RD |
10400 | |
10401 | def AppendItem(*args, **kwargs): | |
5b5c9bc7 RD |
10402 | """AppendItem(self, MenuItem item) -> MenuItem""" |
10403 | return _core_.Menu_AppendItem(*args, **kwargs) | |
d55e5bfc RD |
10404 | |
10405 | def Break(*args, **kwargs): | |
10406 | """Break(self)""" | |
5b5c9bc7 | 10407 | return _core_.Menu_Break(*args, **kwargs) |
d55e5bfc RD |
10408 | |
10409 | def InsertItem(*args, **kwargs): | |
5b5c9bc7 RD |
10410 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
10411 | return _core_.Menu_InsertItem(*args, **kwargs) | |
d55e5bfc RD |
10412 | |
10413 | def Insert(*args, **kwargs): | |
10414 | """ | |
5b5c9bc7 RD |
10415 | Insert(self, size_t pos, int id, String text, String help=EmptyString, |
10416 | int kind=ITEM_NORMAL) -> MenuItem | |
d55e5bfc | 10417 | """ |
5b5c9bc7 | 10418 | return _core_.Menu_Insert(*args, **kwargs) |
d55e5bfc RD |
10419 | |
10420 | def InsertSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
10421 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
10422 | return _core_.Menu_InsertSeparator(*args, **kwargs) | |
d55e5bfc RD |
10423 | |
10424 | def InsertCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
10425 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
10426 | return _core_.Menu_InsertCheckItem(*args, **kwargs) | |
d55e5bfc RD |
10427 | |
10428 | def InsertRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
10429 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
10430 | return _core_.Menu_InsertRadioItem(*args, **kwargs) | |
d55e5bfc RD |
10431 | |
10432 | def InsertMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10433 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
10434 | return _core_.Menu_InsertMenu(*args, **kwargs) | |
d55e5bfc RD |
10435 | |
10436 | def PrependItem(*args, **kwargs): | |
5b5c9bc7 RD |
10437 | """PrependItem(self, MenuItem item) -> MenuItem""" |
10438 | return _core_.Menu_PrependItem(*args, **kwargs) | |
d55e5bfc RD |
10439 | |
10440 | def Prepend(*args, **kwargs): | |
5b5c9bc7 RD |
10441 | """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
10442 | return _core_.Menu_Prepend(*args, **kwargs) | |
d55e5bfc RD |
10443 | |
10444 | def PrependSeparator(*args, **kwargs): | |
5b5c9bc7 RD |
10445 | """PrependSeparator(self) -> MenuItem""" |
10446 | return _core_.Menu_PrependSeparator(*args, **kwargs) | |
d55e5bfc RD |
10447 | |
10448 | def PrependCheckItem(*args, **kwargs): | |
5b5c9bc7 RD |
10449 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10450 | return _core_.Menu_PrependCheckItem(*args, **kwargs) | |
d55e5bfc RD |
10451 | |
10452 | def PrependRadioItem(*args, **kwargs): | |
5b5c9bc7 RD |
10453 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
10454 | return _core_.Menu_PrependRadioItem(*args, **kwargs) | |
d55e5bfc RD |
10455 | |
10456 | def PrependMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10457 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
10458 | return _core_.Menu_PrependMenu(*args, **kwargs) | |
d55e5bfc RD |
10459 | |
10460 | def Remove(*args, **kwargs): | |
5b5c9bc7 RD |
10461 | """Remove(self, int id) -> MenuItem""" |
10462 | return _core_.Menu_Remove(*args, **kwargs) | |
d55e5bfc RD |
10463 | |
10464 | def RemoveItem(*args, **kwargs): | |
5b5c9bc7 RD |
10465 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
10466 | return _core_.Menu_RemoveItem(*args, **kwargs) | |
d55e5bfc RD |
10467 | |
10468 | def Delete(*args, **kwargs): | |
10469 | """Delete(self, int id) -> bool""" | |
5b5c9bc7 | 10470 | return _core_.Menu_Delete(*args, **kwargs) |
d55e5bfc RD |
10471 | |
10472 | def DeleteItem(*args, **kwargs): | |
5b5c9bc7 RD |
10473 | """DeleteItem(self, MenuItem item) -> bool""" |
10474 | return _core_.Menu_DeleteItem(*args, **kwargs) | |
d55e5bfc RD |
10475 | |
10476 | def Destroy(*args, **kwargs): | |
10477 | """ | |
10478 | Destroy(self) | |
10479 | ||
10480 | Deletes the C++ object this Python object is a proxy for. | |
10481 | """ | |
5b5c9bc7 | 10482 | return _core_.Menu_Destroy(*args, **kwargs) |
d55e5bfc RD |
10483 | |
10484 | def DestroyId(*args, **kwargs): | |
10485 | """ | |
10486 | DestroyId(self, int id) -> bool | |
10487 | ||
10488 | Deletes the C++ object this Python object is a proxy for. | |
10489 | """ | |
5b5c9bc7 | 10490 | return _core_.Menu_DestroyId(*args, **kwargs) |
d55e5bfc RD |
10491 | |
10492 | def DestroyItem(*args, **kwargs): | |
10493 | """ | |
5b5c9bc7 | 10494 | DestroyItem(self, MenuItem item) -> bool |
d55e5bfc RD |
10495 | |
10496 | Deletes the C++ object this Python object is a proxy for. | |
10497 | """ | |
5b5c9bc7 | 10498 | return _core_.Menu_DestroyItem(*args, **kwargs) |
d55e5bfc RD |
10499 | |
10500 | def GetMenuItemCount(*args, **kwargs): | |
10501 | """GetMenuItemCount(self) -> size_t""" | |
5b5c9bc7 | 10502 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
d55e5bfc RD |
10503 | |
10504 | def GetMenuItems(*args, **kwargs): | |
10505 | """GetMenuItems(self) -> PyObject""" | |
5b5c9bc7 | 10506 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
d55e5bfc RD |
10507 | |
10508 | def FindItem(*args, **kwargs): | |
5b5c9bc7 RD |
10509 | """FindItem(self, String item) -> int""" |
10510 | return _core_.Menu_FindItem(*args, **kwargs) | |
d55e5bfc RD |
10511 | |
10512 | def FindItemById(*args, **kwargs): | |
5b5c9bc7 RD |
10513 | """FindItemById(self, int id) -> MenuItem""" |
10514 | return _core_.Menu_FindItemById(*args, **kwargs) | |
d55e5bfc RD |
10515 | |
10516 | def FindItemByPosition(*args, **kwargs): | |
5b5c9bc7 RD |
10517 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
10518 | return _core_.Menu_FindItemByPosition(*args, **kwargs) | |
d55e5bfc RD |
10519 | |
10520 | def Enable(*args, **kwargs): | |
10521 | """Enable(self, int id, bool enable)""" | |
5b5c9bc7 | 10522 | return _core_.Menu_Enable(*args, **kwargs) |
d55e5bfc RD |
10523 | |
10524 | def IsEnabled(*args, **kwargs): | |
10525 | """IsEnabled(self, int id) -> bool""" | |
5b5c9bc7 | 10526 | return _core_.Menu_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10527 | |
10528 | def Check(*args, **kwargs): | |
10529 | """Check(self, int id, bool check)""" | |
5b5c9bc7 | 10530 | return _core_.Menu_Check(*args, **kwargs) |
d55e5bfc RD |
10531 | |
10532 | def IsChecked(*args, **kwargs): | |
10533 | """IsChecked(self, int id) -> bool""" | |
5b5c9bc7 | 10534 | return _core_.Menu_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10535 | |
10536 | def SetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10537 | """SetLabel(self, int id, String label)""" |
10538 | return _core_.Menu_SetLabel(*args, **kwargs) | |
d55e5bfc RD |
10539 | |
10540 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10541 | """GetLabel(self, int id) -> String""" |
10542 | return _core_.Menu_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10543 | |
10544 | def SetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10545 | """SetHelpString(self, int id, String helpString)""" |
10546 | return _core_.Menu_SetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10547 | |
10548 | def GetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10549 | """GetHelpString(self, int id) -> String""" |
10550 | return _core_.Menu_GetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10551 | |
10552 | def SetTitle(*args, **kwargs): | |
5b5c9bc7 RD |
10553 | """SetTitle(self, String title)""" |
10554 | return _core_.Menu_SetTitle(*args, **kwargs) | |
d55e5bfc RD |
10555 | |
10556 | def GetTitle(*args, **kwargs): | |
5b5c9bc7 RD |
10557 | """GetTitle(self) -> String""" |
10558 | return _core_.Menu_GetTitle(*args, **kwargs) | |
d55e5bfc RD |
10559 | |
10560 | def SetEventHandler(*args, **kwargs): | |
5b5c9bc7 RD |
10561 | """SetEventHandler(self, EvtHandler handler)""" |
10562 | return _core_.Menu_SetEventHandler(*args, **kwargs) | |
d55e5bfc RD |
10563 | |
10564 | def GetEventHandler(*args, **kwargs): | |
5b5c9bc7 RD |
10565 | """GetEventHandler(self) -> EvtHandler""" |
10566 | return _core_.Menu_GetEventHandler(*args, **kwargs) | |
d55e5bfc RD |
10567 | |
10568 | def SetInvokingWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10569 | """SetInvokingWindow(self, Window win)""" |
10570 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) | |
d55e5bfc RD |
10571 | |
10572 | def GetInvokingWindow(*args, **kwargs): | |
5b5c9bc7 RD |
10573 | """GetInvokingWindow(self) -> Window""" |
10574 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) | |
d55e5bfc RD |
10575 | |
10576 | def GetStyle(*args, **kwargs): | |
10577 | """GetStyle(self) -> long""" | |
5b5c9bc7 | 10578 | return _core_.Menu_GetStyle(*args, **kwargs) |
d55e5bfc RD |
10579 | |
10580 | def UpdateUI(*args, **kwargs): | |
5b5c9bc7 RD |
10581 | """UpdateUI(self, EvtHandler source=None)""" |
10582 | return _core_.Menu_UpdateUI(*args, **kwargs) | |
d55e5bfc RD |
10583 | |
10584 | def GetMenuBar(*args, **kwargs): | |
5b5c9bc7 RD |
10585 | """GetMenuBar(self) -> MenuBar""" |
10586 | return _core_.Menu_GetMenuBar(*args, **kwargs) | |
d55e5bfc RD |
10587 | |
10588 | def Attach(*args, **kwargs): | |
10589 | """Attach(self, wxMenuBarBase menubar)""" | |
5b5c9bc7 | 10590 | return _core_.Menu_Attach(*args, **kwargs) |
d55e5bfc RD |
10591 | |
10592 | def Detach(*args, **kwargs): | |
10593 | """Detach(self)""" | |
5b5c9bc7 | 10594 | return _core_.Menu_Detach(*args, **kwargs) |
d55e5bfc RD |
10595 | |
10596 | def IsAttached(*args, **kwargs): | |
10597 | """IsAttached(self) -> bool""" | |
5b5c9bc7 | 10598 | return _core_.Menu_IsAttached(*args, **kwargs) |
d55e5bfc RD |
10599 | |
10600 | def SetParent(*args, **kwargs): | |
5b5c9bc7 RD |
10601 | """SetParent(self, Menu parent)""" |
10602 | return _core_.Menu_SetParent(*args, **kwargs) | |
d55e5bfc RD |
10603 | |
10604 | def GetParent(*args, **kwargs): | |
5b5c9bc7 RD |
10605 | """GetParent(self) -> Menu""" |
10606 | return _core_.Menu_GetParent(*args, **kwargs) | |
d55e5bfc RD |
10607 | |
10608 | ||
5b5c9bc7 | 10609 | class MenuPtr(Menu): |
d55e5bfc RD |
10610 | def __init__(self, this): |
10611 | self.this = this | |
10612 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10613 | self.__class__ = Menu |
10614 | _core_.Menu_swigregister(MenuPtr) | |
10615 | DefaultValidator = cvar.DefaultValidator | |
d55e5bfc RD |
10616 | |
10617 | #--------------------------------------------------------------------------- | |
10618 | ||
5b5c9bc7 RD |
10619 | class MenuBar(Window): |
10620 | """Proxy of C++ MenuBar class""" | |
d55e5bfc RD |
10621 | def __repr__(self): |
10622 | return "<%s.%s; proxy of C++ wxMenuBar instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10623 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
10624 | """__init__(self, long style=0) -> MenuBar""" |
10625 | newobj = _core_.new_MenuBar(*args, **kwargs) | |
d55e5bfc RD |
10626 | self.this = newobj.this |
10627 | self.thisown = 1 | |
10628 | del newobj.thisown | |
10629 | self._setOORInfo(self) | |
10630 | ||
10631 | def Append(*args, **kwargs): | |
5b5c9bc7 RD |
10632 | """Append(self, Menu menu, String title) -> bool""" |
10633 | return _core_.MenuBar_Append(*args, **kwargs) | |
d55e5bfc RD |
10634 | |
10635 | def Insert(*args, **kwargs): | |
5b5c9bc7 RD |
10636 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
10637 | return _core_.MenuBar_Insert(*args, **kwargs) | |
d55e5bfc RD |
10638 | |
10639 | def GetMenuCount(*args, **kwargs): | |
10640 | """GetMenuCount(self) -> size_t""" | |
5b5c9bc7 | 10641 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
d55e5bfc RD |
10642 | |
10643 | def GetMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10644 | """GetMenu(self, size_t pos) -> Menu""" |
10645 | return _core_.MenuBar_GetMenu(*args, **kwargs) | |
d55e5bfc RD |
10646 | |
10647 | def Replace(*args, **kwargs): | |
5b5c9bc7 RD |
10648 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
10649 | return _core_.MenuBar_Replace(*args, **kwargs) | |
d55e5bfc RD |
10650 | |
10651 | def Remove(*args, **kwargs): | |
5b5c9bc7 RD |
10652 | """Remove(self, size_t pos) -> Menu""" |
10653 | return _core_.MenuBar_Remove(*args, **kwargs) | |
d55e5bfc RD |
10654 | |
10655 | def EnableTop(*args, **kwargs): | |
10656 | """EnableTop(self, size_t pos, bool enable)""" | |
5b5c9bc7 | 10657 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
d55e5bfc RD |
10658 | |
10659 | def IsEnabledTop(*args, **kwargs): | |
10660 | """IsEnabledTop(self, size_t pos) -> bool""" | |
5b5c9bc7 | 10661 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
d55e5bfc RD |
10662 | |
10663 | def SetLabelTop(*args, **kwargs): | |
5b5c9bc7 RD |
10664 | """SetLabelTop(self, size_t pos, String label)""" |
10665 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) | |
d55e5bfc RD |
10666 | |
10667 | def GetLabelTop(*args, **kwargs): | |
5b5c9bc7 RD |
10668 | """GetLabelTop(self, size_t pos) -> String""" |
10669 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) | |
d55e5bfc RD |
10670 | |
10671 | def FindMenuItem(*args, **kwargs): | |
5b5c9bc7 RD |
10672 | """FindMenuItem(self, String menu, String item) -> int""" |
10673 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) | |
d55e5bfc RD |
10674 | |
10675 | def FindItemById(*args, **kwargs): | |
5b5c9bc7 RD |
10676 | """FindItemById(self, int id) -> MenuItem""" |
10677 | return _core_.MenuBar_FindItemById(*args, **kwargs) | |
d55e5bfc RD |
10678 | |
10679 | def FindMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10680 | """FindMenu(self, String title) -> int""" |
10681 | return _core_.MenuBar_FindMenu(*args, **kwargs) | |
d55e5bfc RD |
10682 | |
10683 | def Enable(*args, **kwargs): | |
10684 | """Enable(self, int id, bool enable)""" | |
5b5c9bc7 | 10685 | return _core_.MenuBar_Enable(*args, **kwargs) |
d55e5bfc RD |
10686 | |
10687 | def Check(*args, **kwargs): | |
10688 | """Check(self, int id, bool check)""" | |
5b5c9bc7 | 10689 | return _core_.MenuBar_Check(*args, **kwargs) |
d55e5bfc RD |
10690 | |
10691 | def IsChecked(*args, **kwargs): | |
10692 | """IsChecked(self, int id) -> bool""" | |
5b5c9bc7 | 10693 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10694 | |
10695 | def IsEnabled(*args, **kwargs): | |
10696 | """IsEnabled(self, int id) -> bool""" | |
5b5c9bc7 | 10697 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10698 | |
10699 | def SetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10700 | """SetLabel(self, int id, String label)""" |
10701 | return _core_.MenuBar_SetLabel(*args, **kwargs) | |
d55e5bfc RD |
10702 | |
10703 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10704 | """GetLabel(self, int id) -> String""" |
10705 | return _core_.MenuBar_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10706 | |
10707 | def SetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10708 | """SetHelpString(self, int id, String helpString)""" |
10709 | return _core_.MenuBar_SetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10710 | |
10711 | def GetHelpString(*args, **kwargs): | |
5b5c9bc7 RD |
10712 | """GetHelpString(self, int id) -> String""" |
10713 | return _core_.MenuBar_GetHelpString(*args, **kwargs) | |
d55e5bfc RD |
10714 | |
10715 | def GetFrame(*args, **kwargs): | |
10716 | """GetFrame(self) -> wxFrame""" | |
5b5c9bc7 | 10717 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
d55e5bfc RD |
10718 | |
10719 | def IsAttached(*args, **kwargs): | |
10720 | """IsAttached(self) -> bool""" | |
5b5c9bc7 | 10721 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
d55e5bfc RD |
10722 | |
10723 | def Attach(*args, **kwargs): | |
10724 | """Attach(self, wxFrame frame)""" | |
5b5c9bc7 | 10725 | return _core_.MenuBar_Attach(*args, **kwargs) |
d55e5bfc RD |
10726 | |
10727 | def Detach(*args, **kwargs): | |
10728 | """Detach(self)""" | |
5b5c9bc7 | 10729 | return _core_.MenuBar_Detach(*args, **kwargs) |
d55e5bfc | 10730 | |
4f433fef RD |
10731 | def SetAutoWindowMenu(*args, **kwargs): |
10732 | """SetAutoWindowMenu(bool enable)""" | |
10733 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10734 | ||
10735 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
10736 | def GetAutoWindowMenu(*args, **kwargs): | |
10737 | """GetAutoWindowMenu() -> bool""" | |
10738 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10739 | ||
10740 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
d55e5bfc | 10741 | |
5b5c9bc7 | 10742 | class MenuBarPtr(MenuBar): |
d55e5bfc RD |
10743 | def __init__(self, this): |
10744 | self.this = this | |
10745 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10746 | self.__class__ = MenuBar |
10747 | _core_.MenuBar_swigregister(MenuBarPtr) | |
d55e5bfc | 10748 | |
4f433fef RD |
10749 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
10750 | """MenuBar_SetAutoWindowMenu(bool enable)""" | |
10751 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10752 | ||
10753 | def MenuBar_GetAutoWindowMenu(*args, **kwargs): | |
10754 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
10755 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10756 | ||
d55e5bfc RD |
10757 | #--------------------------------------------------------------------------- |
10758 | ||
5b5c9bc7 RD |
10759 | class MenuItem(Object): |
10760 | """Proxy of C++ MenuItem class""" | |
d55e5bfc RD |
10761 | def __repr__(self): |
10762 | return "<%s.%s; proxy of C++ wxMenuItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10763 | def __init__(self, *args, **kwargs): | |
10764 | """ | |
5b5c9bc7 RD |
10765 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, |
10766 | String help=EmptyString, int kind=ITEM_NORMAL, | |
10767 | Menu subMenu=None) -> MenuItem | |
d55e5bfc | 10768 | """ |
5b5c9bc7 | 10769 | newobj = _core_.new_MenuItem(*args, **kwargs) |
d55e5bfc RD |
10770 | self.this = newobj.this |
10771 | self.thisown = 1 | |
10772 | del newobj.thisown | |
10773 | def GetMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10774 | """GetMenu(self) -> Menu""" |
10775 | return _core_.MenuItem_GetMenu(*args, **kwargs) | |
d55e5bfc RD |
10776 | |
10777 | def SetMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10778 | """SetMenu(self, Menu menu)""" |
10779 | return _core_.MenuItem_SetMenu(*args, **kwargs) | |
d55e5bfc RD |
10780 | |
10781 | def SetId(*args, **kwargs): | |
10782 | """SetId(self, int id)""" | |
5b5c9bc7 | 10783 | return _core_.MenuItem_SetId(*args, **kwargs) |
d55e5bfc RD |
10784 | |
10785 | def GetId(*args, **kwargs): | |
10786 | """GetId(self) -> int""" | |
5b5c9bc7 | 10787 | return _core_.MenuItem_GetId(*args, **kwargs) |
d55e5bfc RD |
10788 | |
10789 | def IsSeparator(*args, **kwargs): | |
10790 | """IsSeparator(self) -> bool""" | |
5b5c9bc7 | 10791 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
d55e5bfc RD |
10792 | |
10793 | def SetText(*args, **kwargs): | |
5b5c9bc7 RD |
10794 | """SetText(self, String str)""" |
10795 | return _core_.MenuItem_SetText(*args, **kwargs) | |
d55e5bfc RD |
10796 | |
10797 | def GetLabel(*args, **kwargs): | |
5b5c9bc7 RD |
10798 | """GetLabel(self) -> String""" |
10799 | return _core_.MenuItem_GetLabel(*args, **kwargs) | |
d55e5bfc RD |
10800 | |
10801 | def GetText(*args, **kwargs): | |
5b5c9bc7 RD |
10802 | """GetText(self) -> String""" |
10803 | return _core_.MenuItem_GetText(*args, **kwargs) | |
d55e5bfc RD |
10804 | |
10805 | def GetLabelFromText(*args, **kwargs): | |
5b5c9bc7 RD |
10806 | """GetLabelFromText(String text) -> String""" |
10807 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d55e5bfc RD |
10808 | |
10809 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10810 | def GetKind(*args, **kwargs): | |
10811 | """GetKind(self) -> int""" | |
5b5c9bc7 | 10812 | return _core_.MenuItem_GetKind(*args, **kwargs) |
d55e5bfc RD |
10813 | |
10814 | def SetKind(*args, **kwargs): | |
10815 | """SetKind(self, int kind)""" | |
5b5c9bc7 | 10816 | return _core_.MenuItem_SetKind(*args, **kwargs) |
d55e5bfc RD |
10817 | |
10818 | def SetCheckable(*args, **kwargs): | |
10819 | """SetCheckable(self, bool checkable)""" | |
5b5c9bc7 | 10820 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
d55e5bfc RD |
10821 | |
10822 | def IsCheckable(*args, **kwargs): | |
10823 | """IsCheckable(self) -> bool""" | |
5b5c9bc7 | 10824 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
d55e5bfc RD |
10825 | |
10826 | def IsSubMenu(*args, **kwargs): | |
10827 | """IsSubMenu(self) -> bool""" | |
5b5c9bc7 | 10828 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
d55e5bfc RD |
10829 | |
10830 | def SetSubMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10831 | """SetSubMenu(self, Menu menu)""" |
10832 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) | |
d55e5bfc RD |
10833 | |
10834 | def GetSubMenu(*args, **kwargs): | |
5b5c9bc7 RD |
10835 | """GetSubMenu(self) -> Menu""" |
10836 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) | |
d55e5bfc RD |
10837 | |
10838 | def Enable(*args, **kwargs): | |
10839 | """Enable(self, bool enable=True)""" | |
5b5c9bc7 | 10840 | return _core_.MenuItem_Enable(*args, **kwargs) |
d55e5bfc RD |
10841 | |
10842 | def IsEnabled(*args, **kwargs): | |
10843 | """IsEnabled(self) -> bool""" | |
5b5c9bc7 | 10844 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
d55e5bfc RD |
10845 | |
10846 | def Check(*args, **kwargs): | |
10847 | """Check(self, bool check=True)""" | |
5b5c9bc7 | 10848 | return _core_.MenuItem_Check(*args, **kwargs) |
d55e5bfc RD |
10849 | |
10850 | def IsChecked(*args, **kwargs): | |
10851 | """IsChecked(self) -> bool""" | |
5b5c9bc7 | 10852 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
d55e5bfc RD |
10853 | |
10854 | def Toggle(*args, **kwargs): | |
10855 | """Toggle(self)""" | |
5b5c9bc7 | 10856 | return _core_.MenuItem_Toggle(*args, **kwargs) |
d55e5bfc RD |
10857 | |
10858 | def SetHelp(*args, **kwargs): | |
5b5c9bc7 RD |
10859 | """SetHelp(self, String str)""" |
10860 | return _core_.MenuItem_SetHelp(*args, **kwargs) | |
d55e5bfc RD |
10861 | |
10862 | def GetHelp(*args, **kwargs): | |
5b5c9bc7 RD |
10863 | """GetHelp(self) -> String""" |
10864 | return _core_.MenuItem_GetHelp(*args, **kwargs) | |
d55e5bfc RD |
10865 | |
10866 | def GetAccel(*args, **kwargs): | |
5b5c9bc7 RD |
10867 | """GetAccel(self) -> AcceleratorEntry""" |
10868 | return _core_.MenuItem_GetAccel(*args, **kwargs) | |
d55e5bfc RD |
10869 | |
10870 | def SetAccel(*args, **kwargs): | |
5b5c9bc7 RD |
10871 | """SetAccel(self, AcceleratorEntry accel)""" |
10872 | return _core_.MenuItem_SetAccel(*args, **kwargs) | |
d55e5bfc | 10873 | |
c1280d1e | 10874 | def SetFont(*args, **kwargs): |
5b5c9bc7 RD |
10875 | """SetFont(self, Font font)""" |
10876 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
c1280d1e RD |
10877 | |
10878 | def GetFont(*args, **kwargs): | |
5b5c9bc7 RD |
10879 | """GetFont(self) -> Font""" |
10880 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
c1280d1e RD |
10881 | |
10882 | def SetTextColour(*args, **kwargs): | |
5b5c9bc7 RD |
10883 | """SetTextColour(self, Colour colText)""" |
10884 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
c1280d1e RD |
10885 | |
10886 | def GetTextColour(*args, **kwargs): | |
5b5c9bc7 RD |
10887 | """GetTextColour(self) -> Colour""" |
10888 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
c1280d1e RD |
10889 | |
10890 | def SetBackgroundColour(*args, **kwargs): | |
5b5c9bc7 RD |
10891 | """SetBackgroundColour(self, Colour colBack)""" |
10892 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
c1280d1e RD |
10893 | |
10894 | def GetBackgroundColour(*args, **kwargs): | |
5b5c9bc7 RD |
10895 | """GetBackgroundColour(self) -> Colour""" |
10896 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
c1280d1e RD |
10897 | |
10898 | def SetBitmaps(*args, **kwargs): | |
5b5c9bc7 RD |
10899 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" |
10900 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
c1280d1e RD |
10901 | |
10902 | def SetDisabledBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
10903 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" |
10904 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
c1280d1e RD |
10905 | |
10906 | def GetDisabledBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
10907 | """GetDisabledBitmap(self) -> Bitmap""" |
10908 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
c1280d1e RD |
10909 | |
10910 | def SetMarginWidth(*args, **kwargs): | |
10911 | """SetMarginWidth(self, int nWidth)""" | |
5b5c9bc7 | 10912 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) |
c1280d1e RD |
10913 | |
10914 | def GetMarginWidth(*args, **kwargs): | |
10915 | """GetMarginWidth(self) -> int""" | |
5b5c9bc7 | 10916 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) |
c1280d1e | 10917 | |
d55e5bfc | 10918 | def GetDefaultMarginWidth(*args, **kwargs): |
d6c14a4c | 10919 | """GetDefaultMarginWidth() -> int""" |
5b5c9bc7 | 10920 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
d55e5bfc RD |
10921 | |
10922 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
10923 | def IsOwnerDrawn(*args, **kwargs): |
10924 | """IsOwnerDrawn(self) -> bool""" | |
5b5c9bc7 | 10925 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) |
c1280d1e RD |
10926 | |
10927 | def SetOwnerDrawn(*args, **kwargs): | |
10928 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
5b5c9bc7 | 10929 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) |
c1280d1e RD |
10930 | |
10931 | def ResetOwnerDrawn(*args, **kwargs): | |
10932 | """ResetOwnerDrawn(self)""" | |
5b5c9bc7 | 10933 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) |
c1280d1e | 10934 | |
d55e5bfc | 10935 | def SetBitmap(*args, **kwargs): |
5b5c9bc7 RD |
10936 | """SetBitmap(self, Bitmap bitmap)""" |
10937 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
d55e5bfc RD |
10938 | |
10939 | def GetBitmap(*args, **kwargs): | |
5b5c9bc7 RD |
10940 | """GetBitmap(self) -> Bitmap""" |
10941 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
d55e5bfc RD |
10942 | |
10943 | ||
5b5c9bc7 | 10944 | class MenuItemPtr(MenuItem): |
d55e5bfc RD |
10945 | def __init__(self, this): |
10946 | self.this = this | |
10947 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
10948 | self.__class__ = MenuItem |
10949 | _core_.MenuItem_swigregister(MenuItemPtr) | |
d55e5bfc | 10950 | |
5b5c9bc7 RD |
10951 | def MenuItem_GetLabelFromText(*args, **kwargs): |
10952 | """MenuItem_GetLabelFromText(String text) -> String""" | |
10953 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d55e5bfc | 10954 | |
5b5c9bc7 RD |
10955 | def MenuItem_GetDefaultMarginWidth(*args, **kwargs): |
10956 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
10957 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) | |
d55e5bfc RD |
10958 | |
10959 | #--------------------------------------------------------------------------- | |
10960 | ||
5b5c9bc7 | 10961 | class Control(Window): |
d55e5bfc RD |
10962 | """ |
10963 | This is the base class for a control or 'widget'. | |
10964 | ||
15817c7e RD |
10965 | A control is generally a small window which processes user input |
10966 | and/or displays one or more item of data. | |
d55e5bfc RD |
10967 | """ |
10968 | def __repr__(self): | |
10969 | return "<%s.%s; proxy of C++ wxControl instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
10970 | def __init__(self, *args, **kwargs): | |
10971 | """ | |
5b5c9bc7 RD |
10972 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10973 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
10974 | String name=ControlNameStr) -> Control | |
d55e5bfc | 10975 | |
15817c7e RD |
10976 | Create a Control. Normally you should only call this from a subclass' |
10977 | __init__ as a plain old wx.Control is not very useful. | |
d55e5bfc | 10978 | """ |
5b5c9bc7 | 10979 | newobj = _core_.new_Control(*args, **kwargs) |
d55e5bfc RD |
10980 | self.this = newobj.this |
10981 | self.thisown = 1 | |
10982 | del newobj.thisown | |
10983 | self._setOORInfo(self) | |
10984 | ||
10985 | def Create(*args, **kwargs): | |
10986 | """ | |
5b5c9bc7 RD |
10987 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10988 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
10989 | String name=ControlNameStr) -> bool | |
d55e5bfc RD |
10990 | |
10991 | Do the 2nd phase and create the GUI control. | |
10992 | """ | |
5b5c9bc7 | 10993 | return _core_.Control_Create(*args, **kwargs) |
d55e5bfc RD |
10994 | |
10995 | def Command(*args, **kwargs): | |
10996 | """ | |
5b5c9bc7 | 10997 | Command(self, CommandEvent event) |
d55e5bfc | 10998 | |
15817c7e RD |
10999 | Simulates the effect of the user issuing a command to the item. |
11000 | ||
11001 | :see: `wx.CommandEvent` | |
11002 | ||
d55e5bfc | 11003 | """ |
5b5c9bc7 | 11004 | return _core_.Control_Command(*args, **kwargs) |
d55e5bfc RD |
11005 | |
11006 | def GetLabel(*args, **kwargs): | |
11007 | """ | |
5b5c9bc7 | 11008 | GetLabel(self) -> String |
d55e5bfc RD |
11009 | |
11010 | Return a control's text. | |
11011 | """ | |
5b5c9bc7 | 11012 | return _core_.Control_GetLabel(*args, **kwargs) |
d55e5bfc RD |
11013 | |
11014 | def SetLabel(*args, **kwargs): | |
11015 | """ | |
5b5c9bc7 | 11016 | SetLabel(self, String label) |
d55e5bfc RD |
11017 | |
11018 | Sets the item's text. | |
11019 | """ | |
5b5c9bc7 | 11020 | return _core_.Control_SetLabel(*args, **kwargs) |
d55e5bfc RD |
11021 | |
11022 | def GetClassDefaultAttributes(*args, **kwargs): | |
110da5b0 | 11023 | """ |
5b5c9bc7 | 11024 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
110da5b0 RD |
11025 | |
11026 | Get the default attributes for this class. This is useful if you want | |
11027 | to use the same font or colour in your own control as in a standard | |
11028 | control -- which is a much better idea than hard coding specific | |
11029 | colours or fonts which might look completely out of place on the | |
11030 | user's system, especially if it uses themes. | |
11031 | ||
11032 | The variant parameter is only relevant under Mac currently and is | |
11033 | ignore under other platforms. Under Mac, it will change the size of | |
11034 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11035 | this. | |
11036 | """ | |
5b5c9bc7 | 11037 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
11038 | |
11039 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
11040 | ||
5b5c9bc7 | 11041 | class ControlPtr(Control): |
d55e5bfc RD |
11042 | def __init__(self, this): |
11043 | self.this = this | |
11044 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11045 | self.__class__ = Control |
11046 | _core_.Control_swigregister(ControlPtr) | |
d55e5bfc RD |
11047 | ControlNameStr = cvar.ControlNameStr |
11048 | ||
11049 | def PreControl(*args, **kwargs): | |
11050 | """ | |
5b5c9bc7 | 11051 | PreControl() -> Control |
d55e5bfc RD |
11052 | |
11053 | Precreate a Control control for 2-phase creation | |
11054 | """ | |
5b5c9bc7 | 11055 | val = _core_.new_PreControl(*args, **kwargs) |
d55e5bfc RD |
11056 | val.thisown = 1 |
11057 | return val | |
11058 | ||
5b5c9bc7 | 11059 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 | 11060 | """ |
5b5c9bc7 | 11061 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
110da5b0 RD |
11062 | |
11063 | Get the default attributes for this class. This is useful if you want | |
11064 | to use the same font or colour in your own control as in a standard | |
11065 | control -- which is a much better idea than hard coding specific | |
11066 | colours or fonts which might look completely out of place on the | |
11067 | user's system, especially if it uses themes. | |
11068 | ||
11069 | The variant parameter is only relevant under Mac currently and is | |
11070 | ignore under other platforms. Under Mac, it will change the size of | |
11071 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11072 | this. | |
11073 | """ | |
5b5c9bc7 | 11074 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
d55e5bfc RD |
11075 | |
11076 | #--------------------------------------------------------------------------- | |
11077 | ||
5b5c9bc7 | 11078 | class ItemContainer(object): |
d55e5bfc | 11079 | """ |
53aa7709 RD |
11080 | The wx.ItemContainer class defines an interface which is implemented |
11081 | by all controls which have string subitems, each of which may be | |
11082 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
11083 | as `wx.ComboBox` which implements an extended interface deriving from | |
15817c7e | 11084 | this one. |
d55e5bfc | 11085 | |
15817c7e RD |
11086 | It defines the methods for accessing the control's items and although |
11087 | each of the derived classes implements them differently, they still | |
11088 | all conform to the same interface. | |
d55e5bfc | 11089 | |
15817c7e RD |
11090 | The items in a wx.ItemContainer have (non empty) string labels and, |
11091 | optionally, client data associated with them. | |
d55e5bfc RD |
11092 | |
11093 | """ | |
11094 | def __init__(self): raise RuntimeError, "No constructor defined" | |
11095 | def __repr__(self): | |
11096 | return "<%s.%s; proxy of C++ wxItemContainer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11097 | def Append(*args, **kwargs): | |
11098 | """ | |
5b5c9bc7 | 11099 | Append(self, String item, PyObject clientData=None) -> int |
d55e5bfc | 11100 | |
15817c7e RD |
11101 | Adds the item to the control, associating the given data with the item |
11102 | if not None. The return value is the index of the newly added item | |
11103 | which may be different from the last one if the control is sorted (e.g. | |
11104 | has wx.LB_SORT or wx.CB_SORT style). | |
d55e5bfc | 11105 | """ |
5b5c9bc7 | 11106 | return _core_.ItemContainer_Append(*args, **kwargs) |
d55e5bfc RD |
11107 | |
11108 | def AppendItems(*args, **kwargs): | |
11109 | """ | |
f5b96ee1 | 11110 | AppendItems(self, List strings) |
d55e5bfc | 11111 | |
15817c7e RD |
11112 | Apend several items at once to the control. Notice that calling this |
11113 | method may be much faster than appending the items one by one if you | |
11114 | need to add a lot of items. | |
d55e5bfc | 11115 | """ |
5b5c9bc7 | 11116 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
d55e5bfc RD |
11117 | |
11118 | def Insert(*args, **kwargs): | |
11119 | """ | |
5b5c9bc7 | 11120 | Insert(self, String item, int pos, PyObject clientData=None) -> int |
d55e5bfc | 11121 | |
15817c7e | 11122 | Insert an item into the control before the item at the ``pos`` index, |
d55e5bfc RD |
11123 | optionally associating some data object with the item. |
11124 | """ | |
5b5c9bc7 | 11125 | return _core_.ItemContainer_Insert(*args, **kwargs) |
d55e5bfc RD |
11126 | |
11127 | def Clear(*args, **kwargs): | |
11128 | """ | |
11129 | Clear(self) | |
11130 | ||
11131 | Removes all items from the control. | |
11132 | """ | |
5b5c9bc7 | 11133 | return _core_.ItemContainer_Clear(*args, **kwargs) |
d55e5bfc RD |
11134 | |
11135 | def Delete(*args, **kwargs): | |
11136 | """ | |
11137 | Delete(self, int n) | |
11138 | ||
15817c7e RD |
11139 | Deletes the item at the zero-based index 'n' from the control. Note |
11140 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
11141 | enabled) to remove an item with the index negative or greater or equal | |
11142 | than the number of items in the control. | |
d55e5bfc | 11143 | """ |
5b5c9bc7 | 11144 | return _core_.ItemContainer_Delete(*args, **kwargs) |
d55e5bfc | 11145 | |
53aa7709 RD |
11146 | def GetClientData(*args, **kwargs): |
11147 | """ | |
11148 | GetClientData(self, int n) -> PyObject | |
11149 | ||
11150 | Returns the client data associated with the given item, (if any.) | |
11151 | """ | |
5b5c9bc7 | 11152 | return _core_.ItemContainer_GetClientData(*args, **kwargs) |
53aa7709 RD |
11153 | |
11154 | def SetClientData(*args, **kwargs): | |
11155 | """ | |
11156 | SetClientData(self, int n, PyObject clientData) | |
11157 | ||
11158 | Associate the given client data with the item at position n. | |
11159 | """ | |
5b5c9bc7 | 11160 | return _core_.ItemContainer_SetClientData(*args, **kwargs) |
53aa7709 | 11161 | |
d55e5bfc RD |
11162 | def GetCount(*args, **kwargs): |
11163 | """ | |
11164 | GetCount(self) -> int | |
11165 | ||
11166 | Returns the number of items in the control. | |
11167 | """ | |
5b5c9bc7 | 11168 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
d55e5bfc RD |
11169 | |
11170 | def IsEmpty(*args, **kwargs): | |
11171 | """ | |
11172 | IsEmpty(self) -> bool | |
11173 | ||
11174 | Returns True if the control is empty or False if it has some items. | |
11175 | """ | |
5b5c9bc7 | 11176 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
d55e5bfc RD |
11177 | |
11178 | def GetString(*args, **kwargs): | |
11179 | """ | |
5b5c9bc7 | 11180 | GetString(self, int n) -> String |
d55e5bfc RD |
11181 | |
11182 | Returns the label of the item with the given index. | |
11183 | """ | |
5b5c9bc7 | 11184 | return _core_.ItemContainer_GetString(*args, **kwargs) |
d55e5bfc RD |
11185 | |
11186 | def GetStrings(*args, **kwargs): | |
11187 | """GetStrings(self) -> wxArrayString""" | |
5b5c9bc7 | 11188 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
d55e5bfc RD |
11189 | |
11190 | def SetString(*args, **kwargs): | |
11191 | """ | |
5b5c9bc7 | 11192 | SetString(self, int n, String s) |
d55e5bfc RD |
11193 | |
11194 | Sets the label for the given item. | |
11195 | """ | |
5b5c9bc7 | 11196 | return _core_.ItemContainer_SetString(*args, **kwargs) |
d55e5bfc RD |
11197 | |
11198 | def FindString(*args, **kwargs): | |
11199 | """ | |
5b5c9bc7 | 11200 | FindString(self, String s) -> int |
d55e5bfc RD |
11201 | |
11202 | Finds an item whose label matches the given string. Returns the | |
15817c7e RD |
11203 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
11204 | found. | |
d55e5bfc | 11205 | """ |
5b5c9bc7 | 11206 | return _core_.ItemContainer_FindString(*args, **kwargs) |
d55e5bfc | 11207 | |
53aa7709 | 11208 | def SetSelection(*args, **kwargs): |
d55e5bfc | 11209 | """ |
53aa7709 | 11210 | SetSelection(self, int n) |
d55e5bfc RD |
11211 | |
11212 | Sets the item at index 'n' to be the selected item. | |
11213 | """ | |
5b5c9bc7 | 11214 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
d55e5bfc | 11215 | |
d55e5bfc RD |
11216 | def GetSelection(*args, **kwargs): |
11217 | """ | |
11218 | GetSelection(self) -> int | |
11219 | ||
15817c7e RD |
11220 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
11221 | is selected. | |
d55e5bfc | 11222 | """ |
5b5c9bc7 | 11223 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
d55e5bfc | 11224 | |
53aa7709 | 11225 | def SetStringSelection(*args, **kwargs): |
5b5c9bc7 RD |
11226 | """SetStringSelection(self, String s) -> bool""" |
11227 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
53aa7709 | 11228 | |
d55e5bfc RD |
11229 | def GetStringSelection(*args, **kwargs): |
11230 | """ | |
5b5c9bc7 | 11231 | GetStringSelection(self) -> String |
d55e5bfc | 11232 | |
15817c7e RD |
11233 | Returns the label of the selected item or an empty string if no item |
11234 | is selected. | |
d55e5bfc | 11235 | """ |
5b5c9bc7 | 11236 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
d55e5bfc | 11237 | |
53aa7709 | 11238 | def Select(*args, **kwargs): |
d55e5bfc | 11239 | """ |
53aa7709 | 11240 | Select(self, int n) |
d55e5bfc | 11241 | |
53aa7709 RD |
11242 | This is the same as `SetSelection` and exists only because it is |
11243 | slightly more natural for controls which support multiple selection. | |
d55e5bfc | 11244 | """ |
5b5c9bc7 | 11245 | return _core_.ItemContainer_Select(*args, **kwargs) |
d55e5bfc RD |
11246 | |
11247 | ||
5b5c9bc7 | 11248 | class ItemContainerPtr(ItemContainer): |
d55e5bfc RD |
11249 | def __init__(self, this): |
11250 | self.this = this | |
11251 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11252 | self.__class__ = ItemContainer |
11253 | _core_.ItemContainer_swigregister(ItemContainerPtr) | |
d55e5bfc RD |
11254 | |
11255 | #--------------------------------------------------------------------------- | |
11256 | ||
5b5c9bc7 | 11257 | class ControlWithItems(Control,ItemContainer): |
d55e5bfc | 11258 | """ |
15817c7e RD |
11259 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
11260 | wx.Control class, and is used for the base class of various controls | |
11261 | that have items. | |
d55e5bfc RD |
11262 | """ |
11263 | def __init__(self): raise RuntimeError, "No constructor defined" | |
11264 | def __repr__(self): | |
11265 | return "<%s.%s; proxy of C++ wxControlWithItems instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11266 | ||
5b5c9bc7 | 11267 | class ControlWithItemsPtr(ControlWithItems): |
d55e5bfc RD |
11268 | def __init__(self, this): |
11269 | self.this = this | |
11270 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11271 | self.__class__ = ControlWithItems |
11272 | _core_.ControlWithItems_swigregister(ControlWithItemsPtr) | |
d55e5bfc RD |
11273 | |
11274 | #--------------------------------------------------------------------------- | |
11275 | ||
5b5c9bc7 | 11276 | class SizerItem(Object): |
bfddbb17 RD |
11277 | """ |
11278 | The wx.SizerItem class is used to track the position, size and other | |
11279 | attributes of each item managed by a `wx.Sizer`. In normal usage user | |
11280 | code should never need to deal directly with a wx.SizerItem, but | |
11281 | custom classes derived from `wx.PySizer` will probably need to use the | |
11282 | collection of wx.SizerItems held by wx.Sizer when calculating layout. | |
11283 | ||
11284 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
11285 | """ | |
d55e5bfc RD |
11286 | def __repr__(self): |
11287 | return "<%s.%s; proxy of C++ wxSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11288 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 11289 | """ |
5b5c9bc7 | 11290 | __init__(self) -> SizerItem |
bfddbb17 RD |
11291 | |
11292 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
11293 | size will need to be set before this item can be used in a Sizer. | |
11294 | ||
11295 | You will probably never need to create a wx.SizerItem directly as they | |
11296 | are created automatically when the sizer's Add, Insert or Prepend | |
11297 | methods are called. | |
11298 | ||
11299 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
11300 | """ | |
5b5c9bc7 | 11301 | newobj = _core_.new_SizerItem(*args, **kwargs) |
d55e5bfc RD |
11302 | self.this = newobj.this |
11303 | self.thisown = 1 | |
11304 | del newobj.thisown | |
11305 | def DeleteWindows(*args, **kwargs): | |
bfddbb17 RD |
11306 | """ |
11307 | DeleteWindows(self) | |
11308 | ||
11309 | Destroy the window or the windows in a subsizer, depending on the type | |
11310 | of item. | |
11311 | """ | |
5b5c9bc7 | 11312 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
d55e5bfc RD |
11313 | |
11314 | def DetachSizer(*args, **kwargs): | |
bfddbb17 RD |
11315 | """ |
11316 | DetachSizer(self) | |
11317 | ||
11318 | Enable deleting the SizerItem without destroying the contained sizer. | |
11319 | """ | |
5b5c9bc7 | 11320 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
d55e5bfc RD |
11321 | |
11322 | def GetSize(*args, **kwargs): | |
bfddbb17 | 11323 | """ |
5b5c9bc7 | 11324 | GetSize(self) -> Size |
bfddbb17 RD |
11325 | |
11326 | Get the current size of the item, as set in the last Layout. | |
11327 | """ | |
5b5c9bc7 | 11328 | return _core_.SizerItem_GetSize(*args, **kwargs) |
d55e5bfc RD |
11329 | |
11330 | def CalcMin(*args, **kwargs): | |
bfddbb17 | 11331 | """ |
5b5c9bc7 | 11332 | CalcMin(self) -> Size |
bfddbb17 RD |
11333 | |
11334 | Calculates the minimum desired size for the item, including any space | |
11335 | needed by borders. | |
11336 | """ | |
5b5c9bc7 | 11337 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
d55e5bfc RD |
11338 | |
11339 | def SetDimension(*args, **kwargs): | |
bfddbb17 | 11340 | """ |
5b5c9bc7 | 11341 | SetDimension(self, Point pos, Size size) |
bfddbb17 RD |
11342 | |
11343 | Set the position and size of the space allocated for this item by the | |
11344 | sizer, and adjust the position and size of the item (window or | |
11345 | subsizer) to be within that space taking alignment and borders into | |
11346 | account. | |
11347 | """ | |
5b5c9bc7 | 11348 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
d55e5bfc RD |
11349 | |
11350 | def GetMinSize(*args, **kwargs): | |
bfddbb17 | 11351 | """ |
5b5c9bc7 | 11352 | GetMinSize(self) -> Size |
bfddbb17 RD |
11353 | |
11354 | Get the minimum size needed for the item. | |
11355 | """ | |
5b5c9bc7 | 11356 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
d55e5bfc | 11357 | |
a001823c RD |
11358 | def GetMinSizeWithBorder(*args, **kwargs): |
11359 | """ | |
5b5c9bc7 | 11360 | GetMinSizeWithBorder(self) -> Size |
a001823c RD |
11361 | |
11362 | Get the minimum size needed for the item with space for the borders | |
11363 | added, if needed. | |
11364 | """ | |
5b5c9bc7 | 11365 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) |
a001823c | 11366 | |
d55e5bfc RD |
11367 | def SetInitSize(*args, **kwargs): |
11368 | """SetInitSize(self, int x, int y)""" | |
5b5c9bc7 | 11369 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
d55e5bfc RD |
11370 | |
11371 | def SetRatioWH(*args, **kwargs): | |
bfddbb17 RD |
11372 | """ |
11373 | SetRatioWH(self, int width, int height) | |
11374 | ||
11375 | Set the ratio item attribute. | |
11376 | """ | |
5b5c9bc7 | 11377 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
d55e5bfc RD |
11378 | |
11379 | def SetRatioSize(*args, **kwargs): | |
bfddbb17 | 11380 | """ |
5b5c9bc7 | 11381 | SetRatioSize(self, Size size) |
bfddbb17 RD |
11382 | |
11383 | Set the ratio item attribute. | |
11384 | """ | |
5b5c9bc7 | 11385 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
d55e5bfc RD |
11386 | |
11387 | def SetRatio(*args, **kwargs): | |
bfddbb17 RD |
11388 | """ |
11389 | SetRatio(self, float ratio) | |
11390 | ||
11391 | Set the ratio item attribute. | |
11392 | """ | |
5b5c9bc7 | 11393 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
d55e5bfc RD |
11394 | |
11395 | def GetRatio(*args, **kwargs): | |
bfddbb17 RD |
11396 | """ |
11397 | GetRatio(self) -> float | |
11398 | ||
11399 | Set the ratio item attribute. | |
11400 | """ | |
5b5c9bc7 | 11401 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
d55e5bfc | 11402 | |
070c48b4 RD |
11403 | def GetRect(*args, **kwargs): |
11404 | """ | |
5b5c9bc7 | 11405 | GetRect(self) -> Rect |
070c48b4 RD |
11406 | |
11407 | Returns the rectangle that the sizer item should occupy | |
11408 | """ | |
5b5c9bc7 | 11409 | return _core_.SizerItem_GetRect(*args, **kwargs) |
070c48b4 | 11410 | |
d55e5bfc | 11411 | def IsWindow(*args, **kwargs): |
bfddbb17 RD |
11412 | """ |
11413 | IsWindow(self) -> bool | |
11414 | ||
11415 | Is this sizer item a window? | |
11416 | """ | |
5b5c9bc7 | 11417 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
d55e5bfc RD |
11418 | |
11419 | def IsSizer(*args, **kwargs): | |
bfddbb17 RD |
11420 | """ |
11421 | IsSizer(self) -> bool | |
11422 | ||
11423 | Is this sizer item a subsizer? | |
11424 | """ | |
5b5c9bc7 | 11425 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
d55e5bfc RD |
11426 | |
11427 | def IsSpacer(*args, **kwargs): | |
bfddbb17 RD |
11428 | """ |
11429 | IsSpacer(self) -> bool | |
11430 | ||
11431 | Is this sizer item a spacer? | |
11432 | """ | |
5b5c9bc7 | 11433 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
d55e5bfc RD |
11434 | |
11435 | def SetProportion(*args, **kwargs): | |
bfddbb17 RD |
11436 | """ |
11437 | SetProportion(self, int proportion) | |
11438 | ||
11439 | Set the proportion value for this item. | |
11440 | """ | |
5b5c9bc7 | 11441 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
d55e5bfc RD |
11442 | |
11443 | def GetProportion(*args, **kwargs): | |
bfddbb17 RD |
11444 | """ |
11445 | GetProportion(self) -> int | |
11446 | ||
11447 | Get the proportion value for this item. | |
11448 | """ | |
5b5c9bc7 | 11449 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
d55e5bfc | 11450 | |
bfddbb17 RD |
11451 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
11452 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
d55e5bfc | 11453 | def SetFlag(*args, **kwargs): |
bfddbb17 RD |
11454 | """ |
11455 | SetFlag(self, int flag) | |
11456 | ||
11457 | Set the flag value for this item. | |
11458 | """ | |
5b5c9bc7 | 11459 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
d55e5bfc RD |
11460 | |
11461 | def GetFlag(*args, **kwargs): | |
bfddbb17 RD |
11462 | """ |
11463 | GetFlag(self) -> int | |
11464 | ||
11465 | Get the flag value for this item. | |
11466 | """ | |
5b5c9bc7 | 11467 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
d55e5bfc RD |
11468 | |
11469 | def SetBorder(*args, **kwargs): | |
bfddbb17 RD |
11470 | """ |
11471 | SetBorder(self, int border) | |
11472 | ||
11473 | Set the border value for this item. | |
11474 | """ | |
5b5c9bc7 | 11475 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
d55e5bfc RD |
11476 | |
11477 | def GetBorder(*args, **kwargs): | |
bfddbb17 RD |
11478 | """ |
11479 | GetBorder(self) -> int | |
11480 | ||
11481 | Get the border value for this item. | |
11482 | """ | |
5b5c9bc7 | 11483 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
d55e5bfc RD |
11484 | |
11485 | def GetWindow(*args, **kwargs): | |
bfddbb17 | 11486 | """ |
5b5c9bc7 | 11487 | GetWindow(self) -> Window |
bfddbb17 RD |
11488 | |
11489 | Get the window (if any) that is managed by this sizer item. | |
11490 | """ | |
5b5c9bc7 | 11491 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
d55e5bfc RD |
11492 | |
11493 | def SetWindow(*args, **kwargs): | |
bfddbb17 | 11494 | """ |
5b5c9bc7 | 11495 | SetWindow(self, Window window) |
bfddbb17 RD |
11496 | |
11497 | Set the window to be managed by this sizer item. | |
11498 | """ | |
5b5c9bc7 | 11499 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
d55e5bfc RD |
11500 | |
11501 | def GetSizer(*args, **kwargs): | |
bfddbb17 | 11502 | """ |
5b5c9bc7 | 11503 | GetSizer(self) -> Sizer |
bfddbb17 RD |
11504 | |
11505 | Get the subsizer (if any) that is managed by this sizer item. | |
11506 | """ | |
5b5c9bc7 | 11507 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
d55e5bfc RD |
11508 | |
11509 | def SetSizer(*args, **kwargs): | |
bfddbb17 | 11510 | """ |
5b5c9bc7 | 11511 | SetSizer(self, Sizer sizer) |
bfddbb17 RD |
11512 | |
11513 | Set the subsizer to be managed by this sizer item. | |
11514 | """ | |
5b5c9bc7 | 11515 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
d55e5bfc RD |
11516 | |
11517 | def GetSpacer(*args, **kwargs): | |
bfddbb17 | 11518 | """ |
5b5c9bc7 | 11519 | GetSpacer(self) -> Size |
bfddbb17 RD |
11520 | |
11521 | Get the size of the spacer managed by this sizer item. | |
11522 | """ | |
5b5c9bc7 | 11523 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
d55e5bfc RD |
11524 | |
11525 | def SetSpacer(*args, **kwargs): | |
bfddbb17 | 11526 | """ |
5b5c9bc7 | 11527 | SetSpacer(self, Size size) |
bfddbb17 RD |
11528 | |
11529 | Set the size of the spacer to be managed by this sizer item. | |
11530 | """ | |
5b5c9bc7 | 11531 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
d55e5bfc RD |
11532 | |
11533 | def Show(*args, **kwargs): | |
bfddbb17 RD |
11534 | """ |
11535 | Show(self, bool show) | |
11536 | ||
11537 | Set the show item attribute, which sizers use to determine if the item | |
11538 | is to be made part of the layout or not. If the item is tracking a | |
11539 | window then it is shown or hidden as needed. | |
11540 | """ | |
5b5c9bc7 | 11541 | return _core_.SizerItem_Show(*args, **kwargs) |
d55e5bfc RD |
11542 | |
11543 | def IsShown(*args, **kwargs): | |
bfddbb17 RD |
11544 | """ |
11545 | IsShown(self) -> bool | |
11546 | ||
11547 | Is the item to be shown in the layout? | |
11548 | """ | |
5b5c9bc7 | 11549 | return _core_.SizerItem_IsShown(*args, **kwargs) |
d55e5bfc RD |
11550 | |
11551 | def GetPosition(*args, **kwargs): | |
bfddbb17 | 11552 | """ |
5b5c9bc7 | 11553 | GetPosition(self) -> Point |
bfddbb17 RD |
11554 | |
11555 | Returns the current position of the item, as set in the last Layout. | |
11556 | """ | |
5b5c9bc7 | 11557 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
d55e5bfc RD |
11558 | |
11559 | def GetUserData(*args, **kwargs): | |
bfddbb17 RD |
11560 | """ |
11561 | GetUserData(self) -> PyObject | |
11562 | ||
11563 | Returns the userData associated with this sizer item, or None if there | |
11564 | isn't any. | |
11565 | """ | |
5b5c9bc7 | 11566 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
d55e5bfc RD |
11567 | |
11568 | ||
5b5c9bc7 | 11569 | class SizerItemPtr(SizerItem): |
d55e5bfc RD |
11570 | def __init__(self, this): |
11571 | self.this = this | |
11572 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
11573 | self.__class__ = SizerItem |
11574 | _core_.SizerItem_swigregister(SizerItemPtr) | |
d55e5bfc | 11575 | |
bfddbb17 | 11576 | def SizerItemWindow(*args, **kwargs): |
d55e5bfc | 11577 | """ |
5b5c9bc7 RD |
11578 | SizerItemWindow(Window window, int proportion, int flag, int border, |
11579 | PyObject userData=None) -> SizerItem | |
bfddbb17 RD |
11580 | |
11581 | Constructs a `wx.SizerItem` for tracking a window. | |
d55e5bfc | 11582 | """ |
5b5c9bc7 | 11583 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d55e5bfc RD |
11584 | val.thisown = 1 |
11585 | return val | |
11586 | ||
bfddbb17 | 11587 | def SizerItemSpacer(*args, **kwargs): |
d55e5bfc | 11588 | """ |
bfddbb17 | 11589 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
5b5c9bc7 | 11590 | PyObject userData=None) -> SizerItem |
bfddbb17 RD |
11591 | |
11592 | Constructs a `wx.SizerItem` for tracking a spacer. | |
d55e5bfc | 11593 | """ |
5b5c9bc7 | 11594 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d55e5bfc RD |
11595 | val.thisown = 1 |
11596 | return val | |
11597 | ||
11598 | def SizerItemSizer(*args, **kwargs): | |
11599 | """ | |
5b5c9bc7 RD |
11600 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, |
11601 | PyObject userData=None) -> SizerItem | |
bfddbb17 RD |
11602 | |
11603 | Constructs a `wx.SizerItem` for tracking a subsizer | |
d55e5bfc | 11604 | """ |
5b5c9bc7 | 11605 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d55e5bfc RD |
11606 | val.thisown = 1 |
11607 | return val | |
11608 | ||
5b5c9bc7 | 11609 | class Sizer(Object): |
bfddbb17 RD |
11610 | """ |
11611 | wx.Sizer is the abstract base class used for laying out subwindows in | |
11612 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
11613 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
11614 | `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer` | |
11615 | and `wx.GridBagSizer`. | |
11616 | ||
11617 | The concept implemented by sizers in wxWidgets is closely related to | |
11618 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
11619 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
11620 | subwindows reporting their minimal required size and their ability to | |
11621 | get stretched if the size of the parent window has changed. This will | |
11622 | most often mean that the programmer does not set the original size of | |
11623 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
11624 | this sizer will be queried about the recommended size. The sizer in | |
11625 | turn will query its children, which can be normal windows or contorls, | |
11626 | empty space or other sizers, so that a hierarchy of sizers can be | |
11627 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
11628 | do not interfere with tab ordering and requires very little resources | |
11629 | compared to a real window on screen. | |
11630 | ||
11631 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
11632 | every control reports its own minimal size and the algorithm can | |
11633 | handle differences in font sizes or different window (dialog item) | |
11634 | sizes on different platforms without problems. If for example the | |
11635 | standard font as well as the overall design of Mac widgets requires | |
11636 | more space than on Windows, then the initial size of a dialog using a | |
11637 | sizer will automatically be bigger on Mac than on Windows. | |
11638 | """ | |
d55e5bfc RD |
11639 | def __init__(self): raise RuntimeError, "No constructor defined" |
11640 | def __repr__(self): | |
11641 | return "<%s.%s; proxy of C++ wxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
11642 | def _setOORInfo(*args, **kwargs): | |
11643 | """_setOORInfo(self, PyObject _self)""" | |
5b5c9bc7 | 11644 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
d55e5bfc RD |
11645 | |
11646 | def Add(*args, **kwargs): | |
11647 | """ | |
bfddbb17 | 11648 | Add(self, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11649 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11650 | |
11651 | Appends a child item to the sizer. | |
d55e5bfc | 11652 | """ |
5b5c9bc7 | 11653 | return _core_.Sizer_Add(*args, **kwargs) |
d55e5bfc RD |
11654 | |
11655 | def Insert(*args, **kwargs): | |
11656 | """ | |
bfddbb17 | 11657 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11658 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11659 | |
11660 | Inserts a new item into the list of items managed by this sizer before | |
11661 | the item at index *before*. See `Add` for a description of the parameters. | |
d55e5bfc | 11662 | """ |
5b5c9bc7 | 11663 | return _core_.Sizer_Insert(*args, **kwargs) |
d55e5bfc RD |
11664 | |
11665 | def Prepend(*args, **kwargs): | |
11666 | """ | |
bfddbb17 | 11667 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
070c48b4 | 11668 | PyObject userData=None) -> wx.SizerItem |
bfddbb17 RD |
11669 | |
11670 | Adds a new item to the begining of the list of sizer items managed by | |
11671 | this sizer. See `Add` for a description of the parameters. | |
d55e5bfc | 11672 | """ |
5b5c9bc7 | 11673 | return _core_.Sizer_Prepend(*args, **kwargs) |
d55e5bfc RD |
11674 | |
11675 | def Remove(*args, **kwargs): | |
bfddbb17 RD |
11676 | """ |
11677 | Remove(self, item) -> bool | |
11678 | ||
11679 | Removes an item from the sizer and destroys it. This method does not | |
11680 | cause any layout or resizing to take place, call `Layout` to update | |
11681 | the layout on screen after removing a child from the sizer. The | |
11682 | *item* parameter can be either a window, a sizer, or the zero-based | |
11683 | index of an item to remove. Returns True if the child item was found | |
11684 | and removed. | |
11685 | """ | |
5b5c9bc7 | 11686 | return _core_.Sizer_Remove(*args, **kwargs) |
d55e5bfc | 11687 | |
1a6bba1e | 11688 | def Detach(*args, **kwargs): |
bfddbb17 RD |
11689 | """ |
11690 | Detach(self, item) -> bool | |
11691 | ||
11692 | Detaches an item from the sizer without destroying it. This method | |
11693 | does not cause any layout or resizing to take place, call `Layout` to | |
11694 | do so. The *item* parameter can be either a window, a sizer, or the | |
11695 | zero-based index of the item to be detached. Returns True if the child item | |
11696 | was found and detached. | |
11697 | """ | |
5b5c9bc7 | 11698 | return _core_.Sizer_Detach(*args, **kwargs) |
1a6bba1e | 11699 | |
070c48b4 RD |
11700 | def GetItem(*args, **kwargs): |
11701 | """ | |
11702 | GetItem(self, item) -> wx.SizerItem | |
11703 | ||
11704 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11705 | parameter can be either a window, a sizer, or the zero-based index of | |
4d170c95 | 11706 | the item to be found. |
070c48b4 | 11707 | """ |
5b5c9bc7 | 11708 | return _core_.Sizer_GetItem(*args, **kwargs) |
070c48b4 | 11709 | |
d55e5bfc | 11710 | def _SetItemMinSize(*args, **kwargs): |
5b5c9bc7 RD |
11711 | """_SetItemMinSize(self, PyObject item, Size size)""" |
11712 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) | |
d55e5bfc | 11713 | |
bfddbb17 RD |
11714 | def SetItemMinSize(self, item, *args): |
11715 | """ | |
11716 | SetItemMinSize(self, item, Size size) | |
11717 | ||
11718 | Sets the minimum size that will be allocated for an item in the sizer. | |
11719 | The *item* parameter can be either a window, a sizer, or the | |
11720 | zero-based index of the item. If a window or sizer is given then it | |
11721 | will be searched for recursivly in subsizers if neccessary. | |
11722 | """ | |
11723 | if len(args) == 2: | |
11724 | # for backward compatibility accept separate width,height args too | |
11725 | return self._SetItemMinSize(item, args) | |
11726 | else: | |
11727 | return self._SetItemMinSize(item, args[0]) | |
11728 | ||
d55e5bfc | 11729 | def AddItem(*args, **kwargs): |
bfddbb17 RD |
11730 | """ |
11731 | AddItem(self, SizerItem item) | |
11732 | ||
11733 | Adds a `wx.SizerItem` to the sizer. | |
11734 | """ | |
5b5c9bc7 | 11735 | return _core_.Sizer_AddItem(*args, **kwargs) |
d55e5bfc RD |
11736 | |
11737 | def InsertItem(*args, **kwargs): | |
bfddbb17 RD |
11738 | """ |
11739 | InsertItem(self, int index, SizerItem item) | |
11740 | ||
11741 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11742 | """ | |
5b5c9bc7 | 11743 | return _core_.Sizer_InsertItem(*args, **kwargs) |
d55e5bfc RD |
11744 | |
11745 | def PrependItem(*args, **kwargs): | |
bfddbb17 RD |
11746 | """ |
11747 | PrependItem(self, SizerItem item) | |
11748 | ||
11749 | Prepends a `wx.SizerItem` to the sizer. | |
11750 | """ | |
5b5c9bc7 | 11751 | return _core_.Sizer_PrependItem(*args, **kwargs) |
d55e5bfc | 11752 | |
bfddbb17 | 11753 | def AddMany(self, items): |
d6c14a4c RD |
11754 | """ |
11755 | AddMany is a convenience method for adding several items | |
11756 | to a sizer at one time. Simply pass it a list of tuples, | |
11757 | where each tuple consists of the parameters that you | |
11758 | would normally pass to the `Add` method. | |
11759 | """ | |
bfddbb17 RD |
11760 | for item in items: |
11761 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11762 | item = (item, ) | |
11763 | self.Add(*item) | |
d55e5bfc RD |
11764 | |
11765 | # for backwards compatibility only, please do not use in new code | |
7fbf8399 RD |
11766 | def AddWindow(self, *args, **kw): |
11767 | """Compatibility alias for `Add`.""" | |
11768 | return self.Add(*args, **kw) | |
11769 | def AddSizer(self, *args, **kw): | |
11770 | """Compatibility alias for `Add`.""" | |
11771 | return self.Add(*args, **kw) | |
11772 | def AddSpacer(self, *args, **kw): | |
11773 | """Compatibility alias for `Add`.""" | |
11774 | return self.Add(*args, **kw) | |
11775 | ||
11776 | def PrependWindow(self, *args, **kw): | |
11777 | """Compatibility alias for `Prepend`.""" | |
11778 | return self.Prepend(*args, **kw) | |
11779 | def PrependSizer(self, *args, **kw): | |
11780 | """Compatibility alias for `Prepend`.""" | |
11781 | return self.Prepend(*args, **kw) | |
11782 | def PrependSpacer(self, *args, **kw): | |
11783 | """Compatibility alias for `Prepend`.""" | |
11784 | return self.Prepend(*args, **kw) | |
11785 | ||
11786 | def InsertWindow(self, *args, **kw): | |
11787 | """Compatibility alias for `Insert`.""" | |
11788 | return self.Insert(*args, **kw) | |
11789 | def InsertSizer(self, *args, **kw): | |
11790 | """Compatibility alias for `Insert`.""" | |
11791 | return self.Insert(*args, **kw) | |
11792 | def InsertSpacer(self, *args, **kw): | |
11793 | """Compatibility alias for `Insert`.""" | |
11794 | return self.Insert(*args, **kw) | |
11795 | ||
11796 | def RemoveWindow(self, *args, **kw): | |
11797 | """Compatibility alias for `Remove`.""" | |
11798 | return self.Remove(*args, **kw) | |
11799 | def RemoveSizer(self, *args, **kw): | |
11800 | """Compatibility alias for `Remove`.""" | |
11801 | return self.Remove(*args, **kw) | |
11802 | def RemovePos(self, *args, **kw): | |
11803 | """Compatibility alias for `Remove`.""" | |
11804 | return self.Remove(*args, **kw) | |
d55e5bfc RD |
11805 | |
11806 | ||
d55e5bfc | 11807 | def SetDimension(*args, **kwargs): |
bfddbb17 RD |
11808 | """ |
11809 | SetDimension(self, int x, int y, int width, int height) | |
11810 | ||
11811 | Call this to force the sizer to take the given dimension and thus | |
11812 | force the items owned by the sizer to resize themselves according to | |
11813 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11814 | methods. | |
11815 | """ | |
5b5c9bc7 | 11816 | return _core_.Sizer_SetDimension(*args, **kwargs) |
d55e5bfc RD |
11817 | |
11818 | def SetMinSize(*args, **kwargs): | |
bfddbb17 | 11819 | """ |
5b5c9bc7 | 11820 | SetMinSize(self, Size size) |
bfddbb17 RD |
11821 | |
11822 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11823 | calculate its minimal size based purely on how much space its children | |
11824 | need. After calling this method `GetMinSize` will return either the | |
11825 | minimal size as requested by its children or the minimal size set | |
11826 | here, depending on which is bigger. | |
11827 | """ | |
5b5c9bc7 | 11828 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
d55e5bfc RD |
11829 | |
11830 | def GetSize(*args, **kwargs): | |
bfddbb17 | 11831 | """ |
5b5c9bc7 | 11832 | GetSize(self) -> Size |
bfddbb17 RD |
11833 | |
11834 | Returns the current size of the space managed by the sizer. | |
11835 | """ | |
5b5c9bc7 | 11836 | return _core_.Sizer_GetSize(*args, **kwargs) |
d55e5bfc RD |
11837 | |
11838 | def GetPosition(*args, **kwargs): | |
bfddbb17 | 11839 | """ |
5b5c9bc7 | 11840 | GetPosition(self) -> Point |
bfddbb17 RD |
11841 | |
11842 | Returns the current position of the sizer's managed space. | |
11843 | """ | |
5b5c9bc7 | 11844 | return _core_.Sizer_GetPosition(*args, **kwargs) |
d55e5bfc RD |
11845 | |
11846 | def GetMinSize(*args, **kwargs): | |
bfddbb17 | 11847 | """ |
5b5c9bc7 | 11848 | GetMinSize(self) -> Size |
bfddbb17 RD |
11849 | |
11850 | Returns the minimal size of the sizer. This is either the combined | |
11851 | minimal size of all the children and their borders or the minimal size | |
11852 | set by SetMinSize, depending on which is bigger. | |
11853 | """ | |
5b5c9bc7 | 11854 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
d55e5bfc RD |
11855 | |
11856 | def GetSizeTuple(self): | |
1a6bba1e | 11857 | return self.GetSize().Get() |
d55e5bfc | 11858 | def GetPositionTuple(self): |
1a6bba1e | 11859 | return self.GetPosition().Get() |
d55e5bfc | 11860 | def GetMinSizeTuple(self): |
1a6bba1e | 11861 | return self.GetMinSize().Get() |
d55e5bfc RD |
11862 | |
11863 | def RecalcSizes(*args, **kwargs): | |
bfddbb17 RD |
11864 | """ |
11865 | RecalcSizes(self) | |
11866 | ||
11867 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11868 | items managed by this sizer. You should not need to call this directly as | |
11869 | it is called by `Layout`. | |
11870 | """ | |
5b5c9bc7 | 11871 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
d55e5bfc RD |
11872 | |
11873 | def CalcMin(*args, **kwargs): | |
bfddbb17 | 11874 | """ |
5b5c9bc7 | 11875 | CalcMin(self) -> Size |
bfddbb17 RD |
11876 | |
11877 | This method is where the sizer will do the actual calculation of its | |
11878 | children's minimal sizes. You should not need to call this directly as | |
11879 | it is called by `Layout`. | |
11880 | """ | |
5b5c9bc7 | 11881 | return _core_.Sizer_CalcMin(*args, **kwargs) |
d55e5bfc RD |
11882 | |
11883 | def Layout(*args, **kwargs): | |
bfddbb17 RD |
11884 | """ |
11885 | Layout(self) | |
11886 | ||
11887 | This method will force the recalculation and layout of the items | |
11888 | controlled by the sizer using the current space allocated to the | |
11889 | sizer. Normally this is called automatically from the owning window's | |
11890 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11891 | one of the items in a sizer change size, or items are added or | |
11892 | removed. | |
11893 | """ | |
5b5c9bc7 | 11894 | return _core_.Sizer_Layout(*args, **kwargs) |
d55e5bfc RD |
11895 | |
11896 | def Fit(*args, **kwargs): | |
bfddbb17 | 11897 | """ |
5b5c9bc7 | 11898 | Fit(self, Window window) -> Size |
bfddbb17 RD |
11899 | |
11900 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11901 | size. This is commonly done in the constructor of the window itself in | |
11902 | order to set its initial size to match the needs of the children as | |
11903 | determined by the sizer. Returns the new size. | |
11904 | ||
11905 | For a top level window this is the total window size, not the client size. | |
11906 | """ | |
5b5c9bc7 | 11907 | return _core_.Sizer_Fit(*args, **kwargs) |
d55e5bfc RD |
11908 | |
11909 | def FitInside(*args, **kwargs): | |
bfddbb17 | 11910 | """ |
5b5c9bc7 | 11911 | FitInside(self, Window window) |
bfddbb17 RD |
11912 | |
11913 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
11914 | sizer's minimal size. This will not alter the on screen size of the | |
11915 | window, but may cause the addition/removal/alteration of scrollbars | |
11916 | required to view the virtual area in windows which manage it. | |
11917 | ||
11918 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
11919 | ||
11920 | """ | |
5b5c9bc7 | 11921 | return _core_.Sizer_FitInside(*args, **kwargs) |
d55e5bfc RD |
11922 | |
11923 | def SetSizeHints(*args, **kwargs): | |
bfddbb17 | 11924 | """ |
5b5c9bc7 | 11925 | SetSizeHints(self, Window window) |
bfddbb17 RD |
11926 | |
11927 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
11928 | match the sizer's minimal size. This is commonly done in the | |
11929 | constructor of the window itself if the window is resizable (as are | |
11930 | many dialogs under Unix and frames on probably all platforms) in order | |
11931 | to prevent the window from being sized smaller than the minimal size | |
11932 | required by the sizer. | |
11933 | """ | |
5b5c9bc7 | 11934 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
d55e5bfc RD |
11935 | |
11936 | def SetVirtualSizeHints(*args, **kwargs): | |
bfddbb17 | 11937 | """ |
5b5c9bc7 | 11938 | SetVirtualSizeHints(self, Window window) |
bfddbb17 RD |
11939 | |
11940 | Tell the sizer to set the minimal size of the window virtual area to | |
11941 | match the sizer's minimal size. For windows with managed scrollbars | |
11942 | this will set them appropriately. | |
11943 | ||
11944 | :see: `wx.ScrolledWindow.SetScrollbars` | |
11945 | ||
11946 | """ | |
5b5c9bc7 | 11947 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
d55e5bfc RD |
11948 | |
11949 | def Clear(*args, **kwargs): | |
bfddbb17 RD |
11950 | """ |
11951 | Clear(self, bool deleteWindows=False) | |
11952 | ||
11953 | Clear all items from the sizer, optionally destroying the window items | |
11954 | as well. | |
11955 | """ | |
5b5c9bc7 | 11956 | return _core_.Sizer_Clear(*args, **kwargs) |
d55e5bfc RD |
11957 | |
11958 | def DeleteWindows(*args, **kwargs): | |
bfddbb17 RD |
11959 | """ |
11960 | DeleteWindows(self) | |
11961 | ||
11962 | Destroy all windows managed by the sizer. | |
11963 | """ | |
5b5c9bc7 | 11964 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
d55e5bfc RD |
11965 | |
11966 | def GetChildren(*args, **kwargs): | |
bfddbb17 | 11967 | """ |
51b83b37 | 11968 | GetChildren(self) -> list |
bfddbb17 RD |
11969 | |
11970 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
11971 | """ | |
5b5c9bc7 | 11972 | return _core_.Sizer_GetChildren(*args, **kwargs) |
d55e5bfc RD |
11973 | |
11974 | def Show(*args, **kwargs): | |
bfddbb17 | 11975 | """ |
b411df4a | 11976 | Show(self, item, bool show=True, bool recursive=false) -> bool |
d55e5bfc | 11977 | |
bfddbb17 RD |
11978 | Shows or hides an item managed by the sizer. To make a sizer item |
11979 | disappear or reappear, use Show followed by `Layout`. The *item* | |
11980 | parameter can be either a window, a sizer, or the zero-based index of | |
629e65c2 RD |
11981 | the item. Use the recursive parameter to show or hide an item in a |
11982 | subsizer. Returns True if the item was found. | |
bfddbb17 | 11983 | """ |
5b5c9bc7 | 11984 | return _core_.Sizer_Show(*args, **kwargs) |
d55e5bfc RD |
11985 | |
11986 | def IsShown(*args, **kwargs): | |
bfddbb17 RD |
11987 | """ |
11988 | IsShown(self, item) | |
11989 | ||
11990 | Determines if the item is currently shown. sizer. To make a sizer | |
11991 | item disappear or reappear, use Show followed by `Layout`. The *item* | |
11992 | parameter can be either a window, a sizer, or the zero-based index of | |
11993 | the item. | |
11994 | """ | |
5b5c9bc7 | 11995 | return _core_.Sizer_IsShown(*args, **kwargs) |
d55e5bfc | 11996 | |
629e65c2 | 11997 | def Hide(self, item, recursive=False): |
bfddbb17 | 11998 | """ |
27fb7603 | 11999 | A convenience method for `Show` (item, False, recursive). |
bfddbb17 | 12000 | """ |
06759a38 | 12001 | return self.Show(item, False, recursive) |
bfddbb17 | 12002 | |
d55e5bfc | 12003 | def ShowItems(*args, **kwargs): |
bfddbb17 RD |
12004 | """ |
12005 | ShowItems(self, bool show) | |
12006 | ||
84f85550 | 12007 | Recursively call `wx.SizerItem.Show` on all sizer items. |
bfddbb17 | 12008 | """ |
5b5c9bc7 | 12009 | return _core_.Sizer_ShowItems(*args, **kwargs) |
d55e5bfc RD |
12010 | |
12011 | ||
5b5c9bc7 | 12012 | class SizerPtr(Sizer): |
d55e5bfc RD |
12013 | def __init__(self, this): |
12014 | self.this = this | |
12015 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12016 | self.__class__ = Sizer |
12017 | _core_.Sizer_swigregister(SizerPtr) | |
d55e5bfc | 12018 | |
5b5c9bc7 | 12019 | class PySizer(Sizer): |
bfddbb17 RD |
12020 | """ |
12021 | wx.PySizer is a special version of `wx.Sizer` that has been | |
12022 | instrumented to allow the C++ virtual methods to be overloaded in | |
12023 | Python derived classes. You would derive from this class if you are | |
12024 | wanting to implement a custom sizer in Python code. Simply implement | |
12025 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
12026 | For example:: | |
12027 | ||
12028 | class MySizer(wx.PySizer): | |
12029 | def __init__(self): | |
12030 | wx.PySizer.__init__(self) | |
12031 | ||
12032 | def CalcMin(self): | |
12033 | for item in self.GetChildren(): | |
12034 | # calculate the total minimum width and height needed | |
12035 | # by all items in the sizer according to this sizer's | |
12036 | # layout algorithm. | |
12037 | ... | |
12038 | return wx.Size(width, height) | |
12039 | ||
12040 | def RecalcSizes(self): | |
12041 | # find the space allotted to this sizer | |
12042 | pos = self.GetPosition() | |
12043 | size = self.GetSize() | |
12044 | for item in self.GetChildren(): | |
12045 | # Recalculate (if necessary) the position and size of | |
12046 | # each item and then call item.SetDimension to do the | |
12047 | # actual positioning and sizing of the items within the | |
12048 | # space alloted to this sizer. | |
12049 | ... | |
12050 | item.SetDimension(itemPos, itemSize) | |
12051 | ||
12052 | ||
12053 | When `Layout` is called it first calls `CalcMin` followed by | |
12054 | `RecalcSizes` so you can optimize a bit by saving the results of | |
62d32a5f | 12055 | `CalcMin` and reusing them in `RecalcSizes`. |
bfddbb17 RD |
12056 | |
12057 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
12058 | ||
12059 | ||
12060 | """ | |
d55e5bfc RD |
12061 | def __repr__(self): |
12062 | return "<%s.%s; proxy of C++ wxPySizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12063 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12064 | """ |
5b5c9bc7 | 12065 | __init__(self) -> PySizer |
bfddbb17 RD |
12066 | |
12067 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
12068 | class. | |
12069 | """ | |
5b5c9bc7 | 12070 | newobj = _core_.new_PySizer(*args, **kwargs) |
d55e5bfc RD |
12071 | self.this = newobj.this |
12072 | self.thisown = 1 | |
12073 | del newobj.thisown | |
12074 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) | |
12075 | ||
12076 | def _setCallbackInfo(*args, **kwargs): | |
12077 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" | |
5b5c9bc7 | 12078 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
d55e5bfc RD |
12079 | |
12080 | ||
5b5c9bc7 | 12081 | class PySizerPtr(PySizer): |
d55e5bfc RD |
12082 | def __init__(self, this): |
12083 | self.this = this | |
12084 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12085 | self.__class__ = PySizer |
12086 | _core_.PySizer_swigregister(PySizerPtr) | |
d55e5bfc RD |
12087 | |
12088 | #--------------------------------------------------------------------------- | |
12089 | ||
5b5c9bc7 | 12090 | class BoxSizer(Sizer): |
bfddbb17 RD |
12091 | """ |
12092 | The basic idea behind a box sizer is that windows will most often be | |
12093 | laid out in rather simple basic geometry, typically in a row or a | |
12094 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
12095 | its items in a simple row or column, depending on the orientation | |
12096 | parameter passed to the constructor. | |
12097 | """ | |
d55e5bfc RD |
12098 | def __repr__(self): |
12099 | return "<%s.%s; proxy of C++ wxBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12100 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12101 | """ |
5b5c9bc7 | 12102 | __init__(self, int orient=HORIZONTAL) -> BoxSizer |
bfddbb17 RD |
12103 | |
12104 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
12105 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
12106 | sizer. | |
12107 | """ | |
5b5c9bc7 | 12108 | newobj = _core_.new_BoxSizer(*args, **kwargs) |
d55e5bfc RD |
12109 | self.this = newobj.this |
12110 | self.thisown = 1 | |
12111 | del newobj.thisown | |
12112 | self._setOORInfo(self) | |
12113 | ||
12114 | def GetOrientation(*args, **kwargs): | |
bfddbb17 RD |
12115 | """ |
12116 | GetOrientation(self) -> int | |
12117 | ||
12118 | Returns the current orientation of the sizer. | |
12119 | """ | |
5b5c9bc7 | 12120 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
d55e5bfc RD |
12121 | |
12122 | def SetOrientation(*args, **kwargs): | |
bfddbb17 RD |
12123 | """ |
12124 | SetOrientation(self, int orient) | |
d55e5bfc | 12125 | |
bfddbb17 RD |
12126 | Resets the orientation of the sizer. |
12127 | """ | |
5b5c9bc7 | 12128 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) |
d55e5bfc RD |
12129 | |
12130 | ||
5b5c9bc7 | 12131 | class BoxSizerPtr(BoxSizer): |
d55e5bfc RD |
12132 | def __init__(self, this): |
12133 | self.this = this | |
12134 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12135 | self.__class__ = BoxSizer |
12136 | _core_.BoxSizer_swigregister(BoxSizerPtr) | |
d55e5bfc RD |
12137 | |
12138 | #--------------------------------------------------------------------------- | |
12139 | ||
5b5c9bc7 | 12140 | class StaticBoxSizer(BoxSizer): |
bfddbb17 RD |
12141 | """ |
12142 | wx.StaticBoxSizer derives from and functions identically to the | |
12143 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
12144 | manages. Note that this static box must be created separately and | |
12145 | passed to the sizer constructor. | |
12146 | """ | |
d55e5bfc RD |
12147 | def __repr__(self): |
12148 | return "<%s.%s; proxy of C++ wxStaticBoxSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12149 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12150 | """ |
5b5c9bc7 | 12151 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer |
bfddbb17 RD |
12152 | |
12153 | Constructor. It takes an associated static box and the orientation | |
12154 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
12155 | ``wx.HORIZONTAL``. | |
12156 | """ | |
5b5c9bc7 | 12157 | newobj = _core_.new_StaticBoxSizer(*args, **kwargs) |
d55e5bfc RD |
12158 | self.this = newobj.this |
12159 | self.thisown = 1 | |
12160 | del newobj.thisown | |
12161 | self._setOORInfo(self) | |
12162 | ||
12163 | def GetStaticBox(*args, **kwargs): | |
bfddbb17 | 12164 | """ |
5b5c9bc7 | 12165 | GetStaticBox(self) -> StaticBox |
d55e5bfc | 12166 | |
bfddbb17 RD |
12167 | Returns the static box associated with this sizer. |
12168 | """ | |
5b5c9bc7 | 12169 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) |
d55e5bfc RD |
12170 | |
12171 | ||
5b5c9bc7 | 12172 | class StaticBoxSizerPtr(StaticBoxSizer): |
d55e5bfc RD |
12173 | def __init__(self, this): |
12174 | self.this = this | |
12175 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12176 | self.__class__ = StaticBoxSizer |
12177 | _core_.StaticBoxSizer_swigregister(StaticBoxSizerPtr) | |
d55e5bfc RD |
12178 | |
12179 | #--------------------------------------------------------------------------- | |
12180 | ||
5b5c9bc7 | 12181 | class GridSizer(Sizer): |
bfddbb17 RD |
12182 | """ |
12183 | A grid sizer is a sizer which lays out its children in a | |
12184 | two-dimensional table with all cells having the same size. In other | |
12185 | words, the width of each cell within the grid is the width of the | |
12186 | widest item added to the sizer and the height of each grid cell is the | |
12187 | height of the tallest item. An optional vertical and/or horizontal | |
12188 | gap between items can also be specified (in pixels.) | |
12189 | ||
12190 | Items are placed in the cells of the grid in the order they are added, | |
12191 | in row-major order. In other words, the first row is filled first, | |
12192 | then the second, and so on until all items have been added. (If | |
12193 | neccessary, additional rows will be added as items are added.) If you | |
12194 | need to have greater control over the cells that items are placed in | |
12195 | then use the `wx.GridBagSizer`. | |
12196 | ||
12197 | """ | |
d55e5bfc RD |
12198 | def __repr__(self): |
12199 | return "<%s.%s; proxy of C++ wxGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12200 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12201 | """ |
5b5c9bc7 | 12202 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer |
bfddbb17 RD |
12203 | |
12204 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
12205 | of columns and rows in the sizer - if either of the parameters is | |
12206 | zero, it will be calculated to from the total number of children in | |
12207 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12208 | define extra space between all children. | |
12209 | """ | |
5b5c9bc7 | 12210 | newobj = _core_.new_GridSizer(*args, **kwargs) |
d55e5bfc RD |
12211 | self.this = newobj.this |
12212 | self.thisown = 1 | |
12213 | del newobj.thisown | |
12214 | self._setOORInfo(self) | |
12215 | ||
d55e5bfc | 12216 | def SetCols(*args, **kwargs): |
bfddbb17 RD |
12217 | """ |
12218 | SetCols(self, int cols) | |
12219 | ||
12220 | Sets the number of columns in the sizer. | |
12221 | """ | |
5b5c9bc7 | 12222 | return _core_.GridSizer_SetCols(*args, **kwargs) |
d55e5bfc RD |
12223 | |
12224 | def SetRows(*args, **kwargs): | |
bfddbb17 RD |
12225 | """ |
12226 | SetRows(self, int rows) | |
12227 | ||
12228 | Sets the number of rows in the sizer. | |
12229 | """ | |
5b5c9bc7 | 12230 | return _core_.GridSizer_SetRows(*args, **kwargs) |
d55e5bfc RD |
12231 | |
12232 | def SetVGap(*args, **kwargs): | |
bfddbb17 RD |
12233 | """ |
12234 | SetVGap(self, int gap) | |
12235 | ||
12236 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
12237 | """ | |
5b5c9bc7 | 12238 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
d55e5bfc RD |
12239 | |
12240 | def SetHGap(*args, **kwargs): | |
bfddbb17 RD |
12241 | """ |
12242 | SetHGap(self, int gap) | |
12243 | ||
12244 | Sets the horizontal gap (in pixels) between cells in the sizer | |
12245 | """ | |
5b5c9bc7 | 12246 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
d55e5bfc RD |
12247 | |
12248 | def GetCols(*args, **kwargs): | |
bfddbb17 RD |
12249 | """ |
12250 | GetCols(self) -> int | |
12251 | ||
12252 | Returns the number of columns in the sizer. | |
12253 | """ | |
5b5c9bc7 | 12254 | return _core_.GridSizer_GetCols(*args, **kwargs) |
d55e5bfc RD |
12255 | |
12256 | def GetRows(*args, **kwargs): | |
bfddbb17 RD |
12257 | """ |
12258 | GetRows(self) -> int | |
12259 | ||
12260 | Returns the number of rows in the sizer. | |
12261 | """ | |
5b5c9bc7 | 12262 | return _core_.GridSizer_GetRows(*args, **kwargs) |
d55e5bfc RD |
12263 | |
12264 | def GetVGap(*args, **kwargs): | |
bfddbb17 RD |
12265 | """ |
12266 | GetVGap(self) -> int | |
12267 | ||
12268 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
12269 | """ | |
5b5c9bc7 | 12270 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
d55e5bfc RD |
12271 | |
12272 | def GetHGap(*args, **kwargs): | |
bfddbb17 RD |
12273 | """ |
12274 | GetHGap(self) -> int | |
12275 | ||
12276 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
12277 | """ | |
5b5c9bc7 | 12278 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
d55e5bfc RD |
12279 | |
12280 | ||
5b5c9bc7 | 12281 | class GridSizerPtr(GridSizer): |
d55e5bfc RD |
12282 | def __init__(self, this): |
12283 | self.this = this | |
12284 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12285 | self.__class__ = GridSizer |
12286 | _core_.GridSizer_swigregister(GridSizerPtr) | |
d55e5bfc RD |
12287 | |
12288 | #--------------------------------------------------------------------------- | |
12289 | ||
5b5c9bc7 RD |
12290 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
12291 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
12292 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
12293 | class FlexGridSizer(GridSizer): | |
bfddbb17 RD |
12294 | """ |
12295 | A flex grid sizer is a sizer which lays out its children in a | |
12296 | two-dimensional table with all table cells in one row having the same | |
12297 | height and all cells in one column having the same width, but all | |
12298 | rows or all columns are not necessarily the same height or width as in | |
12299 | the `wx.GridSizer`. | |
12300 | ||
12301 | wx.FlexGridSizer can also size items equally in one direction but | |
12302 | unequally ("flexibly") in the other. If the sizer is only flexible | |
12303 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
12304 | needs to be decided how the sizer should grow in the other ("non | |
12305 | flexible") direction in order to fill the available space. The | |
12306 | `SetNonFlexibleGrowMode` method serves this purpose. | |
12307 | ||
12308 | ||
12309 | """ | |
d55e5bfc RD |
12310 | def __repr__(self): |
12311 | return "<%s.%s; proxy of C++ wxFlexGridSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12312 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12313 | """ |
5b5c9bc7 | 12314 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer |
bfddbb17 RD |
12315 | |
12316 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
12317 | number of columns and rows in the sizer - if either of the parameters | |
12318 | is zero, it will be calculated to from the total number of children in | |
12319 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
12320 | define extra space between all children. | |
12321 | """ | |
5b5c9bc7 | 12322 | newobj = _core_.new_FlexGridSizer(*args, **kwargs) |
d55e5bfc RD |
12323 | self.this = newobj.this |
12324 | self.thisown = 1 | |
12325 | del newobj.thisown | |
12326 | self._setOORInfo(self) | |
12327 | ||
bfddbb17 RD |
12328 | def AddGrowableRow(*args, **kwargs): |
12329 | """ | |
12330 | AddGrowableRow(self, size_t idx, int proportion=0) | |
d55e5bfc | 12331 | |
bfddbb17 RD |
12332 | Specifies that row *idx* (starting from zero) should be grown if there |
12333 | is extra space available to the sizer. | |
d55e5bfc | 12334 | |
bfddbb17 RD |
12335 | The *proportion* parameter has the same meaning as the stretch factor |
12336 | for the box sizers except that if all proportions are 0, then all | |
12337 | columns are resized equally (instead of not being resized at all). | |
12338 | """ | |
5b5c9bc7 | 12339 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
d55e5bfc RD |
12340 | |
12341 | def RemoveGrowableRow(*args, **kwargs): | |
bfddbb17 RD |
12342 | """ |
12343 | RemoveGrowableRow(self, size_t idx) | |
12344 | ||
12345 | Specifies that row *idx* is no longer growable. | |
12346 | """ | |
5b5c9bc7 | 12347 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
d55e5bfc RD |
12348 | |
12349 | def AddGrowableCol(*args, **kwargs): | |
bfddbb17 RD |
12350 | """ |
12351 | AddGrowableCol(self, size_t idx, int proportion=0) | |
12352 | ||
12353 | Specifies that column *idx* (starting from zero) should be grown if | |
12354 | there is extra space available to the sizer. | |
12355 | ||
12356 | The *proportion* parameter has the same meaning as the stretch factor | |
12357 | for the box sizers except that if all proportions are 0, then all | |
12358 | columns are resized equally (instead of not being resized at all). | |
12359 | """ | |
5b5c9bc7 | 12360 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
d55e5bfc RD |
12361 | |
12362 | def RemoveGrowableCol(*args, **kwargs): | |
bfddbb17 RD |
12363 | """ |
12364 | RemoveGrowableCol(self, size_t idx) | |
12365 | ||
12366 | Specifies that column *idx* is no longer growable. | |
12367 | """ | |
5b5c9bc7 | 12368 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
d55e5bfc RD |
12369 | |
12370 | def SetFlexibleDirection(*args, **kwargs): | |
bfddbb17 RD |
12371 | """ |
12372 | SetFlexibleDirection(self, int direction) | |
12373 | ||
12374 | Specifies whether the sizer should flexibly resize its columns, rows, | |
12375 | or both. Argument *direction* can be one of the following values. Any | |
12376 | other value is ignored. | |
12377 | ||
12378 | ============== ======================================= | |
12379 | wx.VERTICAL Rows are flexibly sized. | |
12380 | wx.HORIZONTAL Columns are flexibly sized. | |
12381 | wx.BOTH Both rows and columns are flexibly sized | |
12382 | (this is the default value). | |
12383 | ============== ======================================= | |
12384 | ||
12385 | Note that this method does not trigger relayout. | |
12386 | ||
12387 | """ | |
5b5c9bc7 | 12388 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
d55e5bfc RD |
12389 | |
12390 | def GetFlexibleDirection(*args, **kwargs): | |
bfddbb17 RD |
12391 | """ |
12392 | GetFlexibleDirection(self) -> int | |
12393 | ||
12394 | Returns a value that specifies whether the sizer | |
12395 | flexibly resizes its columns, rows, or both (default). | |
12396 | ||
12397 | :see: `SetFlexibleDirection` | |
12398 | """ | |
5b5c9bc7 | 12399 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
d55e5bfc RD |
12400 | |
12401 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
bfddbb17 RD |
12402 | """ |
12403 | SetNonFlexibleGrowMode(self, int mode) | |
12404 | ||
12405 | Specifies how the sizer should grow in the non-flexible direction if | |
12406 | there is one (so `SetFlexibleDirection` must have been called | |
12407 | previously). Argument *mode* can be one of the following values: | |
12408 | ||
12409 | ========================== ================================================= | |
12410 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
12411 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
12412 | `AddGrowableCol` and `AddGrowableRow`. In this | |
12413 | case equal sizing applies to minimum sizes of | |
12414 | columns or rows (this is the default value). | |
12415 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
12416 | the non flexible direction, whether they are | |
12417 | growable or not in the flexbile direction. | |
12418 | ========================== ================================================= | |
12419 | ||
12420 | Note that this method does not trigger relayout. | |
12421 | ||
12422 | ||
12423 | """ | |
5b5c9bc7 | 12424 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
d55e5bfc RD |
12425 | |
12426 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
bfddbb17 RD |
12427 | """ |
12428 | GetNonFlexibleGrowMode(self) -> int | |
12429 | ||
12430 | Returns the value that specifies how the sizer grows in the | |
12431 | non-flexible direction if there is one. | |
12432 | ||
12433 | :see: `SetNonFlexibleGrowMode` | |
12434 | """ | |
5b5c9bc7 | 12435 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
d55e5bfc RD |
12436 | |
12437 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
12438 | """ |
12439 | GetRowHeights(self) -> list | |
12440 | ||
12441 | Returns a list of integers representing the heights of each of the | |
12442 | rows in the sizer. | |
12443 | """ | |
5b5c9bc7 | 12444 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
d55e5bfc RD |
12445 | |
12446 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
12447 | """ |
12448 | GetColWidths(self) -> list | |
12449 | ||
12450 | Returns a list of integers representing the widths of each of the | |
12451 | columns in the sizer. | |
12452 | """ | |
5b5c9bc7 | 12453 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
d55e5bfc RD |
12454 | |
12455 | ||
5b5c9bc7 | 12456 | class FlexGridSizerPtr(FlexGridSizer): |
d55e5bfc RD |
12457 | def __init__(self, this): |
12458 | self.this = this | |
12459 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12460 | self.__class__ = FlexGridSizer |
12461 | _core_.FlexGridSizer_swigregister(FlexGridSizerPtr) | |
d55e5bfc | 12462 | |
5b5c9bc7 | 12463 | class StdDialogButtonSizer(BoxSizer): |
62d32a5f RD |
12464 | """ |
12465 | A special sizer that knows how to order and position standard buttons | |
12466 | in order to conform to the current platform's standards. You simply | |
12467 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 12468 | buttons using the standard ID's. Then call `Realize` and the sizer |
62d32a5f RD |
12469 | will take care of the rest. |
12470 | ||
12471 | """ | |
12472 | def __repr__(self): | |
12473 | return "<%s.%s; proxy of C++ wxStdDialogButtonSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12474 | def __init__(self, *args, **kwargs): | |
5b5c9bc7 RD |
12475 | """__init__(self) -> StdDialogButtonSizer""" |
12476 | newobj = _core_.new_StdDialogButtonSizer(*args, **kwargs) | |
62d32a5f RD |
12477 | self.this = newobj.this |
12478 | self.thisown = 1 | |
12479 | del newobj.thisown | |
12480 | def AddButton(*args, **kwargs): | |
12481 | """ | |
12482 | AddButton(self, wxButton button) | |
12483 | ||
12484 | Use this to add the buttons to this sizer. Do not use the `Add` | |
12485 | method in the base class. | |
12486 | """ | |
5b5c9bc7 | 12487 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) |
62d32a5f | 12488 | |
53aa7709 | 12489 | def Realize(*args, **kwargs): |
62d32a5f | 12490 | """ |
53aa7709 | 12491 | Realize(self) |
62d32a5f RD |
12492 | |
12493 | This funciton needs to be called after all the buttons have been added | |
12494 | to the sizer. It will reorder them and position them in a platform | |
12495 | specifc manner. | |
12496 | """ | |
5b5c9bc7 | 12497 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
12498 | |
12499 | def SetAffirmativeButton(*args, **kwargs): | |
12500 | """SetAffirmativeButton(self, wxButton button)""" | |
5b5c9bc7 | 12501 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) |
51b83b37 RD |
12502 | |
12503 | def SetNegativeButton(*args, **kwargs): | |
12504 | """SetNegativeButton(self, wxButton button)""" | |
5b5c9bc7 | 12505 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) |
51b83b37 RD |
12506 | |
12507 | def SetCancelButton(*args, **kwargs): | |
12508 | """SetCancelButton(self, wxButton button)""" | |
5b5c9bc7 | 12509 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) |
62d32a5f RD |
12510 | |
12511 | def GetAffirmativeButton(*args, **kwargs): | |
12512 | """GetAffirmativeButton(self) -> wxButton""" | |
5b5c9bc7 | 12513 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) |
62d32a5f RD |
12514 | |
12515 | def GetApplyButton(*args, **kwargs): | |
12516 | """GetApplyButton(self) -> wxButton""" | |
5b5c9bc7 | 12517 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) |
62d32a5f RD |
12518 | |
12519 | def GetNegativeButton(*args, **kwargs): | |
12520 | """GetNegativeButton(self) -> wxButton""" | |
5b5c9bc7 | 12521 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) |
62d32a5f RD |
12522 | |
12523 | def GetCancelButton(*args, **kwargs): | |
12524 | """GetCancelButton(self) -> wxButton""" | |
5b5c9bc7 | 12525 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) |
62d32a5f RD |
12526 | |
12527 | def GetHelpButton(*args, **kwargs): | |
12528 | """GetHelpButton(self) -> wxButton""" | |
5b5c9bc7 | 12529 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) |
62d32a5f RD |
12530 | |
12531 | ||
5b5c9bc7 | 12532 | class StdDialogButtonSizerPtr(StdDialogButtonSizer): |
62d32a5f RD |
12533 | def __init__(self, this): |
12534 | self.this = this | |
12535 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12536 | self.__class__ = StdDialogButtonSizer |
12537 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizerPtr) | |
62d32a5f | 12538 | |
d55e5bfc RD |
12539 | #--------------------------------------------------------------------------- |
12540 | ||
5b5c9bc7 | 12541 | class GBPosition(object): |
bfddbb17 RD |
12542 | """ |
12543 | This class represents the position of an item in a virtual grid of | |
12544 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12545 | typemaps that will automatically convert from a 2-element sequence of | |
12546 | integers to a wx.GBPosition, so you can use the more pythonic | |
12547 | representation of the position nearly transparently in Python code. | |
12548 | """ | |
d55e5bfc RD |
12549 | def __repr__(self): |
12550 | return "<%s.%s; proxy of C++ wxGBPosition instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12551 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12552 | """ |
5b5c9bc7 | 12553 | __init__(self, int row=0, int col=0) -> GBPosition |
bfddbb17 RD |
12554 | |
12555 | This class represents the position of an item in a virtual grid of | |
12556 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
12557 | typemaps that will automatically convert from a 2-element sequence of | |
12558 | integers to a wx.GBPosition, so you can use the more pythonic | |
12559 | representation of the position nearly transparently in Python code. | |
12560 | """ | |
5b5c9bc7 | 12561 | newobj = _core_.new_GBPosition(*args, **kwargs) |
d55e5bfc RD |
12562 | self.this = newobj.this |
12563 | self.thisown = 1 | |
12564 | del newobj.thisown | |
12565 | def GetRow(*args, **kwargs): | |
12566 | """GetRow(self) -> int""" | |
5b5c9bc7 | 12567 | return _core_.GBPosition_GetRow(*args, **kwargs) |
d55e5bfc RD |
12568 | |
12569 | def GetCol(*args, **kwargs): | |
12570 | """GetCol(self) -> int""" | |
5b5c9bc7 | 12571 | return _core_.GBPosition_GetCol(*args, **kwargs) |
d55e5bfc RD |
12572 | |
12573 | def SetRow(*args, **kwargs): | |
12574 | """SetRow(self, int row)""" | |
5b5c9bc7 | 12575 | return _core_.GBPosition_SetRow(*args, **kwargs) |
d55e5bfc RD |
12576 | |
12577 | def SetCol(*args, **kwargs): | |
12578 | """SetCol(self, int col)""" | |
5b5c9bc7 | 12579 | return _core_.GBPosition_SetCol(*args, **kwargs) |
d55e5bfc RD |
12580 | |
12581 | def __eq__(*args, **kwargs): | |
5b5c9bc7 RD |
12582 | """__eq__(self, GBPosition other) -> bool""" |
12583 | return _core_.GBPosition___eq__(*args, **kwargs) | |
d55e5bfc RD |
12584 | |
12585 | def __ne__(*args, **kwargs): | |
5b5c9bc7 RD |
12586 | """__ne__(self, GBPosition other) -> bool""" |
12587 | return _core_.GBPosition___ne__(*args, **kwargs) | |
d55e5bfc RD |
12588 | |
12589 | def Set(*args, **kwargs): | |
12590 | """Set(self, int row=0, int col=0)""" | |
5b5c9bc7 | 12591 | return _core_.GBPosition_Set(*args, **kwargs) |
d55e5bfc RD |
12592 | |
12593 | def Get(*args, **kwargs): | |
12594 | """Get(self) -> PyObject""" | |
5b5c9bc7 | 12595 | return _core_.GBPosition_Get(*args, **kwargs) |
d55e5bfc | 12596 | |
15817c7e | 12597 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
12598 | def __str__(self): return str(self.Get()) |
12599 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
12600 | def __len__(self): return len(self.Get()) | |
12601 | def __getitem__(self, index): return self.Get()[index] | |
12602 | def __setitem__(self, index, val): | |
12603 | if index == 0: self.SetRow(val) | |
12604 | elif index == 1: self.SetCol(val) | |
12605 | else: raise IndexError | |
12606 | def __nonzero__(self): return self.Get() != (0,0) | |
12607 | __safe_for_unpickling__ = True | |
12608 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
12609 | ||
12610 | row = property(GetRow, SetRow) | |
12611 | col = property(GetCol, SetCol) | |
12612 | ||
12613 | ||
5b5c9bc7 | 12614 | class GBPositionPtr(GBPosition): |
d55e5bfc RD |
12615 | def __init__(self, this): |
12616 | self.this = this | |
12617 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12618 | self.__class__ = GBPosition |
12619 | _core_.GBPosition_swigregister(GBPositionPtr) | |
d55e5bfc | 12620 | |
5b5c9bc7 | 12621 | class GBSpan(object): |
bfddbb17 RD |
12622 | """ |
12623 | This class is used to hold the row and column spanning attributes of | |
12624 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
12625 | automatically convert from a 2-element sequence of integers to a | |
12626 | wx.GBSpan, so you can use the more pythonic representation of the span | |
12627 | nearly transparently in Python code. | |
12628 | ||
12629 | """ | |
d55e5bfc RD |
12630 | def __repr__(self): |
12631 | return "<%s.%s; proxy of C++ wxGBSpan instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12632 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12633 | """ |
5b5c9bc7 | 12634 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan |
bfddbb17 RD |
12635 | |
12636 | Construct a new wxGBSpan, optionally setting the rowspan and | |
12637 | colspan. The default is (1,1). (Meaning that the item occupies one | |
12638 | cell in each direction. | |
12639 | """ | |
5b5c9bc7 | 12640 | newobj = _core_.new_GBSpan(*args, **kwargs) |
d55e5bfc RD |
12641 | self.this = newobj.this |
12642 | self.thisown = 1 | |
12643 | del newobj.thisown | |
12644 | def GetRowspan(*args, **kwargs): | |
12645 | """GetRowspan(self) -> int""" | |
5b5c9bc7 | 12646 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
d55e5bfc RD |
12647 | |
12648 | def GetColspan(*args, **kwargs): | |
12649 | """GetColspan(self) -> int""" | |
5b5c9bc7 | 12650 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
d55e5bfc RD |
12651 | |
12652 | def SetRowspan(*args, **kwargs): | |
12653 | """SetRowspan(self, int rowspan)""" | |
5b5c9bc7 | 12654 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
d55e5bfc RD |
12655 | |
12656 | def SetColspan(*args, **kwargs): | |
12657 | """SetColspan(self, int colspan)""" | |
5b5c9bc7 | 12658 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
d55e5bfc RD |
12659 | |
12660 | def __eq__(*args, **kwargs): | |
5b5c9bc7 RD |
12661 | """__eq__(self, GBSpan other) -> bool""" |
12662 | return _core_.GBSpan___eq__(*args, **kwargs) | |
d55e5bfc RD |
12663 | |
12664 | def __ne__(*args, **kwargs): | |
5b5c9bc7 RD |
12665 | """__ne__(self, GBSpan other) -> bool""" |
12666 | return _core_.GBSpan___ne__(*args, **kwargs) | |
d55e5bfc RD |
12667 | |
12668 | def Set(*args, **kwargs): | |
12669 | """Set(self, int rowspan=1, int colspan=1)""" | |
5b5c9bc7 | 12670 | return _core_.GBSpan_Set(*args, **kwargs) |
d55e5bfc RD |
12671 | |
12672 | def Get(*args, **kwargs): | |
12673 | """Get(self) -> PyObject""" | |
5b5c9bc7 | 12674 | return _core_.GBSpan_Get(*args, **kwargs) |
d55e5bfc | 12675 | |
15817c7e | 12676 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
d55e5bfc RD |
12677 | def __str__(self): return str(self.Get()) |
12678 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
12679 | def __len__(self): return len(self.Get()) | |
12680 | def __getitem__(self, index): return self.Get()[index] | |
12681 | def __setitem__(self, index, val): | |
12682 | if index == 0: self.SetRowspan(val) | |
12683 | elif index == 1: self.SetColspan(val) | |
12684 | else: raise IndexError | |
12685 | def __nonzero__(self): return self.Get() != (0,0) | |
12686 | __safe_for_unpickling__ = True | |
12687 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
12688 | ||
12689 | rowspan = property(GetRowspan, SetRowspan) | |
12690 | colspan = property(GetColspan, SetColspan) | |
12691 | ||
12692 | ||
5b5c9bc7 | 12693 | class GBSpanPtr(GBSpan): |
d55e5bfc RD |
12694 | def __init__(self, this): |
12695 | self.this = this | |
12696 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12697 | self.__class__ = GBSpan |
12698 | _core_.GBSpan_swigregister(GBSpanPtr) | |
d55e5bfc | 12699 | |
5b5c9bc7 | 12700 | class GBSizerItem(SizerItem): |
bfddbb17 RD |
12701 | """ |
12702 | The wx.GBSizerItem class is used to track the additional data about | |
12703 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12704 | and how many rows or columns it spans. | |
12705 | ||
12706 | """ | |
d55e5bfc RD |
12707 | def __repr__(self): |
12708 | return "<%s.%s; proxy of C++ wxGBSizerItem instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12709 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12710 | """ |
5b5c9bc7 | 12711 | __init__(self) -> GBSizerItem |
bfddbb17 RD |
12712 | |
12713 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12714 | size will need to be set, as well as a position and span before this | |
12715 | item can be used in a Sizer. | |
12716 | ||
12717 | You will probably never need to create a wx.GBSizerItem directly as they | |
12718 | are created automatically when the sizer's Add method is called. | |
12719 | """ | |
5b5c9bc7 | 12720 | newobj = _core_.new_GBSizerItem(*args, **kwargs) |
d55e5bfc RD |
12721 | self.this = newobj.this |
12722 | self.thisown = 1 | |
12723 | del newobj.thisown | |
12724 | def GetPos(*args, **kwargs): | |
bfddbb17 | 12725 | """ |
5b5c9bc7 | 12726 | GetPos(self) -> GBPosition |
bfddbb17 RD |
12727 | |
12728 | Get the grid position of the item | |
12729 | """ | |
5b5c9bc7 | 12730 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
d55e5bfc RD |
12731 | |
12732 | def GetPosTuple(self): return self.GetPos().Get() | |
12733 | def GetSpan(*args, **kwargs): | |
bfddbb17 | 12734 | """ |
5b5c9bc7 | 12735 | GetSpan(self) -> GBSpan |
bfddbb17 RD |
12736 | |
12737 | Get the row and column spanning of the item | |
12738 | """ | |
5b5c9bc7 | 12739 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
d55e5bfc RD |
12740 | |
12741 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12742 | def SetPos(*args, **kwargs): | |
bfddbb17 | 12743 | """ |
5b5c9bc7 | 12744 | SetPos(self, GBPosition pos) -> bool |
bfddbb17 RD |
12745 | |
12746 | If the item is already a member of a sizer then first ensure that | |
12747 | there is no other item that would intersect with this one at the new | |
12748 | position, then set the new position. Returns True if the change is | |
12749 | successful and after the next Layout() the item will be moved. | |
12750 | """ | |
5b5c9bc7 | 12751 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
d55e5bfc RD |
12752 | |
12753 | def SetSpan(*args, **kwargs): | |
bfddbb17 | 12754 | """ |
5b5c9bc7 | 12755 | SetSpan(self, GBSpan span) -> bool |
bfddbb17 RD |
12756 | |
12757 | If the item is already a member of a sizer then first ensure that | |
12758 | there is no other item that would intersect with this one with its new | |
12759 | spanning size, then set the new spanning. Returns True if the change | |
12760 | is successful and after the next Layout() the item will be resized. | |
12761 | ||
12762 | """ | |
5b5c9bc7 | 12763 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
d55e5bfc | 12764 | |
bfddbb17 | 12765 | def Intersects(*args, **kwargs): |
d55e5bfc | 12766 | """ |
5b5c9bc7 | 12767 | Intersects(self, GBSizerItem other) -> bool |
bfddbb17 RD |
12768 | |
12769 | Returns True if this item and the other item instersect. | |
d55e5bfc | 12770 | """ |
5b5c9bc7 | 12771 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
bfddbb17 RD |
12772 | |
12773 | def IntersectsPos(*args, **kwargs): | |
12774 | """ | |
5b5c9bc7 | 12775 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool |
bfddbb17 RD |
12776 | |
12777 | Returns True if the given pos/span would intersect with this item. | |
12778 | """ | |
5b5c9bc7 | 12779 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) |
d55e5bfc RD |
12780 | |
12781 | def GetEndPos(*args, **kwargs): | |
bfddbb17 | 12782 | """ |
5b5c9bc7 | 12783 | GetEndPos(self) -> GBPosition |
bfddbb17 RD |
12784 | |
12785 | Get the row and column of the endpoint of this item. | |
12786 | """ | |
5b5c9bc7 | 12787 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
d55e5bfc RD |
12788 | |
12789 | def GetGBSizer(*args, **kwargs): | |
bfddbb17 | 12790 | """ |
5b5c9bc7 | 12791 | GetGBSizer(self) -> GridBagSizer |
bfddbb17 RD |
12792 | |
12793 | Get the sizer this item is a member of. | |
12794 | """ | |
5b5c9bc7 | 12795 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
d55e5bfc RD |
12796 | |
12797 | def SetGBSizer(*args, **kwargs): | |
bfddbb17 | 12798 | """ |
5b5c9bc7 | 12799 | SetGBSizer(self, GridBagSizer sizer) |
bfddbb17 RD |
12800 | |
12801 | Set the sizer this item is a member of. | |
12802 | """ | |
5b5c9bc7 | 12803 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
d55e5bfc RD |
12804 | |
12805 | ||
5b5c9bc7 | 12806 | class GBSizerItemPtr(GBSizerItem): |
d55e5bfc RD |
12807 | def __init__(self, this): |
12808 | self.this = this | |
12809 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
12810 | self.__class__ = GBSizerItem |
12811 | _core_.GBSizerItem_swigregister(GBSizerItemPtr) | |
12812 | DefaultSpan = cvar.DefaultSpan | |
d55e5bfc RD |
12813 | |
12814 | def GBSizerItemWindow(*args, **kwargs): | |
12815 | """ | |
5b5c9bc7 RD |
12816 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, |
12817 | int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12818 | |
12819 | Construct a `wx.GBSizerItem` for a window. | |
d55e5bfc | 12820 | """ |
5b5c9bc7 | 12821 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d55e5bfc RD |
12822 | val.thisown = 1 |
12823 | return val | |
12824 | ||
12825 | def GBSizerItemSizer(*args, **kwargs): | |
12826 | """ | |
5b5c9bc7 RD |
12827 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, |
12828 | int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12829 | |
12830 | Construct a `wx.GBSizerItem` for a sizer | |
d55e5bfc | 12831 | """ |
5b5c9bc7 | 12832 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d55e5bfc RD |
12833 | val.thisown = 1 |
12834 | return val | |
12835 | ||
12836 | def GBSizerItemSpacer(*args, **kwargs): | |
12837 | """ | |
5b5c9bc7 RD |
12838 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, |
12839 | int flag, int border, PyObject userData=None) -> GBSizerItem | |
bfddbb17 RD |
12840 | |
12841 | Construct a `wx.GBSizerItem` for a spacer. | |
d55e5bfc | 12842 | """ |
5b5c9bc7 | 12843 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d55e5bfc RD |
12844 | val.thisown = 1 |
12845 | return val | |
12846 | ||
5b5c9bc7 | 12847 | class GridBagSizer(FlexGridSizer): |
bfddbb17 RD |
12848 | """ |
12849 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12850 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12851 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12852 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12853 | virtual grid is determined by the largest row and column that items are | |
12854 | positioned at, adjusted for spanning. | |
12855 | ||
12856 | """ | |
d55e5bfc RD |
12857 | def __repr__(self): |
12858 | return "<%s.%s; proxy of C++ wxGridBagSizer instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
12859 | def __init__(self, *args, **kwargs): | |
bfddbb17 | 12860 | """ |
5b5c9bc7 | 12861 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer |
bfddbb17 RD |
12862 | |
12863 | Constructor, with optional parameters to specify the gap between the | |
12864 | rows and columns. | |
12865 | """ | |
5b5c9bc7 | 12866 | newobj = _core_.new_GridBagSizer(*args, **kwargs) |
d55e5bfc RD |
12867 | self.this = newobj.this |
12868 | self.thisown = 1 | |
12869 | del newobj.thisown | |
03e46024 RD |
12870 | self._setOORInfo(self) |
12871 | ||
d55e5bfc RD |
12872 | def Add(*args, **kwargs): |
12873 | """ | |
bfddbb17 | 12874 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
070c48b4 | 12875 | int border=0, userData=None) -> wx.GBSizerItem |
bfddbb17 RD |
12876 | |
12877 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12878 | more than one row or column as specified with *span*. The remaining | |
12879 | args behave similarly to `wx.Sizer.Add`. | |
12880 | ||
12881 | Returns True if the item was successfully placed at the given cell | |
12882 | position, False if something was already there. | |
12883 | ||
d55e5bfc | 12884 | """ |
5b5c9bc7 | 12885 | return _core_.GridBagSizer_Add(*args, **kwargs) |
d55e5bfc RD |
12886 | |
12887 | def AddItem(*args, **kwargs): | |
bfddbb17 | 12888 | """ |
070c48b4 | 12889 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
bfddbb17 RD |
12890 | |
12891 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12892 | the item was successfully placed at its given cell position, False if | |
12893 | something was already there. | |
12894 | """ | |
5b5c9bc7 | 12895 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
d55e5bfc | 12896 | |
84f85550 RD |
12897 | def GetCellSize(*args, **kwargs): |
12898 | """ | |
5b5c9bc7 | 12899 | GetCellSize(self, int row, int col) -> Size |
84f85550 RD |
12900 | |
12901 | Get the size of the specified cell, including hgap and | |
12902 | vgap. Only valid after a Layout. | |
12903 | """ | |
5b5c9bc7 | 12904 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) |
84f85550 | 12905 | |
d55e5bfc | 12906 | def GetEmptyCellSize(*args, **kwargs): |
bfddbb17 | 12907 | """ |
5b5c9bc7 | 12908 | GetEmptyCellSize(self) -> Size |
bfddbb17 RD |
12909 | |
12910 | Get the size used for cells in the grid with no item. | |
12911 | """ | |
5b5c9bc7 | 12912 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
d55e5bfc RD |
12913 | |
12914 | def SetEmptyCellSize(*args, **kwargs): | |
bfddbb17 | 12915 | """ |
5b5c9bc7 | 12916 | SetEmptyCellSize(self, Size sz) |
bfddbb17 RD |
12917 | |
12918 | Set the size used for cells in the grid with no item. | |
12919 | """ | |
5b5c9bc7 | 12920 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
d55e5bfc RD |
12921 | |
12922 | def GetItemPosition(*args): | |
12923 | """ | |
bfddbb17 RD |
12924 | GetItemPosition(self, item) -> GBPosition |
12925 | ||
12926 | Get the grid position of the specified *item* where *item* is either a | |
12927 | window or subsizer that is a member of this sizer, or a zero-based | |
12928 | index of an item. | |
d55e5bfc | 12929 | """ |
5b5c9bc7 | 12930 | return _core_.GridBagSizer_GetItemPosition(*args) |
d55e5bfc RD |
12931 | |
12932 | def SetItemPosition(*args): | |
12933 | """ | |
bfddbb17 RD |
12934 | SetItemPosition(self, item, GBPosition pos) -> bool |
12935 | ||
12936 | Set the grid position of the specified *item* where *item* is either a | |
12937 | window or subsizer that is a member of this sizer, or a zero-based | |
12938 | index of an item. Returns True on success. If the move is not | |
12939 | allowed (because an item is already there) then False is returned. | |
12940 | ||
d55e5bfc | 12941 | """ |
5b5c9bc7 | 12942 | return _core_.GridBagSizer_SetItemPosition(*args) |
d55e5bfc RD |
12943 | |
12944 | def GetItemSpan(*args): | |
12945 | """ | |
bfddbb17 RD |
12946 | GetItemSpan(self, item) -> GBSpan |
12947 | ||
12948 | Get the row/col spanning of the specified *item* where *item* is | |
12949 | either a window or subsizer that is a member of this sizer, or a | |
12950 | zero-based index of an item. | |
d55e5bfc | 12951 | """ |
5b5c9bc7 | 12952 | return _core_.GridBagSizer_GetItemSpan(*args) |
d55e5bfc RD |
12953 | |
12954 | def SetItemSpan(*args): | |
12955 | """ | |
bfddbb17 RD |
12956 | SetItemSpan(self, item, GBSpan span) -> bool |
12957 | ||
12958 | Set the row/col spanning of the specified *item* where *item* is | |
12959 | either a window or subsizer that is a member of this sizer, or a | |
12960 | zero-based index of an item. Returns True on success. If the move is | |
12961 | not allowed (because an item is already there) then False is returned. | |
d55e5bfc | 12962 | """ |
5b5c9bc7 | 12963 | return _core_.GridBagSizer_SetItemSpan(*args) |
d55e5bfc RD |
12964 | |
12965 | def FindItem(*args): | |
12966 | """ | |
bfddbb17 RD |
12967 | FindItem(self, item) -> GBSizerItem |
12968 | ||
12969 | Find the sizer item for the given window or subsizer, returns None if | |
12970 | not found. (non-recursive) | |
d55e5bfc | 12971 | """ |
5b5c9bc7 | 12972 | return _core_.GridBagSizer_FindItem(*args) |
d55e5bfc RD |
12973 | |
12974 | def FindItemAtPosition(*args, **kwargs): | |
bfddbb17 | 12975 | """ |
5b5c9bc7 | 12976 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem |
bfddbb17 RD |
12977 | |
12978 | Return the sizer item for the given grid cell, or None if there is no | |
12979 | item at that position. (non-recursive) | |
12980 | """ | |
5b5c9bc7 | 12981 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
d55e5bfc RD |
12982 | |
12983 | def FindItemAtPoint(*args, **kwargs): | |
bfddbb17 | 12984 | """ |
5b5c9bc7 | 12985 | FindItemAtPoint(self, Point pt) -> GBSizerItem |
bfddbb17 RD |
12986 | |
12987 | Return the sizer item located at the point given in *pt*, or None if | |
12988 | there is no item at that point. The (x,y) coordinates in pt correspond | |
12989 | to the client coordinates of the window using the sizer for | |
12990 | layout. (non-recursive) | |
12991 | """ | |
5b5c9bc7 | 12992 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
d55e5bfc | 12993 | |
bfddbb17 RD |
12994 | def CheckForIntersection(*args, **kwargs): |
12995 | """ | |
5b5c9bc7 | 12996 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool |
d55e5bfc | 12997 | |
bfddbb17 RD |
12998 | Look at all items and see if any intersect (or would overlap) the |
12999 | given *item*. Returns True if so, False if there would be no overlap. | |
13000 | If an *excludeItem* is given then it will not be checked for | |
13001 | intersection, for example it may be the item we are checking the | |
13002 | position of. | |
d55e5bfc | 13003 | |
bfddbb17 | 13004 | """ |
5b5c9bc7 | 13005 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) |
d55e5bfc | 13006 | |
bfddbb17 | 13007 | def CheckForIntersectionPos(*args, **kwargs): |
d55e5bfc | 13008 | """ |
5b5c9bc7 | 13009 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
bfddbb17 RD |
13010 | |
13011 | Look at all items and see if any intersect (or would overlap) the | |
13012 | given position and span. Returns True if so, False if there would be | |
13013 | no overlap. If an *excludeItem* is given then it will not be checked | |
13014 | for intersection, for example it may be the item we are checking the | |
13015 | position of. | |
d55e5bfc | 13016 | """ |
5b5c9bc7 | 13017 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
d55e5bfc RD |
13018 | |
13019 | ||
5b5c9bc7 | 13020 | class GridBagSizerPtr(GridBagSizer): |
d55e5bfc RD |
13021 | def __init__(self, this): |
13022 | self.this = this | |
13023 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
13024 | self.__class__ = GridBagSizer |
13025 | _core_.GridBagSizer_swigregister(GridBagSizerPtr) | |
d55e5bfc RD |
13026 | |
13027 | #--------------------------------------------------------------------------- | |
13028 | ||
5b5c9bc7 RD |
13029 | Left = _core_.Left |
13030 | Top = _core_.Top | |
13031 | Right = _core_.Right | |
13032 | Bottom = _core_.Bottom | |
13033 | Width = _core_.Width | |
13034 | Height = _core_.Height | |
13035 | Centre = _core_.Centre | |
13036 | Center = _core_.Center | |
13037 | CentreX = _core_.CentreX | |
13038 | CentreY = _core_.CentreY | |
13039 | Unconstrained = _core_.Unconstrained | |
13040 | AsIs = _core_.AsIs | |
13041 | PercentOf = _core_.PercentOf | |
13042 | Above = _core_.Above | |
13043 | Below = _core_.Below | |
13044 | LeftOf = _core_.LeftOf | |
13045 | RightOf = _core_.RightOf | |
13046 | SameAs = _core_.SameAs | |
13047 | Absolute = _core_.Absolute | |
13048 | class IndividualLayoutConstraint(Object): | |
d55e5bfc | 13049 | """ |
15817c7e RD |
13050 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
13051 | one of eight possible constraints that a window can be involved in. | |
13052 | You will never need to create an instance of | |
13053 | wx.IndividualLayoutConstraint, rather you should create a | |
13054 | `wx.LayoutConstraints` instance and use the individual contstraints | |
d55e5bfc | 13055 | that it contains. |
d55e5bfc RD |
13056 | """ |
13057 | def __init__(self): raise RuntimeError, "No constructor defined" | |
13058 | def __repr__(self): | |
13059 | return "<%s.%s; proxy of C++ wxIndividualLayoutConstraint instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
13060 | def Set(*args, **kwargs): | |
15817c7e | 13061 | """ |
5b5c9bc7 | 13062 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) |
15817c7e RD |
13063 | |
13064 | Sets the properties of the constraint. Normally called by one of the | |
13065 | convenience functions such as Above, RightOf, SameAs. | |
13066 | """ | |
5b5c9bc7 | 13067 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
d55e5bfc RD |
13068 | |
13069 | def LeftOf(*args, **kwargs): | |
13070 | """ | |
5b5c9bc7 | 13071 | LeftOf(self, Window sibling, int marg=0) |
d55e5bfc | 13072 | |
15817c7e RD |
13073 | Constrains this edge to be to the left of the given window, with an |
13074 | optional margin. Implicitly, this is relative to the left edge of the | |
13075 | other window. | |
d55e5bfc | 13076 | """ |
5b5c9bc7 | 13077 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
d55e5bfc RD |
13078 | |
13079 | def RightOf(*args, **kwargs): | |
13080 | """ | |
5b5c9bc7 | 13081 | RightOf(self, Window sibling, int marg=0) |
d55e5bfc | 13082 | |
15817c7e RD |
13083 | Constrains this edge to be to the right of the given window, with an |
13084 | optional margin. Implicitly, this is relative to the right edge of the | |
13085 | other window. | |
d55e5bfc | 13086 | """ |
5b5c9bc7 | 13087 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
d55e5bfc RD |
13088 | |
13089 | def Above(*args, **kwargs): | |
13090 | """ | |
5b5c9bc7 | 13091 | Above(self, Window sibling, int marg=0) |
d55e5bfc | 13092 | |
15817c7e RD |
13093 | Constrains this edge to be above the given window, with an optional |
13094 | margin. Implicitly, this is relative to the top edge of the other | |
13095 | window. | |
d55e5bfc | 13096 | """ |
5b5c9bc7 | 13097 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
d55e5bfc RD |
13098 | |
13099 | def Below(*args, **kwargs): | |
13100 | """ | |
5b5c9bc7 | 13101 | Below(self, Window sibling, int marg=0) |
d55e5bfc | 13102 | |
15817c7e RD |
13103 | Constrains this edge to be below the given window, with an optional |
13104 | margin. Implicitly, this is relative to the bottom edge of the other | |
13105 | window. | |
d55e5bfc | 13106 | """ |
5b5c9bc7 | 13107 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
d55e5bfc RD |
13108 | |
13109 | def SameAs(*args, **kwargs): | |
13110 | """ | |
5b5c9bc7 | 13111 | SameAs(self, Window otherW, int edge, int marg=0) |
d55e5bfc | 13112 | |
15817c7e RD |
13113 | Constrains this edge or dimension to be to the same as the edge of the |
13114 | given window, with an optional margin. | |
d55e5bfc | 13115 | """ |
5b5c9bc7 | 13116 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
d55e5bfc RD |
13117 | |
13118 | def PercentOf(*args, **kwargs): | |
13119 | """ | |
5b5c9bc7 | 13120 | PercentOf(self, Window otherW, int wh, int per) |
d55e5bfc | 13121 | |
15817c7e RD |
13122 | Constrains this edge or dimension to be to a percentage of the given |
13123 | window, with an optional margin. | |
d55e5bfc | 13124 | """ |
5b5c9bc7 | 13125 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
d55e5bfc RD |
13126 | |
13127 | def Absolute(*args, **kwargs): | |
13128 | """ | |
13129 | Absolute(self, int val) | |
13130 | ||
15817c7e | 13131 | Constrains this edge or dimension to be the given absolute value. |
d55e5bfc | 13132 | """ |
5b5c9bc7 | 13133 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
d55e5bfc RD |
13134 | |
13135 | def Unconstrained(*args, **kwargs): | |
13136 | """ | |
13137 | Unconstrained(self) | |
13138 | ||
15817c7e RD |
13139 | Sets this edge or dimension to be unconstrained, that is, dependent on |
13140 | other edges and dimensions from which this value can be deduced. | |
d55e5bfc | 13141 | """ |
5b5c9bc7 | 13142 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
d55e5bfc RD |
13143 | |
13144 | def AsIs(*args, **kwargs): | |
13145 | """ | |
13146 | AsIs(self) | |
13147 | ||
15817c7e RD |
13148 | Sets this edge or constraint to be whatever the window's value is at |
13149 | the moment. If either of the width and height constraints are *as is*, | |
13150 | the window will not be resized, but moved instead. This is important | |
13151 | when considering panel items which are intended to have a default | |
13152 | size, such as a button, which may take its size from the size of the | |
13153 | button label. | |
d55e5bfc | 13154 | """ |
5b5c9bc7 | 13155 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
d55e5bfc RD |
13156 | |
13157 | def GetOtherWindow(*args, **kwargs): | |
5b5c9bc7 RD |
13158 | """GetOtherWindow(self) -> Window""" |
13159 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) | |
d55e5bfc RD |
13160 | |
13161 | def GetMyEdge(*args, **kwargs): | |
13162 | """GetMyEdge(self) -> int""" | |
5b5c9bc7 | 13163 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
d55e5bfc RD |
13164 | |
13165 | def SetEdge(*args, **kwargs): | |
13166 | """SetEdge(self, int which)""" | |
5b5c9bc7 | 13167 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
d55e5bfc RD |
13168 | |
13169 | def SetValue(*args, **kwargs): | |
13170 | """SetValue(self, int v)""" | |
5b5c9bc7 | 13171 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
d55e5bfc RD |
13172 | |
13173 | def GetMargin(*args, **kwargs): | |
13174 | """GetMargin(self) -> int""" | |
5b5c9bc7 | 13175 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
d55e5bfc RD |
13176 | |
13177 | def SetMargin(*args, **kwargs): | |
13178 | """SetMargin(self, int m)""" | |
5b5c9bc7 | 13179 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
d55e5bfc RD |
13180 | |
13181 | def GetValue(*args, **kwargs): | |
13182 | """GetValue(self) -> int""" | |
5b5c9bc7 | 13183 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
d55e5bfc RD |
13184 | |
13185 | def GetPercent(*args, **kwargs): | |
13186 | """GetPercent(self) -> int""" | |
5b5c9bc7 | 13187 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
d55e5bfc RD |
13188 | |
13189 | def GetOtherEdge(*args, **kwargs): | |
13190 | """GetOtherEdge(self) -> int""" | |
5b5c9bc7 | 13191 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
d55e5bfc RD |
13192 | |
13193 | def GetDone(*args, **kwargs): | |
13194 | """GetDone(self) -> bool""" | |
5b5c9bc7 | 13195 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
d55e5bfc RD |
13196 | |
13197 | def SetDone(*args, **kwargs): | |
13198 | """SetDone(self, bool d)""" | |
5b5c9bc7 | 13199 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
d55e5bfc RD |
13200 | |
13201 | def GetRelationship(*args, **kwargs): | |
13202 | """GetRelationship(self) -> int""" | |
5b5c9bc7 | 13203 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
d55e5bfc RD |
13204 | |
13205 | def SetRelationship(*args, **kwargs): | |
13206 | """SetRelationship(self, int r)""" | |
5b5c9bc7 | 13207 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
d55e5bfc RD |
13208 | |
13209 | def ResetIfWin(*args, **kwargs): | |
13210 | """ | |
5b5c9bc7 | 13211 | ResetIfWin(self, Window otherW) -> bool |
d55e5bfc RD |
13212 | |
13213 | Reset constraint if it mentions otherWin | |
13214 | """ | |
5b5c9bc7 | 13215 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
d55e5bfc RD |
13216 | |
13217 | def SatisfyConstraint(*args, **kwargs): | |
13218 | """ | |
5b5c9bc7 | 13219 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
d55e5bfc RD |
13220 | |
13221 | Try to satisfy constraint | |
13222 | """ | |
5b5c9bc7 | 13223 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
d55e5bfc RD |
13224 | |
13225 | def GetEdge(*args, **kwargs): | |
13226 | """ | |
5b5c9bc7 | 13227 | GetEdge(self, int which, Window thisWin, Window other) -> int |
d55e5bfc RD |
13228 | |
13229 | Get the value of this edge or dimension, or if this | |
13230 | is not determinable, -1. | |
13231 | """ | |
5b5c9bc7 | 13232 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
d55e5bfc RD |
13233 | |
13234 | ||
5b5c9bc7 | 13235 | class IndividualLayoutConstraintPtr(IndividualLayoutConstraint): |
d55e5bfc RD |
13236 | def __init__(self, this): |
13237 | self.this = this | |
13238 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
13239 | self.__class__ = IndividualLayoutConstraint |
13240 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraintPtr) | |
d55e5bfc | 13241 | |
5b5c9bc7 | 13242 | class LayoutConstraints(Object): |
d55e5bfc | 13243 | """ |
15817c7e RD |
13244 | **Note:** constraints are now deprecated and you should use sizers |
13245 | instead. | |
d55e5bfc | 13246 | |
15817c7e RD |
13247 | Objects of this class can be associated with a window to define its |
13248 | layout constraints, with respect to siblings or its parent. | |
d55e5bfc RD |
13249 | |
13250 | The class consists of the following eight constraints of class | |
13251 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
13252 | directly to set the appropriate constraints. | |
13253 | ||
13254 | * left: represents the left hand edge of the window | |
13255 | * right: represents the right hand edge of the window | |
13256 | * top: represents the top edge of the window | |
13257 | * bottom: represents the bottom edge of the window | |
13258 | * width: represents the width of the window | |
13259 | * height: represents the height of the window | |
13260 | * centreX: represents the horizontal centre point of the window | |
13261 | * centreY: represents the vertical centre point of the window | |
13262 | ||
15817c7e RD |
13263 | Most constraints are initially set to have the relationship |
13264 | wxUnconstrained, which means that their values should be calculated by | |
13265 | looking at known constraints. The exceptions are width and height, | |
13266 | which are set to wxAsIs to ensure that if the user does not specify a | |
13267 | constraint, the existing width and height will be used, to be | |
13268 | compatible with panel items which often have take a default size. If | |
13269 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
13270 | ||
13271 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
d55e5bfc RD |
13272 | |
13273 | """ | |
13274 | def __repr__(self): | |
13275 | return "<%s.%s; proxy of C++ wxLayoutConstraints instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) | |
5b5c9bc7 RD |
13276 | left = property(_core_.LayoutConstraints_left_get) |
13277 | top = property(_core_.LayoutConstraints_top_get) | |
13278 | right = property(_core_.LayoutConstraints_right_get) | |
13279 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
13280 | width = property(_core_.LayoutConstraints_width_get) | |
13281 | height = property(_core_.LayoutConstraints_height_get) | |
13282 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
13283 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
d55e5bfc | 13284 | def __init__(self, *args, **kwargs): |
5b5c9bc7 RD |
13285 | """__init__(self) -> LayoutConstraints""" |
13286 | newobj = _core_.new_LayoutConstraints(*args, **kwargs) | |
d55e5bfc RD |
13287 | self.this = newobj.this |
13288 | self.thisown = 1 | |
13289 | del newobj.thisown | |
13290 | def SatisfyConstraints(*args, **kwargs): | |
13291 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" | |
5b5c9bc7 | 13292 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
d55e5bfc RD |
13293 | |
13294 | def AreSatisfied(*args, **kwargs): | |
13295 | """AreSatisfied(self) -> bool""" | |
5b5c9bc7 | 13296 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
d55e5bfc RD |
13297 | |
13298 | ||
5b5c9bc7 | 13299 | class LayoutConstraintsPtr(LayoutConstraints): |
d55e5bfc RD |
13300 | def __init__(self, this): |
13301 | self.this = this | |
13302 | if not hasattr(self,"thisown"): self.thisown = 0 | |
5b5c9bc7 RD |
13303 | self.__class__ = LayoutConstraints |
13304 | _core_.LayoutConstraints_swigregister(LayoutConstraintsPtr) | |
d55e5bfc RD |
13305 | |
13306 | #---------------------------------------------------------------------------- | |
13307 | ||
13308 | # Use Python's bool constants if available, make some if not | |
13309 | try: | |
13310 | True | |
13311 | except NameError: | |
13312 | __builtins__.True = 1==1 | |
13313 | __builtins__.False = 1==0 | |
13314 | def bool(value): return not not value | |
13315 | __builtins__.bool = bool | |
13316 | ||
13317 | ||
13318 | ||
13319 | # workarounds for bad wxRTTI names | |
13320 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
13321 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
13322 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
13323 | ||
13324 | ||
13325 | #---------------------------------------------------------------------------- | |
13326 | # Load version numbers from __version__... Ensure that major and minor | |
0f63ec68 | 13327 | # versions are the same for both wxPython and wxWidgets. |
d55e5bfc RD |
13328 | |
13329 | from __version__ import * | |
13330 | __version__ = VERSION_STRING | |
13331 | ||
0f63ec68 RD |
13332 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
13333 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
d55e5bfc RD |
13334 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
13335 | import warnings | |
0f63ec68 | 13336 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d55e5bfc RD |
13337 | |
13338 | #---------------------------------------------------------------------------- | |
13339 | ||
7993762b RD |
13340 | # Set wxPython's default string<-->unicode conversion encoding from |
13341 | # the locale, but only if Python's default hasn't been changed. (We | |
13342 | # assume that if the user has customized it already then that is the | |
13343 | # encoding we need to use as well.) | |
13344 | # | |
13345 | # The encoding selected here is used when string or unicode objects | |
13346 | # need to be converted in order to pass them to wxWidgets. Please be | |
13347 | # aware that the default encoding within the same locale may be | |
13348 | # slightly different on different platforms. For example, please see | |
62d32a5f RD |
13349 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
13350 | # between the common latin/roman encodings. | |
3837a853 RD |
13351 | |
13352 | default = _sys.getdefaultencoding() | |
13353 | if default == 'ascii': | |
13354 | import locale | |
13355 | import codecs | |
13356 | try: | |
13357 | default = locale.getdefaultlocale()[1] | |
13358 | codecs.lookup(default) | |
7993762b | 13359 | except (ValueError, LookupError, TypeError): |
3837a853 RD |
13360 | default = _sys.getdefaultencoding() |
13361 | del locale | |
13362 | del codecs | |
5cbf236d RD |
13363 | if default: |
13364 | wx.SetDefaultPyEncoding(default) | |
13365 | del default | |
5cbf236d RD |
13366 | |
13367 | #---------------------------------------------------------------------------- | |
13368 | ||
d55e5bfc RD |
13369 | class PyDeadObjectError(AttributeError): |
13370 | pass | |
13371 | ||
13372 | class _wxPyDeadObject(object): | |
13373 | """ | |
13374 | Instances of wx objects that are OOR capable will have their __class__ | |
13375 | changed to this class when the C++ object is deleted. This should help | |
13376 | prevent crashes due to referencing a bogus C++ pointer. | |
13377 | """ | |
13378 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
13379 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
13380 | ||
13381 | def __repr__(self): | |
13382 | if not hasattr(self, "_name"): | |
13383 | self._name = "[unknown]" | |
13384 | return self.reprStr % self._name | |
13385 | ||
13386 | def __getattr__(self, *args): | |
13387 | if not hasattr(self, "_name"): | |
13388 | self._name = "[unknown]" | |
13389 | raise PyDeadObjectError(self.attrStr % self._name) | |
13390 | ||
13391 | def __nonzero__(self): | |
13392 | return 0 | |
13393 | ||
13394 | ||
13395 | ||
13396 | class PyUnbornObjectError(AttributeError): | |
13397 | pass | |
13398 | ||
13399 | class _wxPyUnbornObject(object): | |
13400 | """ | |
13401 | Some stock objects are created when the wx._core module is | |
13402 | imported, but their C++ instance is not created until the wx.App | |
13403 | object is created and initialized. These object instances will | |
13404 | temporarily have their __class__ changed to this class so an | |
13405 | exception will be raised if they are used before the C++ instance | |
13406 | is ready. | |
13407 | """ | |
13408 | ||
13409 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
13410 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
13411 | ||
13412 | def __repr__(self): | |
13413 | #if not hasattr(self, "_name"): | |
13414 | # self._name = "[unknown]" | |
13415 | return self.reprStr #% self._name | |
13416 | ||
13417 | def __getattr__(self, *args): | |
13418 | #if not hasattr(self, "_name"): | |
13419 | # self._name = "[unknown]" | |
13420 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
13421 | ||
13422 | def __nonzero__(self): | |
13423 | return 0 | |
13424 | ||
13425 | ||
13426 | #---------------------------------------------------------------------------- | |
d55e5bfc RD |
13427 | |
13428 | def CallAfter(callable, *args, **kw): | |
13429 | """ | |
13430 | Call the specified function after the current and pending event | |
13431 | handlers have been completed. This is also good for making GUI | |
0439c23b RD |
13432 | method calls from non-GUI threads. Any extra positional or |
13433 | keyword args are passed on to the callable when it is called. | |
13434 | ||
13435 | :see: `wx.FutureCall` | |
d55e5bfc RD |
13436 | """ |
13437 | app = wx.GetApp() | |
a001823c | 13438 | assert app is not None, 'No wx.App created yet' |
d55e5bfc | 13439 | |
891bb194 RD |
13440 | if not hasattr(app, "_CallAfterId"): |
13441 | app._CallAfterId = wx.NewEventType() | |
13442 | app.Connect(-1, -1, app._CallAfterId, | |
13443 | lambda event: event.callable(*event.args, **event.kw) ) | |
d55e5bfc | 13444 | evt = wx.PyEvent() |
891bb194 | 13445 | evt.SetEventType(app._CallAfterId) |
d55e5bfc RD |
13446 | evt.callable = callable |
13447 | evt.args = args | |
13448 | evt.kw = kw | |
13449 | wx.PostEvent(app, evt) | |
13450 | ||
d55e5bfc RD |
13451 | #---------------------------------------------------------------------------- |
13452 | ||
13453 | ||
13454 | class FutureCall: | |
13455 | """ | |
6e0de3df | 13456 | A convenience class for `wx.Timer`, that calls the given callable |
d55e5bfc RD |
13457 | object once after the given amount of milliseconds, passing any |
13458 | positional or keyword args. The return value of the callable is | |
0439c23b | 13459 | availbale after it has been run with the `GetResult` method. |
d55e5bfc RD |
13460 | |
13461 | If you don't need to get the return value or restart the timer | |
13462 | then there is no need to hold a reference to this object. It will | |
13463 | hold a reference to itself while the timer is running (the timer | |
13464 | has a reference to self.Notify) but the cycle will be broken when | |
13465 | the timer completes, automatically cleaning up the wx.FutureCall | |
13466 | object. | |
0439c23b RD |
13467 | |
13468 | :see: `wx.CallAfter` | |
d55e5bfc RD |
13469 | """ |
13470 | def __init__(self, millis, callable, *args, **kwargs): | |
13471 | self.millis = millis | |
13472 | self.callable = callable | |
13473 | self.SetArgs(*args, **kwargs) | |
13474 | self.runCount = 0 | |
13475 | self.running = False | |
13476 | self.hasRun = False | |
13477 | self.result = None | |
13478 | self.timer = None | |
13479 | self.Start() | |
13480 | ||
13481 | def __del__(self): | |
13482 | self.Stop() | |
13483 | ||
13484 | ||
13485 | def Start(self, millis=None, *args, **kwargs): | |
13486 | """ | |
13487 | (Re)start the timer | |
13488 | """ | |
13489 | self.hasRun = False | |
13490 | if millis is not None: | |
13491 | self.millis = millis | |
13492 | if args or kwargs: | |
13493 | self.SetArgs(*args, **kwargs) | |
13494 | self.Stop() | |
13495 | self.timer = wx.PyTimer(self.Notify) | |
13496 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
13497 | self.running = True | |
13498 | Restart = Start | |
13499 | ||
13500 | ||
13501 | def Stop(self): | |
13502 | """ | |
13503 | Stop and destroy the timer. | |
13504 | """ | |
13505 | if self.timer is not None: | |
13506 | self.timer.Stop() | |
13507 | self.timer = None | |
13508 | ||
13509 | ||
13510 | def GetInterval(self): | |
13511 | if self.timer is not None: | |
13512 | return self.timer.GetInterval() | |
13513 | else: | |
13514 | return 0 | |
13515 | ||
13516 | ||
13517 | def IsRunning(self): | |
13518 | return self.timer is not None and self.timer.IsRunning() | |
13519 | ||
13520 | ||
13521 | def SetArgs(self, *args, **kwargs): | |
13522 | """ | |
13523 | (Re)set the args passed to the callable object. This is | |
13524 | useful in conjunction with Restart if you want to schedule a | |
13525 | new call to the same callable object but with different | |
13526 | parameters. | |
13527 | """ | |
13528 | self.args = args | |
13529 | self.kwargs = kwargs | |
13530 | ||
13531 | ||
13532 | def HasRun(self): | |
13533 | return self.hasRun | |
13534 | ||
13535 | def GetResult(self): | |
13536 | return self.result | |
13537 | ||
13538 | def Notify(self): | |
13539 | """ | |
13540 | The timer has expired so call the callable. | |
13541 | """ | |
13542 | if self.callable and getattr(self.callable, 'im_self', True): | |
13543 | self.runCount += 1 | |
13544 | self.running = False | |
13545 | self.result = self.callable(*self.args, **self.kwargs) | |
13546 | self.hasRun = True | |
13547 | if not self.running: | |
13548 | # if it wasn't restarted, then cleanup | |
13549 | wx.CallAfter(self.Stop) | |
13550 | ||
13551 | ||
13552 | ||
13553 | #---------------------------------------------------------------------------- | |
13554 | # Control which items in this module should be documented by epydoc. | |
13555 | # We allow only classes and functions, which will help reduce the size | |
13556 | # of the docs by filtering out the zillions of constants, EVT objects, | |
13557 | # and etc that don't make much sense by themselves, but are instead | |
13558 | # documented (or will be) as part of the classes/functions/methods | |
13559 | # where they should be used. | |
13560 | ||
d6c14a4c RD |
13561 | class __DocFilter: |
13562 | """ | |
13563 | A filter for epydoc that only allows non-Ptr classes and | |
13564 | fucntions, in order to reduce the clutter in the API docs. | |
13565 | """ | |
13566 | def __init__(self, globals): | |
13567 | self._globals = globals | |
13568 | ||
13569 | def __call__(self, name): | |
13570 | import types | |
13571 | obj = self._globals.get(name, None) | |
13572 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: | |
13573 | return False | |
13574 | if name.startswith('_') or name.endswith('Ptr') or name.startswith('EVT'): | |
13575 | return False | |
13576 | return True | |
d55e5bfc RD |
13577 | |
13578 | #---------------------------------------------------------------------------- | |
13579 | #---------------------------------------------------------------------------- | |
13580 | ||
13581 | # Import other modules in this package that should show up in the | |
13582 | # "core" wx namespace | |
13583 | from _gdi import * | |
13584 | from _windows import * | |
13585 | from _controls import * | |
13586 | from _misc import * | |
13587 | ||
13588 | ||
13589 | # Fixup the stock objects since they can't be used yet. (They will be | |
13590 | # restored in wx.PyApp.OnInit.) | |
13591 | _core_._wxPyFixStockObjects() | |
13592 | ||
13593 | #---------------------------------------------------------------------------- | |
13594 | #---------------------------------------------------------------------------- | |
13595 | ||
13596 |