]>
Commit | Line | Data |
---|---|---|
0085ce49 | 1 | # This file was created automatically by SWIG 1.3.29. |
d14a1e28 RD |
2 | # Don't modify this file, modify the SWIG interface instead. |
3 | ||
54f9ee45 | 4 | import _core_ |
0085ce49 RD |
5 | import new |
6 | new_instancemethod = new.instancemethod | |
093d3ff1 | 7 | def _swig_setattr_nondynamic(self,class_type,name,value,static=1): |
0085ce49 | 8 | if (name == "thisown"): return self.this.own(value) |
093d3ff1 | 9 | if (name == "this"): |
0085ce49 RD |
10 | if type(value).__name__ == 'PySwigObject': |
11 | self.__dict__[name] = value | |
093d3ff1 RD |
12 | return |
13 | method = class_type.__swig_setmethods__.get(name,None) | |
14 | if method: return method(self,value) | |
0085ce49 | 15 | if (not static) or hasattr(self,name): |
093d3ff1 RD |
16 | self.__dict__[name] = value |
17 | else: | |
18 | raise AttributeError("You cannot add attributes to %s" % self) | |
19 | ||
20 | def _swig_setattr(self,class_type,name,value): | |
21 | return _swig_setattr_nondynamic(self,class_type,name,value,0) | |
22 | ||
23 | def _swig_getattr(self,class_type,name): | |
0085ce49 | 24 | if (name == "thisown"): return self.this.own() |
093d3ff1 RD |
25 | method = class_type.__swig_getmethods__.get(name,None) |
26 | if method: return method(self) | |
27 | raise AttributeError,name | |
28 | ||
0085ce49 RD |
29 | def _swig_repr(self): |
30 | try: strthis = "proxy of " + self.this.__repr__() | |
31 | except: strthis = "" | |
32 | return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) | |
33 | ||
093d3ff1 RD |
34 | import types |
35 | try: | |
36 | _object = types.ObjectType | |
37 | _newclass = 1 | |
38 | except AttributeError: | |
39 | class _object : pass | |
40 | _newclass = 0 | |
41 | del types | |
42 | ||
43 | ||
44 | def _swig_setattr_nondynamic_method(set): | |
45 | def set_attr(self,name,value): | |
0085ce49 RD |
46 | if (name == "thisown"): return self.this.own(value) |
47 | if hasattr(self,name) or (name == "this"): | |
093d3ff1 RD |
48 | set(self,name,value) |
49 | else: | |
50 | raise AttributeError("You cannot add attributes to %s" % self) | |
51 | return set_attr | |
52 | ||
53 | ||
d14a1e28 RD |
54 | #// Give a reference to the dictionary of this module to the C++ extension |
55 | #// code. | |
54f9ee45 | 56 | _core_._wxPySetDictionary(vars()) |
d14a1e28 RD |
57 | |
58 | #// A little trick to make 'wx' be a reference to this module so wx.Names can | |
59 | #// be used here. | |
60 | import sys as _sys | |
61 | wx = _sys.modules[__name__] | |
62 | ||
66c033b4 RD |
63 | |
64 | #---------------------------------------------------------------------------- | |
65 | ||
66 | def _deprecated(callable, msg=None): | |
67 | """ | |
68 | Create a wrapper function that will raise a DeprecationWarning | |
69 | before calling the callable. | |
70 | """ | |
71 | if msg is None: | |
72 | msg = "%s is deprecated" % callable | |
73 | def deprecatedWrapper(*args, **kwargs): | |
74 | import warnings | |
75 | warnings.warn(msg, DeprecationWarning, stacklevel=2) | |
76 | return callable(*args, **kwargs) | |
77 | deprecatedWrapper.__doc__ = msg | |
78 | return deprecatedWrapper | |
79 | ||
80 | ||
81 | #---------------------------------------------------------------------------- | |
82 | ||
54f9ee45 RD |
83 | NOT_FOUND = _core_.NOT_FOUND |
84 | VSCROLL = _core_.VSCROLL | |
85 | HSCROLL = _core_.HSCROLL | |
86 | CAPTION = _core_.CAPTION | |
87 | DOUBLE_BORDER = _core_.DOUBLE_BORDER | |
88 | SUNKEN_BORDER = _core_.SUNKEN_BORDER | |
89 | RAISED_BORDER = _core_.RAISED_BORDER | |
90 | BORDER = _core_.BORDER | |
91 | SIMPLE_BORDER = _core_.SIMPLE_BORDER | |
92 | STATIC_BORDER = _core_.STATIC_BORDER | |
93 | TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW | |
94 | NO_BORDER = _core_.NO_BORDER | |
bcd0d7b6 | 95 | DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER |
6d88e192 | 96 | DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE |
54f9ee45 RD |
97 | TAB_TRAVERSAL = _core_.TAB_TRAVERSAL |
98 | WANTS_CHARS = _core_.WANTS_CHARS | |
99 | POPUP_WINDOW = _core_.POPUP_WINDOW | |
100 | CENTER_FRAME = _core_.CENTER_FRAME | |
101 | CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN | |
102 | CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN | |
54f9ee45 RD |
103 | CLIP_CHILDREN = _core_.CLIP_CHILDREN |
104 | CLIP_SIBLINGS = _core_.CLIP_SIBLINGS | |
092f0ed7 | 105 | WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK |
54f9ee45 RD |
106 | ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB |
107 | RETAINED = _core_.RETAINED | |
108 | BACKINGSTORE = _core_.BACKINGSTORE | |
109 | COLOURED = _core_.COLOURED | |
110 | FIXED_LENGTH = _core_.FIXED_LENGTH | |
111 | LB_NEEDED_SB = _core_.LB_NEEDED_SB | |
112 | LB_ALWAYS_SB = _core_.LB_ALWAYS_SB | |
113 | LB_SORT = _core_.LB_SORT | |
114 | LB_SINGLE = _core_.LB_SINGLE | |
115 | LB_MULTIPLE = _core_.LB_MULTIPLE | |
116 | LB_EXTENDED = _core_.LB_EXTENDED | |
117 | LB_OWNERDRAW = _core_.LB_OWNERDRAW | |
118 | LB_HSCROLL = _core_.LB_HSCROLL | |
119 | PROCESS_ENTER = _core_.PROCESS_ENTER | |
120 | PASSWORD = _core_.PASSWORD | |
121 | CB_SIMPLE = _core_.CB_SIMPLE | |
122 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
123 | CB_SORT = _core_.CB_SORT | |
124 | CB_READONLY = _core_.CB_READONLY | |
125 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
126 | RA_VERTICAL = _core_.RA_VERTICAL | |
127 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
128 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
fef4c27a | 129 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX |
54f9ee45 RD |
130 | RB_GROUP = _core_.RB_GROUP |
131 | RB_SINGLE = _core_.RB_SINGLE | |
54f9ee45 RD |
132 | SB_HORIZONTAL = _core_.SB_HORIZONTAL |
133 | SB_VERTICAL = _core_.SB_VERTICAL | |
fef4c27a | 134 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX |
54f9ee45 RD |
135 | ST_SIZEGRIP = _core_.ST_SIZEGRIP |
136 | ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE | |
e9d6f3a4 RD |
137 | ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE |
138 | ST_DOTS_END = _core_.ST_DOTS_END | |
54f9ee45 RD |
139 | FLOOD_SURFACE = _core_.FLOOD_SURFACE |
140 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
141 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
142 | WINDING_RULE = _core_.WINDING_RULE | |
143 | TOOL_TOP = _core_.TOOL_TOP | |
144 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
145 | TOOL_LEFT = _core_.TOOL_LEFT | |
146 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
147 | OK = _core_.OK | |
148 | YES_NO = _core_.YES_NO | |
149 | CANCEL = _core_.CANCEL | |
150 | YES = _core_.YES | |
151 | NO = _core_.NO | |
152 | NO_DEFAULT = _core_.NO_DEFAULT | |
153 | YES_DEFAULT = _core_.YES_DEFAULT | |
154 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION | |
155 | ICON_HAND = _core_.ICON_HAND | |
156 | ICON_QUESTION = _core_.ICON_QUESTION | |
157 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
158 | ICON_STOP = _core_.ICON_STOP | |
159 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
160 | ICON_MASK = _core_.ICON_MASK | |
161 | ICON_WARNING = _core_.ICON_WARNING | |
162 | ICON_ERROR = _core_.ICON_ERROR | |
163 | FORWARD = _core_.FORWARD | |
164 | BACKWARD = _core_.BACKWARD | |
165 | RESET = _core_.RESET | |
166 | HELP = _core_.HELP | |
167 | MORE = _core_.MORE | |
168 | SETUP = _core_.SETUP | |
169 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
170 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
171 | SIZE_AUTO = _core_.SIZE_AUTO | |
172 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
173 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
943e8dfd | 174 | SIZE_FORCE = _core_.SIZE_FORCE |
54f9ee45 RD |
175 | PORTRAIT = _core_.PORTRAIT |
176 | LANDSCAPE = _core_.LANDSCAPE | |
177 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
178 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
179 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
180 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
181 | ID_ANY = _core_.ID_ANY | |
182 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
943e8dfd | 183 | ID_NONE = _core_.ID_NONE |
54f9ee45 RD |
184 | ID_LOWEST = _core_.ID_LOWEST |
185 | ID_OPEN = _core_.ID_OPEN | |
186 | ID_CLOSE = _core_.ID_CLOSE | |
187 | ID_NEW = _core_.ID_NEW | |
188 | ID_SAVE = _core_.ID_SAVE | |
189 | ID_SAVEAS = _core_.ID_SAVEAS | |
190 | ID_REVERT = _core_.ID_REVERT | |
191 | ID_EXIT = _core_.ID_EXIT | |
192 | ID_UNDO = _core_.ID_UNDO | |
193 | ID_REDO = _core_.ID_REDO | |
194 | ID_HELP = _core_.ID_HELP | |
195 | ID_PRINT = _core_.ID_PRINT | |
196 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
197 | ID_PREVIEW = _core_.ID_PREVIEW | |
198 | ID_ABOUT = _core_.ID_ABOUT | |
199 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
200 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
201 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
202 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
203 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL | |
204 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
205 | ID_CUT = _core_.ID_CUT | |
206 | ID_COPY = _core_.ID_COPY | |
207 | ID_PASTE = _core_.ID_PASTE | |
208 | ID_CLEAR = _core_.ID_CLEAR | |
209 | ID_FIND = _core_.ID_FIND | |
210 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
211 | ID_SELECTALL = _core_.ID_SELECTALL | |
212 | ID_DELETE = _core_.ID_DELETE | |
213 | ID_REPLACE = _core_.ID_REPLACE | |
214 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
215 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
216 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
217 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
218 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
219 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
220 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
221 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
222 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
223 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
224 | ID_FILE1 = _core_.ID_FILE1 | |
225 | ID_FILE2 = _core_.ID_FILE2 | |
226 | ID_FILE3 = _core_.ID_FILE3 | |
227 | ID_FILE4 = _core_.ID_FILE4 | |
228 | ID_FILE5 = _core_.ID_FILE5 | |
229 | ID_FILE6 = _core_.ID_FILE6 | |
230 | ID_FILE7 = _core_.ID_FILE7 | |
231 | ID_FILE8 = _core_.ID_FILE8 | |
232 | ID_FILE9 = _core_.ID_FILE9 | |
233 | ID_OK = _core_.ID_OK | |
234 | ID_CANCEL = _core_.ID_CANCEL | |
235 | ID_APPLY = _core_.ID_APPLY | |
236 | ID_YES = _core_.ID_YES | |
237 | ID_NO = _core_.ID_NO | |
238 | ID_STATIC = _core_.ID_STATIC | |
239 | ID_FORWARD = _core_.ID_FORWARD | |
240 | ID_BACKWARD = _core_.ID_BACKWARD | |
241 | ID_DEFAULT = _core_.ID_DEFAULT | |
242 | ID_MORE = _core_.ID_MORE | |
243 | ID_SETUP = _core_.ID_SETUP | |
244 | ID_RESET = _core_.ID_RESET | |
245 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
246 | ID_YESTOALL = _core_.ID_YESTOALL | |
247 | ID_NOTOALL = _core_.ID_NOTOALL | |
248 | ID_ABORT = _core_.ID_ABORT | |
249 | ID_RETRY = _core_.ID_RETRY | |
250 | ID_IGNORE = _core_.ID_IGNORE | |
7bc1e663 RD |
251 | ID_ADD = _core_.ID_ADD |
252 | ID_REMOVE = _core_.ID_REMOVE | |
253 | ID_UP = _core_.ID_UP | |
254 | ID_DOWN = _core_.ID_DOWN | |
255 | ID_HOME = _core_.ID_HOME | |
256 | ID_REFRESH = _core_.ID_REFRESH | |
257 | ID_STOP = _core_.ID_STOP | |
258 | ID_INDEX = _core_.ID_INDEX | |
259 | ID_BOLD = _core_.ID_BOLD | |
260 | ID_ITALIC = _core_.ID_ITALIC | |
261 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
262 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
263 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
264 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
265 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
266 | ID_INDENT = _core_.ID_INDENT | |
267 | ID_UNINDENT = _core_.ID_UNINDENT | |
268 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
269 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
270 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
271 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
272 | ID_UNDELETE = _core_.ID_UNDELETE | |
273 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
54f9ee45 | 274 | ID_HIGHEST = _core_.ID_HIGHEST |
54f9ee45 RD |
275 | ACCEL_ALT = _core_.ACCEL_ALT |
276 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
277 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
278 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
279 | PD_AUTO_HIDE = _core_.PD_AUTO_HIDE | |
280 | PD_APP_MODAL = _core_.PD_APP_MODAL | |
281 | PD_CAN_ABORT = _core_.PD_CAN_ABORT | |
282 | PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME | |
283 | PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME | |
284 | PD_REMAINING_TIME = _core_.PD_REMAINING_TIME | |
e505d15e RD |
285 | PD_SMOOTH = _core_.PD_SMOOTH |
286 | PD_CAN_SKIP = _core_.PD_CAN_SKIP | |
54f9ee45 RD |
287 | MENU_TEAROFF = _core_.MENU_TEAROFF |
288 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
289 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
290 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
291 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
292 | LI_VERTICAL = _core_.LI_VERTICAL | |
293 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
294 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
295 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
296 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
297 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
298 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
299 | MM_TEXT = _core_.MM_TEXT | |
300 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
301 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
302 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
303 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
304 | MM_TWIPS = _core_.MM_TWIPS | |
305 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
306 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
307 | MM_POINTS = _core_.MM_POINTS | |
308 | MM_METRIC = _core_.MM_METRIC | |
309 | CENTRE = _core_.CENTRE | |
310 | CENTER = _core_.CENTER | |
311 | HORIZONTAL = _core_.HORIZONTAL | |
312 | VERTICAL = _core_.VERTICAL | |
313 | BOTH = _core_.BOTH | |
314 | LEFT = _core_.LEFT | |
315 | RIGHT = _core_.RIGHT | |
316 | UP = _core_.UP | |
317 | DOWN = _core_.DOWN | |
318 | TOP = _core_.TOP | |
319 | BOTTOM = _core_.BOTTOM | |
320 | NORTH = _core_.NORTH | |
321 | SOUTH = _core_.SOUTH | |
322 | WEST = _core_.WEST | |
323 | EAST = _core_.EAST | |
324 | ALL = _core_.ALL | |
325 | ALIGN_NOT = _core_.ALIGN_NOT | |
326 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
327 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
328 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
329 | ALIGN_TOP = _core_.ALIGN_TOP | |
330 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
331 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
332 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
333 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
334 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
335 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
336 | ALIGN_MASK = _core_.ALIGN_MASK | |
337 | STRETCH_NOT = _core_.STRETCH_NOT | |
338 | SHRINK = _core_.SHRINK | |
339 | GROW = _core_.GROW | |
340 | EXPAND = _core_.EXPAND | |
341 | SHAPED = _core_.SHAPED | |
342 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
343 | TILE = _core_.TILE | |
344 | ADJUST_MINSIZE = _core_.ADJUST_MINSIZE | |
345 | BORDER_DEFAULT = _core_.BORDER_DEFAULT | |
346 | BORDER_NONE = _core_.BORDER_NONE | |
347 | BORDER_STATIC = _core_.BORDER_STATIC | |
348 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
349 | BORDER_RAISED = _core_.BORDER_RAISED | |
350 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
351 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
352 | BORDER_MASK = _core_.BORDER_MASK | |
7bc1e663 RD |
353 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM |
354 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
355 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
54f9ee45 RD |
356 | DEFAULT = _core_.DEFAULT |
357 | DECORATIVE = _core_.DECORATIVE | |
358 | ROMAN = _core_.ROMAN | |
359 | SCRIPT = _core_.SCRIPT | |
360 | SWISS = _core_.SWISS | |
361 | MODERN = _core_.MODERN | |
362 | TELETYPE = _core_.TELETYPE | |
363 | VARIABLE = _core_.VARIABLE | |
364 | FIXED = _core_.FIXED | |
365 | NORMAL = _core_.NORMAL | |
366 | LIGHT = _core_.LIGHT | |
367 | BOLD = _core_.BOLD | |
368 | ITALIC = _core_.ITALIC | |
369 | SLANT = _core_.SLANT | |
370 | SOLID = _core_.SOLID | |
371 | DOT = _core_.DOT | |
372 | LONG_DASH = _core_.LONG_DASH | |
373 | SHORT_DASH = _core_.SHORT_DASH | |
374 | DOT_DASH = _core_.DOT_DASH | |
375 | USER_DASH = _core_.USER_DASH | |
376 | TRANSPARENT = _core_.TRANSPARENT | |
377 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
378 | STIPPLE_MASK = _core_.STIPPLE_MASK |
379 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
54f9ee45 RD |
380 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH |
381 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
382 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
383 | CROSS_HATCH = _core_.CROSS_HATCH | |
384 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
385 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
386 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
387 | JOIN_MITER = _core_.JOIN_MITER | |
388 | JOIN_ROUND = _core_.JOIN_ROUND | |
389 | CAP_ROUND = _core_.CAP_ROUND | |
390 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
391 | CAP_BUTT = _core_.CAP_BUTT | |
392 | CLEAR = _core_.CLEAR | |
393 | XOR = _core_.XOR | |
394 | INVERT = _core_.INVERT | |
395 | OR_REVERSE = _core_.OR_REVERSE | |
396 | AND_REVERSE = _core_.AND_REVERSE | |
397 | COPY = _core_.COPY | |
398 | AND = _core_.AND | |
399 | AND_INVERT = _core_.AND_INVERT | |
400 | NO_OP = _core_.NO_OP | |
401 | NOR = _core_.NOR | |
402 | EQUIV = _core_.EQUIV | |
403 | SRC_INVERT = _core_.SRC_INVERT | |
404 | OR_INVERT = _core_.OR_INVERT | |
405 | NAND = _core_.NAND | |
406 | OR = _core_.OR | |
407 | SET = _core_.SET | |
408 | WXK_BACK = _core_.WXK_BACK | |
409 | WXK_TAB = _core_.WXK_TAB | |
410 | WXK_RETURN = _core_.WXK_RETURN | |
411 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
412 | WXK_SPACE = _core_.WXK_SPACE | |
413 | WXK_DELETE = _core_.WXK_DELETE | |
414 | WXK_START = _core_.WXK_START | |
415 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
416 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
417 | WXK_CANCEL = _core_.WXK_CANCEL | |
418 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
419 | WXK_CLEAR = _core_.WXK_CLEAR | |
420 | WXK_SHIFT = _core_.WXK_SHIFT | |
421 | WXK_ALT = _core_.WXK_ALT | |
422 | WXK_CONTROL = _core_.WXK_CONTROL | |
423 | WXK_MENU = _core_.WXK_MENU | |
424 | WXK_PAUSE = _core_.WXK_PAUSE | |
425 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
426 | WXK_PRIOR = _core_.WXK_PRIOR | |
427 | WXK_NEXT = _core_.WXK_NEXT | |
428 | WXK_END = _core_.WXK_END | |
429 | WXK_HOME = _core_.WXK_HOME | |
430 | WXK_LEFT = _core_.WXK_LEFT | |
431 | WXK_UP = _core_.WXK_UP | |
432 | WXK_RIGHT = _core_.WXK_RIGHT | |
433 | WXK_DOWN = _core_.WXK_DOWN | |
434 | WXK_SELECT = _core_.WXK_SELECT | |
435 | WXK_PRINT = _core_.WXK_PRINT | |
436 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
437 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
438 | WXK_INSERT = _core_.WXK_INSERT | |
439 | WXK_HELP = _core_.WXK_HELP | |
440 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
441 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
442 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
443 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
444 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
445 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
446 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
447 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
448 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
449 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
450 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
451 | WXK_ADD = _core_.WXK_ADD | |
452 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
453 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
454 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
455 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
456 | WXK_F1 = _core_.WXK_F1 | |
457 | WXK_F2 = _core_.WXK_F2 | |
458 | WXK_F3 = _core_.WXK_F3 | |
459 | WXK_F4 = _core_.WXK_F4 | |
460 | WXK_F5 = _core_.WXK_F5 | |
461 | WXK_F6 = _core_.WXK_F6 | |
462 | WXK_F7 = _core_.WXK_F7 | |
463 | WXK_F8 = _core_.WXK_F8 | |
464 | WXK_F9 = _core_.WXK_F9 | |
465 | WXK_F10 = _core_.WXK_F10 | |
466 | WXK_F11 = _core_.WXK_F11 | |
467 | WXK_F12 = _core_.WXK_F12 | |
468 | WXK_F13 = _core_.WXK_F13 | |
469 | WXK_F14 = _core_.WXK_F14 | |
470 | WXK_F15 = _core_.WXK_F15 | |
471 | WXK_F16 = _core_.WXK_F16 | |
472 | WXK_F17 = _core_.WXK_F17 | |
473 | WXK_F18 = _core_.WXK_F18 | |
474 | WXK_F19 = _core_.WXK_F19 | |
475 | WXK_F20 = _core_.WXK_F20 | |
476 | WXK_F21 = _core_.WXK_F21 | |
477 | WXK_F22 = _core_.WXK_F22 | |
478 | WXK_F23 = _core_.WXK_F23 | |
479 | WXK_F24 = _core_.WXK_F24 | |
480 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
481 | WXK_SCROLL = _core_.WXK_SCROLL | |
482 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
483 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
484 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
485 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
486 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
487 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
488 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
489 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
490 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
491 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
492 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
493 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
494 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
495 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
496 | WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR | |
497 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP | |
498 | WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT | |
499 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN | |
500 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
501 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
502 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
503 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
504 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
505 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
506 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
507 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
508 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
509 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
510 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
511 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
512 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
513 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
88c6b281 RD |
514 | WXK_COMMAND = _core_.WXK_COMMAND |
515 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
516 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
517 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
518 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
519 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
520 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
521 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
522 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
523 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
524 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
525 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
526 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
527 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
528 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
529 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
530 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
531 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
532 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
533 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
534 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
54f9ee45 RD |
535 | PAPER_NONE = _core_.PAPER_NONE |
536 | PAPER_LETTER = _core_.PAPER_LETTER | |
537 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
538 | PAPER_A4 = _core_.PAPER_A4 | |
539 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
540 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
541 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
542 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
543 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
544 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
545 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
546 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
547 | PAPER_A3 = _core_.PAPER_A3 | |
548 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
549 | PAPER_A5 = _core_.PAPER_A5 | |
550 | PAPER_B4 = _core_.PAPER_B4 | |
551 | PAPER_B5 = _core_.PAPER_B5 | |
552 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
553 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
554 | PAPER_10X14 = _core_.PAPER_10X14 | |
555 | PAPER_11X17 = _core_.PAPER_11X17 | |
556 | PAPER_NOTE = _core_.PAPER_NOTE | |
557 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
558 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
559 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
560 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
561 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
562 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
563 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
564 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
565 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
566 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
567 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
568 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
569 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
570 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
571 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
572 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
573 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
574 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
575 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
576 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
577 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
578 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
579 | PAPER_9X11 = _core_.PAPER_9X11 | |
580 | PAPER_10X11 = _core_.PAPER_10X11 | |
581 | PAPER_15X11 = _core_.PAPER_15X11 | |
582 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
583 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
584 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
585 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
586 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
587 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
588 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
589 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
590 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
591 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
592 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
593 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
594 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
595 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
596 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
597 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
598 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
599 | PAPER_A2 = _core_.PAPER_A2 | |
600 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
601 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
6c75a4cf RD |
602 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD |
603 | PAPER_A6 = _core_.PAPER_A6 | |
604 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
605 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
606 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
607 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
608 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
609 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
610 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
611 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
612 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
613 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
614 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
615 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
616 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
617 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
618 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
619 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
620 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
621 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
622 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
623 | PAPER_12X11 = _core_.PAPER_12X11 | |
624 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
625 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
626 | PAPER_P16K = _core_.PAPER_P16K | |
627 | PAPER_P32K = _core_.PAPER_P32K | |
628 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
629 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
630 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
631 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
632 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
633 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
634 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
635 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
636 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
637 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
638 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
639 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
640 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
641 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
642 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
643 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
644 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
645 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
646 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
647 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
648 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
649 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
650 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
651 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
54f9ee45 RD |
652 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX |
653 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
654 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
655 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
656 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
657 | ITEM_CHECK = _core_.ITEM_CHECK | |
658 | ITEM_RADIO = _core_.ITEM_RADIO | |
659 | ITEM_MAX = _core_.ITEM_MAX | |
660 | HT_NOWHERE = _core_.HT_NOWHERE | |
661 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
662 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
663 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
664 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
665 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
666 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
667 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
668 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
669 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
670 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
671 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
672 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
673 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
674 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
675 | HT_MAX = _core_.HT_MAX | |
676 | MOD_NONE = _core_.MOD_NONE | |
677 | MOD_ALT = _core_.MOD_ALT | |
678 | MOD_CONTROL = _core_.MOD_CONTROL | |
943e8dfd | 679 | MOD_ALTGR = _core_.MOD_ALTGR |
54f9ee45 | 680 | MOD_SHIFT = _core_.MOD_SHIFT |
943e8dfd | 681 | MOD_META = _core_.MOD_META |
54f9ee45 | 682 | MOD_WIN = _core_.MOD_WIN |
943e8dfd RD |
683 | MOD_CMD = _core_.MOD_CMD |
684 | MOD_ALL = _core_.MOD_ALL | |
54f9ee45 RD |
685 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE |
686 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
687 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
d14a1e28 RD |
688 | #--------------------------------------------------------------------------- |
689 | ||
690 | class Object(object): | |
0df68c9f RD |
691 | """ |
692 | The base class for most wx objects, although in wxPython not | |
693 | much functionality is needed nor exposed. | |
694 | """ | |
0085ce49 RD |
695 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
696 | def __init__(self): raise AttributeError, "No constructor defined" | |
697 | __repr__ = _swig_repr | |
e811c8ce | 698 | def GetClassName(*args, **kwargs): |
0df68c9f | 699 | """ |
a95a7133 | 700 | GetClassName(self) -> String |
e811c8ce | 701 | |
a95a7133 | 702 | Returns the class name of the C++ class using wxRTTI. |
0df68c9f | 703 | """ |
54f9ee45 | 704 | return _core_.Object_GetClassName(*args, **kwargs) |
e811c8ce RD |
705 | |
706 | def Destroy(*args, **kwargs): | |
0df68c9f | 707 | """ |
a95a7133 | 708 | Destroy(self) |
e811c8ce | 709 | |
0df68c9f RD |
710 | Deletes the C++ object this Python object is a proxy for. |
711 | """ | |
7e08d4ef RD |
712 | val = _core_.Object_Destroy(*args, **kwargs) |
713 | args[0].thisown = 0 | |
714 | return val | |
e811c8ce | 715 | |
2131d850 | 716 | _core_.Object_swigregister(Object) |
54f9ee45 | 717 | _wxPySetDictionary = _core_._wxPySetDictionary |
54f9ee45 | 718 | cvar = _core_.cvar |
196addbf | 719 | EmptyString = cvar.EmptyString |
d14a1e28 RD |
720 | |
721 | #--------------------------------------------------------------------------- | |
722 | ||
54f9ee45 RD |
723 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID |
724 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
725 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
726 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
727 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
728 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
729 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
730 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
731 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
732 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
733 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
734 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
735 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
736 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
737 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
738 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
739 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
740 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
741 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR | |
742 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
743 | CURSOR_NONE = _core_.CURSOR_NONE | |
744 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
745 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
746 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
747 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
748 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
749 | CURSOR_HAND = _core_.CURSOR_HAND | |
750 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
751 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
752 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
753 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
754 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
755 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
756 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
757 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
758 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
759 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
760 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
761 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
762 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
763 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
764 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
765 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
766 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
767 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
768 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
769 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
770 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
771 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
772 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
773 | CURSOR_MAX = _core_.CURSOR_MAX | |
d14a1e28 RD |
774 | #--------------------------------------------------------------------------- |
775 | ||
776 | class Size(object): | |
0df68c9f | 777 | """ |
41e2b43e | 778 | wx.Size is a useful data structure used to represent the size of |
0085ce49 RD |
779 | something. It simply contains integer width and height |
780 | properties. In most places in wxPython where a wx.Size is | |
093d3ff1 | 781 | expected a (width, height) tuple can be used instead. |
0df68c9f | 782 | """ |
0085ce49 RD |
783 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
784 | __repr__ = _swig_repr | |
54f9ee45 RD |
785 | width = property(_core_.Size_width_get, _core_.Size_width_set) |
786 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
242b7b46 | 787 | x = width; y = height |
0085ce49 | 788 | def __init__(self, *args, **kwargs): |
0df68c9f | 789 | """ |
a95a7133 | 790 | __init__(self, int w=0, int h=0) -> Size |
e811c8ce | 791 | |
0df68c9f RD |
792 | Creates a size object. |
793 | """ | |
0085ce49 RD |
794 | _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs)) |
795 | __swig_destroy__ = _core_.delete_Size | |
796 | __del__ = lambda self : None; | |
e811c8ce | 797 | def __eq__(*args, **kwargs): |
0df68c9f | 798 | """ |
e9d6f3a4 | 799 | __eq__(self, PyObject other) -> bool |
e811c8ce | 800 | |
0df68c9f RD |
801 | Test for equality of wx.Size objects. |
802 | """ | |
54f9ee45 | 803 | return _core_.Size___eq__(*args, **kwargs) |
e811c8ce RD |
804 | |
805 | def __ne__(*args, **kwargs): | |
0df68c9f | 806 | """ |
e9d6f3a4 | 807 | __ne__(self, PyObject other) -> bool |
e811c8ce | 808 | |
e9d6f3a4 | 809 | Test for inequality of wx.Size objects. |
0df68c9f | 810 | """ |
54f9ee45 | 811 | return _core_.Size___ne__(*args, **kwargs) |
e811c8ce RD |
812 | |
813 | def __add__(*args, **kwargs): | |
0df68c9f | 814 | """ |
a95a7133 | 815 | __add__(self, Size sz) -> Size |
e811c8ce | 816 | |
0df68c9f RD |
817 | Add sz's proprties to this and return the result. |
818 | """ | |
54f9ee45 | 819 | return _core_.Size___add__(*args, **kwargs) |
e811c8ce RD |
820 | |
821 | def __sub__(*args, **kwargs): | |
0df68c9f | 822 | """ |
a95a7133 | 823 | __sub__(self, Size sz) -> Size |
e811c8ce | 824 | |
0df68c9f RD |
825 | Subtract sz's properties from this and return the result. |
826 | """ | |
54f9ee45 | 827 | return _core_.Size___sub__(*args, **kwargs) |
e811c8ce RD |
828 | |
829 | def IncTo(*args, **kwargs): | |
0df68c9f | 830 | """ |
a95a7133 | 831 | IncTo(self, Size sz) |
e811c8ce | 832 | |
0df68c9f RD |
833 | Increments this object so that both of its dimensions are not less |
834 | than the corresponding dimensions of the size. | |
835 | """ | |
54f9ee45 | 836 | return _core_.Size_IncTo(*args, **kwargs) |
e811c8ce RD |
837 | |
838 | def DecTo(*args, **kwargs): | |
0df68c9f | 839 | """ |
a95a7133 | 840 | DecTo(self, Size sz) |
e811c8ce | 841 | |
0df68c9f RD |
842 | Decrements this object so that both of its dimensions are not greater |
843 | than the corresponding dimensions of the size. | |
844 | """ | |
54f9ee45 | 845 | return _core_.Size_DecTo(*args, **kwargs) |
e811c8ce RD |
846 | |
847 | def Set(*args, **kwargs): | |
0df68c9f | 848 | """ |
a95a7133 | 849 | Set(self, int w, int h) |
e811c8ce | 850 | |
0df68c9f RD |
851 | Set both width and height. |
852 | """ | |
54f9ee45 | 853 | return _core_.Size_Set(*args, **kwargs) |
e811c8ce RD |
854 | |
855 | def SetWidth(*args, **kwargs): | |
a95a7133 | 856 | """SetWidth(self, int w)""" |
54f9ee45 | 857 | return _core_.Size_SetWidth(*args, **kwargs) |
e811c8ce RD |
858 | |
859 | def SetHeight(*args, **kwargs): | |
a95a7133 | 860 | """SetHeight(self, int h)""" |
54f9ee45 | 861 | return _core_.Size_SetHeight(*args, **kwargs) |
e811c8ce RD |
862 | |
863 | def GetWidth(*args, **kwargs): | |
a95a7133 | 864 | """GetWidth(self) -> int""" |
54f9ee45 | 865 | return _core_.Size_GetWidth(*args, **kwargs) |
e811c8ce RD |
866 | |
867 | def GetHeight(*args, **kwargs): | |
a95a7133 | 868 | """GetHeight(self) -> int""" |
54f9ee45 | 869 | return _core_.Size_GetHeight(*args, **kwargs) |
e811c8ce | 870 | |
74a57fcd RD |
871 | def IsFullySpecified(*args, **kwargs): |
872 | """ | |
a95a7133 | 873 | IsFullySpecified(self) -> bool |
74a57fcd RD |
874 | |
875 | Returns True if both components of the size are non-default values. | |
876 | """ | |
54f9ee45 | 877 | return _core_.Size_IsFullySpecified(*args, **kwargs) |
74a57fcd RD |
878 | |
879 | def SetDefaults(*args, **kwargs): | |
880 | """ | |
a95a7133 | 881 | SetDefaults(self, Size size) |
74a57fcd | 882 | |
41e2b43e RD |
883 | Combine this size with the other one replacing the default components |
884 | of this object (i.e. equal to -1) with those of the other. | |
74a57fcd | 885 | """ |
54f9ee45 | 886 | return _core_.Size_SetDefaults(*args, **kwargs) |
74a57fcd | 887 | |
e811c8ce | 888 | def Get(*args, **kwargs): |
0df68c9f RD |
889 | """ |
890 | Get() -> (width,height) | |
e811c8ce | 891 | |
0df68c9f RD |
892 | Returns the width and height properties as a tuple. |
893 | """ | |
54f9ee45 | 894 | return _core_.Size_Get(*args, **kwargs) |
e811c8ce | 895 | |
41e2b43e | 896 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
897 | def __str__(self): return str(self.Get()) |
898 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
899 | def __len__(self): return len(self.Get()) | |
900 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
901 | def __setitem__(self, index, val): |
902 | if index == 0: self.width = val | |
903 | elif index == 1: self.height = val | |
904 | else: raise IndexError | |
e811c8ce | 905 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
906 | __safe_for_unpickling__ = True |
907 | def __reduce__(self): return (wx.Size, self.Get()) | |
d14a1e28 | 908 | |
2131d850 | 909 | _core_.Size_swigregister(Size) |
d14a1e28 RD |
910 | |
911 | #--------------------------------------------------------------------------- | |
912 | ||
913 | class RealPoint(object): | |
0df68c9f | 914 | """ |
41e2b43e RD |
915 | A data structure for representing a point or position with floating |
916 | point x and y properties. In wxPython most places that expect a | |
917 | wx.RealPoint can also accept a (x,y) tuple. | |
0df68c9f | 918 | """ |
0085ce49 RD |
919 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
920 | __repr__ = _swig_repr | |
54f9ee45 RD |
921 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
922 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
0085ce49 | 923 | def __init__(self, *args, **kwargs): |
0df68c9f | 924 | """ |
a95a7133 | 925 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
e811c8ce | 926 | |
0df68c9f RD |
927 | Create a wx.RealPoint object |
928 | """ | |
0085ce49 RD |
929 | _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs)) |
930 | __swig_destroy__ = _core_.delete_RealPoint | |
931 | __del__ = lambda self : None; | |
e811c8ce | 932 | def __eq__(*args, **kwargs): |
0df68c9f | 933 | """ |
e9d6f3a4 | 934 | __eq__(self, PyObject other) -> bool |
e811c8ce | 935 | |
0df68c9f RD |
936 | Test for equality of wx.RealPoint objects. |
937 | """ | |
54f9ee45 | 938 | return _core_.RealPoint___eq__(*args, **kwargs) |
e811c8ce RD |
939 | |
940 | def __ne__(*args, **kwargs): | |
0df68c9f | 941 | """ |
e9d6f3a4 | 942 | __ne__(self, PyObject other) -> bool |
e811c8ce | 943 | |
0df68c9f RD |
944 | Test for inequality of wx.RealPoint objects. |
945 | """ | |
54f9ee45 | 946 | return _core_.RealPoint___ne__(*args, **kwargs) |
e811c8ce RD |
947 | |
948 | def __add__(*args, **kwargs): | |
0df68c9f | 949 | """ |
a95a7133 | 950 | __add__(self, RealPoint pt) -> RealPoint |
e811c8ce | 951 | |
0df68c9f RD |
952 | Add pt's proprties to this and return the result. |
953 | """ | |
54f9ee45 | 954 | return _core_.RealPoint___add__(*args, **kwargs) |
e811c8ce RD |
955 | |
956 | def __sub__(*args, **kwargs): | |
0df68c9f | 957 | """ |
a95a7133 | 958 | __sub__(self, RealPoint pt) -> RealPoint |
e811c8ce | 959 | |
0df68c9f RD |
960 | Subtract pt's proprties from this and return the result |
961 | """ | |
54f9ee45 | 962 | return _core_.RealPoint___sub__(*args, **kwargs) |
e811c8ce RD |
963 | |
964 | def Set(*args, **kwargs): | |
0df68c9f | 965 | """ |
a95a7133 | 966 | Set(self, double x, double y) |
e811c8ce | 967 | |
0df68c9f RD |
968 | Set both the x and y properties |
969 | """ | |
54f9ee45 | 970 | return _core_.RealPoint_Set(*args, **kwargs) |
e811c8ce RD |
971 | |
972 | def Get(*args, **kwargs): | |
0df68c9f RD |
973 | """ |
974 | Get() -> (x,y) | |
e811c8ce | 975 | |
0df68c9f RD |
976 | Return the x and y properties as a tuple. |
977 | """ | |
54f9ee45 | 978 | return _core_.RealPoint_Get(*args, **kwargs) |
e811c8ce | 979 | |
41e2b43e | 980 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
981 | def __str__(self): return str(self.Get()) |
982 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
983 | def __len__(self): return len(self.Get()) | |
984 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 985 | def __setitem__(self, index, val): |
e811c8ce RD |
986 | if index == 0: self.x = val |
987 | elif index == 1: self.y = val | |
d14a1e28 | 988 | else: raise IndexError |
e811c8ce | 989 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
990 | __safe_for_unpickling__ = True |
991 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
d14a1e28 | 992 | |
2131d850 | 993 | _core_.RealPoint_swigregister(RealPoint) |
d14a1e28 RD |
994 | |
995 | #--------------------------------------------------------------------------- | |
996 | ||
997 | class Point(object): | |
0df68c9f | 998 | """ |
41e2b43e RD |
999 | A data structure for representing a point or position with integer x |
1000 | and y properties. Most places in wxPython that expect a wx.Point can | |
1001 | also accept a (x,y) tuple. | |
0df68c9f | 1002 | """ |
0085ce49 RD |
1003 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1004 | __repr__ = _swig_repr | |
54f9ee45 RD |
1005 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1006 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
0085ce49 | 1007 | def __init__(self, *args, **kwargs): |
0df68c9f | 1008 | """ |
a95a7133 | 1009 | __init__(self, int x=0, int y=0) -> Point |
e811c8ce | 1010 | |
0df68c9f RD |
1011 | Create a wx.Point object |
1012 | """ | |
0085ce49 RD |
1013 | _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs)) |
1014 | __swig_destroy__ = _core_.delete_Point | |
1015 | __del__ = lambda self : None; | |
e811c8ce | 1016 | def __eq__(*args, **kwargs): |
0df68c9f | 1017 | """ |
e9d6f3a4 | 1018 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1019 | |
0df68c9f RD |
1020 | Test for equality of wx.Point objects. |
1021 | """ | |
54f9ee45 | 1022 | return _core_.Point___eq__(*args, **kwargs) |
e811c8ce RD |
1023 | |
1024 | def __ne__(*args, **kwargs): | |
0df68c9f | 1025 | """ |
e9d6f3a4 | 1026 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1027 | |
0df68c9f RD |
1028 | Test for inequality of wx.Point objects. |
1029 | """ | |
54f9ee45 | 1030 | return _core_.Point___ne__(*args, **kwargs) |
e811c8ce RD |
1031 | |
1032 | def __add__(*args, **kwargs): | |
0df68c9f | 1033 | """ |
a95a7133 | 1034 | __add__(self, Point pt) -> Point |
e811c8ce | 1035 | |
0df68c9f RD |
1036 | Add pt's proprties to this and return the result. |
1037 | """ | |
54f9ee45 | 1038 | return _core_.Point___add__(*args, **kwargs) |
e811c8ce RD |
1039 | |
1040 | def __sub__(*args, **kwargs): | |
0df68c9f | 1041 | """ |
a95a7133 | 1042 | __sub__(self, Point pt) -> Point |
e811c8ce | 1043 | |
0df68c9f RD |
1044 | Subtract pt's proprties from this and return the result |
1045 | """ | |
54f9ee45 | 1046 | return _core_.Point___sub__(*args, **kwargs) |
e811c8ce RD |
1047 | |
1048 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1049 | """ |
a95a7133 | 1050 | __iadd__(self, Point pt) -> Point |
e811c8ce | 1051 | |
0df68c9f RD |
1052 | Add pt to this object. |
1053 | """ | |
54f9ee45 | 1054 | return _core_.Point___iadd__(*args, **kwargs) |
e811c8ce RD |
1055 | |
1056 | def __isub__(*args, **kwargs): | |
0df68c9f | 1057 | """ |
a95a7133 | 1058 | __isub__(self, Point pt) -> Point |
e811c8ce | 1059 | |
0df68c9f RD |
1060 | Subtract pt from this object. |
1061 | """ | |
54f9ee45 | 1062 | return _core_.Point___isub__(*args, **kwargs) |
e811c8ce RD |
1063 | |
1064 | def Set(*args, **kwargs): | |
0df68c9f | 1065 | """ |
a95a7133 | 1066 | Set(self, long x, long y) |
e811c8ce | 1067 | |
0df68c9f RD |
1068 | Set both the x and y properties |
1069 | """ | |
54f9ee45 | 1070 | return _core_.Point_Set(*args, **kwargs) |
e811c8ce RD |
1071 | |
1072 | def Get(*args, **kwargs): | |
0df68c9f RD |
1073 | """ |
1074 | Get() -> (x,y) | |
e811c8ce | 1075 | |
0df68c9f RD |
1076 | Return the x and y properties as a tuple. |
1077 | """ | |
54f9ee45 | 1078 | return _core_.Point_Get(*args, **kwargs) |
e811c8ce | 1079 | |
41e2b43e | 1080 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1081 | def __str__(self): return str(self.Get()) |
1082 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1083 | def __len__(self): return len(self.Get()) | |
1084 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1085 | def __setitem__(self, index, val): |
1086 | if index == 0: self.x = val | |
1087 | elif index == 1: self.y = val | |
1088 | else: raise IndexError | |
e811c8ce | 1089 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
1090 | __safe_for_unpickling__ = True |
1091 | def __reduce__(self): return (wx.Point, self.Get()) | |
d14a1e28 | 1092 | |
2131d850 | 1093 | _core_.Point_swigregister(Point) |
d14a1e28 RD |
1094 | |
1095 | #--------------------------------------------------------------------------- | |
1096 | ||
1097 | class Rect(object): | |
0df68c9f | 1098 | """ |
41e2b43e RD |
1099 | A class for representing and manipulating rectangles. It has x, y, |
1100 | width and height properties. In wxPython most palces that expect a | |
1101 | wx.Rect can also accept a (x,y,width,height) tuple. | |
0df68c9f | 1102 | """ |
0085ce49 RD |
1103 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1104 | __repr__ = _swig_repr | |
1105 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1106 | """ |
a95a7133 | 1107 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
e811c8ce | 1108 | |
0df68c9f RD |
1109 | Create a new Rect object. |
1110 | """ | |
0085ce49 RD |
1111 | _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs)) |
1112 | __swig_destroy__ = _core_.delete_Rect | |
1113 | __del__ = lambda self : None; | |
e811c8ce | 1114 | def GetX(*args, **kwargs): |
a95a7133 | 1115 | """GetX(self) -> int""" |
54f9ee45 | 1116 | return _core_.Rect_GetX(*args, **kwargs) |
e811c8ce RD |
1117 | |
1118 | def SetX(*args, **kwargs): | |
a95a7133 | 1119 | """SetX(self, int x)""" |
54f9ee45 | 1120 | return _core_.Rect_SetX(*args, **kwargs) |
e811c8ce RD |
1121 | |
1122 | def GetY(*args, **kwargs): | |
a95a7133 | 1123 | """GetY(self) -> int""" |
54f9ee45 | 1124 | return _core_.Rect_GetY(*args, **kwargs) |
e811c8ce RD |
1125 | |
1126 | def SetY(*args, **kwargs): | |
a95a7133 | 1127 | """SetY(self, int y)""" |
54f9ee45 | 1128 | return _core_.Rect_SetY(*args, **kwargs) |
e811c8ce RD |
1129 | |
1130 | def GetWidth(*args, **kwargs): | |
a95a7133 | 1131 | """GetWidth(self) -> int""" |
54f9ee45 | 1132 | return _core_.Rect_GetWidth(*args, **kwargs) |
e811c8ce RD |
1133 | |
1134 | def SetWidth(*args, **kwargs): | |
a95a7133 | 1135 | """SetWidth(self, int w)""" |
54f9ee45 | 1136 | return _core_.Rect_SetWidth(*args, **kwargs) |
e811c8ce RD |
1137 | |
1138 | def GetHeight(*args, **kwargs): | |
a95a7133 | 1139 | """GetHeight(self) -> int""" |
54f9ee45 | 1140 | return _core_.Rect_GetHeight(*args, **kwargs) |
e811c8ce RD |
1141 | |
1142 | def SetHeight(*args, **kwargs): | |
a95a7133 | 1143 | """SetHeight(self, int h)""" |
54f9ee45 | 1144 | return _core_.Rect_SetHeight(*args, **kwargs) |
e811c8ce RD |
1145 | |
1146 | def GetPosition(*args, **kwargs): | |
a95a7133 | 1147 | """GetPosition(self) -> Point""" |
54f9ee45 | 1148 | return _core_.Rect_GetPosition(*args, **kwargs) |
e811c8ce RD |
1149 | |
1150 | def SetPosition(*args, **kwargs): | |
a95a7133 | 1151 | """SetPosition(self, Point p)""" |
54f9ee45 | 1152 | return _core_.Rect_SetPosition(*args, **kwargs) |
e811c8ce RD |
1153 | |
1154 | def GetSize(*args, **kwargs): | |
a95a7133 | 1155 | """GetSize(self) -> Size""" |
54f9ee45 | 1156 | return _core_.Rect_GetSize(*args, **kwargs) |
e811c8ce RD |
1157 | |
1158 | def SetSize(*args, **kwargs): | |
a95a7133 | 1159 | """SetSize(self, Size s)""" |
54f9ee45 | 1160 | return _core_.Rect_SetSize(*args, **kwargs) |
e811c8ce | 1161 | |
aff4cc5c RD |
1162 | def IsEmpty(*args, **kwargs): |
1163 | """IsEmpty(self) -> bool""" | |
1164 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1165 | ||
c9c7117a | 1166 | def GetTopLeft(*args, **kwargs): |
a95a7133 | 1167 | """GetTopLeft(self) -> Point""" |
54f9ee45 | 1168 | return _core_.Rect_GetTopLeft(*args, **kwargs) |
c9c7117a RD |
1169 | |
1170 | def SetTopLeft(*args, **kwargs): | |
a95a7133 | 1171 | """SetTopLeft(self, Point p)""" |
54f9ee45 | 1172 | return _core_.Rect_SetTopLeft(*args, **kwargs) |
c9c7117a RD |
1173 | |
1174 | def GetBottomRight(*args, **kwargs): | |
a95a7133 | 1175 | """GetBottomRight(self) -> Point""" |
54f9ee45 | 1176 | return _core_.Rect_GetBottomRight(*args, **kwargs) |
c9c7117a RD |
1177 | |
1178 | def SetBottomRight(*args, **kwargs): | |
a95a7133 | 1179 | """SetBottomRight(self, Point p)""" |
54f9ee45 | 1180 | return _core_.Rect_SetBottomRight(*args, **kwargs) |
c9c7117a | 1181 | |
e811c8ce | 1182 | def GetLeft(*args, **kwargs): |
a95a7133 | 1183 | """GetLeft(self) -> int""" |
54f9ee45 | 1184 | return _core_.Rect_GetLeft(*args, **kwargs) |
e811c8ce RD |
1185 | |
1186 | def GetTop(*args, **kwargs): | |
a95a7133 | 1187 | """GetTop(self) -> int""" |
54f9ee45 | 1188 | return _core_.Rect_GetTop(*args, **kwargs) |
e811c8ce RD |
1189 | |
1190 | def GetBottom(*args, **kwargs): | |
a95a7133 | 1191 | """GetBottom(self) -> int""" |
54f9ee45 | 1192 | return _core_.Rect_GetBottom(*args, **kwargs) |
e811c8ce RD |
1193 | |
1194 | def GetRight(*args, **kwargs): | |
a95a7133 | 1195 | """GetRight(self) -> int""" |
54f9ee45 | 1196 | return _core_.Rect_GetRight(*args, **kwargs) |
e811c8ce RD |
1197 | |
1198 | def SetLeft(*args, **kwargs): | |
a95a7133 | 1199 | """SetLeft(self, int left)""" |
54f9ee45 | 1200 | return _core_.Rect_SetLeft(*args, **kwargs) |
e811c8ce RD |
1201 | |
1202 | def SetRight(*args, **kwargs): | |
a95a7133 | 1203 | """SetRight(self, int right)""" |
54f9ee45 | 1204 | return _core_.Rect_SetRight(*args, **kwargs) |
e811c8ce RD |
1205 | |
1206 | def SetTop(*args, **kwargs): | |
a95a7133 | 1207 | """SetTop(self, int top)""" |
54f9ee45 | 1208 | return _core_.Rect_SetTop(*args, **kwargs) |
e811c8ce RD |
1209 | |
1210 | def SetBottom(*args, **kwargs): | |
a95a7133 | 1211 | """SetBottom(self, int bottom)""" |
54f9ee45 | 1212 | return _core_.Rect_SetBottom(*args, **kwargs) |
e811c8ce RD |
1213 | |
1214 | position = property(GetPosition, SetPosition) | |
1215 | size = property(GetSize, SetSize) | |
1216 | left = property(GetLeft, SetLeft) | |
1217 | right = property(GetRight, SetRight) | |
1218 | top = property(GetTop, SetTop) | |
1219 | bottom = property(GetBottom, SetBottom) | |
1220 | ||
1221 | def Inflate(*args, **kwargs): | |
0df68c9f | 1222 | """ |
a95a7133 | 1223 | Inflate(self, int dx, int dy) -> Rect |
e811c8ce | 1224 | |
8e738329 RD |
1225 | Increases the size of the rectangle. |
1226 | ||
1227 | The left border is moved farther left and the right border is moved | |
1228 | farther right by ``dx``. The upper border is moved farther up and the | |
1229 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1230 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1231 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1232 | opposite happens: the rectangle size decreases in the respective | |
1233 | direction. | |
1234 | ||
1235 | The change is made to the rectangle inplace, if instead you need a | |
1236 | copy that is inflated, preserving the original then make the copy | |
1237 | first:: | |
1238 | ||
1239 | copy = wx.Rect(*original) | |
1240 | copy.Inflate(10,15) | |
1241 | ||
1242 | ||
0df68c9f | 1243 | """ |
54f9ee45 | 1244 | return _core_.Rect_Inflate(*args, **kwargs) |
e811c8ce RD |
1245 | |
1246 | def Deflate(*args, **kwargs): | |
0df68c9f | 1247 | """ |
a95a7133 | 1248 | Deflate(self, int dx, int dy) -> Rect |
e811c8ce | 1249 | |
8e738329 RD |
1250 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1251 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1252 | `Inflate` for a full description. | |
0df68c9f | 1253 | """ |
54f9ee45 | 1254 | return _core_.Rect_Deflate(*args, **kwargs) |
e811c8ce RD |
1255 | |
1256 | def OffsetXY(*args, **kwargs): | |
0df68c9f | 1257 | """ |
a95a7133 | 1258 | OffsetXY(self, int dx, int dy) |
e811c8ce | 1259 | |
41e2b43e RD |
1260 | Moves the rectangle by the specified offset. If dx is positive, the |
1261 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1262 | bottom, otherwise it is moved to the left or top respectively. | |
0df68c9f | 1263 | """ |
54f9ee45 | 1264 | return _core_.Rect_OffsetXY(*args, **kwargs) |
e811c8ce RD |
1265 | |
1266 | def Offset(*args, **kwargs): | |
0df68c9f | 1267 | """ |
a95a7133 | 1268 | Offset(self, Point pt) |
e811c8ce | 1269 | |
b1fcee84 | 1270 | Same as `OffsetXY` but uses dx,dy from Point |
0df68c9f | 1271 | """ |
54f9ee45 | 1272 | return _core_.Rect_Offset(*args, **kwargs) |
e811c8ce RD |
1273 | |
1274 | def Intersect(*args, **kwargs): | |
0df68c9f | 1275 | """ |
a95a7133 | 1276 | Intersect(self, Rect rect) -> Rect |
e811c8ce | 1277 | |
5cbf236d | 1278 | Returns the intersectsion of this rectangle and rect. |
0df68c9f | 1279 | """ |
54f9ee45 | 1280 | return _core_.Rect_Intersect(*args, **kwargs) |
e811c8ce | 1281 | |
5cbf236d RD |
1282 | def Union(*args, **kwargs): |
1283 | """ | |
1284 | Union(self, Rect rect) -> Rect | |
1285 | ||
1286 | Returns the union of this rectangle and rect. | |
1287 | """ | |
1288 | return _core_.Rect_Union(*args, **kwargs) | |
1289 | ||
e811c8ce | 1290 | def __add__(*args, **kwargs): |
0df68c9f | 1291 | """ |
a95a7133 | 1292 | __add__(self, Rect rect) -> Rect |
e811c8ce | 1293 | |
0df68c9f RD |
1294 | Add the properties of rect to this rectangle and return the result. |
1295 | """ | |
54f9ee45 | 1296 | return _core_.Rect___add__(*args, **kwargs) |
e811c8ce RD |
1297 | |
1298 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1299 | """ |
a95a7133 | 1300 | __iadd__(self, Rect rect) -> Rect |
e811c8ce | 1301 | |
0df68c9f RD |
1302 | Add the properties of rect to this rectangle, updating this rectangle. |
1303 | """ | |
54f9ee45 | 1304 | return _core_.Rect___iadd__(*args, **kwargs) |
e811c8ce RD |
1305 | |
1306 | def __eq__(*args, **kwargs): | |
0df68c9f | 1307 | """ |
e9d6f3a4 | 1308 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1309 | |
e9d6f3a4 | 1310 | Test for equality of wx.Rect objects. |
0df68c9f | 1311 | """ |
54f9ee45 | 1312 | return _core_.Rect___eq__(*args, **kwargs) |
e811c8ce RD |
1313 | |
1314 | def __ne__(*args, **kwargs): | |
0df68c9f | 1315 | """ |
e9d6f3a4 | 1316 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1317 | |
e9d6f3a4 | 1318 | Test for inequality of wx.Rect objects. |
0df68c9f | 1319 | """ |
54f9ee45 | 1320 | return _core_.Rect___ne__(*args, **kwargs) |
e811c8ce RD |
1321 | |
1322 | def InsideXY(*args, **kwargs): | |
0df68c9f | 1323 | """ |
a95a7133 | 1324 | InsideXY(self, int x, int y) -> bool |
e811c8ce | 1325 | |
0df68c9f RD |
1326 | Return True if the point is (not strcitly) inside the rect. |
1327 | """ | |
54f9ee45 | 1328 | return _core_.Rect_InsideXY(*args, **kwargs) |
e811c8ce RD |
1329 | |
1330 | def Inside(*args, **kwargs): | |
0df68c9f | 1331 | """ |
a95a7133 | 1332 | Inside(self, Point pt) -> bool |
e811c8ce | 1333 | |
0df68c9f RD |
1334 | Return True if the point is (not strcitly) inside the rect. |
1335 | """ | |
54f9ee45 | 1336 | return _core_.Rect_Inside(*args, **kwargs) |
e811c8ce RD |
1337 | |
1338 | def Intersects(*args, **kwargs): | |
0df68c9f | 1339 | """ |
a95a7133 | 1340 | Intersects(self, Rect rect) -> bool |
e811c8ce | 1341 | |
0df68c9f RD |
1342 | Returns True if the rectangles have a non empty intersection. |
1343 | """ | |
54f9ee45 | 1344 | return _core_.Rect_Intersects(*args, **kwargs) |
e811c8ce | 1345 | |
b1fcee84 RD |
1346 | def CenterIn(*args, **kwargs): |
1347 | """ | |
1348 | CenterIn(self, Rect r, int dir=BOTH) -> Rect | |
1349 | ||
1350 | Center this rectangle within the one passed to the method, which is | |
1351 | usually, but not necessarily, the larger one. | |
1352 | """ | |
1353 | return _core_.Rect_CenterIn(*args, **kwargs) | |
1354 | ||
1355 | CentreIn = CenterIn | |
54f9ee45 RD |
1356 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) |
1357 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1358 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1359 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
e811c8ce | 1360 | def Set(*args, **kwargs): |
0df68c9f | 1361 | """ |
a95a7133 | 1362 | Set(self, int x=0, int y=0, int width=0, int height=0) |
e811c8ce | 1363 | |
0df68c9f RD |
1364 | Set all rectangle properties. |
1365 | """ | |
54f9ee45 | 1366 | return _core_.Rect_Set(*args, **kwargs) |
e811c8ce RD |
1367 | |
1368 | def Get(*args, **kwargs): | |
0df68c9f RD |
1369 | """ |
1370 | Get() -> (x,y,width,height) | |
e811c8ce | 1371 | |
0df68c9f RD |
1372 | Return the rectangle properties as a tuple. |
1373 | """ | |
54f9ee45 | 1374 | return _core_.Rect_Get(*args, **kwargs) |
e811c8ce | 1375 | |
41e2b43e | 1376 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1377 | def __str__(self): return str(self.Get()) |
1378 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1379 | def __len__(self): return len(self.Get()) | |
1380 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1381 | def __setitem__(self, index, val): |
1382 | if index == 0: self.x = val | |
1383 | elif index == 1: self.y = val | |
1384 | elif index == 2: self.width = val | |
1385 | elif index == 3: self.height = val | |
1386 | else: raise IndexError | |
e811c8ce | 1387 | def __nonzero__(self): return self.Get() != (0,0,0,0) |
74e96f3d RD |
1388 | __safe_for_unpickling__ = True |
1389 | def __reduce__(self): return (wx.Rect, self.Get()) | |
d14a1e28 | 1390 | |
2131d850 | 1391 | _core_.Rect_swigregister(Rect) |
d14a1e28 RD |
1392 | |
1393 | def RectPP(*args, **kwargs): | |
0df68c9f RD |
1394 | """ |
1395 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
e811c8ce | 1396 | |
0df68c9f RD |
1397 | Create a new Rect object from Points representing two corners. |
1398 | """ | |
54f9ee45 | 1399 | val = _core_.new_RectPP(*args, **kwargs) |
d14a1e28 RD |
1400 | return val |
1401 | ||
1402 | def RectPS(*args, **kwargs): | |
0df68c9f RD |
1403 | """ |
1404 | RectPS(Point pos, Size size) -> Rect | |
e811c8ce | 1405 | |
0df68c9f RD |
1406 | Create a new Rect from a position and size. |
1407 | """ | |
54f9ee45 | 1408 | val = _core_.new_RectPS(*args, **kwargs) |
d14a1e28 RD |
1409 | return val |
1410 | ||
d3b6e4ff RD |
1411 | def RectS(*args, **kwargs): |
1412 | """ | |
1413 | RectS(Size size) -> Rect | |
1414 | ||
1415 | Create a new Rect from a size only. | |
1416 | """ | |
1417 | val = _core_.new_RectS(*args, **kwargs) | |
d3b6e4ff RD |
1418 | return val |
1419 | ||
d14a1e28 | 1420 | |
e811c8ce | 1421 | def IntersectRect(*args, **kwargs): |
0085ce49 | 1422 | """ |
0df68c9f | 1423 | IntersectRect(Rect r1, Rect r2) -> Rect |
e811c8ce | 1424 | |
0df68c9f RD |
1425 | Calculate and return the intersection of r1 and r2. |
1426 | """ | |
0085ce49 | 1427 | return _core_.IntersectRect(*args, **kwargs) |
d14a1e28 RD |
1428 | #--------------------------------------------------------------------------- |
1429 | ||
1430 | class Point2D(object): | |
41e2b43e RD |
1431 | """ |
1432 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1433 | with floating point values. | |
1434 | """ | |
0085ce49 RD |
1435 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1436 | __repr__ = _swig_repr | |
1437 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1438 | """ |
a95a7133 | 1439 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
e811c8ce | 1440 | |
0df68c9f RD |
1441 | Create a w.Point2D object. |
1442 | """ | |
0085ce49 | 1443 | _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs)) |
e811c8ce | 1444 | def GetFloor(*args, **kwargs): |
fd2dc343 RD |
1445 | """ |
1446 | GetFloor() -> (x,y) | |
1447 | ||
1448 | Convert to integer | |
1449 | """ | |
54f9ee45 | 1450 | return _core_.Point2D_GetFloor(*args, **kwargs) |
e811c8ce RD |
1451 | |
1452 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1453 | """ |
1454 | GetRounded() -> (x,y) | |
1455 | ||
1456 | Convert to integer | |
1457 | """ | |
54f9ee45 | 1458 | return _core_.Point2D_GetRounded(*args, **kwargs) |
e811c8ce RD |
1459 | |
1460 | def GetVectorLength(*args, **kwargs): | |
a95a7133 | 1461 | """GetVectorLength(self) -> double""" |
54f9ee45 | 1462 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
e811c8ce RD |
1463 | |
1464 | def GetVectorAngle(*args, **kwargs): | |
a95a7133 | 1465 | """GetVectorAngle(self) -> double""" |
54f9ee45 | 1466 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
e811c8ce RD |
1467 | |
1468 | def SetVectorLength(*args, **kwargs): | |
a95a7133 | 1469 | """SetVectorLength(self, double length)""" |
54f9ee45 | 1470 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
e811c8ce RD |
1471 | |
1472 | def SetVectorAngle(*args, **kwargs): | |
a95a7133 | 1473 | """SetVectorAngle(self, double degrees)""" |
54f9ee45 | 1474 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
e811c8ce | 1475 | |
d14a1e28 RD |
1476 | def SetPolarCoordinates(self, angle, length): |
1477 | self.SetVectorLength(length) | |
1478 | self.SetVectorAngle(angle) | |
1479 | def Normalize(self): | |
1480 | self.SetVectorLength(1.0) | |
1481 | ||
e811c8ce | 1482 | def GetDistance(*args, **kwargs): |
a95a7133 | 1483 | """GetDistance(self, Point2D pt) -> double""" |
54f9ee45 | 1484 | return _core_.Point2D_GetDistance(*args, **kwargs) |
e811c8ce RD |
1485 | |
1486 | def GetDistanceSquare(*args, **kwargs): | |
a95a7133 | 1487 | """GetDistanceSquare(self, Point2D pt) -> double""" |
54f9ee45 | 1488 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) |
e811c8ce RD |
1489 | |
1490 | def GetDotProduct(*args, **kwargs): | |
a95a7133 | 1491 | """GetDotProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1492 | return _core_.Point2D_GetDotProduct(*args, **kwargs) |
e811c8ce RD |
1493 | |
1494 | def GetCrossProduct(*args, **kwargs): | |
a95a7133 | 1495 | """GetCrossProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1496 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) |
e811c8ce RD |
1497 | |
1498 | def __neg__(*args, **kwargs): | |
0df68c9f | 1499 | """ |
a95a7133 | 1500 | __neg__(self) -> Point2D |
e811c8ce | 1501 | |
0df68c9f RD |
1502 | the reflection of this point |
1503 | """ | |
54f9ee45 | 1504 | return _core_.Point2D___neg__(*args, **kwargs) |
e811c8ce RD |
1505 | |
1506 | def __iadd__(*args, **kwargs): | |
a95a7133 | 1507 | """__iadd__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1508 | return _core_.Point2D___iadd__(*args, **kwargs) |
e811c8ce RD |
1509 | |
1510 | def __isub__(*args, **kwargs): | |
a95a7133 | 1511 | """__isub__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1512 | return _core_.Point2D___isub__(*args, **kwargs) |
e811c8ce RD |
1513 | |
1514 | def __imul__(*args, **kwargs): | |
a95a7133 | 1515 | """__imul__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1516 | return _core_.Point2D___imul__(*args, **kwargs) |
e811c8ce RD |
1517 | |
1518 | def __idiv__(*args, **kwargs): | |
a95a7133 | 1519 | """__idiv__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1520 | return _core_.Point2D___idiv__(*args, **kwargs) |
e811c8ce RD |
1521 | |
1522 | def __eq__(*args, **kwargs): | |
0df68c9f | 1523 | """ |
e9d6f3a4 | 1524 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1525 | |
e9d6f3a4 | 1526 | Test for equality of wx.Point2D objects. |
0df68c9f | 1527 | """ |
54f9ee45 | 1528 | return _core_.Point2D___eq__(*args, **kwargs) |
e811c8ce RD |
1529 | |
1530 | def __ne__(*args, **kwargs): | |
0df68c9f | 1531 | """ |
e9d6f3a4 | 1532 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1533 | |
e9d6f3a4 | 1534 | Test for inequality of wx.Point2D objects. |
0df68c9f | 1535 | """ |
54f9ee45 | 1536 | return _core_.Point2D___ne__(*args, **kwargs) |
e811c8ce | 1537 | |
54f9ee45 RD |
1538 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1539 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
e811c8ce | 1540 | def Set(*args, **kwargs): |
a95a7133 | 1541 | """Set(self, double x=0, double y=0)""" |
54f9ee45 | 1542 | return _core_.Point2D_Set(*args, **kwargs) |
e811c8ce RD |
1543 | |
1544 | def Get(*args, **kwargs): | |
0df68c9f RD |
1545 | """ |
1546 | Get() -> (x,y) | |
e811c8ce | 1547 | |
0df68c9f RD |
1548 | Return x and y properties as a tuple. |
1549 | """ | |
54f9ee45 | 1550 | return _core_.Point2D_Get(*args, **kwargs) |
e811c8ce | 1551 | |
41e2b43e | 1552 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1553 | def __str__(self): return str(self.Get()) |
1554 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1555 | def __len__(self): return len(self.Get()) | |
1556 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 1557 | def __setitem__(self, index, val): |
e811c8ce RD |
1558 | if index == 0: self.x = val |
1559 | elif index == 1: self.y = val | |
d14a1e28 | 1560 | else: raise IndexError |
e811c8ce | 1561 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1562 | __safe_for_unpickling__ = True |
1563 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
d14a1e28 | 1564 | |
2131d850 | 1565 | _core_.Point2D_swigregister(Point2D) |
d14a1e28 RD |
1566 | |
1567 | def Point2DCopy(*args, **kwargs): | |
0df68c9f RD |
1568 | """ |
1569 | Point2DCopy(Point2D pt) -> Point2D | |
e811c8ce | 1570 | |
0df68c9f RD |
1571 | Create a w.Point2D object. |
1572 | """ | |
54f9ee45 | 1573 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d14a1e28 RD |
1574 | return val |
1575 | ||
1576 | def Point2DFromPoint(*args, **kwargs): | |
0df68c9f RD |
1577 | """ |
1578 | Point2DFromPoint(Point pt) -> Point2D | |
e811c8ce | 1579 | |
0df68c9f RD |
1580 | Create a w.Point2D object. |
1581 | """ | |
54f9ee45 | 1582 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d14a1e28 RD |
1583 | return val |
1584 | ||
1585 | #--------------------------------------------------------------------------- | |
1586 | ||
54f9ee45 RD |
1587 | FromStart = _core_.FromStart |
1588 | FromCurrent = _core_.FromCurrent | |
1589 | FromEnd = _core_.FromEnd | |
d14a1e28 | 1590 | class InputStream(object): |
093d3ff1 | 1591 | """Proxy of C++ InputStream class""" |
0085ce49 RD |
1592 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1593 | __repr__ = _swig_repr | |
1594 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1595 | """__init__(self, PyObject p) -> InputStream""" |
0085ce49 RD |
1596 | _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs)) |
1597 | __swig_destroy__ = _core_.delete_InputStream | |
1598 | __del__ = lambda self : None; | |
e811c8ce | 1599 | def close(*args, **kwargs): |
a95a7133 | 1600 | """close(self)""" |
54f9ee45 | 1601 | return _core_.InputStream_close(*args, **kwargs) |
e811c8ce RD |
1602 | |
1603 | def flush(*args, **kwargs): | |
a95a7133 | 1604 | """flush(self)""" |
54f9ee45 | 1605 | return _core_.InputStream_flush(*args, **kwargs) |
e811c8ce RD |
1606 | |
1607 | def eof(*args, **kwargs): | |
a95a7133 | 1608 | """eof(self) -> bool""" |
54f9ee45 | 1609 | return _core_.InputStream_eof(*args, **kwargs) |
e811c8ce RD |
1610 | |
1611 | def read(*args, **kwargs): | |
a95a7133 | 1612 | """read(self, int size=-1) -> PyObject""" |
54f9ee45 | 1613 | return _core_.InputStream_read(*args, **kwargs) |
e811c8ce RD |
1614 | |
1615 | def readline(*args, **kwargs): | |
a95a7133 | 1616 | """readline(self, int size=-1) -> PyObject""" |
54f9ee45 | 1617 | return _core_.InputStream_readline(*args, **kwargs) |
e811c8ce RD |
1618 | |
1619 | def readlines(*args, **kwargs): | |
a95a7133 | 1620 | """readlines(self, int sizehint=-1) -> PyObject""" |
54f9ee45 | 1621 | return _core_.InputStream_readlines(*args, **kwargs) |
e811c8ce RD |
1622 | |
1623 | def seek(*args, **kwargs): | |
a95a7133 | 1624 | """seek(self, int offset, int whence=0)""" |
54f9ee45 | 1625 | return _core_.InputStream_seek(*args, **kwargs) |
e811c8ce RD |
1626 | |
1627 | def tell(*args, **kwargs): | |
a95a7133 | 1628 | """tell(self) -> int""" |
54f9ee45 | 1629 | return _core_.InputStream_tell(*args, **kwargs) |
e811c8ce RD |
1630 | |
1631 | def Peek(*args, **kwargs): | |
a95a7133 | 1632 | """Peek(self) -> char""" |
54f9ee45 | 1633 | return _core_.InputStream_Peek(*args, **kwargs) |
e811c8ce RD |
1634 | |
1635 | def GetC(*args, **kwargs): | |
a95a7133 | 1636 | """GetC(self) -> char""" |
54f9ee45 | 1637 | return _core_.InputStream_GetC(*args, **kwargs) |
e811c8ce RD |
1638 | |
1639 | def LastRead(*args, **kwargs): | |
a95a7133 | 1640 | """LastRead(self) -> size_t""" |
54f9ee45 | 1641 | return _core_.InputStream_LastRead(*args, **kwargs) |
e811c8ce RD |
1642 | |
1643 | def CanRead(*args, **kwargs): | |
a95a7133 | 1644 | """CanRead(self) -> bool""" |
54f9ee45 | 1645 | return _core_.InputStream_CanRead(*args, **kwargs) |
e811c8ce RD |
1646 | |
1647 | def Eof(*args, **kwargs): | |
a95a7133 | 1648 | """Eof(self) -> bool""" |
54f9ee45 | 1649 | return _core_.InputStream_Eof(*args, **kwargs) |
e811c8ce RD |
1650 | |
1651 | def Ungetch(*args, **kwargs): | |
a95a7133 | 1652 | """Ungetch(self, char c) -> bool""" |
54f9ee45 | 1653 | return _core_.InputStream_Ungetch(*args, **kwargs) |
e811c8ce RD |
1654 | |
1655 | def SeekI(*args, **kwargs): | |
a95a7133 | 1656 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
54f9ee45 | 1657 | return _core_.InputStream_SeekI(*args, **kwargs) |
e811c8ce RD |
1658 | |
1659 | def TellI(*args, **kwargs): | |
a95a7133 | 1660 | """TellI(self) -> long""" |
54f9ee45 | 1661 | return _core_.InputStream_TellI(*args, **kwargs) |
e811c8ce | 1662 | |
2131d850 | 1663 | _core_.InputStream_swigregister(InputStream) |
d14a1e28 RD |
1664 | DefaultPosition = cvar.DefaultPosition |
1665 | DefaultSize = cvar.DefaultSize | |
1666 | ||
1667 | class OutputStream(object): | |
093d3ff1 | 1668 | """Proxy of C++ OutputStream class""" |
0085ce49 RD |
1669 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1670 | def __init__(self): raise AttributeError, "No constructor defined" | |
1671 | __repr__ = _swig_repr | |
e811c8ce | 1672 | def write(*args, **kwargs): |
a95a7133 | 1673 | """write(self, PyObject obj)""" |
54f9ee45 | 1674 | return _core_.OutputStream_write(*args, **kwargs) |
e811c8ce | 1675 | |
0085ce49 RD |
1676 | def LastWrite(*args, **kwargs): |
1677 | """LastWrite(self) -> size_t""" | |
1678 | return _core_.OutputStream_LastWrite(*args, **kwargs) | |
d14a1e28 | 1679 | |
2131d850 | 1680 | _core_.OutputStream_swigregister(OutputStream) |
d14a1e28 RD |
1681 | |
1682 | #--------------------------------------------------------------------------- | |
1683 | ||
1684 | class FSFile(Object): | |
093d3ff1 | 1685 | """Proxy of C++ FSFile class""" |
0085ce49 RD |
1686 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1687 | __repr__ = _swig_repr | |
1688 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1689 | """ |
a95a7133 | 1690 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
196addbf | 1691 | DateTime modif) -> FSFile |
0df68c9f | 1692 | """ |
0085ce49 | 1693 | _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs)) |
e2950dbb | 1694 | self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem |
4cf4100f | 1695 | |
0085ce49 RD |
1696 | __swig_destroy__ = _core_.delete_FSFile |
1697 | __del__ = lambda self : None; | |
e811c8ce | 1698 | def GetStream(*args, **kwargs): |
a95a7133 | 1699 | """GetStream(self) -> InputStream""" |
54f9ee45 | 1700 | return _core_.FSFile_GetStream(*args, **kwargs) |
e811c8ce RD |
1701 | |
1702 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 1703 | """GetMimeType(self) -> String""" |
54f9ee45 | 1704 | return _core_.FSFile_GetMimeType(*args, **kwargs) |
e811c8ce RD |
1705 | |
1706 | def GetLocation(*args, **kwargs): | |
a95a7133 | 1707 | """GetLocation(self) -> String""" |
54f9ee45 | 1708 | return _core_.FSFile_GetLocation(*args, **kwargs) |
e811c8ce RD |
1709 | |
1710 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1711 | """GetAnchor(self) -> String""" |
54f9ee45 | 1712 | return _core_.FSFile_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1713 | |
1714 | def GetModificationTime(*args, **kwargs): | |
a95a7133 | 1715 | """GetModificationTime(self) -> DateTime""" |
54f9ee45 | 1716 | return _core_.FSFile_GetModificationTime(*args, **kwargs) |
e811c8ce | 1717 | |
2131d850 | 1718 | _core_.FSFile_swigregister(FSFile) |
d14a1e28 RD |
1719 | |
1720 | class CPPFileSystemHandler(object): | |
093d3ff1 | 1721 | """Proxy of C++ CPPFileSystemHandler class""" |
0085ce49 RD |
1722 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1723 | def __init__(self): raise AttributeError, "No constructor defined" | |
1724 | __repr__ = _swig_repr | |
50f151d7 RD |
1725 | __swig_destroy__ = _core_.delete_CPPFileSystemHandler |
1726 | __del__ = lambda self : None; | |
2131d850 | 1727 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler) |
d14a1e28 RD |
1728 | |
1729 | class FileSystemHandler(CPPFileSystemHandler): | |
093d3ff1 | 1730 | """Proxy of C++ FileSystemHandler class""" |
0085ce49 RD |
1731 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1732 | __repr__ = _swig_repr | |
1733 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1734 | """__init__(self) -> FileSystemHandler""" |
0085ce49 | 1735 | _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs)) |
d14a1e28 | 1736 | self._setCallbackInfo(self, FileSystemHandler) |
e811c8ce RD |
1737 | |
1738 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 1739 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 1740 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
1741 | |
1742 | def CanOpen(*args, **kwargs): | |
a95a7133 | 1743 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1744 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1745 | |
1746 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1747 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1748 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1749 | |
1750 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1751 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1752 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1753 | |
1754 | def FindNext(*args, **kwargs): | |
a95a7133 | 1755 | """FindNext(self) -> String""" |
54f9ee45 | 1756 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) |
e811c8ce RD |
1757 | |
1758 | def GetProtocol(*args, **kwargs): | |
a95a7133 | 1759 | """GetProtocol(self, String location) -> String""" |
54f9ee45 | 1760 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) |
e811c8ce RD |
1761 | |
1762 | def GetLeftLocation(*args, **kwargs): | |
a95a7133 | 1763 | """GetLeftLocation(self, String location) -> String""" |
54f9ee45 | 1764 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) |
e811c8ce RD |
1765 | |
1766 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 1767 | """GetAnchor(self, String location) -> String""" |
54f9ee45 | 1768 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) |
e811c8ce RD |
1769 | |
1770 | def GetRightLocation(*args, **kwargs): | |
a95a7133 | 1771 | """GetRightLocation(self, String location) -> String""" |
54f9ee45 | 1772 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) |
e811c8ce RD |
1773 | |
1774 | def GetMimeTypeFromExt(*args, **kwargs): | |
a95a7133 | 1775 | """GetMimeTypeFromExt(self, String location) -> String""" |
54f9ee45 | 1776 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) |
e811c8ce | 1777 | |
2131d850 | 1778 | _core_.FileSystemHandler_swigregister(FileSystemHandler) |
d14a1e28 RD |
1779 | |
1780 | class FileSystem(Object): | |
093d3ff1 | 1781 | """Proxy of C++ FileSystem class""" |
0085ce49 RD |
1782 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1783 | __repr__ = _swig_repr | |
1784 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1785 | """__init__(self) -> FileSystem""" |
0085ce49 RD |
1786 | _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs)) |
1787 | __swig_destroy__ = _core_.delete_FileSystem | |
1788 | __del__ = lambda self : None; | |
e811c8ce | 1789 | def ChangePathTo(*args, **kwargs): |
a95a7133 | 1790 | """ChangePathTo(self, String location, bool is_dir=False)""" |
54f9ee45 | 1791 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) |
e811c8ce RD |
1792 | |
1793 | def GetPath(*args, **kwargs): | |
a95a7133 | 1794 | """GetPath(self) -> String""" |
54f9ee45 | 1795 | return _core_.FileSystem_GetPath(*args, **kwargs) |
e811c8ce RD |
1796 | |
1797 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1798 | """OpenFile(self, String location) -> FSFile""" |
54f9ee45 | 1799 | return _core_.FileSystem_OpenFile(*args, **kwargs) |
e811c8ce RD |
1800 | |
1801 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1802 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1803 | return _core_.FileSystem_FindFirst(*args, **kwargs) |
e811c8ce RD |
1804 | |
1805 | def FindNext(*args, **kwargs): | |
a95a7133 | 1806 | """FindNext(self) -> String""" |
54f9ee45 | 1807 | return _core_.FileSystem_FindNext(*args, **kwargs) |
e811c8ce RD |
1808 | |
1809 | def AddHandler(*args, **kwargs): | |
66c033b4 | 1810 | """AddHandler(CPPFileSystemHandler handler)""" |
54f9ee45 | 1811 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
e811c8ce RD |
1812 | |
1813 | AddHandler = staticmethod(AddHandler) | |
1814 | def CleanUpHandlers(*args, **kwargs): | |
66c033b4 | 1815 | """CleanUpHandlers()""" |
54f9ee45 | 1816 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
e811c8ce RD |
1817 | |
1818 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
1819 | def FileNameToURL(*args, **kwargs): | |
66c033b4 | 1820 | """FileNameToURL(String filename) -> String""" |
54f9ee45 | 1821 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
e811c8ce RD |
1822 | |
1823 | FileNameToURL = staticmethod(FileNameToURL) | |
2ef75293 RD |
1824 | def URLToFileName(*args, **kwargs): |
1825 | """URLToFileName(String url) -> String""" | |
1826 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
1827 | ||
1828 | URLToFileName = staticmethod(URLToFileName) | |
2131d850 | 1829 | _core_.FileSystem_swigregister(FileSystem) |
d14a1e28 | 1830 | |
e811c8ce | 1831 | def FileSystem_AddHandler(*args, **kwargs): |
0085ce49 RD |
1832 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" |
1833 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
d14a1e28 | 1834 | |
0085ce49 RD |
1835 | def FileSystem_CleanUpHandlers(*args): |
1836 | """FileSystem_CleanUpHandlers()""" | |
1837 | return _core_.FileSystem_CleanUpHandlers(*args) | |
d14a1e28 | 1838 | |
e811c8ce | 1839 | def FileSystem_FileNameToURL(*args, **kwargs): |
0085ce49 RD |
1840 | """FileSystem_FileNameToURL(String filename) -> String""" |
1841 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d14a1e28 | 1842 | |
e811c8ce | 1843 | def FileSystem_URLToFileName(*args, **kwargs): |
0085ce49 RD |
1844 | """FileSystem_URLToFileName(String url) -> String""" |
1845 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
2ef75293 | 1846 | |
d14a1e28 | 1847 | class InternetFSHandler(CPPFileSystemHandler): |
093d3ff1 | 1848 | """Proxy of C++ InternetFSHandler class""" |
0085ce49 RD |
1849 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1850 | __repr__ = _swig_repr | |
1851 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1852 | """__init__(self) -> InternetFSHandler""" |
0085ce49 | 1853 | _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs)) |
e811c8ce | 1854 | def CanOpen(*args, **kwargs): |
a95a7133 | 1855 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1856 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1857 | |
1858 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1859 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1860 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) |
e811c8ce | 1861 | |
2131d850 | 1862 | _core_.InternetFSHandler_swigregister(InternetFSHandler) |
d14a1e28 RD |
1863 | |
1864 | class ZipFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1865 | """Proxy of C++ ZipFSHandler class""" |
0085ce49 RD |
1866 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1867 | __repr__ = _swig_repr | |
1868 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1869 | """__init__(self) -> ZipFSHandler""" |
0085ce49 | 1870 | _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs)) |
e811c8ce | 1871 | def CanOpen(*args, **kwargs): |
a95a7133 | 1872 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1873 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1874 | |
1875 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1876 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1877 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1878 | |
1879 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1880 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1881 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1882 | |
1883 | def FindNext(*args, **kwargs): | |
a95a7133 | 1884 | """FindNext(self) -> String""" |
54f9ee45 | 1885 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 1886 | |
2131d850 | 1887 | _core_.ZipFSHandler_swigregister(ZipFSHandler) |
d14a1e28 RD |
1888 | |
1889 | ||
e811c8ce | 1890 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): |
0085ce49 RD |
1891 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
1892 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
d14a1e28 | 1893 | |
e811c8ce | 1894 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): |
0085ce49 RD |
1895 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
1896 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
d14a1e28 | 1897 | |
e811c8ce | 1898 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): |
0085ce49 RD |
1899 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
1900 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
2ef75293 RD |
1901 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
1902 | """ | |
1903 | Add 'file' to the memory filesystem. The dataItem parameter can | |
1904 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
1905 | arbitrary data. If a bitmap or image is used then the imgType | |
1906 | parameter should specify what kind of image file it should be | |
1907 | written as, wx.BITMAP_TYPE_PNG, etc. | |
1908 | """ | |
1909 | if isinstance(dataItem, wx.Image): | |
1910 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
1911 | elif isinstance(dataItem, wx.Bitmap): | |
1912 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
1913 | elif type(dataItem) == str: | |
1914 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
1915 | else: | |
1916 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d14a1e28 RD |
1917 | |
1918 | class MemoryFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 1919 | """Proxy of C++ MemoryFSHandler class""" |
0085ce49 RD |
1920 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1921 | __repr__ = _swig_repr | |
1922 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1923 | """__init__(self) -> MemoryFSHandler""" |
0085ce49 | 1924 | _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs)) |
e811c8ce | 1925 | def RemoveFile(*args, **kwargs): |
66c033b4 | 1926 | """RemoveFile(String filename)""" |
54f9ee45 | 1927 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
e811c8ce RD |
1928 | |
1929 | RemoveFile = staticmethod(RemoveFile) | |
d14a1e28 | 1930 | AddFile = staticmethod(MemoryFSHandler_AddFile) |
e811c8ce | 1931 | def CanOpen(*args, **kwargs): |
a95a7133 | 1932 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 1933 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
1934 | |
1935 | def OpenFile(*args, **kwargs): | |
a95a7133 | 1936 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 1937 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
1938 | |
1939 | def FindFirst(*args, **kwargs): | |
a95a7133 | 1940 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 1941 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
1942 | |
1943 | def FindNext(*args, **kwargs): | |
a95a7133 | 1944 | """FindNext(self) -> String""" |
54f9ee45 | 1945 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 1946 | |
2131d850 | 1947 | _core_.MemoryFSHandler_swigregister(MemoryFSHandler) |
d14a1e28 | 1948 | |
e811c8ce | 1949 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
0085ce49 RD |
1950 | """MemoryFSHandler_RemoveFile(String filename)""" |
1951 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d14a1e28 | 1952 | |
bcd0d7b6 RD |
1953 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
1954 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
1955 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
d14a1e28 RD |
1956 | #--------------------------------------------------------------------------- |
1957 | ||
1958 | class ImageHandler(Object): | |
27fb7603 RD |
1959 | """ |
1960 | This is the base class for implementing image file loading/saving, and | |
1961 | image creation from data. It is used within `wx.Image` and is not | |
1962 | normally seen by the application. | |
1963 | """ | |
0085ce49 RD |
1964 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1965 | def __init__(self): raise AttributeError, "No constructor defined" | |
1966 | __repr__ = _swig_repr | |
e811c8ce | 1967 | def GetName(*args, **kwargs): |
a95a7133 | 1968 | """GetName(self) -> String""" |
54f9ee45 | 1969 | return _core_.ImageHandler_GetName(*args, **kwargs) |
e811c8ce RD |
1970 | |
1971 | def GetExtension(*args, **kwargs): | |
a95a7133 | 1972 | """GetExtension(self) -> String""" |
54f9ee45 | 1973 | return _core_.ImageHandler_GetExtension(*args, **kwargs) |
e811c8ce RD |
1974 | |
1975 | def GetType(*args, **kwargs): | |
a95a7133 | 1976 | """GetType(self) -> long""" |
54f9ee45 | 1977 | return _core_.ImageHandler_GetType(*args, **kwargs) |
e811c8ce RD |
1978 | |
1979 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 1980 | """GetMimeType(self) -> String""" |
54f9ee45 | 1981 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) |
e811c8ce RD |
1982 | |
1983 | def CanRead(*args, **kwargs): | |
a95a7133 | 1984 | """CanRead(self, String name) -> bool""" |
54f9ee45 | 1985 | return _core_.ImageHandler_CanRead(*args, **kwargs) |
e811c8ce RD |
1986 | |
1987 | def SetName(*args, **kwargs): | |
a95a7133 | 1988 | """SetName(self, String name)""" |
54f9ee45 | 1989 | return _core_.ImageHandler_SetName(*args, **kwargs) |
e811c8ce RD |
1990 | |
1991 | def SetExtension(*args, **kwargs): | |
a95a7133 | 1992 | """SetExtension(self, String extension)""" |
54f9ee45 | 1993 | return _core_.ImageHandler_SetExtension(*args, **kwargs) |
e811c8ce RD |
1994 | |
1995 | def SetType(*args, **kwargs): | |
a95a7133 | 1996 | """SetType(self, long type)""" |
54f9ee45 | 1997 | return _core_.ImageHandler_SetType(*args, **kwargs) |
e811c8ce RD |
1998 | |
1999 | def SetMimeType(*args, **kwargs): | |
a95a7133 | 2000 | """SetMimeType(self, String mimetype)""" |
54f9ee45 | 2001 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) |
e811c8ce | 2002 | |
2131d850 | 2003 | _core_.ImageHandler_swigregister(ImageHandler) |
d14a1e28 | 2004 | |
943e8dfd RD |
2005 | class PyImageHandler(ImageHandler): |
2006 | """ | |
2007 | This is the base class for implementing image file loading/saving, and | |
2008 | image creation from data, all written in Python. To create a custom | |
2009 | image handler derive a new class from wx.PyImageHandler and provide | |
2010 | the following methods:: | |
2011 | ||
2012 | def DoCanRead(self, stream) --> bool | |
2013 | '''Check if this handler can read the image on the stream''' | |
2014 | ||
2015 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2016 | '''Load image data from the stream and load it into image.''' | |
2017 | ||
2018 | def SaveFile(self, image, stream, verbose) --> bool | |
2019 | '''Save the iamge data in image to the stream using | |
2020 | this handler's image file format.''' | |
2021 | ||
2022 | def GetImageCount(self, stream) --> int | |
2023 | '''If this image format can hold more than one image, | |
2024 | how many does the image on the stream have?''' | |
2025 | ||
2026 | To activate your handler create an instance of it and pass it to | |
2027 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2028 | `SetExtension` from your constructor. | |
2029 | ||
2030 | """ | |
0085ce49 RD |
2031 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2032 | __repr__ = _swig_repr | |
2033 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2034 | """ |
2035 | __init__(self) -> PyImageHandler | |
2036 | ||
2037 | This is the base class for implementing image file loading/saving, and | |
2038 | image creation from data, all written in Python. To create a custom | |
2039 | image handler derive a new class from wx.PyImageHandler and provide | |
2040 | the following methods:: | |
2041 | ||
2042 | def DoCanRead(self, stream) --> bool | |
2043 | '''Check if this handler can read the image on the stream''' | |
2044 | ||
2045 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2046 | '''Load image data from the stream and load it into image.''' | |
2047 | ||
2048 | def SaveFile(self, image, stream, verbose) --> bool | |
2049 | '''Save the iamge data in image to the stream using | |
2050 | this handler's image file format.''' | |
2051 | ||
2052 | def GetImageCount(self, stream) --> int | |
2053 | '''If this image format can hold more than one image, | |
2054 | how many does the image on the stream have?''' | |
2055 | ||
2056 | To activate your handler create an instance of it and pass it to | |
2057 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2058 | `SetExtension` from your constructor. | |
2059 | ||
2060 | """ | |
0085ce49 | 2061 | _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs)) |
943e8dfd RD |
2062 | self._SetSelf(self) |
2063 | ||
2064 | def _SetSelf(*args, **kwargs): | |
2065 | """_SetSelf(self, PyObject self)""" | |
2066 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2067 | ||
2131d850 | 2068 | _core_.PyImageHandler_swigregister(PyImageHandler) |
943e8dfd | 2069 | |
d14a1e28 | 2070 | class ImageHistogram(object): |
093d3ff1 | 2071 | """Proxy of C++ ImageHistogram class""" |
0085ce49 RD |
2072 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2073 | __repr__ = _swig_repr | |
2074 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2075 | """__init__(self) -> ImageHistogram""" |
0085ce49 | 2076 | _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs)) |
e811c8ce | 2077 | def MakeKey(*args, **kwargs): |
0df68c9f | 2078 | """ |
7a27cf7c | 2079 | MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2080 | |
0df68c9f RD |
2081 | Get the key in the histogram for the given RGB values |
2082 | """ | |
54f9ee45 | 2083 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
e811c8ce RD |
2084 | |
2085 | MakeKey = staticmethod(MakeKey) | |
2086 | def FindFirstUnusedColour(*args, **kwargs): | |
fd2dc343 RD |
2087 | """ |
2088 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2089 | ||
2090 | Find first colour that is not used in the image and has higher RGB | |
2091 | values than startR, startG, startB. Returns a tuple consisting of a | |
2092 | success flag and rgb values. | |
2093 | """ | |
54f9ee45 | 2094 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2095 | |
f1cbd8fa RD |
2096 | def GetCount(*args, **kwargs): |
2097 | """ | |
2098 | GetCount(self, unsigned long key) -> unsigned long | |
2099 | ||
2100 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2101 | key value from a RGB tripple. | |
2102 | """ | |
2103 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
2104 | ||
2105 | def GetCountRGB(*args, **kwargs): | |
2106 | """ | |
7a27cf7c | 2107 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2108 | |
2109 | Returns the pixel count for the given RGB values. | |
2110 | """ | |
2111 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2112 | ||
2113 | def GetCountColour(*args, **kwargs): | |
2114 | """ | |
2115 | GetCountColour(self, Colour colour) -> unsigned long | |
2116 | ||
2117 | Returns the pixel count for the given `wx.Colour` value. | |
2118 | """ | |
2119 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2120 | ||
2131d850 | 2121 | _core_.ImageHistogram_swigregister(ImageHistogram) |
d14a1e28 | 2122 | |
e811c8ce | 2123 | def ImageHistogram_MakeKey(*args, **kwargs): |
0085ce49 | 2124 | """ |
7a27cf7c | 2125 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2126 | |
0df68c9f RD |
2127 | Get the key in the histogram for the given RGB values |
2128 | """ | |
0085ce49 | 2129 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d14a1e28 | 2130 | |
943e8dfd RD |
2131 | class Image_RGBValue(object): |
2132 | """ | |
2133 | An object that contains values for red, green and blue which represent | |
2134 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2135 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2136 | color space. | |
2137 | """ | |
0085ce49 RD |
2138 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2139 | __repr__ = _swig_repr | |
2140 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2141 | """ |
2142 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2143 | ||
2144 | Constructor. | |
2145 | """ | |
0085ce49 | 2146 | _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs)) |
943e8dfd RD |
2147 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) |
2148 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2149 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2131d850 | 2150 | _core_.Image_RGBValue_swigregister(Image_RGBValue) |
943e8dfd RD |
2151 | |
2152 | class Image_HSVValue(object): | |
2153 | """ | |
2154 | An object that contains values for hue, saturation and value which | |
2155 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2156 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2157 | color space. | |
2158 | """ | |
0085ce49 RD |
2159 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2160 | __repr__ = _swig_repr | |
2161 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2162 | """ |
2163 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2164 | ||
2165 | Constructor. | |
2166 | """ | |
0085ce49 | 2167 | _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs)) |
943e8dfd RD |
2168 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) |
2169 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2170 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2131d850 | 2171 | _core_.Image_HSVValue_swigregister(Image_HSVValue) |
943e8dfd | 2172 | |
d14a1e28 | 2173 | class Image(Object): |
7a27cf7c RD |
2174 | """ |
2175 | A platform-independent image class. An image can be created from | |
2176 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2177 | variety of formats. Functions are available to set and get image | |
2178 | bits, so it can be used for basic image manipulation. | |
2179 | ||
2180 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2181 | platform-specific `wx.Bitmap` object must be created from it using the | |
2182 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2183 | device context, using `wx.DC.DrawBitmap`. | |
2184 | ||
2185 | One colour value of the image may be used as a mask colour which will | |
2186 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2187 | bitmap object. | |
2188 | ||
2189 | wx.Image supports alpha channel data, that is in addition to a byte | |
2190 | for the red, green and blue colour components for each pixel it also | |
2191 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2192 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2193 | means that the pixel is 100% opaque. | |
2194 | ||
2195 | Unlike RGB data, not all images have an alpha channel and before using | |
2196 | `GetAlpha` you should check if this image contains an alpha channel | |
2197 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2198 | with transparency information will have an alpha channel. | |
2199 | """ | |
0085ce49 RD |
2200 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2201 | __repr__ = _swig_repr | |
2202 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2203 | """ |
2204 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2205 | ||
2206 | Loads an image from a file. | |
2207 | """ | |
0085ce49 RD |
2208 | _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs)) |
2209 | __swig_destroy__ = _core_.delete_Image | |
2210 | __del__ = lambda self : None; | |
e811c8ce | 2211 | def Create(*args, **kwargs): |
7a27cf7c RD |
2212 | """ |
2213 | Create(self, int width, int height, bool clear=True) | |
2214 | ||
2215 | Creates a fresh image. If clear is ``True``, the new image will be | |
2216 | initialized to black. Otherwise, the image data will be uninitialized. | |
2217 | """ | |
54f9ee45 | 2218 | return _core_.Image_Create(*args, **kwargs) |
e811c8ce RD |
2219 | |
2220 | def Destroy(*args, **kwargs): | |
0df68c9f | 2221 | """ |
a95a7133 | 2222 | Destroy(self) |
e811c8ce | 2223 | |
7a27cf7c | 2224 | Destroys the image data. |
0df68c9f | 2225 | """ |
7e08d4ef RD |
2226 | val = _core_.Image_Destroy(*args, **kwargs) |
2227 | args[0].thisown = 0 | |
2228 | return val | |
e811c8ce RD |
2229 | |
2230 | def Scale(*args, **kwargs): | |
7a27cf7c RD |
2231 | """ |
2232 | Scale(self, int width, int height) -> Image | |
2233 | ||
2234 | Returns a scaled version of the image. This is also useful for scaling | |
2235 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
2236 | `wx.MemoryDC` into another `wx.MemoryDC`. | |
2237 | """ | |
54f9ee45 | 2238 | return _core_.Image_Scale(*args, **kwargs) |
e811c8ce RD |
2239 | |
2240 | def ShrinkBy(*args, **kwargs): | |
7a27cf7c RD |
2241 | """ |
2242 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2243 | ||
2244 | Return a version of the image scaled smaller by the given factors. | |
2245 | """ | |
54f9ee45 | 2246 | return _core_.Image_ShrinkBy(*args, **kwargs) |
e811c8ce RD |
2247 | |
2248 | def Rescale(*args, **kwargs): | |
7a27cf7c RD |
2249 | """ |
2250 | Rescale(self, int width, int height) -> Image | |
2251 | ||
2252 | Changes the size of the image in-place by scaling it: after a call to | |
2253 | this function, the image will have the given width and height. | |
2254 | ||
2255 | Returns the (modified) image itself. | |
2256 | """ | |
54f9ee45 | 2257 | return _core_.Image_Rescale(*args, **kwargs) |
e811c8ce | 2258 | |
aff4cc5c | 2259 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2260 | """ |
2261 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2262 | ||
2263 | Changes the size of the image in-place without scaling it, by adding | |
2264 | either a border with the given colour or cropping as necessary. The | |
2265 | image is pasted into a new image with the given size and background | |
2266 | colour at the position pos relative to the upper left of the new | |
2267 | image. If red = green = blue = -1 then use either the current mask | |
2268 | colour if set or find, use, and set a suitable mask colour for any | |
2269 | newly exposed areas. | |
2270 | ||
2271 | Returns the (modified) image itself. | |
2272 | """ | |
aff4cc5c RD |
2273 | return _core_.Image_Resize(*args, **kwargs) |
2274 | ||
e811c8ce | 2275 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2276 | """ |
2277 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2278 | ||
2279 | Sets the pixel at the given coordinate. This routine performs | |
2280 | bounds-checks for the coordinate so it can be considered a safe way to | |
2281 | manipulate the data, but in some cases this might be too slow so that | |
2282 | the data will have to be set directly. In that case you will have to | |
2283 | get access to the image data using the `GetData` method. | |
2284 | """ | |
54f9ee45 | 2285 | return _core_.Image_SetRGB(*args, **kwargs) |
e811c8ce | 2286 | |
aff4cc5c | 2287 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2288 | """ |
2289 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2290 | ||
2291 | Sets the colour of the pixels within the given rectangle. This routine | |
2292 | performs bounds-checks for the rectangle so it can be considered a | |
2293 | safe way to manipulate the data. | |
2294 | """ | |
aff4cc5c RD |
2295 | return _core_.Image_SetRGBRect(*args, **kwargs) |
2296 | ||
e811c8ce | 2297 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2298 | """ |
2299 | GetRed(self, int x, int y) -> byte | |
2300 | ||
2301 | Returns the red intensity at the given coordinate. | |
2302 | """ | |
54f9ee45 | 2303 | return _core_.Image_GetRed(*args, **kwargs) |
e811c8ce RD |
2304 | |
2305 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2306 | """ |
2307 | GetGreen(self, int x, int y) -> byte | |
2308 | ||
2309 | Returns the green intensity at the given coordinate. | |
2310 | """ | |
54f9ee45 | 2311 | return _core_.Image_GetGreen(*args, **kwargs) |
e811c8ce RD |
2312 | |
2313 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2314 | """ |
2315 | GetBlue(self, int x, int y) -> byte | |
2316 | ||
2317 | Returns the blue intensity at the given coordinate. | |
2318 | """ | |
54f9ee45 | 2319 | return _core_.Image_GetBlue(*args, **kwargs) |
e811c8ce RD |
2320 | |
2321 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2322 | """ |
2323 | SetAlpha(self, int x, int y, byte alpha) | |
2324 | ||
2325 | Sets the alpha value for the given pixel. This function should only be | |
2326 | called if the image has alpha channel data, use `HasAlpha` to check | |
2327 | for this. | |
2328 | """ | |
54f9ee45 | 2329 | return _core_.Image_SetAlpha(*args, **kwargs) |
e811c8ce RD |
2330 | |
2331 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2332 | """ |
2333 | GetAlpha(self, int x, int y) -> byte | |
2334 | ||
2335 | Returns the alpha value for the given pixel. This function may only be | |
2336 | called for the images with alpha channel, use `HasAlpha` to check for | |
2337 | this. | |
2338 | ||
2339 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2340 | corresponds to the fully transparent pixels while the value of 255 to | |
2341 | the fully opaque pixels. | |
2342 | """ | |
54f9ee45 | 2343 | return _core_.Image_GetAlpha(*args, **kwargs) |
e811c8ce RD |
2344 | |
2345 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2346 | """ |
2347 | HasAlpha(self) -> bool | |
2348 | ||
2349 | Returns true if this image has alpha channel, false otherwise. | |
2350 | """ | |
54f9ee45 | 2351 | return _core_.Image_HasAlpha(*args, **kwargs) |
e811c8ce | 2352 | |
68350608 RD |
2353 | def InitAlpha(*args, **kwargs): |
2354 | """ | |
2355 | InitAlpha(self) | |
2356 | ||
2357 | Initializes the image alpha channel data. It is an error to call it if | |
2358 | the image already has alpha data. If it doesn't, alpha data will be by | |
2359 | default initialized to all pixels being fully opaque. But if the image | |
2360 | has a a mask colour, all mask pixels will be completely transparent. | |
2361 | """ | |
2362 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2363 | ||
bcd0d7b6 RD |
2364 | def IsTransparent(*args, **kwargs): |
2365 | """ | |
7a27cf7c | 2366 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
bcd0d7b6 | 2367 | |
7a27cf7c RD |
2368 | Returns ``True`` if this pixel is masked or has an alpha value less |
2369 | than the spcified threshold. | |
bcd0d7b6 RD |
2370 | """ |
2371 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2372 | ||
e811c8ce | 2373 | def FindFirstUnusedColour(*args, **kwargs): |
fd2dc343 RD |
2374 | """ |
2375 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2376 | ||
2377 | Find first colour that is not used in the image and has higher RGB | |
2378 | values than startR, startG, startB. Returns a tuple consisting of a | |
2379 | success flag and rgb values. | |
2380 | """ | |
54f9ee45 | 2381 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2382 | |
4cf4100f RD |
2383 | def ConvertAlphaToMask(*args, **kwargs): |
2384 | """ | |
bcd0d7b6 | 2385 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2386 | |
7a27cf7c RD |
2387 | If the image has alpha channel, this method converts it to mask. All |
2388 | pixels with alpha value less than ``threshold`` are replaced with the | |
2389 | mask colour and the alpha channel is removed. The mask colour is | |
2390 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2391 | |
2392 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2393 | nothing. | |
2394 | """ | |
2395 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
2396 | ||
8fb0e70a RD |
2397 | def ConvertColourToAlpha(*args, **kwargs): |
2398 | """ | |
7a27cf7c | 2399 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2400 | |
2401 | This method converts an image where the original alpha information is | |
2402 | only available as a shades of a colour (actually shades of grey) | |
2403 | typically when you draw anti-aliased text into a bitmap. The DC | |
2404 | drawing routines draw grey values on the black background although | |
2405 | they actually mean to draw white with differnt alpha values. This | |
2406 | method reverses it, assuming a black (!) background and white text. | |
2407 | The method will then fill up the whole image with the colour given. | |
2408 | """ | |
2409 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2410 | ||
e811c8ce | 2411 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2412 | """ |
2413 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2414 | ||
2415 | Sets the image's mask so that the pixels that have RGB value of | |
2416 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2417 | by first finding an unused colour in the image, setting this colour as | |
2418 | the mask colour and then using this colour to draw all pixels in the | |
2419 | image who corresponding pixel in mask has given RGB value. | |
2420 | ||
2421 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2422 | image or if there is no unused colour left. Returns ``True`` if the | |
2423 | mask was successfully applied. | |
2424 | ||
2425 | Note that this method involves computing the histogram, which is | |
2426 | computationally intensive operation. | |
2427 | """ | |
54f9ee45 | 2428 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
e811c8ce RD |
2429 | |
2430 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2431 | """ |
2432 | CanRead(String filename) -> bool | |
2433 | ||
2434 | Returns True if the image handlers can read this file. | |
2435 | """ | |
54f9ee45 | 2436 | return _core_.Image_CanRead(*args, **kwargs) |
e811c8ce RD |
2437 | |
2438 | CanRead = staticmethod(CanRead) | |
2439 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2440 | """ |
2441 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2442 | ||
2443 | If the image file contains more than one image and the image handler | |
2444 | is capable of retrieving these individually, this function will return | |
2445 | the number of available images. | |
2446 | """ | |
54f9ee45 | 2447 | return _core_.Image_GetImageCount(*args, **kwargs) |
e811c8ce RD |
2448 | |
2449 | GetImageCount = staticmethod(GetImageCount) | |
2450 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2451 | """ |
2452 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2453 | ||
2454 | Loads an image from a file. If no handler type is provided, the | |
2455 | library will try to autodetect the format. | |
2456 | """ | |
54f9ee45 | 2457 | return _core_.Image_LoadFile(*args, **kwargs) |
e811c8ce RD |
2458 | |
2459 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2460 | """ |
2461 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2462 | ||
2463 | Loads an image from a file, specifying the image type with a MIME type | |
2464 | string. | |
2465 | """ | |
54f9ee45 | 2466 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
e811c8ce RD |
2467 | |
2468 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2469 | """ |
2470 | SaveFile(self, String name, int type) -> bool | |
2471 | ||
2472 | Saves an image in the named file. | |
2473 | """ | |
54f9ee45 | 2474 | return _core_.Image_SaveFile(*args, **kwargs) |
e811c8ce RD |
2475 | |
2476 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2477 | """ |
2478 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2479 | ||
2480 | Saves an image in the named file. | |
2481 | """ | |
54f9ee45 | 2482 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
e811c8ce RD |
2483 | |
2484 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2485 | """ |
2486 | CanReadStream(InputStream stream) -> bool | |
2487 | ||
2488 | Returns True if the image handlers can read an image file from the | |
2489 | data currently on the input stream, or a readable Python file-like | |
2490 | object. | |
2491 | """ | |
54f9ee45 | 2492 | return _core_.Image_CanReadStream(*args, **kwargs) |
e811c8ce RD |
2493 | |
2494 | CanReadStream = staticmethod(CanReadStream) | |
2495 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2496 | """ |
2497 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2498 | ||
2499 | Loads an image from an input stream or a readable Python file-like | |
2500 | object. If no handler type is provided, the library will try to | |
2501 | autodetect the format. | |
2502 | """ | |
54f9ee45 | 2503 | return _core_.Image_LoadStream(*args, **kwargs) |
e811c8ce RD |
2504 | |
2505 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2506 | """ |
2507 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2508 | ||
2509 | Loads an image from an input stream or a readable Python file-like | |
2510 | object, using a MIME type string to specify the image file format. | |
2511 | """ | |
54f9ee45 | 2512 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
e811c8ce RD |
2513 | |
2514 | def Ok(*args, **kwargs): | |
7a27cf7c RD |
2515 | """ |
2516 | Ok(self) -> bool | |
2517 | ||
2518 | Returns true if image data is present. | |
2519 | """ | |
54f9ee45 | 2520 | return _core_.Image_Ok(*args, **kwargs) |
e811c8ce RD |
2521 | |
2522 | def GetWidth(*args, **kwargs): | |
7a27cf7c RD |
2523 | """ |
2524 | GetWidth(self) -> int | |
2525 | ||
2526 | Gets the width of the image in pixels. | |
2527 | """ | |
54f9ee45 | 2528 | return _core_.Image_GetWidth(*args, **kwargs) |
e811c8ce RD |
2529 | |
2530 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
2531 | """ |
2532 | GetHeight(self) -> int | |
2533 | ||
2534 | Gets the height of the image in pixels. | |
2535 | """ | |
54f9ee45 | 2536 | return _core_.Image_GetHeight(*args, **kwargs) |
e811c8ce | 2537 | |
b2df227b | 2538 | def GetSize(*args, **kwargs): |
7a27cf7c RD |
2539 | """ |
2540 | GetSize(self) -> Size | |
2541 | ||
2542 | Returns the size of the image in pixels. | |
2543 | """ | |
54f9ee45 | 2544 | return _core_.Image_GetSize(*args, **kwargs) |
b2df227b | 2545 | |
e811c8ce | 2546 | def GetSubImage(*args, **kwargs): |
7a27cf7c RD |
2547 | """ |
2548 | GetSubImage(self, Rect rect) -> Image | |
2549 | ||
2550 | Returns a sub image of the current one as long as the rect belongs | |
2551 | entirely to the image. | |
2552 | """ | |
54f9ee45 | 2553 | return _core_.Image_GetSubImage(*args, **kwargs) |
e811c8ce | 2554 | |
aff4cc5c | 2555 | def Size(*args, **kwargs): |
7a27cf7c RD |
2556 | """ |
2557 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2558 | ||
2559 | Returns a resized version of this image without scaling it by adding | |
2560 | either a border with the given colour or cropping as necessary. The | |
2561 | image is pasted into a new image with the given size and background | |
2562 | colour at the position ``pos`` relative to the upper left of the new | |
2563 | image. If red = green = blue = -1 then use either the current mask | |
2564 | colour if set or find, use, and set a suitable mask colour for any | |
2565 | newly exposed areas. | |
2566 | """ | |
aff4cc5c RD |
2567 | return _core_.Image_Size(*args, **kwargs) |
2568 | ||
e811c8ce | 2569 | def Copy(*args, **kwargs): |
7a27cf7c RD |
2570 | """ |
2571 | Copy(self) -> Image | |
2572 | ||
2573 | Returns an identical copy of the image. | |
2574 | """ | |
54f9ee45 | 2575 | return _core_.Image_Copy(*args, **kwargs) |
e811c8ce RD |
2576 | |
2577 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
2578 | """ |
2579 | Paste(self, Image image, int x, int y) | |
2580 | ||
2581 | Pastes ``image`` into this instance and takes care of the mask colour | |
2582 | and any out of bounds problems. | |
2583 | """ | |
54f9ee45 | 2584 | return _core_.Image_Paste(*args, **kwargs) |
e811c8ce RD |
2585 | |
2586 | def GetData(*args, **kwargs): | |
61d07ac7 RD |
2587 | """ |
2588 | GetData(self) -> PyObject | |
2589 | ||
2590 | Returns a string containing a copy of the RGB bytes of the image. | |
2591 | """ | |
54f9ee45 | 2592 | return _core_.Image_GetData(*args, **kwargs) |
e811c8ce RD |
2593 | |
2594 | def SetData(*args, **kwargs): | |
61d07ac7 RD |
2595 | """ |
2596 | SetData(self, buffer data) | |
2597 | ||
2598 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
2599 | either a string or a buffer object holding the data and the length of | |
2600 | the data must be width*height*3. | |
2601 | """ | |
54f9ee45 | 2602 | return _core_.Image_SetData(*args, **kwargs) |
e811c8ce RD |
2603 | |
2604 | def GetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
2605 | """ |
2606 | GetDataBuffer(self) -> PyObject | |
2607 | ||
2608 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
2609 | image data buffer inside the wx.Image. You need to ensure that you do |
2610 | not use this buffer object after the image has been destroyed. | |
61d07ac7 | 2611 | """ |
54f9ee45 | 2612 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2613 | |
2614 | def SetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
2615 | """ |
2616 | SetDataBuffer(self, buffer data) | |
2617 | ||
2618 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
2619 | object. This can save making an extra copy of the data but you must |
2620 | ensure that the buffer object lives longer than the wx.Image does. | |
61d07ac7 | 2621 | """ |
54f9ee45 | 2622 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
e811c8ce RD |
2623 | |
2624 | def GetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2625 | """ |
2626 | GetAlphaData(self) -> PyObject | |
2627 | ||
2628 | Returns a string containing a copy of the alpha bytes of the image. | |
2629 | """ | |
54f9ee45 | 2630 | return _core_.Image_GetAlphaData(*args, **kwargs) |
e811c8ce RD |
2631 | |
2632 | def SetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
2633 | """ |
2634 | SetAlphaData(self, buffer alpha) | |
2635 | ||
2636 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
2637 | a string or a buffer object holding the data and the length of the | |
2638 | data must be width*height. | |
2639 | """ | |
54f9ee45 | 2640 | return _core_.Image_SetAlphaData(*args, **kwargs) |
e811c8ce RD |
2641 | |
2642 | def GetAlphaBuffer(*args, **kwargs): | |
a95a7133 | 2643 | """GetAlphaBuffer(self) -> PyObject""" |
54f9ee45 | 2644 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2645 | |
2646 | def SetAlphaBuffer(*args, **kwargs): | |
61d07ac7 | 2647 | """SetAlphaBuffer(self, buffer alpha)""" |
54f9ee45 | 2648 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
2649 | |
2650 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
2651 | """ |
2652 | SetMaskColour(self, byte r, byte g, byte b) | |
2653 | ||
2654 | Sets the mask colour for this image (and tells the image to use the | |
2655 | mask). | |
2656 | """ | |
54f9ee45 | 2657 | return _core_.Image_SetMaskColour(*args, **kwargs) |
e811c8ce | 2658 | |
aff4cc5c RD |
2659 | def GetOrFindMaskColour(*args, **kwargs): |
2660 | """ | |
2661 | GetOrFindMaskColour() -> (r,g,b) | |
2662 | ||
2663 | Get the current mask colour or find a suitable colour. | |
2664 | """ | |
2665 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
2666 | ||
e811c8ce | 2667 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
2668 | """ |
2669 | GetMaskRed(self) -> byte | |
2670 | ||
2671 | Gets the red component of the mask colour. | |
2672 | """ | |
54f9ee45 | 2673 | return _core_.Image_GetMaskRed(*args, **kwargs) |
e811c8ce RD |
2674 | |
2675 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
2676 | """ |
2677 | GetMaskGreen(self) -> byte | |
2678 | ||
2679 | Gets the green component of the mask colour. | |
2680 | """ | |
54f9ee45 | 2681 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
e811c8ce RD |
2682 | |
2683 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
2684 | """ |
2685 | GetMaskBlue(self) -> byte | |
2686 | ||
2687 | Gets the blue component of the mask colour. | |
2688 | """ | |
54f9ee45 | 2689 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
e811c8ce RD |
2690 | |
2691 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
2692 | """ |
2693 | SetMask(self, bool mask=True) | |
2694 | ||
2695 | Specifies whether there is a mask or not. The area of the mask is | |
2696 | determined by the current mask colour. | |
2697 | """ | |
54f9ee45 | 2698 | return _core_.Image_SetMask(*args, **kwargs) |
e811c8ce RD |
2699 | |
2700 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
2701 | """ |
2702 | HasMask(self) -> bool | |
2703 | ||
2704 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
2705 | """ | |
54f9ee45 | 2706 | return _core_.Image_HasMask(*args, **kwargs) |
e811c8ce RD |
2707 | |
2708 | def Rotate(*args, **kwargs): | |
0df68c9f | 2709 | """ |
a95a7133 | 2710 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
0df68c9f | 2711 | Point offset_after_rotation=None) -> Image |
7a27cf7c RD |
2712 | |
2713 | Rotates the image about the given point, by ``angle`` radians. Passing | |
2714 | ``True`` to ``interpolating`` results in better image quality, but is | |
2715 | slower. If the image has a mask, then the mask colour is used for the | |
2716 | uncovered pixels in the rotated image background. Otherwise, black | |
2717 | will be used as the fill colour. | |
2718 | ||
2719 | Returns the rotated image, leaving this image intact. | |
0df68c9f | 2720 | """ |
54f9ee45 | 2721 | return _core_.Image_Rotate(*args, **kwargs) |
e811c8ce RD |
2722 | |
2723 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
2724 | """ |
2725 | Rotate90(self, bool clockwise=True) -> Image | |
2726 | ||
2727 | Returns a copy of the image rotated 90 degrees in the direction | |
2728 | indicated by ``clockwise``. | |
2729 | """ | |
54f9ee45 | 2730 | return _core_.Image_Rotate90(*args, **kwargs) |
e811c8ce RD |
2731 | |
2732 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
2733 | """ |
2734 | Mirror(self, bool horizontally=True) -> Image | |
2735 | ||
2736 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
2737 | indicates the orientation. | |
2738 | """ | |
54f9ee45 | 2739 | return _core_.Image_Mirror(*args, **kwargs) |
e811c8ce RD |
2740 | |
2741 | def Replace(*args, **kwargs): | |
0df68c9f | 2742 | """ |
7a27cf7c RD |
2743 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
2744 | ||
2745 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
2746 | ``(r2,g2,b2)``. | |
0df68c9f | 2747 | """ |
54f9ee45 | 2748 | return _core_.Image_Replace(*args, **kwargs) |
e811c8ce | 2749 | |
32fe5131 RD |
2750 | def ConvertToGreyscale(*args, **kwargs): |
2751 | """ | |
2752 | ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image | |
2753 | ||
2754 | Convert to greyscale image. Uses the luminance component (Y) of the | |
2755 | image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), | |
2756 | defaults to ITU-T BT.601 | |
2757 | """ | |
2758 | return _core_.Image_ConvertToGreyscale(*args, **kwargs) | |
2759 | ||
e811c8ce | 2760 | def ConvertToMono(*args, **kwargs): |
7a27cf7c RD |
2761 | """ |
2762 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
2763 | ||
2764 | Returns monochromatic version of the image. The returned image has | |
2765 | white colour where the original has ``(r,g,b)`` colour and black | |
2766 | colour everywhere else. | |
2767 | """ | |
54f9ee45 | 2768 | return _core_.Image_ConvertToMono(*args, **kwargs) |
e811c8ce RD |
2769 | |
2770 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
2771 | """ |
2772 | SetOption(self, String name, String value) | |
2773 | ||
2774 | Sets an image handler defined option. For example, when saving as a | |
2775 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
2776 | number between 0 and 100 (0 is terrible, 100 is very good). | |
2777 | """ | |
54f9ee45 | 2778 | return _core_.Image_SetOption(*args, **kwargs) |
e811c8ce RD |
2779 | |
2780 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2781 | """ |
2782 | SetOptionInt(self, String name, int value) | |
2783 | ||
2784 | Sets an image option as an integer. | |
2785 | """ | |
54f9ee45 | 2786 | return _core_.Image_SetOptionInt(*args, **kwargs) |
e811c8ce RD |
2787 | |
2788 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
2789 | """ |
2790 | GetOption(self, String name) -> String | |
2791 | ||
2792 | Gets the value of an image handler option. | |
2793 | """ | |
54f9ee45 | 2794 | return _core_.Image_GetOption(*args, **kwargs) |
e811c8ce RD |
2795 | |
2796 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
2797 | """ |
2798 | GetOptionInt(self, String name) -> int | |
2799 | ||
2800 | Gets the value of an image handler option as an integer. If the given | |
2801 | option is not present, the function returns 0. | |
2802 | """ | |
54f9ee45 | 2803 | return _core_.Image_GetOptionInt(*args, **kwargs) |
e811c8ce RD |
2804 | |
2805 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
2806 | """ |
2807 | HasOption(self, String name) -> bool | |
2808 | ||
2809 | Returns true if the given option is present. | |
2810 | """ | |
54f9ee45 | 2811 | return _core_.Image_HasOption(*args, **kwargs) |
e811c8ce RD |
2812 | |
2813 | def CountColours(*args, **kwargs): | |
a95a7133 | 2814 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" |
54f9ee45 | 2815 | return _core_.Image_CountColours(*args, **kwargs) |
e811c8ce RD |
2816 | |
2817 | def ComputeHistogram(*args, **kwargs): | |
a95a7133 | 2818 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
54f9ee45 | 2819 | return _core_.Image_ComputeHistogram(*args, **kwargs) |
e811c8ce RD |
2820 | |
2821 | def AddHandler(*args, **kwargs): | |
66c033b4 | 2822 | """AddHandler(ImageHandler handler)""" |
54f9ee45 | 2823 | return _core_.Image_AddHandler(*args, **kwargs) |
e811c8ce RD |
2824 | |
2825 | AddHandler = staticmethod(AddHandler) | |
2826 | def InsertHandler(*args, **kwargs): | |
66c033b4 | 2827 | """InsertHandler(ImageHandler handler)""" |
54f9ee45 | 2828 | return _core_.Image_InsertHandler(*args, **kwargs) |
e811c8ce RD |
2829 | |
2830 | InsertHandler = staticmethod(InsertHandler) | |
2831 | def RemoveHandler(*args, **kwargs): | |
66c033b4 | 2832 | """RemoveHandler(String name) -> bool""" |
54f9ee45 | 2833 | return _core_.Image_RemoveHandler(*args, **kwargs) |
e811c8ce RD |
2834 | |
2835 | RemoveHandler = staticmethod(RemoveHandler) | |
0085ce49 RD |
2836 | def GetHandlers(*args, **kwargs): |
2837 | """GetHandlers() -> PyObject""" | |
2838 | return _core_.Image_GetHandlers(*args, **kwargs) | |
2839 | ||
2840 | GetHandlers = staticmethod(GetHandlers) | |
e811c8ce | 2841 | def GetImageExtWildcard(*args, **kwargs): |
7a27cf7c RD |
2842 | """ |
2843 | GetImageExtWildcard() -> String | |
2844 | ||
2845 | Iterates all registered wxImageHandler objects, and returns a string | |
2846 | containing file extension masks suitable for passing to file open/save | |
2847 | dialog boxes. | |
2848 | """ | |
54f9ee45 | 2849 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
e811c8ce RD |
2850 | |
2851 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
2852 | def ConvertToBitmap(*args, **kwargs): | |
1fbf26be | 2853 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
54f9ee45 | 2854 | return _core_.Image_ConvertToBitmap(*args, **kwargs) |
e811c8ce RD |
2855 | |
2856 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 2857 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
54f9ee45 | 2858 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
e811c8ce | 2859 | |
943e8dfd RD |
2860 | def RotateHue(*args, **kwargs): |
2861 | """ | |
2862 | RotateHue(self, double angle) | |
2863 | ||
2864 | Rotates the hue of each pixel of the image. Hue is a double in the | |
2865 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
2866 | """ | |
2867 | return _core_.Image_RotateHue(*args, **kwargs) | |
2868 | ||
2869 | def RGBtoHSV(*args, **kwargs): | |
2870 | """ | |
2871 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
2872 | ||
2873 | Converts a color in RGB color space to HSV color space. | |
2874 | """ | |
2875 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
2876 | ||
2877 | RGBtoHSV = staticmethod(RGBtoHSV) | |
2878 | def HSVtoRGB(*args, **kwargs): | |
2879 | """ | |
2880 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
2881 | ||
2882 | Converts a color in HSV color space to RGB color space. | |
2883 | """ | |
2884 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
2885 | ||
2886 | HSVtoRGB = staticmethod(HSVtoRGB) | |
e811c8ce | 2887 | def __nonzero__(self): return self.Ok() |
2131d850 | 2888 | _core_.Image_swigregister(Image) |
d14a1e28 RD |
2889 | |
2890 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
2891 | """ |
2892 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
2893 | ||
2894 | Loads an image from a file, using a MIME type string (such as | |
2895 | 'image/jpeg') to specify image type. | |
2896 | """ | |
54f9ee45 | 2897 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d14a1e28 RD |
2898 | return val |
2899 | ||
2900 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
2901 | """ |
2902 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2903 | ||
2904 | Loads an image from an input stream, or any readable Python file-like | |
2905 | object. | |
2906 | """ | |
54f9ee45 | 2907 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d14a1e28 RD |
2908 | return val |
2909 | ||
2910 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
2911 | """ |
2912 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
2913 | ||
2914 | Loads an image from an input stream, or any readable Python file-like | |
2915 | object, specifying the image format with a MIME type string. | |
2916 | """ | |
54f9ee45 | 2917 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d14a1e28 RD |
2918 | return val |
2919 | ||
66c033b4 | 2920 | def EmptyImage(*args, **kwargs): |
61d07ac7 RD |
2921 | """ |
2922 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
2923 | ||
2924 | Construct an empty image of a given size, optionally setting all | |
2925 | pixels to black. | |
2926 | """ | |
66c033b4 | 2927 | val = _core_.new_EmptyImage(*args, **kwargs) |
d14a1e28 RD |
2928 | return val |
2929 | ||
2930 | def ImageFromBitmap(*args, **kwargs): | |
61d07ac7 RD |
2931 | """ |
2932 | ImageFromBitmap(Bitmap bitmap) -> Image | |
2933 | ||
2934 | Construct an Image from a `wx.Bitmap`. | |
2935 | """ | |
54f9ee45 | 2936 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d14a1e28 RD |
2937 | return val |
2938 | ||
2939 | def ImageFromData(*args, **kwargs): | |
61d07ac7 RD |
2940 | """ |
2941 | ImageFromData(int width, int height, buffer data) -> Image | |
2942 | ||
2943 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
2944 | string or a buffer object holding the data and the length of the data | |
2945 | must be width*height*3. | |
2946 | """ | |
54f9ee45 | 2947 | val = _core_.new_ImageFromData(*args, **kwargs) |
d14a1e28 RD |
2948 | return val |
2949 | ||
1823fbb4 | 2950 | def ImageFromDataWithAlpha(*args, **kwargs): |
61d07ac7 RD |
2951 | """ |
2952 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
2953 | ||
2954 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
2955 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
2956 | length of the data must be width*height*3 bytes, and the length of the |
2957 | alpha data must be width*height bytes. | |
61d07ac7 | 2958 | """ |
1823fbb4 | 2959 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
1823fbb4 RD |
2960 | return val |
2961 | ||
e811c8ce | 2962 | def Image_CanRead(*args, **kwargs): |
0085ce49 | 2963 | """ |
7a27cf7c RD |
2964 | Image_CanRead(String filename) -> bool |
2965 | ||
2966 | Returns True if the image handlers can read this file. | |
2967 | """ | |
0085ce49 | 2968 | return _core_.Image_CanRead(*args, **kwargs) |
d14a1e28 | 2969 | |
e811c8ce | 2970 | def Image_GetImageCount(*args, **kwargs): |
0085ce49 | 2971 | """ |
7a27cf7c RD |
2972 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int |
2973 | ||
2974 | If the image file contains more than one image and the image handler | |
2975 | is capable of retrieving these individually, this function will return | |
2976 | the number of available images. | |
2977 | """ | |
0085ce49 | 2978 | return _core_.Image_GetImageCount(*args, **kwargs) |
d14a1e28 | 2979 | |
e811c8ce | 2980 | def Image_CanReadStream(*args, **kwargs): |
0085ce49 | 2981 | """ |
7a27cf7c RD |
2982 | Image_CanReadStream(InputStream stream) -> bool |
2983 | ||
2984 | Returns True if the image handlers can read an image file from the | |
2985 | data currently on the input stream, or a readable Python file-like | |
2986 | object. | |
2987 | """ | |
0085ce49 | 2988 | return _core_.Image_CanReadStream(*args, **kwargs) |
d14a1e28 | 2989 | |
e811c8ce | 2990 | def Image_AddHandler(*args, **kwargs): |
0085ce49 RD |
2991 | """Image_AddHandler(ImageHandler handler)""" |
2992 | return _core_.Image_AddHandler(*args, **kwargs) | |
d14a1e28 | 2993 | |
e811c8ce | 2994 | def Image_InsertHandler(*args, **kwargs): |
0085ce49 RD |
2995 | """Image_InsertHandler(ImageHandler handler)""" |
2996 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d14a1e28 | 2997 | |
e811c8ce | 2998 | def Image_RemoveHandler(*args, **kwargs): |
0085ce49 RD |
2999 | """Image_RemoveHandler(String name) -> bool""" |
3000 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d14a1e28 | 3001 | |
0085ce49 RD |
3002 | def Image_GetHandlers(*args): |
3003 | """Image_GetHandlers() -> PyObject""" | |
3004 | return _core_.Image_GetHandlers(*args) | |
3005 | ||
3006 | def Image_GetImageExtWildcard(*args): | |
3007 | """ | |
7a27cf7c RD |
3008 | Image_GetImageExtWildcard() -> String |
3009 | ||
3010 | Iterates all registered wxImageHandler objects, and returns a string | |
3011 | containing file extension masks suitable for passing to file open/save | |
3012 | dialog boxes. | |
3013 | """ | |
0085ce49 | 3014 | return _core_.Image_GetImageExtWildcard(*args) |
d14a1e28 | 3015 | |
943e8dfd | 3016 | def Image_RGBtoHSV(*args, **kwargs): |
0085ce49 | 3017 | """ |
943e8dfd RD |
3018 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue |
3019 | ||
3020 | Converts a color in RGB color space to HSV color space. | |
3021 | """ | |
0085ce49 | 3022 | return _core_.Image_RGBtoHSV(*args, **kwargs) |
943e8dfd RD |
3023 | |
3024 | def Image_HSVtoRGB(*args, **kwargs): | |
0085ce49 | 3025 | """ |
943e8dfd RD |
3026 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue |
3027 | ||
3028 | Converts a color in HSV color space to RGB color space. | |
3029 | """ | |
0085ce49 | 3030 | return _core_.Image_HSVtoRGB(*args, **kwargs) |
943e8dfd | 3031 | |
5e4ca4a8 RD |
3032 | def InitAllImageHandlers(): |
3033 | """ | |
3034 | The former functionality of InitAllImageHanders is now done internal to | |
3035 | the _core_ extension module and so this function has become a simple NOP. | |
3036 | """ | |
3037 | pass | |
d14a1e28 | 3038 | |
54f9ee45 RD |
3039 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3040 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
b9d6a5f3 RD |
3041 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR |
3042 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3043 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
54f9ee45 RD |
3044 | BMP_24BPP = _core_.BMP_24BPP |
3045 | BMP_8BPP = _core_.BMP_8BPP | |
3046 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3047 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3048 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3049 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3050 | BMP_4BPP = _core_.BMP_4BPP | |
3051 | BMP_1BPP = _core_.BMP_1BPP | |
3052 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
d14a1e28 | 3053 | class BMPHandler(ImageHandler): |
27fb7603 | 3054 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
0085ce49 RD |
3055 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3056 | __repr__ = _swig_repr | |
3057 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3058 | """ |
3059 | __init__(self) -> BMPHandler | |
3060 | ||
3061 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3062 | """ | |
0085ce49 | 3063 | _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs)) |
2131d850 | 3064 | _core_.BMPHandler_swigregister(BMPHandler) |
d14a1e28 | 3065 | NullImage = cvar.NullImage |
0c243d93 | 3066 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d14a1e28 RD |
3067 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3068 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3069 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3070 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
0c243d93 RD |
3071 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3072 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d14a1e28 | 3073 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3074 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
0c243d93 RD |
3075 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3076 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3077 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3078 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
b9d6a5f3 RD |
3079 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3080 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d14a1e28 RD |
3081 | |
3082 | class ICOHandler(BMPHandler): | |
27fb7603 | 3083 | """A `wx.ImageHandler` for \*.ico icon files.""" |
0085ce49 RD |
3084 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3085 | __repr__ = _swig_repr | |
3086 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3087 | """ |
3088 | __init__(self) -> ICOHandler | |
3089 | ||
3090 | A `wx.ImageHandler` for \*.ico icon files. | |
3091 | """ | |
0085ce49 | 3092 | _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs)) |
2131d850 | 3093 | _core_.ICOHandler_swigregister(ICOHandler) |
d14a1e28 RD |
3094 | |
3095 | class CURHandler(ICOHandler): | |
27fb7603 | 3096 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
0085ce49 RD |
3097 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3098 | __repr__ = _swig_repr | |
3099 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3100 | """ |
3101 | __init__(self) -> CURHandler | |
3102 | ||
3103 | A `wx.ImageHandler` for \*.cur cursor files. | |
3104 | """ | |
0085ce49 | 3105 | _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs)) |
2131d850 | 3106 | _core_.CURHandler_swigregister(CURHandler) |
d14a1e28 RD |
3107 | |
3108 | class ANIHandler(CURHandler): | |
27fb7603 | 3109 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
0085ce49 RD |
3110 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3111 | __repr__ = _swig_repr | |
3112 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3113 | """ |
3114 | __init__(self) -> ANIHandler | |
3115 | ||
3116 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3117 | """ | |
0085ce49 | 3118 | _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs)) |
2131d850 | 3119 | _core_.ANIHandler_swigregister(ANIHandler) |
d14a1e28 RD |
3120 | |
3121 | class PNGHandler(ImageHandler): | |
27fb7603 | 3122 | """A `wx.ImageHandler` for PNG image files.""" |
0085ce49 RD |
3123 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3124 | __repr__ = _swig_repr | |
3125 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3126 | """ |
3127 | __init__(self) -> PNGHandler | |
3128 | ||
3129 | A `wx.ImageHandler` for PNG image files. | |
3130 | """ | |
0085ce49 | 3131 | _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs)) |
2131d850 | 3132 | _core_.PNGHandler_swigregister(PNGHandler) |
d14a1e28 RD |
3133 | |
3134 | class GIFHandler(ImageHandler): | |
27fb7603 | 3135 | """A `wx.ImageHandler` for GIF image files.""" |
0085ce49 RD |
3136 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3137 | __repr__ = _swig_repr | |
3138 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3139 | """ |
3140 | __init__(self) -> GIFHandler | |
3141 | ||
3142 | A `wx.ImageHandler` for GIF image files. | |
3143 | """ | |
0085ce49 | 3144 | _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs)) |
2131d850 | 3145 | _core_.GIFHandler_swigregister(GIFHandler) |
d14a1e28 RD |
3146 | |
3147 | class PCXHandler(ImageHandler): | |
27fb7603 | 3148 | """A `wx.ImageHandler` for PCX imager files.""" |
0085ce49 RD |
3149 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3150 | __repr__ = _swig_repr | |
3151 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3152 | """ |
3153 | __init__(self) -> PCXHandler | |
3154 | ||
3155 | A `wx.ImageHandler` for PCX imager files. | |
3156 | """ | |
0085ce49 | 3157 | _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs)) |
2131d850 | 3158 | _core_.PCXHandler_swigregister(PCXHandler) |
d14a1e28 RD |
3159 | |
3160 | class JPEGHandler(ImageHandler): | |
27fb7603 | 3161 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
0085ce49 RD |
3162 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3163 | __repr__ = _swig_repr | |
3164 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3165 | """ |
3166 | __init__(self) -> JPEGHandler | |
3167 | ||
3168 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3169 | """ | |
0085ce49 | 3170 | _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs)) |
2131d850 | 3171 | _core_.JPEGHandler_swigregister(JPEGHandler) |
d14a1e28 RD |
3172 | |
3173 | class PNMHandler(ImageHandler): | |
27fb7603 | 3174 | """A `wx.ImageHandler` for PNM image files.""" |
0085ce49 RD |
3175 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3176 | __repr__ = _swig_repr | |
3177 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3178 | """ |
3179 | __init__(self) -> PNMHandler | |
3180 | ||
3181 | A `wx.ImageHandler` for PNM image files. | |
3182 | """ | |
0085ce49 | 3183 | _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs)) |
2131d850 | 3184 | _core_.PNMHandler_swigregister(PNMHandler) |
d14a1e28 RD |
3185 | |
3186 | class XPMHandler(ImageHandler): | |
27fb7603 | 3187 | """A `wx.ImageHandler` for XPM image.""" |
0085ce49 RD |
3188 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3189 | __repr__ = _swig_repr | |
3190 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3191 | """ |
3192 | __init__(self) -> XPMHandler | |
3193 | ||
3194 | A `wx.ImageHandler` for XPM image. | |
3195 | """ | |
0085ce49 | 3196 | _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs)) |
2131d850 | 3197 | _core_.XPMHandler_swigregister(XPMHandler) |
d14a1e28 RD |
3198 | |
3199 | class TIFFHandler(ImageHandler): | |
27fb7603 | 3200 | """A `wx.ImageHandler` for TIFF image files.""" |
0085ce49 RD |
3201 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3202 | __repr__ = _swig_repr | |
3203 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3204 | """ |
3205 | __init__(self) -> TIFFHandler | |
3206 | ||
3207 | A `wx.ImageHandler` for TIFF image files. | |
3208 | """ | |
0085ce49 | 3209 | _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs)) |
2131d850 | 3210 | _core_.TIFFHandler_swigregister(TIFFHandler) |
d14a1e28 | 3211 | |
c0de73ae RD |
3212 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3213 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3214 | class Quantize(object): | |
3215 | """Performs quantization, or colour reduction, on a wxImage.""" | |
0085ce49 RD |
3216 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3217 | def __init__(self): raise AttributeError, "No constructor defined" | |
3218 | __repr__ = _swig_repr | |
c0de73ae RD |
3219 | def Quantize(*args, **kwargs): |
3220 | """ | |
3221 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3222 | ||
3223 | Reduce the colours in the source image and put the result into the | |
3224 | destination image, setting the palette in the destination if | |
3225 | needed. Both images may be the same, to overwrite the source image. | |
3226 | """ | |
3227 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3228 | ||
3229 | Quantize = staticmethod(Quantize) | |
2131d850 | 3230 | _core_.Quantize_swigregister(Quantize) |
c0de73ae RD |
3231 | |
3232 | def Quantize_Quantize(*args, **kwargs): | |
0085ce49 | 3233 | """ |
c0de73ae RD |
3234 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
3235 | ||
3236 | Reduce the colours in the source image and put the result into the | |
3237 | destination image, setting the palette in the destination if | |
3238 | needed. Both images may be the same, to overwrite the source image. | |
3239 | """ | |
0085ce49 | 3240 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae | 3241 | |
d14a1e28 RD |
3242 | #--------------------------------------------------------------------------- |
3243 | ||
3244 | class EvtHandler(Object): | |
093d3ff1 | 3245 | """Proxy of C++ EvtHandler class""" |
0085ce49 RD |
3246 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3247 | __repr__ = _swig_repr | |
3248 | def __init__(self, *args, **kwargs): | |
a95a7133 | 3249 | """__init__(self) -> EvtHandler""" |
0085ce49 | 3250 | _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs)) |
e811c8ce | 3251 | def GetNextHandler(*args, **kwargs): |
a95a7133 | 3252 | """GetNextHandler(self) -> EvtHandler""" |
54f9ee45 | 3253 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) |
e811c8ce RD |
3254 | |
3255 | def GetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3256 | """GetPreviousHandler(self) -> EvtHandler""" |
54f9ee45 | 3257 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3258 | |
3259 | def SetNextHandler(*args, **kwargs): | |
a95a7133 | 3260 | """SetNextHandler(self, EvtHandler handler)""" |
54f9ee45 | 3261 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) |
e811c8ce RD |
3262 | |
3263 | def SetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3264 | """SetPreviousHandler(self, EvtHandler handler)""" |
54f9ee45 | 3265 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3266 | |
3267 | def GetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3268 | """GetEvtHandlerEnabled(self) -> bool""" |
54f9ee45 | 3269 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3270 | |
3271 | def SetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3272 | """SetEvtHandlerEnabled(self, bool enabled)""" |
54f9ee45 | 3273 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3274 | |
3275 | def ProcessEvent(*args, **kwargs): | |
a95a7133 | 3276 | """ProcessEvent(self, Event event) -> bool""" |
54f9ee45 | 3277 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) |
e811c8ce RD |
3278 | |
3279 | def AddPendingEvent(*args, **kwargs): | |
a95a7133 | 3280 | """AddPendingEvent(self, Event event)""" |
54f9ee45 | 3281 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) |
e811c8ce RD |
3282 | |
3283 | def ProcessPendingEvents(*args, **kwargs): | |
a95a7133 | 3284 | """ProcessPendingEvents(self)""" |
54f9ee45 | 3285 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
3286 | |
3287 | def Connect(*args, **kwargs): | |
a95a7133 | 3288 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" |
54f9ee45 | 3289 | return _core_.EvtHandler_Connect(*args, **kwargs) |
e811c8ce RD |
3290 | |
3291 | def Disconnect(*args, **kwargs): | |
2131d850 | 3292 | """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool""" |
54f9ee45 | 3293 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
e811c8ce RD |
3294 | |
3295 | def _setOORInfo(*args, **kwargs): | |
689b42ee | 3296 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
7e08d4ef RD |
3297 | val = _core_.EvtHandler__setOORInfo(*args, **kwargs) |
3298 | args[0].thisown = 0 | |
3299 | return val | |
e811c8ce | 3300 | |
d14a1e28 RD |
3301 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3302 | """ | |
3303 | Bind an event to an event handler. | |
3304 | ||
db3e571a RD |
3305 | :param event: One of the EVT_* objects that specifies the |
3306 | type of event to bind, | |
d14a1e28 | 3307 | |
db3e571a RD |
3308 | :param handler: A callable object to be invoked when the |
3309 | event is delivered to self. Pass None to | |
3310 | disconnect an event handler. | |
d14a1e28 | 3311 | |
db3e571a RD |
3312 | :param source: Sometimes the event originates from a |
3313 | different window than self, but you still | |
3314 | want to catch it in self. (For example, a | |
3315 | button event delivered to a frame.) By | |
3316 | passing the source of the event, the event | |
3317 | handling system is able to differentiate | |
3318 | between the same event type from different | |
3319 | controls. | |
d14a1e28 | 3320 | |
db3e571a RD |
3321 | :param id: Used to spcify the event source by ID instead |
3322 | of instance. | |
3323 | ||
3324 | :param id2: Used when it is desirable to bind a handler | |
3325 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d14a1e28 RD |
3326 | """ |
3327 | if source is not None: | |
3328 | id = source.GetId() | |
3329 | event.Bind(self, id, id2, handler) | |
3330 | ||
66c033b4 RD |
3331 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3332 | """ | |
3333 | Disconencts the event handler binding for event from self. | |
3334 | Returns True if successful. | |
3335 | """ | |
3336 | if source is not None: | |
3337 | id = source.GetId() | |
3338 | return event.Unbind(self, id, id2) | |
d14a1e28 | 3339 | |
2131d850 | 3340 | _core_.EvtHandler_swigregister(EvtHandler) |
d14a1e28 RD |
3341 | |
3342 | #--------------------------------------------------------------------------- | |
3343 | ||
3344 | class PyEventBinder(object): | |
3345 | """ | |
3346 | Instances of this class are used to bind specific events to event | |
3347 | handlers. | |
3348 | """ | |
3349 | def __init__(self, evtType, expectedIDs=0): | |
3350 | if expectedIDs not in [0, 1, 2]: | |
3351 | raise ValueError, "Invalid number of expectedIDs" | |
3352 | self.expectedIDs = expectedIDs | |
3353 | ||
3354 | if type(evtType) == list or type(evtType) == tuple: | |
3355 | self.evtType = evtType | |
3356 | else: | |
3357 | self.evtType = [evtType] | |
3358 | ||
3359 | ||
3360 | def Bind(self, target, id1, id2, function): | |
3361 | """Bind this set of event types to target.""" | |
3362 | for et in self.evtType: | |
3363 | target.Connect(id1, id2, et, function) | |
3364 | ||
66c033b4 RD |
3365 | |
3366 | def Unbind(self, target, id1, id2): | |
3367 | """Remove an event binding.""" | |
3368 | success = 0 | |
3369 | for et in self.evtType: | |
3370 | success += target.Disconnect(id1, id2, et) | |
3371 | return success != 0 | |
3372 | ||
d14a1e28 RD |
3373 | |
3374 | def __call__(self, *args): | |
3375 | """ | |
3376 | For backwards compatibility with the old EVT_* functions. | |
3377 | Should be called with either (window, func), (window, ID, | |
3378 | func) or (window, ID1, ID2, func) parameters depending on the | |
3379 | type of the event. | |
3380 | """ | |
3381 | assert len(args) == 2 + self.expectedIDs | |
3382 | id1 = wx.ID_ANY | |
3383 | id2 = wx.ID_ANY | |
3384 | target = args[0] | |
3385 | if self.expectedIDs == 0: | |
3386 | func = args[1] | |
3387 | elif self.expectedIDs == 1: | |
3388 | id1 = args[1] | |
3389 | func = args[2] | |
3390 | elif self.expectedIDs == 2: | |
3391 | id1 = args[1] | |
3392 | id2 = args[2] | |
3393 | func = args[3] | |
3394 | else: | |
3395 | raise ValueError, "Unexpected number of IDs" | |
3396 | ||
3397 | self.Bind(target, id1, id2, func) | |
3398 | ||
3399 | ||
3400 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3401 | def EVT_COMMAND(win, id, cmd, func): | |
3402 | win.Connect(id, -1, cmd, func) | |
3403 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3404 | win.Connect(id1, id2, cmd, func) | |
3405 | ||
3406 | ||
3407 | #--------------------------------------------------------------------------- | |
3408 | ||
3409 | #--------------------------------------------------------------------------- | |
3410 | ||
54f9ee45 RD |
3411 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3412 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
d14a1e28 | 3413 | |
0085ce49 | 3414 | def NewEventType(*args): |
2131d850 | 3415 | """NewEventType() -> EventType""" |
0085ce49 | 3416 | return _core_.NewEventType(*args) |
54f9ee45 RD |
3417 | wxEVT_NULL = _core_.wxEVT_NULL |
3418 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3419 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3420 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3421 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3422 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3423 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3424 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3425 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3426 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3427 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3428 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3429 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3430 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3431 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3432 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3433 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3434 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3435 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3436 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3437 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3438 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3439 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3440 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3441 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3442 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3443 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3444 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3445 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3446 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
3447 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
3448 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
3449 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
3450 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
3451 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
3452 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
3453 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
3454 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
3455 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
3456 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
3457 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
3458 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
3459 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
3460 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
3461 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
3462 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
3463 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
3464 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
3465 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
3466 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
3467 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
3468 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
3469 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
3470 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
3471 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
3472 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
3473 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
3474 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
3475 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
3476 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
3477 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
3478 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
4f433fef RD |
3479 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
3480 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
54f9ee45 RD |
3481 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
3482 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
3483 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
3484 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
3485 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
3486 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
3487 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
3488 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
3489 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
3490 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
3491 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
3492 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
3493 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
3494 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
54f9ee45 RD |
3495 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE |
3496 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
3497 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
3498 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
3499 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
3500 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
3501 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
3502 | wxEVT_PAINT = _core_.wxEVT_PAINT | |
3503 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
3504 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
3505 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
3506 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
3507 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
3508 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
3509 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
3510 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
3511 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
3512 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
3513 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
3514 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
3515 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
3516 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
3517 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
3518 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
3519 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
3520 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
3521 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
3522 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
3523 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
88c6b281 | 3524 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE |
2131d850 RD |
3525 | wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY |
3526 | wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT | |
3527 | wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE | |
54f9ee45 RD |
3528 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
3529 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
3530 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
3531 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
3532 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
3533 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
3534 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d14a1e28 RD |
3535 | # |
3536 | # Create some event binders | |
3537 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
3538 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
3539 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
3540 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
3541 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
3542 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
3543 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3544 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
3545 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
3546 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
3547 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
3548 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
3549 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
704eda0c | 3550 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) |
d14a1e28 RD |
3551 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) |
3552 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
3553 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
3554 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
3555 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
3556 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
3557 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
3558 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
3559 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
3560 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
704eda0c | 3561 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d14a1e28 RD |
3562 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
3563 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
3564 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
3565 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
3566 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
3567 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
3568 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
3569 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
3570 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
3571 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
3572 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
3573 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
3574 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
3575 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
3576 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
3577 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
3578 | ||
3579 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
3580 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
3581 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
3582 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
3583 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
3584 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
3585 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
3586 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
3587 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
3588 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
3589 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
3590 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
3591 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
3592 | ||
3593 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
3594 | wxEVT_LEFT_UP, | |
3595 | wxEVT_MIDDLE_DOWN, | |
3596 | wxEVT_MIDDLE_UP, | |
3597 | wxEVT_RIGHT_DOWN, | |
3598 | wxEVT_RIGHT_UP, | |
3599 | wxEVT_MOTION, | |
3600 | wxEVT_LEFT_DCLICK, | |
3601 | wxEVT_MIDDLE_DCLICK, | |
3602 | wxEVT_RIGHT_DCLICK, | |
3603 | wxEVT_ENTER_WINDOW, | |
3604 | wxEVT_LEAVE_WINDOW, | |
3605 | wxEVT_MOUSEWHEEL | |
3606 | ]) | |
3607 | ||
3608 | ||
3609 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
704eda0c | 3610 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, |
d14a1e28 RD |
3611 | wxEVT_SCROLLWIN_BOTTOM, |
3612 | wxEVT_SCROLLWIN_LINEUP, | |
3613 | wxEVT_SCROLLWIN_LINEDOWN, | |
704eda0c | 3614 | wxEVT_SCROLLWIN_PAGEUP, |
d14a1e28 RD |
3615 | wxEVT_SCROLLWIN_PAGEDOWN, |
3616 | wxEVT_SCROLLWIN_THUMBTRACK, | |
3617 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
3618 | ]) | |
3619 | ||
3620 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
3621 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
3622 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
3623 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
3624 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
3625 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
3626 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
3627 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
3628 | ||
27fb7603 | 3629 | # Scrolling from wx.Slider and wx.ScrollBar |
704eda0c RD |
3630 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3631 | wxEVT_SCROLL_BOTTOM, | |
3632 | wxEVT_SCROLL_LINEUP, | |
3633 | wxEVT_SCROLL_LINEDOWN, | |
3634 | wxEVT_SCROLL_PAGEUP, | |
3635 | wxEVT_SCROLL_PAGEDOWN, | |
3636 | wxEVT_SCROLL_THUMBTRACK, | |
3637 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 3638 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
3639 | ]) |
3640 | ||
3641 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
3642 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
3643 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
3644 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
3645 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
3646 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
3647 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
3648 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4f433fef RD |
3649 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
3650 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
704eda0c | 3651 | |
27fb7603 | 3652 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
704eda0c RD |
3653 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
3654 | wxEVT_SCROLL_BOTTOM, | |
3655 | wxEVT_SCROLL_LINEUP, | |
3656 | wxEVT_SCROLL_LINEDOWN, | |
3657 | wxEVT_SCROLL_PAGEUP, | |
3658 | wxEVT_SCROLL_PAGEDOWN, | |
3659 | wxEVT_SCROLL_THUMBTRACK, | |
d14a1e28 | 3660 | wxEVT_SCROLL_THUMBRELEASE, |
4f433fef | 3661 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
3662 | ], 1) |
3663 | ||
3664 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
3665 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
3666 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
3667 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
3668 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
3669 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
3670 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
3671 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4f433fef RD |
3672 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
3673 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d14a1e28 | 3674 | |
d14a1e28 RD |
3675 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) |
3676 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
3677 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
3678 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
3679 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
3680 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
3681 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
3682 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
3683 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
3684 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
3685 | ||
3686 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
3687 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
3688 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
3689 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
3690 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
3691 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
3692 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
3693 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
3694 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
3695 | ||
3696 | ||
3697 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
3698 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
3699 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
3700 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
3701 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
3702 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
3703 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
3704 | ||
3705 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
3706 | ||
3707 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
3708 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
3709 | ||
3710 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
3711 | ||
2131d850 RD |
3712 | EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT ) |
3713 | EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY ) | |
3714 | EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE ) | |
d14a1e28 RD |
3715 | |
3716 | ||
3717 | #--------------------------------------------------------------------------- | |
3718 | ||
3719 | class Event(Object): | |
27fb7603 RD |
3720 | """ |
3721 | An event is a structure holding information about an event passed to a | |
3722 | callback or member function. wx.Event is an abstract base class for | |
3723 | other event classes | |
3724 | """ | |
0085ce49 RD |
3725 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3726 | def __init__(self): raise AttributeError, "No constructor defined" | |
3727 | __repr__ = _swig_repr | |
3728 | __swig_destroy__ = _core_.delete_Event | |
3729 | __del__ = lambda self : None; | |
e811c8ce | 3730 | def SetEventType(*args, **kwargs): |
27fb7603 | 3731 | """ |
2131d850 | 3732 | SetEventType(self, EventType typ) |
27fb7603 RD |
3733 | |
3734 | Sets the specific type of the event. | |
3735 | """ | |
54f9ee45 | 3736 | return _core_.Event_SetEventType(*args, **kwargs) |
e811c8ce RD |
3737 | |
3738 | def GetEventType(*args, **kwargs): | |
27fb7603 | 3739 | """ |
2131d850 | 3740 | GetEventType(self) -> EventType |
27fb7603 RD |
3741 | |
3742 | Returns the identifier of the given event type, such as | |
3743 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
3744 | """ | |
54f9ee45 | 3745 | return _core_.Event_GetEventType(*args, **kwargs) |
e811c8ce RD |
3746 | |
3747 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
3748 | """ |
3749 | GetEventObject(self) -> Object | |
3750 | ||
3751 | Returns the object (usually a window) associated with the event, if | |
3752 | any. | |
3753 | """ | |
54f9ee45 | 3754 | return _core_.Event_GetEventObject(*args, **kwargs) |
e811c8ce RD |
3755 | |
3756 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
3757 | """ |
3758 | SetEventObject(self, Object obj) | |
3759 | ||
3760 | Sets the originating object, or in other words, obj is normally the | |
3761 | object that is sending the event. | |
3762 | """ | |
54f9ee45 | 3763 | return _core_.Event_SetEventObject(*args, **kwargs) |
e811c8ce RD |
3764 | |
3765 | def GetTimestamp(*args, **kwargs): | |
a95a7133 | 3766 | """GetTimestamp(self) -> long""" |
54f9ee45 | 3767 | return _core_.Event_GetTimestamp(*args, **kwargs) |
e811c8ce RD |
3768 | |
3769 | def SetTimestamp(*args, **kwargs): | |
a95a7133 | 3770 | """SetTimestamp(self, long ts=0)""" |
54f9ee45 | 3771 | return _core_.Event_SetTimestamp(*args, **kwargs) |
e811c8ce RD |
3772 | |
3773 | def GetId(*args, **kwargs): | |
27fb7603 RD |
3774 | """ |
3775 | GetId(self) -> int | |
3776 | ||
3777 | Returns the identifier associated with this event, such as a button | |
3778 | command id. | |
3779 | """ | |
54f9ee45 | 3780 | return _core_.Event_GetId(*args, **kwargs) |
e811c8ce RD |
3781 | |
3782 | def SetId(*args, **kwargs): | |
27fb7603 RD |
3783 | """ |
3784 | SetId(self, int Id) | |
3785 | ||
3786 | Set's the ID for the event. This is usually the ID of the window that | |
3787 | is sending the event, but it can also be a command id from a menu | |
3788 | item, etc. | |
3789 | """ | |
54f9ee45 | 3790 | return _core_.Event_SetId(*args, **kwargs) |
e811c8ce RD |
3791 | |
3792 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
3793 | """ |
3794 | IsCommandEvent(self) -> bool | |
3795 | ||
3796 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
3797 | it returns false. Note: Exists only for optimization purposes. | |
3798 | """ | |
54f9ee45 | 3799 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
e811c8ce RD |
3800 | |
3801 | def Skip(*args, **kwargs): | |
51b83b37 RD |
3802 | """ |
3803 | Skip(self, bool skip=True) | |
3804 | ||
3805 | Called by an event handler, it controls whether additional event | |
3806 | handlers bound to this event will be called after the current event | |
3807 | handler returns. Skip(false) (the default setting) will prevent | |
3808 | additional event handlers from being called and control will be | |
3809 | returned to the sender of the event immediately after the current | |
3810 | handler has finished. Skip(True) will cause the event processing | |
3811 | system to continue searching for a handler function for this event. | |
3812 | ||
3813 | """ | |
54f9ee45 | 3814 | return _core_.Event_Skip(*args, **kwargs) |
e811c8ce RD |
3815 | |
3816 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
3817 | """ |
3818 | GetSkipped(self) -> bool | |
3819 | ||
3820 | Returns true if the event handler should be skipped, false otherwise. | |
3821 | :see: `Skip` | |
3822 | """ | |
54f9ee45 | 3823 | return _core_.Event_GetSkipped(*args, **kwargs) |
e811c8ce RD |
3824 | |
3825 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
3826 | """ |
3827 | ShouldPropagate(self) -> bool | |
3828 | ||
3829 | Test if this event should be propagated to the parent window or not, | |
3830 | i.e. if the propagation level is currently greater than 0. | |
3831 | """ | |
54f9ee45 | 3832 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
e811c8ce RD |
3833 | |
3834 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
3835 | """ |
3836 | StopPropagation(self) -> int | |
3837 | ||
3838 | Stop the event from propagating to its parent window. Returns the old | |
3839 | propagation level value which may be later passed to | |
3840 | `ResumePropagation` to allow propagating the event again. | |
3841 | """ | |
54f9ee45 | 3842 | return _core_.Event_StopPropagation(*args, **kwargs) |
e811c8ce RD |
3843 | |
3844 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
3845 | """ |
3846 | ResumePropagation(self, int propagationLevel) | |
3847 | ||
3848 | Resume the event propagation by restoring the propagation level. (For | |
3849 | example, you can use the value returned by an earlier call to | |
3850 | `StopPropagation`.) | |
3851 | ||
3852 | """ | |
54f9ee45 | 3853 | return _core_.Event_ResumePropagation(*args, **kwargs) |
e811c8ce RD |
3854 | |
3855 | def Clone(*args, **kwargs): | |
a95a7133 | 3856 | """Clone(self) -> Event""" |
54f9ee45 | 3857 | return _core_.Event_Clone(*args, **kwargs) |
e811c8ce | 3858 | |
2131d850 | 3859 | _core_.Event_swigregister(Event) |
d14a1e28 RD |
3860 | |
3861 | #--------------------------------------------------------------------------- | |
3862 | ||
3863 | class PropagationDisabler(object): | |
27fb7603 RD |
3864 | """ |
3865 | Helper class to temporarily change an event not to propagate. Simply | |
3866 | create an instance of this class and then whe it is destroyed the | |
3867 | propogation of the event will be restored. | |
3868 | """ | |
0085ce49 RD |
3869 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3870 | __repr__ = _swig_repr | |
3871 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3872 | """ |
3873 | __init__(self, Event event) -> PropagationDisabler | |
3874 | ||
3875 | Helper class to temporarily change an event not to propagate. Simply | |
3876 | create an instance of this class and then whe it is destroyed the | |
3877 | propogation of the event will be restored. | |
3878 | """ | |
0085ce49 RD |
3879 | _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs)) |
3880 | __swig_destroy__ = _core_.delete_PropagationDisabler | |
3881 | __del__ = lambda self : None; | |
2131d850 | 3882 | _core_.PropagationDisabler_swigregister(PropagationDisabler) |
d14a1e28 RD |
3883 | |
3884 | class PropagateOnce(object): | |
27fb7603 RD |
3885 | """ |
3886 | A helper class that will temporarily lower propagation level of an | |
3887 | event. Simply create an instance of this class and then whe it is | |
3888 | destroyed the propogation of the event will be restored. | |
3889 | """ | |
0085ce49 RD |
3890 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3891 | __repr__ = _swig_repr | |
3892 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3893 | """ |
3894 | __init__(self, Event event) -> PropagateOnce | |
3895 | ||
3896 | A helper class that will temporarily lower propagation level of an | |
3897 | event. Simply create an instance of this class and then whe it is | |
3898 | destroyed the propogation of the event will be restored. | |
3899 | """ | |
0085ce49 RD |
3900 | _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs)) |
3901 | __swig_destroy__ = _core_.delete_PropagateOnce | |
3902 | __del__ = lambda self : None; | |
2131d850 | 3903 | _core_.PropagateOnce_swigregister(PropagateOnce) |
d14a1e28 RD |
3904 | |
3905 | #--------------------------------------------------------------------------- | |
3906 | ||
3907 | class CommandEvent(Event): | |
27fb7603 RD |
3908 | """ |
3909 | This event class contains information about command events, which | |
3910 | originate from a variety of simple controls, as well as menus and | |
3911 | toolbars. | |
3912 | """ | |
0085ce49 RD |
3913 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3914 | __repr__ = _swig_repr | |
3915 | def __init__(self, *args, **kwargs): | |
27fb7603 | 3916 | """ |
2131d850 | 3917 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent |
27fb7603 RD |
3918 | |
3919 | This event class contains information about command events, which | |
3920 | originate from a variety of simple controls, as well as menus and | |
3921 | toolbars. | |
3922 | """ | |
0085ce49 | 3923 | _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs)) |
e811c8ce | 3924 | def GetSelection(*args, **kwargs): |
27fb7603 RD |
3925 | """ |
3926 | GetSelection(self) -> int | |
3927 | ||
3928 | Returns item index for a listbox or choice selection event (not valid | |
3929 | for a deselection). | |
3930 | """ | |
54f9ee45 | 3931 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
e811c8ce RD |
3932 | |
3933 | def SetString(*args, **kwargs): | |
a95a7133 | 3934 | """SetString(self, String s)""" |
54f9ee45 | 3935 | return _core_.CommandEvent_SetString(*args, **kwargs) |
e811c8ce RD |
3936 | |
3937 | def GetString(*args, **kwargs): | |
27fb7603 RD |
3938 | """ |
3939 | GetString(self) -> String | |
3940 | ||
3941 | Returns item string for a listbox or choice selection event (not valid | |
3942 | for a deselection). | |
3943 | """ | |
54f9ee45 | 3944 | return _core_.CommandEvent_GetString(*args, **kwargs) |
e811c8ce RD |
3945 | |
3946 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
3947 | """ |
3948 | IsChecked(self) -> bool | |
3949 | ||
3950 | This method can be used with checkbox and menu events: for the | |
3951 | checkboxes, the method returns true for a selection event and false | |
3952 | for a deselection one. For the menu events, this method indicates if | |
3953 | the menu item just has become checked or unchecked (and thus only | |
3954 | makes sense for checkable menu items). | |
3955 | """ | |
54f9ee45 | 3956 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
e811c8ce | 3957 | |
242b7b46 | 3958 | Checked = IsChecked |
e811c8ce | 3959 | def IsSelection(*args, **kwargs): |
27fb7603 RD |
3960 | """ |
3961 | IsSelection(self) -> bool | |
3962 | ||
3963 | For a listbox or similar event, returns true if it is a selection, | |
3964 | false if it is a deselection. | |
3965 | """ | |
54f9ee45 | 3966 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
e811c8ce RD |
3967 | |
3968 | def SetExtraLong(*args, **kwargs): | |
a95a7133 | 3969 | """SetExtraLong(self, long extraLong)""" |
54f9ee45 | 3970 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
e811c8ce RD |
3971 | |
3972 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
3973 | """ |
3974 | GetExtraLong(self) -> long | |
3975 | ||
5ba5649b RD |
3976 | Returns extra information dependant on the event objects type. If the |
3977 | event comes from a listbox selection, it is a boolean determining | |
3978 | whether the event was a selection (true) or a deselection (false). A | |
3979 | listbox deselection only occurs for multiple-selection boxes, and in | |
3980 | this case the index and string values are indeterminate and the | |
3981 | listbox must be examined by the application. | |
27fb7603 | 3982 | """ |
54f9ee45 | 3983 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
e811c8ce RD |
3984 | |
3985 | def SetInt(*args, **kwargs): | |
a95a7133 | 3986 | """SetInt(self, int i)""" |
54f9ee45 | 3987 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
e811c8ce RD |
3988 | |
3989 | def GetInt(*args, **kwargs): | |
27fb7603 | 3990 | """ |
01f6b6d3 | 3991 | GetInt(self) -> int |
27fb7603 | 3992 | |
5ba5649b RD |
3993 | Returns the integer identifier corresponding to a listbox, choice or |
3994 | radiobox selection (only if the event was a selection, not a | |
3995 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 3996 | """ |
54f9ee45 | 3997 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
e811c8ce | 3998 | |
0085ce49 RD |
3999 | def GetClientData(*args, **kwargs): |
4000 | """ | |
4001 | GetClientData(self) -> PyObject | |
4002 | ||
4003 | Returns the client data object for a listbox or choice selection event, (if any.) | |
4004 | """ | |
4005 | return _core_.CommandEvent_GetClientData(*args, **kwargs) | |
4006 | ||
4007 | def SetClientData(*args, **kwargs): | |
4008 | """ | |
4009 | SetClientData(self, PyObject clientData) | |
4010 | ||
4011 | Associate the given client data with the item at position n. | |
4012 | """ | |
4013 | return _core_.CommandEvent_SetClientData(*args, **kwargs) | |
4014 | ||
4015 | GetClientObject = GetClientData | |
4016 | SetClientObject = SetClientData | |
4017 | ||
e811c8ce | 4018 | def Clone(*args, **kwargs): |
a95a7133 | 4019 | """Clone(self) -> Event""" |
54f9ee45 | 4020 | return _core_.CommandEvent_Clone(*args, **kwargs) |
e811c8ce | 4021 | |
2131d850 | 4022 | _core_.CommandEvent_swigregister(CommandEvent) |
d14a1e28 RD |
4023 | |
4024 | #--------------------------------------------------------------------------- | |
4025 | ||
4026 | class NotifyEvent(CommandEvent): | |
27fb7603 RD |
4027 | """ |
4028 | An instance of this class (or one of its derived classes) is sent from | |
4029 | a control when the control's state is being changed and the control | |
4030 | allows that change to be prevented from happening. The event handler | |
4031 | can call `Veto` or `Allow` to tell the control what to do. | |
4032 | """ | |
0085ce49 RD |
4033 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4034 | __repr__ = _swig_repr | |
4035 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4036 | """ |
2131d850 | 4037 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent |
27fb7603 RD |
4038 | |
4039 | An instance of this class (or one of its derived classes) is sent from | |
4040 | a control when the control's state is being changed and the control | |
4041 | allows that change to be prevented from happening. The event handler | |
4042 | can call `Veto` or `Allow` to tell the control what to do. | |
4043 | """ | |
0085ce49 | 4044 | _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs)) |
e811c8ce | 4045 | def Veto(*args, **kwargs): |
27fb7603 RD |
4046 | """ |
4047 | Veto(self) | |
4048 | ||
4049 | Prevents the change announced by this event from happening. | |
4050 | ||
4051 | It is in general a good idea to notify the user about the reasons for | |
4052 | vetoing the change because otherwise the applications behaviour (which | |
4053 | just refuses to do what the user wants) might be quite surprising. | |
4054 | """ | |
54f9ee45 | 4055 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
e811c8ce RD |
4056 | |
4057 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4058 | """ |
4059 | Allow(self) | |
4060 | ||
4061 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4062 | processed. For most events it is not necessary to call this method as | |
4063 | the events are allowed anyhow but some are forbidden by default (this | |
4064 | will be mentioned in the corresponding event description). | |
4065 | """ | |
54f9ee45 | 4066 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
e811c8ce RD |
4067 | |
4068 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4069 | """ |
4070 | IsAllowed(self) -> bool | |
4071 | ||
4072 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4073 | false otherwise (if it was). | |
4074 | """ | |
54f9ee45 | 4075 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
e811c8ce | 4076 | |
2131d850 | 4077 | _core_.NotifyEvent_swigregister(NotifyEvent) |
d14a1e28 RD |
4078 | |
4079 | #--------------------------------------------------------------------------- | |
4080 | ||
4081 | class ScrollEvent(CommandEvent): | |
27fb7603 RD |
4082 | """ |
4083 | A scroll event holds information about events sent from stand-alone | |
4084 | scrollbars and sliders. Note that scrolled windows do not send | |
4085 | instnaces of this event class, but send the `wx.ScrollWinEvent` | |
4086 | instead. | |
4087 | """ | |
0085ce49 RD |
4088 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4089 | __repr__ = _swig_repr | |
4090 | def __init__(self, *args, **kwargs): | |
0df68c9f | 4091 | """ |
2131d850 | 4092 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0, |
0df68c9f RD |
4093 | int orient=0) -> ScrollEvent |
4094 | """ | |
0085ce49 | 4095 | _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs)) |
e811c8ce | 4096 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4097 | """ |
4098 | GetOrientation(self) -> int | |
4099 | ||
4100 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4101 | the scrollbar. | |
4102 | """ | |
54f9ee45 | 4103 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4104 | |
4105 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4106 | """ |
4107 | GetPosition(self) -> int | |
4108 | ||
4109 | Returns the position of the scrollbar. | |
4110 | """ | |
54f9ee45 | 4111 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4112 | |
4113 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4114 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4115 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4116 | |
4117 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4118 | """SetPosition(self, int pos)""" |
54f9ee45 | 4119 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4120 | |
2131d850 | 4121 | _core_.ScrollEvent_swigregister(ScrollEvent) |
d14a1e28 RD |
4122 | |
4123 | #--------------------------------------------------------------------------- | |
4124 | ||
4125 | class ScrollWinEvent(Event): | |
27fb7603 RD |
4126 | """ |
4127 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4128 | scrolling windows. | |
4129 | """ | |
0085ce49 RD |
4130 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4131 | __repr__ = _swig_repr | |
4132 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4133 | """ |
2131d850 | 4134 | __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent |
27fb7603 RD |
4135 | |
4136 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4137 | scrolling windows. | |
4138 | """ | |
0085ce49 | 4139 | _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs)) |
e811c8ce | 4140 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4141 | """ |
4142 | GetOrientation(self) -> int | |
4143 | ||
4144 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4145 | the scrollbar. | |
4146 | """ | |
54f9ee45 | 4147 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4148 | |
4149 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4150 | """ |
4151 | GetPosition(self) -> int | |
4152 | ||
4153 | Returns the position of the scrollbar for the thumb track and release | |
4154 | events. Note that this field can't be used for the other events, you | |
4155 | need to query the window itself for the current position in that case. | |
4156 | """ | |
54f9ee45 | 4157 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4158 | |
4159 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4160 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4161 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4162 | |
4163 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4164 | """SetPosition(self, int pos)""" |
54f9ee45 | 4165 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4166 | |
2131d850 | 4167 | _core_.ScrollWinEvent_swigregister(ScrollWinEvent) |
d14a1e28 RD |
4168 | |
4169 | #--------------------------------------------------------------------------- | |
4170 | ||
54f9ee45 RD |
4171 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4172 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4173 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4174 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4175 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
d14a1e28 | 4176 | class MouseEvent(Event): |
27fb7603 RD |
4177 | """ |
4178 | This event class contains information about the events generated by | |
4179 | the mouse: they include mouse buttons press and release events and | |
4180 | mouse move events. | |
4181 | ||
4182 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4183 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4184 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4185 | a middle button so a portable application should avoid relying on the | |
4186 | events from it. | |
4187 | ||
4188 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4189 | the former returns true when the event corresponds to the left mouse | |
4190 | button click while the latter returns true if the left mouse button is | |
4191 | currently being pressed. For example, when the user is dragging the | |
4192 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4193 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4194 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4195 | underlying GUI behaviour is (which is platform-dependent). The same | |
4196 | applies, of course, to other mouse buttons as well. | |
4197 | """ | |
0085ce49 RD |
4198 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4199 | __repr__ = _swig_repr | |
4200 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4201 | """ |
2131d850 | 4202 | __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent |
27fb7603 RD |
4203 | |
4204 | Constructs a wx.MouseEvent. Valid event types are: | |
4205 | ||
4206 | * wxEVT_ENTER_WINDOW | |
4207 | * wxEVT_LEAVE_WINDOW | |
4208 | * wxEVT_LEFT_DOWN | |
4209 | * wxEVT_LEFT_UP | |
4210 | * wxEVT_LEFT_DCLICK | |
4211 | * wxEVT_MIDDLE_DOWN | |
4212 | * wxEVT_MIDDLE_UP | |
4213 | * wxEVT_MIDDLE_DCLICK | |
4214 | * wxEVT_RIGHT_DOWN | |
4215 | * wxEVT_RIGHT_UP | |
4216 | * wxEVT_RIGHT_DCLICK | |
4217 | * wxEVT_MOTION | |
4218 | * wxEVT_MOUSEWHEEL | |
4219 | """ | |
0085ce49 | 4220 | _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs)) |
e811c8ce | 4221 | def IsButton(*args, **kwargs): |
27fb7603 RD |
4222 | """ |
4223 | IsButton(self) -> bool | |
4224 | ||
4225 | Returns true if the event was a mouse button event (not necessarily a | |
4226 | button down event - that may be tested using `ButtonDown`). | |
4227 | """ | |
54f9ee45 | 4228 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
e811c8ce RD |
4229 | |
4230 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4231 | """ |
4232 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4233 | ||
5ba5649b RD |
4234 | If the argument is omitted, this returns true if the event was any |
4235 | mouse button down event. Otherwise the argument specifies which | |
4236 | button-down event shold be checked for (see `Button` for the possible | |
4237 | values). | |
27fb7603 | 4238 | """ |
54f9ee45 | 4239 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
e811c8ce RD |
4240 | |
4241 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4242 | """ |
4243 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4244 | ||
4245 | If the argument is omitted, this returns true if the event was any | |
4246 | mouse double click event. Otherwise the argument specifies which | |
4247 | double click event to check for (see `Button` for the possible | |
4248 | values). | |
4249 | """ | |
54f9ee45 | 4250 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
e811c8ce RD |
4251 | |
4252 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4253 | """ |
4254 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4255 | ||
4256 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4257 | mouse button up event. Otherwise the argument specifies which button |
4258 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4259 | """ |
54f9ee45 | 4260 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
e811c8ce RD |
4261 | |
4262 | def Button(*args, **kwargs): | |
27fb7603 RD |
4263 | """ |
4264 | Button(self, int button) -> bool | |
4265 | ||
4266 | Returns true if the identified mouse button is changing state. Valid | |
4267 | values of button are: | |
4268 | ||
4269 | ==================== ===================================== | |
4270 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4271 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4272 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4273 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4274 | ==================== ===================================== | |
4275 | ||
4276 | """ | |
54f9ee45 | 4277 | return _core_.MouseEvent_Button(*args, **kwargs) |
e811c8ce RD |
4278 | |
4279 | def ButtonIsDown(*args, **kwargs): | |
a95a7133 | 4280 | """ButtonIsDown(self, int but) -> bool""" |
54f9ee45 | 4281 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
e811c8ce RD |
4282 | |
4283 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4284 | """ |
4285 | GetButton(self) -> int | |
4286 | ||
4287 | Returns the mouse button which generated this event or | |
4288 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4289 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4290 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4291 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4292 | right buttons respectively. | |
4293 | """ | |
54f9ee45 | 4294 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
e811c8ce RD |
4295 | |
4296 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4297 | """ |
4298 | ControlDown(self) -> bool | |
4299 | ||
4300 | Returns true if the control key was down at the time of the event. | |
4301 | """ | |
54f9ee45 | 4302 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4303 | |
4304 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4305 | """ |
4306 | MetaDown(self) -> bool | |
4307 | ||
4308 | Returns true if the Meta key was down at the time of the event. | |
4309 | """ | |
54f9ee45 | 4310 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4311 | |
4312 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4313 | """ |
4314 | AltDown(self) -> bool | |
4315 | ||
4316 | Returns true if the Alt key was down at the time of the event. | |
4317 | """ | |
54f9ee45 | 4318 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4319 | |
4320 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4321 | """ |
4322 | ShiftDown(self) -> bool | |
4323 | ||
4324 | Returns true if the Shift key was down at the time of the event. | |
4325 | """ | |
54f9ee45 | 4326 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4327 | |
412d302d RD |
4328 | def CmdDown(*args, **kwargs): |
4329 | """ | |
4330 | CmdDown(self) -> bool | |
4331 | ||
4332 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4333 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4334 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4335 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4336 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4337 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4338 | and Macs this is the same as `MetaDown`. | |
4339 | """ | |
4340 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4341 | ||
e811c8ce | 4342 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4343 | """ |
4344 | LeftDown(self) -> bool | |
4345 | ||
4346 | Returns true if the left mouse button state changed to down. | |
4347 | """ | |
54f9ee45 | 4348 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
e811c8ce RD |
4349 | |
4350 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4351 | """ |
4352 | MiddleDown(self) -> bool | |
4353 | ||
4354 | Returns true if the middle mouse button state changed to down. | |
4355 | """ | |
54f9ee45 | 4356 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
e811c8ce RD |
4357 | |
4358 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4359 | """ |
4360 | RightDown(self) -> bool | |
4361 | ||
4362 | Returns true if the right mouse button state changed to down. | |
4363 | """ | |
54f9ee45 | 4364 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
e811c8ce RD |
4365 | |
4366 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4367 | """ |
4368 | LeftUp(self) -> bool | |
4369 | ||
4370 | Returns true if the left mouse button state changed to up. | |
4371 | """ | |
54f9ee45 | 4372 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
e811c8ce RD |
4373 | |
4374 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4375 | """ |
4376 | MiddleUp(self) -> bool | |
4377 | ||
4378 | Returns true if the middle mouse button state changed to up. | |
4379 | """ | |
54f9ee45 | 4380 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
e811c8ce RD |
4381 | |
4382 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4383 | """ |
4384 | RightUp(self) -> bool | |
4385 | ||
4386 | Returns true if the right mouse button state changed to up. | |
4387 | """ | |
54f9ee45 | 4388 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
e811c8ce RD |
4389 | |
4390 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4391 | """ |
4392 | LeftDClick(self) -> bool | |
4393 | ||
4394 | Returns true if the event was a left button double click. | |
4395 | """ | |
54f9ee45 | 4396 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
e811c8ce RD |
4397 | |
4398 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4399 | """ |
4400 | MiddleDClick(self) -> bool | |
4401 | ||
4402 | Returns true if the event was a middle button double click. | |
4403 | """ | |
54f9ee45 | 4404 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
e811c8ce RD |
4405 | |
4406 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4407 | """ |
4408 | RightDClick(self) -> bool | |
4409 | ||
4410 | Returns true if the event was a right button double click. | |
4411 | """ | |
54f9ee45 | 4412 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
e811c8ce RD |
4413 | |
4414 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4415 | """ |
4416 | LeftIsDown(self) -> bool | |
4417 | ||
4418 | Returns true if the left mouse button is currently down, independent | |
4419 | of the current event type. | |
4420 | ||
4421 | Please notice that it is not the same as LeftDown which returns true | |
4422 | if the left mouse button was just pressed. Rather, it describes the | |
4423 | state of the mouse button before the event happened. | |
4424 | ||
4425 | This event is usually used in the mouse event handlers which process | |
4426 | "move mouse" messages to determine whether the user is (still) | |
4427 | dragging the mouse. | |
4428 | """ | |
54f9ee45 | 4429 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
e811c8ce RD |
4430 | |
4431 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
4432 | """ |
4433 | MiddleIsDown(self) -> bool | |
4434 | ||
4435 | Returns true if the middle mouse button is currently down, independent | |
4436 | of the current event type. | |
4437 | """ | |
54f9ee45 | 4438 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
e811c8ce RD |
4439 | |
4440 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
4441 | """ |
4442 | RightIsDown(self) -> bool | |
4443 | ||
4444 | Returns true if the right mouse button is currently down, independent | |
4445 | of the current event type. | |
4446 | """ | |
54f9ee45 | 4447 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
e811c8ce RD |
4448 | |
4449 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
4450 | """ |
4451 | Dragging(self) -> bool | |
4452 | ||
4453 | Returns true if this was a dragging event (motion while a button is | |
4454 | depressed). | |
4455 | """ | |
54f9ee45 | 4456 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
e811c8ce RD |
4457 | |
4458 | def Moving(*args, **kwargs): | |
27fb7603 RD |
4459 | """ |
4460 | Moving(self) -> bool | |
4461 | ||
4462 | Returns true if this was a motion event and no mouse buttons were | |
4463 | pressed. If any mouse button is held pressed, then this method returns | |
4464 | false and Dragging returns true. | |
4465 | """ | |
54f9ee45 | 4466 | return _core_.MouseEvent_Moving(*args, **kwargs) |
e811c8ce RD |
4467 | |
4468 | def Entering(*args, **kwargs): | |
27fb7603 RD |
4469 | """ |
4470 | Entering(self) -> bool | |
4471 | ||
4472 | Returns true if the mouse was entering the window. | |
4473 | """ | |
54f9ee45 | 4474 | return _core_.MouseEvent_Entering(*args, **kwargs) |
e811c8ce RD |
4475 | |
4476 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
4477 | """ |
4478 | Leaving(self) -> bool | |
4479 | ||
4480 | Returns true if the mouse was leaving the window. | |
4481 | """ | |
54f9ee45 | 4482 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
e811c8ce RD |
4483 | |
4484 | def GetPosition(*args, **kwargs): | |
0df68c9f | 4485 | """ |
a95a7133 | 4486 | GetPosition(self) -> Point |
e811c8ce | 4487 | |
27fb7603 RD |
4488 | Returns the pixel position of the mouse in window coordinates when the |
4489 | event happened. | |
0df68c9f | 4490 | """ |
54f9ee45 | 4491 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4492 | |
4493 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
4494 | """ |
4495 | GetPositionTuple() -> (x,y) | |
e811c8ce | 4496 | |
27fb7603 RD |
4497 | Returns the pixel position of the mouse in window coordinates when the |
4498 | event happened. | |
0df68c9f | 4499 | """ |
54f9ee45 | 4500 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
4501 | |
4502 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
4503 | """ |
4504 | GetLogicalPosition(self, DC dc) -> Point | |
4505 | ||
4506 | Returns the logical mouse position in pixels (i.e. translated | |
4507 | according to the translation set for the DC, which usually indicates | |
4508 | that the window has been scrolled). | |
4509 | """ | |
54f9ee45 | 4510 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
e811c8ce RD |
4511 | |
4512 | def GetX(*args, **kwargs): | |
27fb7603 RD |
4513 | """ |
4514 | GetX(self) -> int | |
4515 | ||
4516 | Returns X coordinate of the physical mouse event position. | |
4517 | """ | |
54f9ee45 | 4518 | return _core_.MouseEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4519 | |
4520 | def GetY(*args, **kwargs): | |
27fb7603 RD |
4521 | """ |
4522 | GetY(self) -> int | |
4523 | ||
4524 | Returns Y coordinate of the physical mouse event position. | |
4525 | """ | |
54f9ee45 | 4526 | return _core_.MouseEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4527 | |
4528 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
4529 | """ |
4530 | GetWheelRotation(self) -> int | |
4531 | ||
4532 | Get wheel rotation, positive or negative indicates direction of | |
4533 | rotation. Current devices all send an event when rotation is equal to | |
4534 | +/-WheelDelta, but this allows for finer resolution devices to be | |
4535 | created in the future. Because of this you shouldn't assume that one | |
4536 | event is equal to 1 line or whatever, but you should be able to either | |
4537 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
4538 | have been accumulated before scrolling. | |
4539 | """ | |
54f9ee45 | 4540 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
e811c8ce RD |
4541 | |
4542 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
4543 | """ |
4544 | GetWheelDelta(self) -> int | |
4545 | ||
4546 | Get wheel delta, normally 120. This is the threshold for action to be | |
4547 | taken, and one such action (for example, scrolling one increment) | |
4548 | should occur for each delta. | |
4549 | """ | |
54f9ee45 | 4550 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
e811c8ce RD |
4551 | |
4552 | def GetLinesPerAction(*args, **kwargs): | |
27fb7603 RD |
4553 | """ |
4554 | GetLinesPerAction(self) -> int | |
4555 | ||
4556 | Returns the configured number of lines (or whatever) to be scrolled | |
4557 | per wheel action. Defaults to three. | |
4558 | """ | |
54f9ee45 | 4559 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
e811c8ce RD |
4560 | |
4561 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
4562 | """ |
4563 | IsPageScroll(self) -> bool | |
4564 | ||
4565 | Returns true if the system has been setup to do page scrolling with | |
4566 | the mouse wheel instead of line scrolling. | |
4567 | """ | |
54f9ee45 RD |
4568 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
4569 | ||
4570 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
4571 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
4572 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
4573 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
4574 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
4575 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
4576 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
4577 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
4578 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
4579 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
4580 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
4581 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
2131d850 | 4582 | _core_.MouseEvent_swigregister(MouseEvent) |
d14a1e28 RD |
4583 | |
4584 | #--------------------------------------------------------------------------- | |
4585 | ||
4586 | class SetCursorEvent(Event): | |
5ba5649b RD |
4587 | """ |
4588 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
4589 | as a result of mouse motion. This event gives the application the | |
4590 | chance to perform specific mouse cursor processing based on the | |
4591 | current position of the mouse within the window. Use the `SetCursor` | |
4592 | method to specify the cursor you want to be displayed. | |
4593 | """ | |
0085ce49 RD |
4594 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4595 | __repr__ = _swig_repr | |
4596 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4597 | """ |
4598 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
4599 | ||
4600 | Construct a new `wx.SetCursorEvent`. | |
4601 | """ | |
0085ce49 | 4602 | _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs)) |
e811c8ce | 4603 | def GetX(*args, **kwargs): |
5ba5649b RD |
4604 | """ |
4605 | GetX(self) -> int | |
4606 | ||
4607 | Returns the X coordinate of the mouse in client coordinates. | |
4608 | """ | |
54f9ee45 | 4609 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4610 | |
4611 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4612 | """ |
4613 | GetY(self) -> int | |
4614 | ||
4615 | Returns the Y coordinate of the mouse in client coordinates. | |
4616 | """ | |
54f9ee45 | 4617 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
e811c8ce RD |
4618 | |
4619 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
4620 | """ |
4621 | SetCursor(self, Cursor cursor) | |
4622 | ||
4623 | Sets the cursor associated with this event. | |
4624 | """ | |
54f9ee45 | 4625 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
e811c8ce RD |
4626 | |
4627 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
4628 | """ |
4629 | GetCursor(self) -> Cursor | |
4630 | ||
4631 | Returns a reference to the cursor specified by this event. | |
4632 | """ | |
54f9ee45 | 4633 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
e811c8ce RD |
4634 | |
4635 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
4636 | """ |
4637 | HasCursor(self) -> bool | |
4638 | ||
4639 | Returns true if the cursor specified by this event is a valid cursor. | |
4640 | """ | |
54f9ee45 | 4641 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
e811c8ce | 4642 | |
2131d850 | 4643 | _core_.SetCursorEvent_swigregister(SetCursorEvent) |
d14a1e28 RD |
4644 | |
4645 | #--------------------------------------------------------------------------- | |
4646 | ||
4647 | class KeyEvent(Event): | |
5ba5649b RD |
4648 | """ |
4649 | This event class contains information about keypress and character | |
4650 | events. These events are only sent to the widget that currently has | |
4651 | the keyboard focus. | |
4652 | ||
4653 | Notice that there are three different kinds of keyboard events in | |
4654 | wxWidgets: key down and up events and char events. The difference | |
4655 | between the first two is clear - the first corresponds to a key press | |
4656 | and the second to a key release - otherwise they are identical. Just | |
4657 | note that if the key is maintained in a pressed state you will | |
4658 | typically get a lot of (automatically generated) down events but only | |
4659 | one up so it is wrong to assume that there is one up event | |
4660 | corresponding to each down one. | |
4661 | ||
4662 | Both key events provide untranslated key codes while the char event | |
4663 | carries the translated one. The untranslated code for alphanumeric | |
4664 | keys is always an upper case value. For the other keys it is one of | |
4665 | WXK_XXX values from the keycodes table. The translated key is, in | |
4666 | general, the character the user expects to appear as the result of the | |
4667 | key combination when typing the text into a text entry zone, for | |
4668 | example. | |
4669 | ||
4670 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
4671 | and the standard US keyboard): when the 'A' key is pressed, the key | |
4672 | down event key code is equal to ASCII A == 65. But the char event key | |
4673 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
4674 | 'A' keys simultaneously , the key code in key down event will still be | |
4675 | just 'A' while the char event key code parameter will now be 'A' as | |
4676 | well. | |
4677 | ||
4678 | Although in this simple case it is clear that the correct key code | |
4679 | could be found in the key down event handler by checking the value | |
4680 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
4681 | as for non alphanumeric keys or non-US keyboard layouts the | |
4682 | translation is keyboard-layout dependent and can only be done properly | |
4683 | by the system itself. | |
4684 | ||
4685 | Another kind of translation is done when the control key is pressed: | |
4686 | for example, for CTRL-A key press the key down event still carries the | |
4687 | same key code 'A' as usual but the char event will have key code of 1, | |
4688 | the ASCII value of this key combination. | |
4689 | ||
4690 | You may discover how the other keys on your system behave | |
4691 | interactively by running the KeyEvents sample in the wxPython demo and | |
4692 | pressing some keys while the blue box at the top has the keyboard | |
4693 | focus. | |
4694 | ||
4695 | **Note**: If a key down event is caught and the event handler does not | |
4696 | call event.Skip() then the coresponding char event will not | |
4697 | happen. This is by design and enables the programs that handle both | |
4698 | types of events to be a bit simpler. | |
4699 | ||
4700 | **Note for Windows programmers**: The key and char events in wxWidgets | |
4701 | are similar to but slightly different from Windows WM_KEYDOWN and | |
4702 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
4703 | event in wxWidgets (unless it is used as an accelerator). | |
4704 | ||
4705 | **Tip**: be sure to call event.Skip() for events that you don't | |
4706 | process in key event function, otherwise menu shortcuts may cease to | |
4707 | work under Windows. | |
4708 | ||
4709 | """ | |
0085ce49 RD |
4710 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4711 | __repr__ = _swig_repr | |
4712 | def __init__(self, *args, **kwargs): | |
5ba5649b | 4713 | """ |
2131d850 | 4714 | __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent |
5ba5649b RD |
4715 | |
4716 | Construct a new `wx.KeyEvent`. Valid event types are: | |
4717 | * | |
4718 | """ | |
0085ce49 | 4719 | _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs)) |
b1fcee84 RD |
4720 | def GetModifiers(*args, **kwargs): |
4721 | """ | |
4722 | GetModifiers(self) -> int | |
4723 | ||
4724 | Returns a bitmask of the current modifier settings. Can be used to | |
4725 | check if the key event has exactly the given modifiers without having | |
4726 | to explicitly check that the other modifiers are not down. For | |
4727 | example:: | |
4728 | ||
4729 | if event.GetModifers() == wx.MOD_CONTROL: | |
4730 | DoSomething() | |
4731 | ||
4732 | """ | |
4733 | return _core_.KeyEvent_GetModifiers(*args, **kwargs) | |
4734 | ||
e811c8ce | 4735 | def ControlDown(*args, **kwargs): |
5ba5649b RD |
4736 | """ |
4737 | ControlDown(self) -> bool | |
4738 | ||
4739 | Returns ``True`` if the Control key was down at the time of the event. | |
4740 | """ | |
54f9ee45 | 4741 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4742 | |
4743 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
4744 | """ |
4745 | MetaDown(self) -> bool | |
4746 | ||
4747 | Returns ``True`` if the Meta key was down at the time of the event. | |
4748 | """ | |
54f9ee45 | 4749 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4750 | |
4751 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
4752 | """ |
4753 | AltDown(self) -> bool | |
4754 | ||
4755 | Returns ``True`` if the Alt key was down at the time of the event. | |
4756 | """ | |
54f9ee45 | 4757 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4758 | |
4759 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
4760 | """ |
4761 | ShiftDown(self) -> bool | |
4762 | ||
4763 | Returns ``True`` if the Shift key was down at the time of the event. | |
4764 | """ | |
54f9ee45 | 4765 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4766 | |
412d302d RD |
4767 | def CmdDown(*args, **kwargs): |
4768 | """ | |
4769 | CmdDown(self) -> bool | |
4770 | ||
4771 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4772 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4773 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
4774 | because Cmd key is used for the same thing under Mac as Ctrl |
4775 | elsewhere. The Ctrl still exists, it's just not used for this | |
4776 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
4777 | and Macs this is the same as `MetaDown`. | |
4778 | """ | |
4779 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
4780 | ||
e811c8ce | 4781 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
4782 | """ |
4783 | HasModifiers(self) -> bool | |
4784 | ||
4785 | Returns true if either CTRL or ALT keys was down at the time of the | |
4786 | key event. Note that this function does not take into account neither | |
4787 | SHIFT nor META key states (the reason for ignoring the latter is that | |
4788 | it is common for NUMLOCK key to be configured as META under X but the | |
4789 | key presses even while NUMLOCK is on should be still processed | |
4790 | normally). | |
4791 | """ | |
54f9ee45 | 4792 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
e811c8ce RD |
4793 | |
4794 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
4795 | """ |
4796 | GetKeyCode(self) -> int | |
4797 | ||
4798 | Returns the virtual key code. ASCII events return normal ASCII values, | |
4799 | while non-ASCII events return values such as WXK_LEFT for the left | |
4800 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
4801 | codes. | |
4802 | ||
4803 | Note that in Unicode build, the returned value is meaningful only if | |
4804 | the user entered a character that can be represented in current | |
4805 | locale's default charset. You can obtain the corresponding Unicode | |
4806 | character using `GetUnicodeKey`. | |
4807 | """ | |
54f9ee45 | 4808 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
e811c8ce | 4809 | |
d14a1e28 | 4810 | KeyCode = GetKeyCode |
19272049 | 4811 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
4812 | """ |
4813 | GetUnicodeKey(self) -> int | |
4814 | ||
4815 | Returns the Unicode character corresponding to this key event. This | |
4816 | function is only meaningfule in a Unicode build of wxPython. | |
4817 | """ | |
19272049 | 4818 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
e811c8ce | 4819 | |
19272049 | 4820 | GetUniChar = GetUnicodeKey |
e811c8ce | 4821 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
4822 | """ |
4823 | GetRawKeyCode(self) -> unsigned int | |
4824 | ||
4825 | Returns the raw key code for this event. This is a platform-dependent | |
4826 | scan code which should only be used in advanced | |
4827 | applications. Currently the raw key codes are not supported by all | |
4828 | ports. | |
4829 | """ | |
54f9ee45 | 4830 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
e811c8ce RD |
4831 | |
4832 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
4833 | """ |
4834 | GetRawKeyFlags(self) -> unsigned int | |
4835 | ||
4836 | Returns the low level key flags for this event. The flags are | |
4837 | platform-dependent and should only be used in advanced applications. | |
4838 | Currently the raw key flags are not supported by all ports. | |
4839 | """ | |
54f9ee45 | 4840 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
e811c8ce RD |
4841 | |
4842 | def GetPosition(*args, **kwargs): | |
0df68c9f | 4843 | """ |
a95a7133 | 4844 | GetPosition(self) -> Point |
e811c8ce | 4845 | |
5ba5649b | 4846 | Find the position of the event, if applicable. |
0df68c9f | 4847 | """ |
54f9ee45 | 4848 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4849 | |
4850 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
4851 | """ |
4852 | GetPositionTuple() -> (x,y) | |
e811c8ce | 4853 | |
5ba5649b | 4854 | Find the position of the event, if applicable. |
0df68c9f | 4855 | """ |
54f9ee45 | 4856 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
4857 | |
4858 | def GetX(*args, **kwargs): | |
5ba5649b RD |
4859 | """ |
4860 | GetX(self) -> int | |
4861 | ||
4862 | Returns the X position (in client coordinates) of the event, if | |
4863 | applicable. | |
4864 | """ | |
54f9ee45 | 4865 | return _core_.KeyEvent_GetX(*args, **kwargs) |
e811c8ce RD |
4866 | |
4867 | def GetY(*args, **kwargs): | |
5ba5649b RD |
4868 | """ |
4869 | GetY(self) -> int | |
4870 | ||
4871 | Returns the Y position (in client coordinates) of the event, if | |
4872 | applicable. | |
4873 | """ | |
54f9ee45 RD |
4874 | return _core_.KeyEvent_GetY(*args, **kwargs) |
4875 | ||
4876 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
4877 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
4878 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
4879 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
4880 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
4881 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
4882 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
4883 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
4884 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
4885 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
2131d850 | 4886 | _core_.KeyEvent_swigregister(KeyEvent) |
d14a1e28 RD |
4887 | |
4888 | #--------------------------------------------------------------------------- | |
4889 | ||
4890 | class SizeEvent(Event): | |
5ba5649b RD |
4891 | """ |
4892 | A size event holds information about size change events. The EVT_SIZE | |
4893 | handler function will be called when the window it is bound to has | |
4894 | been resized. | |
4895 | ||
4896 | Note that the size passed is of the whole window: call | |
4897 | `wx.Window.GetClientSize` for the area which may be used by the | |
4898 | application. | |
4899 | ||
4900 | When a window is resized, usually only a small part of the window is | |
4901 | damaged and and that area is all that is in the update region for the | |
4902 | next paint event. However, if your drawing depends on the size of the | |
4903 | window, you may need to clear the DC explicitly and repaint the whole | |
4904 | window. In which case, you may need to call `wx.Window.Refresh` to | |
4905 | invalidate the entire window. | |
4906 | ||
4907 | """ | |
0085ce49 RD |
4908 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4909 | __repr__ = _swig_repr | |
4910 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4911 | """ |
4912 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
4913 | ||
4914 | Construct a new ``wx.SizeEvent``. | |
4915 | """ | |
0085ce49 | 4916 | _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs)) |
e811c8ce | 4917 | def GetSize(*args, **kwargs): |
5ba5649b RD |
4918 | """ |
4919 | GetSize(self) -> Size | |
4920 | ||
4921 | Returns the entire size of the window generating the size change | |
4922 | event. | |
4923 | """ | |
54f9ee45 | 4924 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
e811c8ce RD |
4925 | |
4926 | def GetRect(*args, **kwargs): | |
a95a7133 | 4927 | """GetRect(self) -> Rect""" |
54f9ee45 | 4928 | return _core_.SizeEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
4929 | |
4930 | def SetRect(*args, **kwargs): | |
a95a7133 | 4931 | """SetRect(self, Rect rect)""" |
54f9ee45 | 4932 | return _core_.SizeEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
4933 | |
4934 | def SetSize(*args, **kwargs): | |
a95a7133 | 4935 | """SetSize(self, Size size)""" |
54f9ee45 | 4936 | return _core_.SizeEvent_SetSize(*args, **kwargs) |
e811c8ce | 4937 | |
54f9ee45 RD |
4938 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
4939 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
2131d850 | 4940 | _core_.SizeEvent_swigregister(SizeEvent) |
d14a1e28 RD |
4941 | |
4942 | #--------------------------------------------------------------------------- | |
4943 | ||
4944 | class MoveEvent(Event): | |
5ba5649b RD |
4945 | """ |
4946 | This event object is sent for EVT_MOVE event bindings when a window is | |
4947 | moved to a new position. | |
4948 | """ | |
0085ce49 RD |
4949 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4950 | __repr__ = _swig_repr | |
4951 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
4952 | """ |
4953 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
4954 | ||
4955 | Constructor. | |
4956 | """ | |
0085ce49 | 4957 | _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs)) |
e811c8ce | 4958 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
4959 | """ |
4960 | GetPosition(self) -> Point | |
4961 | ||
4962 | Returns the position of the window generating the move change event. | |
4963 | """ | |
54f9ee45 | 4964 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4965 | |
4966 | def GetRect(*args, **kwargs): | |
a95a7133 | 4967 | """GetRect(self) -> Rect""" |
54f9ee45 | 4968 | return _core_.MoveEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
4969 | |
4970 | def SetRect(*args, **kwargs): | |
a95a7133 | 4971 | """SetRect(self, Rect rect)""" |
54f9ee45 | 4972 | return _core_.MoveEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
4973 | |
4974 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4975 | """SetPosition(self, Point pos)""" |
54f9ee45 | 4976 | return _core_.MoveEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4977 | |
7557b9b5 RD |
4978 | m_pos = property(GetPosition, SetPosition) |
4979 | m_rect = property(GetRect, SetRect) | |
4980 | ||
2131d850 | 4981 | _core_.MoveEvent_swigregister(MoveEvent) |
d14a1e28 RD |
4982 | |
4983 | #--------------------------------------------------------------------------- | |
4984 | ||
4985 | class PaintEvent(Event): | |
5ba5649b RD |
4986 | """ |
4987 | A paint event is sent when a window's contents needs to be repainted. | |
4988 | Note that in an EVT_PAINT handler the application must *always* create | |
4989 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
4990 | Windows assumes that the window has not been painted yet and will send | |
4991 | the event again, causing endless refreshes. | |
4992 | ||
4993 | You can optimize painting by retrieving the rectangles that have been | |
4994 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
4995 | and only repainting these rectangles. The rectangles are in terms of | |
4996 | the client area, and are unscrolled, so you will need to do some | |
4997 | calculations using the current view position to obtain logical, | |
4998 | scrolled units. | |
4999 | ||
5000 | """ | |
0085ce49 RD |
5001 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5002 | __repr__ = _swig_repr | |
5003 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5004 | """__init__(self, int Id=0) -> PaintEvent""" |
0085ce49 | 5005 | _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs)) |
2131d850 | 5006 | _core_.PaintEvent_swigregister(PaintEvent) |
d14a1e28 RD |
5007 | |
5008 | class NcPaintEvent(Event): | |
093d3ff1 | 5009 | """Proxy of C++ NcPaintEvent class""" |
0085ce49 RD |
5010 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5011 | __repr__ = _swig_repr | |
5012 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5013 | """__init__(self, int winid=0) -> NcPaintEvent""" |
0085ce49 | 5014 | _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs)) |
2131d850 | 5015 | _core_.NcPaintEvent_swigregister(NcPaintEvent) |
d14a1e28 RD |
5016 | |
5017 | #--------------------------------------------------------------------------- | |
5018 | ||
5019 | class EraseEvent(Event): | |
5ba5649b RD |
5020 | """ |
5021 | An erase event is sent whenever the background of a window needs to be | |
5022 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5023 | binder. On some platforms, such as GTK+, this event is simulated | |
5024 | (simply generated just before the paint event) and may cause flicker. | |
5025 | ||
5026 | To paint a custom background use the `GetDC` method and use the returned | |
5027 | device context if it is not ``None``, otherwise create a temporary | |
5028 | `wx.ClientDC` and draw on that. | |
5029 | ||
5030 | """ | |
0085ce49 RD |
5031 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5032 | __repr__ = _swig_repr | |
5033 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5034 | """ |
5035 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5036 | ||
5037 | Constructor | |
5038 | """ | |
0085ce49 | 5039 | _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs)) |
e811c8ce | 5040 | def GetDC(*args, **kwargs): |
5ba5649b RD |
5041 | """ |
5042 | GetDC(self) -> DC | |
5043 | ||
5044 | Returns the device context the event handler should draw upon. If | |
5045 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5046 | that instead. | |
5047 | """ | |
54f9ee45 | 5048 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
e811c8ce | 5049 | |
2131d850 | 5050 | _core_.EraseEvent_swigregister(EraseEvent) |
d14a1e28 RD |
5051 | |
5052 | #--------------------------------------------------------------------------- | |
5053 | ||
5054 | class FocusEvent(Event): | |
5ba5649b RD |
5055 | """ |
5056 | A focus event is sent when a window's focus changes. The window losing | |
5057 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5058 | gets an EVT_SET_FOCUS event. | |
5059 | ||
5060 | Notice that the set focus event happens both when the user gives focus | |
5061 | to the window (whether using the mouse or keyboard) and when it is | |
5062 | done from the program itself using `wx.Window.SetFocus`. | |
5063 | ||
5064 | """ | |
0085ce49 RD |
5065 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5066 | __repr__ = _swig_repr | |
5067 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5068 | """ |
2131d850 | 5069 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent |
5ba5649b RD |
5070 | |
5071 | Constructor | |
5072 | """ | |
0085ce49 | 5073 | _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs)) |
e811c8ce | 5074 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5075 | """ |
5076 | GetWindow(self) -> Window | |
5077 | ||
5078 | Returns the other window associated with this event, that is the | |
5079 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5080 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5081 | ||
5082 | Warning: the window returned may be None! | |
5083 | """ | |
54f9ee45 | 5084 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
e811c8ce RD |
5085 | |
5086 | def SetWindow(*args, **kwargs): | |
a95a7133 | 5087 | """SetWindow(self, Window win)""" |
54f9ee45 | 5088 | return _core_.FocusEvent_SetWindow(*args, **kwargs) |
e811c8ce | 5089 | |
2131d850 | 5090 | _core_.FocusEvent_swigregister(FocusEvent) |
d14a1e28 RD |
5091 | |
5092 | #--------------------------------------------------------------------------- | |
5093 | ||
5094 | class ChildFocusEvent(CommandEvent): | |
5ba5649b RD |
5095 | """ |
5096 | wx.ChildFocusEvent notifies the parent that a child has received the | |
5097 | focus. Unlike `wx.FocusEvent` it is propagated up the window | |
5098 | heirarchy. | |
5099 | """ | |
0085ce49 RD |
5100 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5101 | __repr__ = _swig_repr | |
5102 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5103 | """ |
5104 | __init__(self, Window win=None) -> ChildFocusEvent | |
5105 | ||
5106 | Constructor | |
5107 | """ | |
0085ce49 | 5108 | _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs)) |
e811c8ce | 5109 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5110 | """ |
5111 | GetWindow(self) -> Window | |
5112 | ||
5113 | The window which has just received the focus. | |
5114 | """ | |
54f9ee45 | 5115 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
e811c8ce | 5116 | |
2131d850 | 5117 | _core_.ChildFocusEvent_swigregister(ChildFocusEvent) |
d14a1e28 RD |
5118 | |
5119 | #--------------------------------------------------------------------------- | |
5120 | ||
5121 | class ActivateEvent(Event): | |
5ba5649b RD |
5122 | """ |
5123 | An activate event is sent when a top-level window or the entire | |
5124 | application is being activated or deactivated. | |
5125 | ||
5126 | A top-level window (a dialog or frame) receives an activate event when | |
5127 | is being activated or deactivated. This is indicated visually by the | |
5128 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5129 | An application is activated or deactivated when one of its frames | |
5130 | becomes activated, or a frame becomes inactivate resulting in all | |
5131 | application frames being inactive. | |
5132 | ||
5133 | Please note that usually you should call event.Skip() in your handlers | |
5134 | for these events so the default handlers will still be called, as not | |
5135 | doing so can result in strange effects. | |
5136 | ||
5137 | """ | |
0085ce49 RD |
5138 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5139 | __repr__ = _swig_repr | |
5140 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5141 | """ |
2131d850 | 5142 | __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent |
5ba5649b RD |
5143 | |
5144 | Constructor | |
5145 | """ | |
0085ce49 | 5146 | _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs)) |
e811c8ce | 5147 | def GetActive(*args, **kwargs): |
5ba5649b RD |
5148 | """ |
5149 | GetActive(self) -> bool | |
5150 | ||
5151 | Returns true if the application or window is being activated, false | |
5152 | otherwise. | |
5153 | """ | |
54f9ee45 | 5154 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
e811c8ce | 5155 | |
2131d850 | 5156 | _core_.ActivateEvent_swigregister(ActivateEvent) |
d14a1e28 RD |
5157 | |
5158 | #--------------------------------------------------------------------------- | |
5159 | ||
5160 | class InitDialogEvent(Event): | |
5ba5649b RD |
5161 | """ |
5162 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5163 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5164 | event can transfer data to the window, or anything else that should be | |
5165 | done before the user begins editing the form. The default handler | |
5166 | calls `wx.Window.TransferDataToWindow`. | |
5167 | """ | |
0085ce49 RD |
5168 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5169 | __repr__ = _swig_repr | |
5170 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5171 | """ |
5172 | __init__(self, int Id=0) -> InitDialogEvent | |
5173 | ||
5174 | Constructor | |
5175 | """ | |
0085ce49 | 5176 | _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs)) |
2131d850 | 5177 | _core_.InitDialogEvent_swigregister(InitDialogEvent) |
d14a1e28 RD |
5178 | |
5179 | #--------------------------------------------------------------------------- | |
5180 | ||
5181 | class MenuEvent(Event): | |
5ba5649b RD |
5182 | """ |
5183 | This class is used for a variety of menu-related events. Note that | |
5184 | these do not include menu command events, which are handled by sending | |
5185 | `wx.CommandEvent` objects. | |
5186 | ||
5187 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5188 | text in the first field of the status bar. | |
5189 | """ | |
0085ce49 RD |
5190 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5191 | __repr__ = _swig_repr | |
5192 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5193 | """ |
2131d850 | 5194 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent |
5ba5649b RD |
5195 | |
5196 | Constructor | |
5197 | """ | |
0085ce49 | 5198 | _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs)) |
e811c8ce | 5199 | def GetMenuId(*args, **kwargs): |
5ba5649b RD |
5200 | """ |
5201 | GetMenuId(self) -> int | |
5202 | ||
5203 | Returns the menu identifier associated with the event. This method | |
5204 | should be only used with the HIGHLIGHT events. | |
5205 | """ | |
54f9ee45 | 5206 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
e811c8ce RD |
5207 | |
5208 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5209 | """ |
5210 | IsPopup(self) -> bool | |
5211 | ||
5212 | Returns ``True`` if the menu which is being opened or closed is a | |
5213 | popup menu, ``False`` if it is a normal one. This method should only | |
5214 | be used with the OPEN and CLOSE events. | |
5215 | """ | |
54f9ee45 | 5216 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
e811c8ce RD |
5217 | |
5218 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5219 | """ |
5220 | GetMenu(self) -> Menu | |
5221 | ||
5222 | Returns the menu which is being opened or closed. This method should | |
5223 | only be used with the OPEN and CLOSE events. | |
5224 | """ | |
54f9ee45 | 5225 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
e811c8ce | 5226 | |
2131d850 | 5227 | _core_.MenuEvent_swigregister(MenuEvent) |
d14a1e28 RD |
5228 | |
5229 | #--------------------------------------------------------------------------- | |
5230 | ||
5231 | class CloseEvent(Event): | |
5ba5649b RD |
5232 | """ |
5233 | This event class contains information about window and session close | |
5234 | events. | |
5235 | ||
5236 | The handler function for EVT_CLOSE is called when the user has tried | |
5237 | to close a a frame or dialog box using the window manager controls or | |
5238 | the system menu. It can also be invoked by the application itself | |
5239 | programmatically, for example by calling the `wx.Window.Close` | |
5240 | function. | |
5241 | ||
5242 | You should check whether the application is forcing the deletion of | |
5243 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5244 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5245 | it is up to you whether you respond by destroying the window or not. | |
5246 | For example you may wish to display a message dialog prompting to save | |
5247 | files or to cancel the close. | |
5248 | ||
5249 | If you don't destroy the window, you should call `Veto` to let the | |
5250 | calling code know that you did not destroy the window. This allows the | |
5251 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5252 | on whether the close instruction was honored or not. | |
5253 | """ | |
0085ce49 RD |
5254 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5255 | __repr__ = _swig_repr | |
5256 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5257 | """ |
2131d850 | 5258 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent |
5ba5649b RD |
5259 | |
5260 | Constructor. | |
5261 | """ | |
0085ce49 | 5262 | _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs)) |
e811c8ce | 5263 | def SetLoggingOff(*args, **kwargs): |
5ba5649b RD |
5264 | """ |
5265 | SetLoggingOff(self, bool logOff) | |
5266 | ||
5267 | Sets the 'logging off' flag. | |
5268 | """ | |
54f9ee45 | 5269 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5270 | |
5271 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5272 | """ |
5273 | GetLoggingOff(self) -> bool | |
5274 | ||
6c75a4cf RD |
5275 | Returns ``True`` if the user is logging off or ``False`` if the |
5276 | system is shutting down. This method can only be called for end | |
5277 | session and query end session events, it doesn't make sense for close | |
5278 | window event. | |
5ba5649b | 5279 | """ |
54f9ee45 | 5280 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5281 | |
5282 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5283 | """ |
5284 | Veto(self, bool veto=True) | |
5285 | ||
5286 | Call this from your event handler to veto a system shutdown or to | |
5287 | signal to the calling application that a window close did not happen. | |
5288 | ||
5289 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5290 | """ | |
54f9ee45 | 5291 | return _core_.CloseEvent_Veto(*args, **kwargs) |
e811c8ce | 5292 | |
5ba5649b RD |
5293 | def GetVeto(*args, **kwargs): |
5294 | """GetVeto(self) -> bool""" | |
5295 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5296 | ||
e811c8ce | 5297 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5298 | """ |
5299 | SetCanVeto(self, bool canVeto) | |
5300 | ||
5301 | Sets the 'can veto' flag. | |
5302 | """ | |
54f9ee45 | 5303 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
e811c8ce RD |
5304 | |
5305 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5306 | """ |
5307 | CanVeto(self) -> bool | |
e811c8ce | 5308 | |
5ba5649b RD |
5309 | Returns true if you can veto a system shutdown or a window close |
5310 | event. Vetoing a window close event is not possible if the calling | |
5311 | code wishes to force the application to exit, and so this function | |
5312 | must be called to check this. | |
5313 | """ | |
5314 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
e811c8ce | 5315 | |
2131d850 | 5316 | _core_.CloseEvent_swigregister(CloseEvent) |
d14a1e28 RD |
5317 | |
5318 | #--------------------------------------------------------------------------- | |
5319 | ||
5320 | class ShowEvent(Event): | |
5ba5649b | 5321 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
0085ce49 RD |
5322 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5323 | __repr__ = _swig_repr | |
5324 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5325 | """ |
5326 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5327 | ||
5328 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5329 | """ | |
0085ce49 | 5330 | _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs)) |
e811c8ce | 5331 | def SetShow(*args, **kwargs): |
a95a7133 | 5332 | """SetShow(self, bool show)""" |
54f9ee45 | 5333 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
e811c8ce RD |
5334 | |
5335 | def GetShow(*args, **kwargs): | |
a95a7133 | 5336 | """GetShow(self) -> bool""" |
54f9ee45 | 5337 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
e811c8ce | 5338 | |
2131d850 | 5339 | _core_.ShowEvent_swigregister(ShowEvent) |
d14a1e28 RD |
5340 | |
5341 | #--------------------------------------------------------------------------- | |
5342 | ||
5343 | class IconizeEvent(Event): | |
5ba5649b RD |
5344 | """ |
5345 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5346 | restored. | |
5347 | """ | |
0085ce49 RD |
5348 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5349 | __repr__ = _swig_repr | |
5350 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5351 | """ |
5352 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5353 | ||
5354 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5355 | restored. | |
5356 | """ | |
0085ce49 | 5357 | _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs)) |
e811c8ce | 5358 | def Iconized(*args, **kwargs): |
5ba5649b RD |
5359 | """ |
5360 | Iconized(self) -> bool | |
5361 | ||
5362 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5363 | been restored. | |
5364 | """ | |
54f9ee45 | 5365 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
e811c8ce | 5366 | |
2131d850 | 5367 | _core_.IconizeEvent_swigregister(IconizeEvent) |
d14a1e28 RD |
5368 | |
5369 | #--------------------------------------------------------------------------- | |
5370 | ||
5371 | class MaximizeEvent(Event): | |
5ba5649b | 5372 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
0085ce49 RD |
5373 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5374 | __repr__ = _swig_repr | |
5375 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5376 | """ |
5377 | __init__(self, int id=0) -> MaximizeEvent | |
5378 | ||
5379 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
5380 | """ | |
0085ce49 | 5381 | _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs)) |
2131d850 | 5382 | _core_.MaximizeEvent_swigregister(MaximizeEvent) |
d14a1e28 RD |
5383 | |
5384 | #--------------------------------------------------------------------------- | |
5385 | ||
5386 | class DropFilesEvent(Event): | |
5ba5649b RD |
5387 | """ |
5388 | This class is used for drop files events, that is, when files have | |
5389 | been dropped onto the window. This functionality is only available | |
5390 | under Windows. The window must have previously been enabled for | |
5391 | dropping by calling `wx.Window.DragAcceptFiles`. | |
5392 | ||
5393 | Important note: this is a separate implementation to the more general | |
5394 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
5395 | implementation uses the older, Windows message-based approach of | |
5396 | dropping files. | |
5397 | ||
5398 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
5399 | events. | |
5400 | ||
5401 | """ | |
0085ce49 RD |
5402 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5403 | def __init__(self): raise AttributeError, "No constructor defined" | |
5404 | __repr__ = _swig_repr | |
e811c8ce | 5405 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5406 | """ |
5407 | GetPosition(self) -> Point | |
5408 | ||
5409 | Returns the position at which the files were dropped. | |
5410 | """ | |
54f9ee45 | 5411 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5412 | |
5413 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
5414 | """ |
5415 | GetNumberOfFiles(self) -> int | |
5416 | ||
5417 | Returns the number of files dropped. | |
5418 | """ | |
54f9ee45 | 5419 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
e811c8ce RD |
5420 | |
5421 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
5422 | """ |
5423 | GetFiles(self) -> PyObject | |
5424 | ||
5425 | Returns a list of the filenames that were dropped. | |
5426 | """ | |
54f9ee45 | 5427 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
e811c8ce | 5428 | |
2131d850 | 5429 | _core_.DropFilesEvent_swigregister(DropFilesEvent) |
d14a1e28 RD |
5430 | |
5431 | #--------------------------------------------------------------------------- | |
5432 | ||
54f9ee45 RD |
5433 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
5434 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
d14a1e28 | 5435 | class UpdateUIEvent(CommandEvent): |
5ba5649b RD |
5436 | """ |
5437 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
5438 | wxWidgets to give an application the chance to update various user | |
5439 | interface elements. | |
5440 | ||
5441 | Without update UI events, an application has to work hard to | |
5442 | check/uncheck, enable/disable, and set the text for elements such as | |
5443 | menu items and toolbar buttons. The code for doing this has to be | |
5444 | mixed up with the code that is invoked when an action is invoked for a | |
5445 | menu item or button. | |
5446 | ||
5447 | With update UI events, you define an event handler to look at the | |
5448 | state of the application and change UI elements accordingly. wxWidgets | |
5449 | will call your handler functions in idle time, so you don't have to | |
5450 | worry where to call this code. In addition to being a clearer and more | |
5451 | declarative method, it also means you don't have to worry whether | |
5452 | you're updating a toolbar or menubar identifier. The same handler can | |
5453 | update a menu item and toolbar button, if the ID values are the same. | |
5454 | ||
5455 | Instead of directly manipulating the menu or button, you call | |
5456 | functions in the event object, such as `Check`. wxWidgets will | |
5457 | determine whether such a call has been made, and which UI element to | |
5458 | update. | |
5459 | ||
5460 | These events will work for popup menus as well as menubars. Just | |
5461 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
5462 | any UI events for the window that owns the menu. | |
5463 | ||
5464 | If you find that the overhead of UI update processing is affecting | |
5465 | your application, you can do one or both of the following: | |
5466 | ||
5467 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
5468 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
5469 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
5470 | receive update events. No other windows will receive update | |
5471 | events. | |
5472 | ||
5473 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
5474 | value to set the delay between updates. You may need to call | |
5475 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
5476 | a dialog is about to be shown, in case the user sees a slight | |
5477 | delay before windows are updated. | |
5478 | ||
5479 | Note that although events are sent in idle time, defining a EVT_IDLE | |
5480 | handler for a window does not affect this because the events are sent | |
5481 | from an internal idle handler. | |
5482 | ||
5483 | wxWidgets tries to optimize update events on some platforms. On | |
5484 | Windows and GTK+, events for menubar items are only sent when the menu | |
5485 | is about to be shown, and not in idle time. | |
5486 | ||
5487 | """ | |
0085ce49 RD |
5488 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5489 | __repr__ = _swig_repr | |
5490 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5491 | """ |
5492 | __init__(self, int commandId=0) -> UpdateUIEvent | |
5493 | ||
5494 | Constructor | |
5495 | """ | |
0085ce49 | 5496 | _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs)) |
e811c8ce | 5497 | def GetChecked(*args, **kwargs): |
5ba5649b RD |
5498 | """ |
5499 | GetChecked(self) -> bool | |
5500 | ||
5501 | Returns ``True`` if the UI element should be checked. | |
5502 | """ | |
54f9ee45 | 5503 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
e811c8ce RD |
5504 | |
5505 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
5506 | """ |
5507 | GetEnabled(self) -> bool | |
5508 | ||
5509 | Returns ``True`` if the UI element should be enabled. | |
5510 | """ | |
54f9ee45 | 5511 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
e811c8ce | 5512 | |
b1fcee84 RD |
5513 | def GetShown(*args, **kwargs): |
5514 | """ | |
5515 | GetShown(self) -> bool | |
5516 | ||
5517 | Returns ``True`` if the UI element should be shown. | |
5518 | """ | |
5519 | return _core_.UpdateUIEvent_GetShown(*args, **kwargs) | |
5520 | ||
e811c8ce | 5521 | def GetText(*args, **kwargs): |
5ba5649b RD |
5522 | """ |
5523 | GetText(self) -> String | |
5524 | ||
5525 | Returns the text that should be set for the UI element. | |
5526 | """ | |
54f9ee45 | 5527 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
e811c8ce RD |
5528 | |
5529 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
5530 | """ |
5531 | GetSetText(self) -> bool | |
5532 | ||
5533 | Returns ``True`` if the application has called `SetText`. For | |
5534 | wxWidgets internal use only. | |
5535 | """ | |
54f9ee45 | 5536 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
e811c8ce RD |
5537 | |
5538 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
5539 | """ |
5540 | GetSetChecked(self) -> bool | |
5541 | ||
5542 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
5543 | internal use only. | |
5544 | """ | |
54f9ee45 | 5545 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
e811c8ce RD |
5546 | |
5547 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
5548 | """ |
5549 | GetSetEnabled(self) -> bool | |
5550 | ||
5551 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
5552 | internal use only. | |
5553 | """ | |
54f9ee45 | 5554 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
e811c8ce | 5555 | |
b1fcee84 RD |
5556 | def GetSetShown(*args, **kwargs): |
5557 | """ | |
5558 | GetSetShown(self) -> bool | |
5559 | ||
5560 | Returns ``True`` if the application has called `Show`. For wxWidgets | |
5561 | internal use only. | |
5562 | """ | |
5563 | return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs) | |
5564 | ||
e811c8ce | 5565 | def Check(*args, **kwargs): |
5ba5649b RD |
5566 | """ |
5567 | Check(self, bool check) | |
5568 | ||
5569 | Check or uncheck the UI element. | |
5570 | """ | |
54f9ee45 | 5571 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
e811c8ce RD |
5572 | |
5573 | def Enable(*args, **kwargs): | |
5ba5649b RD |
5574 | """ |
5575 | Enable(self, bool enable) | |
5576 | ||
5577 | Enable or disable the UI element. | |
5578 | """ | |
54f9ee45 | 5579 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
e811c8ce | 5580 | |
b1fcee84 RD |
5581 | def Show(*args, **kwargs): |
5582 | """ | |
5583 | Show(self, bool show) | |
5584 | ||
5585 | Show or hide the UI element. | |
5586 | """ | |
5587 | return _core_.UpdateUIEvent_Show(*args, **kwargs) | |
5588 | ||
e811c8ce | 5589 | def SetText(*args, **kwargs): |
5ba5649b RD |
5590 | """ |
5591 | SetText(self, String text) | |
5592 | ||
5593 | Sets the text for this UI element. | |
5594 | """ | |
54f9ee45 | 5595 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
e811c8ce RD |
5596 | |
5597 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5598 | """ |
5599 | SetUpdateInterval(long updateInterval) | |
5600 | ||
5601 | Sets the interval between updates in milliseconds. Set to -1 to | |
5602 | disable updates, or to 0 to update as frequently as possible. The | |
5603 | default is 0. | |
5604 | ||
5605 | Use this to reduce the overhead of UI update events if your | |
5606 | application has a lot of windows. If you set the value to -1 or | |
5607 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5608 | at appropriate points in your application, such as when a dialog is | |
5609 | about to be shown. | |
5610 | """ | |
54f9ee45 | 5611 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5612 | |
5613 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
5614 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
5615 | """ |
5616 | GetUpdateInterval() -> long | |
5617 | ||
5618 | Returns the current interval between updates in milliseconds. -1 | |
5619 | disables updates, 0 updates as frequently as possible. | |
5620 | """ | |
54f9ee45 | 5621 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
5622 | |
5623 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
5624 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
5625 | """ |
5626 | CanUpdate(Window win) -> bool | |
5627 | ||
5628 | Returns ``True`` if it is appropriate to update (send UI update events | |
5629 | to) this window. | |
5630 | ||
5631 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5632 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5633 | events were last sent in idle time, and the update interval, to | |
5634 | determine whether events should be sent to this window now. By default | |
5635 | this will always return true because the update mode is initially | |
5636 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5637 | events will be sent as often as possible. You can reduce the frequency | |
5638 | that events are sent by changing the mode and/or setting an update | |
5639 | interval. | |
5640 | ||
5641 | """ | |
54f9ee45 | 5642 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
e811c8ce RD |
5643 | |
5644 | CanUpdate = staticmethod(CanUpdate) | |
5645 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
5646 | """ |
5647 | ResetUpdateTime() | |
5648 | ||
5649 | Used internally to reset the last-updated time to the current time. It | |
5650 | is assumed that update events are normally sent in idle time, so this | |
5651 | is called at the end of idle processing. | |
5652 | """ | |
54f9ee45 | 5653 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
e811c8ce RD |
5654 | |
5655 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
5656 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
5657 | """ |
5658 | SetMode(int mode) | |
5659 | ||
5660 | Specify how wxWidgets will send update events: to all windows, or only | |
5661 | to those which specify that they will process the events. | |
5662 | ||
5663 | The mode may be one of the following values: | |
5664 | ||
5665 | ============================= ========================================== | |
5666 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5667 | is the default setting. | |
5668 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5669 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5670 | style set. | |
5671 | ============================= ========================================== | |
5672 | ||
5673 | """ | |
54f9ee45 | 5674 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
5675 | |
5676 | SetMode = staticmethod(SetMode) | |
5677 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
5678 | """ |
5679 | GetMode() -> int | |
5680 | ||
5681 | Returns a value specifying how wxWidgets will send update events: to | |
5682 | all windows, or only to those which specify that they will process the | |
5683 | events. | |
5684 | """ | |
54f9ee45 | 5685 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
5686 | |
5687 | GetMode = staticmethod(GetMode) | |
2131d850 | 5688 | _core_.UpdateUIEvent_swigregister(UpdateUIEvent) |
d14a1e28 | 5689 | |
e811c8ce | 5690 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
0085ce49 | 5691 | """ |
5ba5649b RD |
5692 | UpdateUIEvent_SetUpdateInterval(long updateInterval) |
5693 | ||
5694 | Sets the interval between updates in milliseconds. Set to -1 to | |
5695 | disable updates, or to 0 to update as frequently as possible. The | |
5696 | default is 0. | |
5697 | ||
5698 | Use this to reduce the overhead of UI update events if your | |
5699 | application has a lot of windows. If you set the value to -1 or | |
5700 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
5701 | at appropriate points in your application, such as when a dialog is | |
5702 | about to be shown. | |
5703 | """ | |
0085ce49 | 5704 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d14a1e28 | 5705 | |
0085ce49 RD |
5706 | def UpdateUIEvent_GetUpdateInterval(*args): |
5707 | """ | |
5ba5649b RD |
5708 | UpdateUIEvent_GetUpdateInterval() -> long |
5709 | ||
5710 | Returns the current interval between updates in milliseconds. -1 | |
5711 | disables updates, 0 updates as frequently as possible. | |
5712 | """ | |
0085ce49 | 5713 | return _core_.UpdateUIEvent_GetUpdateInterval(*args) |
d14a1e28 | 5714 | |
e811c8ce | 5715 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
0085ce49 | 5716 | """ |
5ba5649b RD |
5717 | UpdateUIEvent_CanUpdate(Window win) -> bool |
5718 | ||
5719 | Returns ``True`` if it is appropriate to update (send UI update events | |
5720 | to) this window. | |
5721 | ||
5722 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
5723 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
5724 | events were last sent in idle time, and the update interval, to | |
5725 | determine whether events should be sent to this window now. By default | |
5726 | this will always return true because the update mode is initially | |
5727 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
5728 | events will be sent as often as possible. You can reduce the frequency | |
5729 | that events are sent by changing the mode and/or setting an update | |
5730 | interval. | |
5731 | ||
5732 | """ | |
0085ce49 | 5733 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d14a1e28 | 5734 | |
0085ce49 RD |
5735 | def UpdateUIEvent_ResetUpdateTime(*args): |
5736 | """ | |
5ba5649b RD |
5737 | UpdateUIEvent_ResetUpdateTime() |
5738 | ||
5739 | Used internally to reset the last-updated time to the current time. It | |
5740 | is assumed that update events are normally sent in idle time, so this | |
5741 | is called at the end of idle processing. | |
5742 | """ | |
0085ce49 | 5743 | return _core_.UpdateUIEvent_ResetUpdateTime(*args) |
d14a1e28 | 5744 | |
e811c8ce | 5745 | def UpdateUIEvent_SetMode(*args, **kwargs): |
0085ce49 | 5746 | """ |
5ba5649b RD |
5747 | UpdateUIEvent_SetMode(int mode) |
5748 | ||
5749 | Specify how wxWidgets will send update events: to all windows, or only | |
5750 | to those which specify that they will process the events. | |
5751 | ||
5752 | The mode may be one of the following values: | |
5753 | ||
5754 | ============================= ========================================== | |
5755 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
5756 | is the default setting. | |
5757 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
5758 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
5759 | style set. | |
5760 | ============================= ========================================== | |
5761 | ||
5762 | """ | |
0085ce49 | 5763 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d14a1e28 | 5764 | |
0085ce49 RD |
5765 | def UpdateUIEvent_GetMode(*args): |
5766 | """ | |
5ba5649b RD |
5767 | UpdateUIEvent_GetMode() -> int |
5768 | ||
5769 | Returns a value specifying how wxWidgets will send update events: to | |
5770 | all windows, or only to those which specify that they will process the | |
5771 | events. | |
5772 | """ | |
0085ce49 | 5773 | return _core_.UpdateUIEvent_GetMode(*args) |
d14a1e28 RD |
5774 | |
5775 | #--------------------------------------------------------------------------- | |
5776 | ||
5777 | class SysColourChangedEvent(Event): | |
5ba5649b RD |
5778 | """ |
5779 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
5780 | when the user changes the colour settings using the control | |
5781 | panel. This is only applicable under Windows. | |
5782 | ||
5783 | The default event handler for this event propagates the event to child | |
5784 | windows, since Windows only sends the events to top-level windows. If | |
5785 | intercepting this event for a top-level window, remember to call | |
5786 | `Skip` so the the base class handler will still be executed, or to | |
5787 | pass the event on to the window's children explicitly. | |
5788 | ||
5789 | """ | |
0085ce49 RD |
5790 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5791 | __repr__ = _swig_repr | |
5792 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5793 | """ |
5794 | __init__(self) -> SysColourChangedEvent | |
5795 | ||
5796 | Constructor | |
5797 | """ | |
0085ce49 | 5798 | _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs)) |
2131d850 | 5799 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent) |
d14a1e28 RD |
5800 | |
5801 | #--------------------------------------------------------------------------- | |
5802 | ||
5803 | class MouseCaptureChangedEvent(Event): | |
5ba5649b RD |
5804 | """ |
5805 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
5806 | a window that loses its mouse capture. This is called even if | |
5807 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
5808 | this event allows an application to cater for unexpected capture | |
5809 | releases which might otherwise confuse mouse handling code. | |
5810 | ||
5811 | This event is implemented under Windows only. | |
5812 | """ | |
0085ce49 RD |
5813 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5814 | __repr__ = _swig_repr | |
5815 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5816 | """ |
5817 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
5818 | ||
5819 | Constructor | |
5820 | """ | |
0085ce49 | 5821 | _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs)) |
e811c8ce | 5822 | def GetCapturedWindow(*args, **kwargs): |
5ba5649b RD |
5823 | """ |
5824 | GetCapturedWindow(self) -> Window | |
5825 | ||
5826 | Returns the window that gained the capture, or ``None`` if it was a | |
5827 | non-wxWidgets window. | |
5828 | """ | |
54f9ee45 | 5829 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
e811c8ce | 5830 | |
2131d850 | 5831 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent) |
d14a1e28 RD |
5832 | |
5833 | #--------------------------------------------------------------------------- | |
5834 | ||
5835 | class DisplayChangedEvent(Event): | |
5ba5649b RD |
5836 | """ |
5837 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
5838 | resolution has changed. | |
5839 | ||
5840 | This event is implemented under Windows only. | |
5841 | """ | |
0085ce49 RD |
5842 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5843 | __repr__ = _swig_repr | |
5844 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5845 | """__init__(self) -> DisplayChangedEvent""" |
0085ce49 | 5846 | _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs)) |
2131d850 | 5847 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent) |
d14a1e28 RD |
5848 | |
5849 | #--------------------------------------------------------------------------- | |
5850 | ||
5851 | class PaletteChangedEvent(Event): | |
5ba5649b RD |
5852 | """ |
5853 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
5854 | changed, thereby giving each window a chance to redo their own to | |
5855 | match. | |
5856 | ||
5857 | This event is implemented under Windows only. | |
5858 | """ | |
0085ce49 RD |
5859 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5860 | __repr__ = _swig_repr | |
5861 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5862 | """ |
5863 | __init__(self, int id=0) -> PaletteChangedEvent | |
5864 | ||
5865 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
5866 | changed, thereby giving each window a chance to redo their own to | |
5867 | match. | |
5868 | ||
5869 | This event is implemented under Windows only. | |
5870 | """ | |
0085ce49 | 5871 | _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs)) |
e811c8ce | 5872 | def SetChangedWindow(*args, **kwargs): |
a95a7133 | 5873 | """SetChangedWindow(self, Window win)""" |
54f9ee45 | 5874 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) |
e811c8ce RD |
5875 | |
5876 | def GetChangedWindow(*args, **kwargs): | |
a95a7133 | 5877 | """GetChangedWindow(self) -> Window""" |
54f9ee45 | 5878 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) |
e811c8ce | 5879 | |
2131d850 | 5880 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent) |
d14a1e28 RD |
5881 | |
5882 | #--------------------------------------------------------------------------- | |
5883 | ||
5884 | class QueryNewPaletteEvent(Event): | |
5ba5649b RD |
5885 | """ |
5886 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
5887 | focus and should re-do its palette. | |
5888 | ||
5889 | This event is implemented under Windows only. | |
5890 | """ | |
0085ce49 RD |
5891 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5892 | __repr__ = _swig_repr | |
5893 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5894 | """ |
5895 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
5896 | ||
5897 | Constructor. | |
5898 | """ | |
0085ce49 | 5899 | _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs)) |
e811c8ce | 5900 | def SetPaletteRealized(*args, **kwargs): |
5ba5649b RD |
5901 | """ |
5902 | SetPaletteRealized(self, bool realized) | |
5903 | ||
5904 | App should set this if it changes the palette. | |
5905 | """ | |
54f9ee45 | 5906 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
e811c8ce RD |
5907 | |
5908 | def GetPaletteRealized(*args, **kwargs): | |
a95a7133 | 5909 | """GetPaletteRealized(self) -> bool""" |
54f9ee45 | 5910 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
e811c8ce | 5911 | |
2131d850 | 5912 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent) |
d14a1e28 RD |
5913 | |
5914 | #--------------------------------------------------------------------------- | |
5915 | ||
5916 | class NavigationKeyEvent(Event): | |
5ba5649b RD |
5917 | """ |
5918 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
5919 | widgets, otherwise known as tab-traversal. You woudl normally not | |
5920 | catch navigation events in applications as there are already | |
5921 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
5922 | it useful to send navigation events in certain situations to change | |
5923 | the focus in certain ways, although it's probably easier to just call | |
5924 | `wx.Window.Navigate`. | |
5925 | """ | |
0085ce49 RD |
5926 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5927 | __repr__ = _swig_repr | |
5928 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5929 | """__init__(self) -> NavigationKeyEvent""" |
0085ce49 | 5930 | _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs)) |
e811c8ce | 5931 | def GetDirection(*args, **kwargs): |
5ba5649b RD |
5932 | """ |
5933 | GetDirection(self) -> bool | |
5934 | ||
5935 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
5936 | """ | |
54f9ee45 | 5937 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
e811c8ce RD |
5938 | |
5939 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
5940 | """ |
5941 | SetDirection(self, bool forward) | |
5942 | ||
5943 | Specify the direction that the navigation should take. Usually the | |
5944 | difference between using Tab and Shift-Tab. | |
5945 | """ | |
54f9ee45 | 5946 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
e811c8ce RD |
5947 | |
5948 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
5949 | """ |
5950 | IsWindowChange(self) -> bool | |
5951 | ||
5952 | Returns ``True`` if window change is allowed. | |
5953 | """ | |
54f9ee45 | 5954 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
e811c8ce RD |
5955 | |
5956 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
5957 | """ |
5958 | SetWindowChange(self, bool ischange) | |
5959 | ||
5960 | Specify if the navigation should be able to change parent windows. | |
5961 | For example, changing notebook pages, etc. This is usually implemented | |
5962 | by using Control-Tab. | |
5963 | """ | |
54f9ee45 | 5964 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
e811c8ce | 5965 | |
68350608 | 5966 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
5967 | """ |
5968 | IsFromTab(self) -> bool | |
5969 | ||
5970 | Returns ``True`` if the navigation event is originated from the Tab | |
5971 | key. | |
5972 | """ | |
68350608 RD |
5973 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
5974 | ||
5975 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
5976 | """ |
5977 | SetFromTab(self, bool bIs) | |
5978 | ||
5979 | Set to true under MSW if the event was generated using the tab key. | |
5980 | This is required for proper navogation over radio buttons. | |
5981 | """ | |
68350608 RD |
5982 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
5983 | ||
908b74cd | 5984 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
5985 | """ |
5986 | SetFlags(self, long flags) | |
5987 | ||
5988 | Set the navigation flags to a combination of the following: | |
5989 | ||
5990 | * wx.NavigationKeyEvent.IsBackward | |
5991 | * wx.NavigationKeyEvent.IsForward | |
5992 | * wx.NavigationKeyEvent.WinChange | |
5993 | * wx.NavigationKeyEvent.FromTab | |
5994 | ||
5995 | """ | |
908b74cd RD |
5996 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
5997 | ||
e811c8ce | 5998 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
5999 | """ |
6000 | GetCurrentFocus(self) -> Window | |
6001 | ||
6002 | Returns the child window which currenty has the focus. May be | |
6003 | ``None``. | |
6004 | """ | |
54f9ee45 | 6005 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
e811c8ce RD |
6006 | |
6007 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6008 | """ |
6009 | SetCurrentFocus(self, Window win) | |
6010 | ||
6011 | Set the window that has the focus. | |
6012 | """ | |
54f9ee45 | 6013 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
e811c8ce | 6014 | |
b0f7404b | 6015 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
908b74cd RD |
6016 | IsForward = _core_.NavigationKeyEvent_IsForward |
6017 | WinChange = _core_.NavigationKeyEvent_WinChange | |
68350608 | 6018 | FromTab = _core_.NavigationKeyEvent_FromTab |
2131d850 | 6019 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent) |
d14a1e28 RD |
6020 | |
6021 | #--------------------------------------------------------------------------- | |
6022 | ||
6023 | class WindowCreateEvent(CommandEvent): | |
5ba5649b RD |
6024 | """ |
6025 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6026 | underlying GUI object) exists. | |
6027 | """ | |
0085ce49 RD |
6028 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6029 | __repr__ = _swig_repr | |
6030 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6031 | """ |
6032 | __init__(self, Window win=None) -> WindowCreateEvent | |
6033 | ||
6034 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6035 | underlying GUI object) exists. | |
6036 | """ | |
0085ce49 | 6037 | _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs)) |
e811c8ce | 6038 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6039 | """ |
6040 | GetWindow(self) -> Window | |
6041 | ||
6042 | Returns the window that this event refers to. | |
6043 | """ | |
54f9ee45 | 6044 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6045 | |
2131d850 | 6046 | _core_.WindowCreateEvent_swigregister(WindowCreateEvent) |
d14a1e28 RD |
6047 | |
6048 | class WindowDestroyEvent(CommandEvent): | |
5ba5649b | 6049 | """ |
943e8dfd RD |
6050 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6051 | when the GUI window is destroyed. | |
6052 | ||
6053 | When a class derived from `wx.Window` is destroyed its destructor will | |
6054 | have already run by the time this event is sent. Therefore this event | |
6055 | will not usually be received at all by the window itself. Since it is | |
6056 | received after the destructor has run, an object should not try to | |
6057 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6058 | notification of the destruction of another window. | |
5ba5649b | 6059 | """ |
0085ce49 RD |
6060 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6061 | __repr__ = _swig_repr | |
6062 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6063 | """ |
6064 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6065 | ||
943e8dfd RD |
6066 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6067 | when the GUI window is destroyed. | |
6068 | ||
6069 | When a class derived from `wx.Window` is destroyed its destructor will | |
6070 | have already run by the time this event is sent. Therefore this event | |
6071 | will not usually be received at all by the window itself. Since it is | |
6072 | received after the destructor has run, an object should not try to | |
6073 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6074 | notification of the destruction of another window. | |
5ba5649b | 6075 | """ |
0085ce49 | 6076 | _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs)) |
e811c8ce | 6077 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6078 | """ |
6079 | GetWindow(self) -> Window | |
6080 | ||
6081 | Returns the window that this event refers to. | |
6082 | """ | |
54f9ee45 | 6083 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6084 | |
2131d850 | 6085 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent) |
d14a1e28 RD |
6086 | |
6087 | #--------------------------------------------------------------------------- | |
6088 | ||
6089 | class ContextMenuEvent(CommandEvent): | |
5ba5649b RD |
6090 | """ |
6091 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6092 | give the application a chance to show a context (popup) menu. | |
6093 | """ | |
0085ce49 RD |
6094 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6095 | __repr__ = _swig_repr | |
6096 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6097 | """ |
2131d850 | 6098 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent |
5ba5649b RD |
6099 | |
6100 | Constructor. | |
6101 | """ | |
0085ce49 | 6102 | _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs)) |
e811c8ce | 6103 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
6104 | """ |
6105 | GetPosition(self) -> Point | |
6106 | ||
6107 | Returns the position (in screen coordinants) at which the menu should | |
6108 | be shown. | |
6109 | """ | |
54f9ee45 | 6110 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
6111 | |
6112 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6113 | """ |
6114 | SetPosition(self, Point pos) | |
6115 | ||
6116 | Sets the position at which the menu should be shown. | |
6117 | """ | |
54f9ee45 | 6118 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
e811c8ce | 6119 | |
2131d850 | 6120 | _core_.ContextMenuEvent_swigregister(ContextMenuEvent) |
d14a1e28 RD |
6121 | |
6122 | #--------------------------------------------------------------------------- | |
6123 | ||
54f9ee45 RD |
6124 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6125 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
d14a1e28 | 6126 | class IdleEvent(Event): |
5ba5649b RD |
6127 | """ |
6128 | This class is used for EVT_IDLE events, which are generated and sent | |
6129 | when the application *becomes* idle. In other words, the when the | |
6130 | event queue becomes empty then idle events are sent to all windows (by | |
6131 | default) and as long as none of them call `RequestMore` then there are | |
6132 | no more idle events until after the system event queue has some normal | |
6133 | events and then becomes empty again. | |
6134 | ||
6135 | By default, idle events are sent to all windows. If this is causing a | |
6136 | significant overhead in your application, you can call | |
6137 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6138 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6139 | which should receive idle events. Then idle events will only be sent | |
6140 | to those windows and not to any others. | |
6141 | """ | |
0085ce49 RD |
6142 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6143 | __repr__ = _swig_repr | |
6144 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6145 | """ |
6146 | __init__(self) -> IdleEvent | |
6147 | ||
6148 | Constructor | |
6149 | """ | |
0085ce49 | 6150 | _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs)) |
e811c8ce | 6151 | def RequestMore(*args, **kwargs): |
5ba5649b RD |
6152 | """ |
6153 | RequestMore(self, bool needMore=True) | |
6154 | ||
6155 | Tells wxWidgets that more processing is required. This function can be | |
6156 | called by an EVT_IDLE handler for a window to indicate that the | |
6157 | application should forward the EVT_IDLE event once more to the | |
6158 | application windows. If no window calls this function during its | |
6159 | EVT_IDLE handler, then the application will remain in a passive event | |
6160 | loop until a new event is posted to the application by the windowing | |
6161 | system. | |
6162 | """ | |
54f9ee45 | 6163 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
e811c8ce RD |
6164 | |
6165 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6166 | """ |
6167 | MoreRequested(self) -> bool | |
6168 | ||
6169 | Returns ``True`` if the OnIdle function processing this event | |
6170 | requested more processing time. | |
6171 | """ | |
54f9ee45 | 6172 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
e811c8ce RD |
6173 | |
6174 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6175 | """ |
6176 | SetMode(int mode) | |
6177 | ||
6178 | Static method for specifying how wxWidgets will send idle events: to | |
6179 | all windows, or only to those which specify that they will process the | |
6180 | events. | |
6181 | ||
6182 | The mode can be one of the following values: | |
6183 | ||
6184 | ========================= ======================================== | |
6185 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6186 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6187 | the wx.WS_EX_PROCESS_IDLE extra style | |
6188 | flag set. | |
6189 | ========================= ======================================== | |
6190 | ||
6191 | """ | |
54f9ee45 | 6192 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
6193 | |
6194 | SetMode = staticmethod(SetMode) | |
6195 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6196 | """ |
6197 | GetMode() -> int | |
6198 | ||
6199 | Static method returning a value specifying how wxWidgets will send | |
6200 | idle events: to all windows, or only to those which specify that they | |
6201 | will process the events. | |
6202 | """ | |
54f9ee45 | 6203 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
6204 | |
6205 | GetMode = staticmethod(GetMode) | |
6206 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6207 | """ |
6208 | CanSend(Window win) -> bool | |
6209 | ||
6210 | Returns ``True`` if it is appropriate to send idle events to this | |
6211 | window. | |
6212 | ||
6213 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6214 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6215 | events should be sent to this window now. By default this will always | |
6216 | return ``True`` because the update mode is initially | |
6217 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6218 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6219 | """ | |
54f9ee45 | 6220 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
e811c8ce RD |
6221 | |
6222 | CanSend = staticmethod(CanSend) | |
2131d850 | 6223 | _core_.IdleEvent_swigregister(IdleEvent) |
d14a1e28 | 6224 | |
e811c8ce | 6225 | def IdleEvent_SetMode(*args, **kwargs): |
0085ce49 | 6226 | """ |
5ba5649b RD |
6227 | IdleEvent_SetMode(int mode) |
6228 | ||
6229 | Static method for specifying how wxWidgets will send idle events: to | |
6230 | all windows, or only to those which specify that they will process the | |
6231 | events. | |
6232 | ||
6233 | The mode can be one of the following values: | |
6234 | ||
6235 | ========================= ======================================== | |
6236 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6237 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6238 | the wx.WS_EX_PROCESS_IDLE extra style | |
6239 | flag set. | |
6240 | ========================= ======================================== | |
6241 | ||
6242 | """ | |
0085ce49 | 6243 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6244 | |
0085ce49 RD |
6245 | def IdleEvent_GetMode(*args): |
6246 | """ | |
5ba5649b RD |
6247 | IdleEvent_GetMode() -> int |
6248 | ||
6249 | Static method returning a value specifying how wxWidgets will send | |
6250 | idle events: to all windows, or only to those which specify that they | |
6251 | will process the events. | |
6252 | """ | |
0085ce49 | 6253 | return _core_.IdleEvent_GetMode(*args) |
d14a1e28 | 6254 | |
e811c8ce | 6255 | def IdleEvent_CanSend(*args, **kwargs): |
0085ce49 | 6256 | """ |
5ba5649b RD |
6257 | IdleEvent_CanSend(Window win) -> bool |
6258 | ||
6259 | Returns ``True`` if it is appropriate to send idle events to this | |
6260 | window. | |
6261 | ||
6262 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6263 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6264 | events should be sent to this window now. By default this will always | |
6265 | return ``True`` because the update mode is initially | |
6266 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6267 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6268 | """ | |
0085ce49 | 6269 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d14a1e28 RD |
6270 | |
6271 | #--------------------------------------------------------------------------- | |
6272 | ||
2131d850 RD |
6273 | class ClipboardTextEvent(CommandEvent): |
6274 | """ | |
6275 | A Clipboard Text event is sent when a window intercepts a text | |
6276 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6277 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6278 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6279 | generated automatically for a Rich Edit text control. | |
6280 | """ | |
6281 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6282 | __repr__ = _swig_repr | |
6283 | def __init__(self, *args, **kwargs): | |
6284 | """ | |
6285 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent | |
6286 | ||
6287 | A Clipboard Text event is sent when a window intercepts a text | |
6288 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6289 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6290 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6291 | generated automatically for a Rich Edit text control. | |
6292 | """ | |
6293 | _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs)) | |
6294 | _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent) | |
6295 | ||
6296 | #--------------------------------------------------------------------------- | |
6297 | ||
d14a1e28 | 6298 | class PyEvent(Event): |
5ba5649b RD |
6299 | """ |
6300 | wx.PyEvent can be used as a base class for implementing custom event | |
6301 | types in Python. You should derived from this class instead of | |
6302 | `wx.Event` because this class is Python-aware and is able to transport | |
6303 | its Python bits safely through the wxWidgets event system and have | |
6304 | them still be there when the event handler is invoked. | |
6305 | ||
6306 | :see: `wx.PyCommandEvent` | |
6307 | ||
6308 | """ | |
0085ce49 RD |
6309 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6310 | __repr__ = _swig_repr | |
6311 | def __init__(self, *args, **kwargs): | |
2131d850 | 6312 | """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent""" |
0085ce49 | 6313 | _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs)) |
5ba5649b | 6314 | self._SetSelf(self) |
e811c8ce | 6315 | |
0085ce49 RD |
6316 | __swig_destroy__ = _core_.delete_PyEvent |
6317 | __del__ = lambda self : None; | |
5ba5649b RD |
6318 | def _SetSelf(*args, **kwargs): |
6319 | """_SetSelf(self, PyObject self)""" | |
6320 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6321 | |
5ba5649b RD |
6322 | def _GetSelf(*args, **kwargs): |
6323 | """_GetSelf(self) -> PyObject""" | |
6324 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6325 | |
2131d850 | 6326 | _core_.PyEvent_swigregister(PyEvent) |
d14a1e28 RD |
6327 | |
6328 | class PyCommandEvent(CommandEvent): | |
5ba5649b RD |
6329 | """ |
6330 | wx.PyCommandEvent can be used as a base class for implementing custom | |
6331 | event types in Python, where the event shoudl travel up to parent | |
6332 | windows looking for a handler. You should derived from this class | |
6333 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
6334 | able to transport its Python bits safely through the wxWidgets event | |
6335 | system and have them still be there when the event handler is invoked. | |
6336 | ||
6337 | :see: `wx.PyEvent` | |
6338 | ||
6339 | """ | |
0085ce49 RD |
6340 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6341 | __repr__ = _swig_repr | |
6342 | def __init__(self, *args, **kwargs): | |
2131d850 | 6343 | """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
0085ce49 | 6344 | _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs)) |
5ba5649b | 6345 | self._SetSelf(self) |
e811c8ce | 6346 | |
0085ce49 RD |
6347 | __swig_destroy__ = _core_.delete_PyCommandEvent |
6348 | __del__ = lambda self : None; | |
5ba5649b RD |
6349 | def _SetSelf(*args, **kwargs): |
6350 | """_SetSelf(self, PyObject self)""" | |
6351 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 6352 | |
5ba5649b RD |
6353 | def _GetSelf(*args, **kwargs): |
6354 | """_GetSelf(self) -> PyObject""" | |
6355 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 6356 | |
2131d850 | 6357 | _core_.PyCommandEvent_swigregister(PyCommandEvent) |
d14a1e28 | 6358 | |
53aa7709 | 6359 | class DateEvent(CommandEvent): |
5ba5649b RD |
6360 | """ |
6361 | This event class holds information about a date change event and is | |
6362 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
6363 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
6364 | EVT_DATE_CHANGED. | |
6365 | """ | |
0085ce49 RD |
6366 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6367 | __repr__ = _swig_repr | |
6368 | def __init__(self, *args, **kwargs): | |
2131d850 | 6369 | """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent""" |
0085ce49 | 6370 | _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs)) |
53aa7709 | 6371 | def GetDate(*args, **kwargs): |
5ba5649b RD |
6372 | """ |
6373 | GetDate(self) -> DateTime | |
6374 | ||
6375 | Returns the date. | |
6376 | """ | |
53aa7709 RD |
6377 | return _core_.DateEvent_GetDate(*args, **kwargs) |
6378 | ||
6379 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
6380 | """ |
6381 | SetDate(self, DateTime date) | |
6382 | ||
6383 | Sets the date carried by the event, normally only used by the library | |
6384 | internally. | |
6385 | """ | |
53aa7709 RD |
6386 | return _core_.DateEvent_SetDate(*args, **kwargs) |
6387 | ||
2131d850 | 6388 | _core_.DateEvent_swigregister(DateEvent) |
53aa7709 RD |
6389 | |
6390 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
6391 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
6392 | ||
d14a1e28 RD |
6393 | #--------------------------------------------------------------------------- |
6394 | ||
54f9ee45 RD |
6395 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
6396 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
6397 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
6398 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
6399 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
6400 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
d14a1e28 | 6401 | class PyApp(EvtHandler): |
66c033b4 RD |
6402 | """ |
6403 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
6404 | `wx.App` class (or some other derived class) instead. | |
6405 | """ | |
0085ce49 RD |
6406 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6407 | __repr__ = _swig_repr | |
6408 | def __init__(self, *args, **kwargs): | |
98e665d3 | 6409 | """ |
a95a7133 | 6410 | __init__(self) -> PyApp |
98e665d3 RD |
6411 | |
6412 | Create a new application object, starting the bootstrap process. | |
6413 | """ | |
0085ce49 | 6414 | _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs)) |
70b7a5fe RD |
6415 | self._setCallbackInfo(self, PyApp, False) |
6416 | self._setOORInfo(self, False) | |
e811c8ce | 6417 | |
0085ce49 RD |
6418 | __swig_destroy__ = _core_.delete_PyApp |
6419 | __del__ = lambda self : None; | |
e811c8ce | 6420 | def _setCallbackInfo(*args, **kwargs): |
70b7a5fe | 6421 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" |
54f9ee45 | 6422 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
6423 | |
6424 | def GetAppName(*args, **kwargs): | |
0df68c9f | 6425 | """ |
a95a7133 | 6426 | GetAppName(self) -> String |
6c3b4aae | 6427 | |
0df68c9f RD |
6428 | Get the application name. |
6429 | """ | |
54f9ee45 | 6430 | return _core_.PyApp_GetAppName(*args, **kwargs) |
e811c8ce RD |
6431 | |
6432 | def SetAppName(*args, **kwargs): | |
0df68c9f | 6433 | """ |
a95a7133 | 6434 | SetAppName(self, String name) |
6c3b4aae | 6435 | |
66c033b4 RD |
6436 | Set the application name. This value may be used automatically by |
6437 | `wx.Config` and such. | |
0df68c9f | 6438 | """ |
54f9ee45 | 6439 | return _core_.PyApp_SetAppName(*args, **kwargs) |
e811c8ce RD |
6440 | |
6441 | def GetClassName(*args, **kwargs): | |
0df68c9f | 6442 | """ |
a95a7133 | 6443 | GetClassName(self) -> String |
e811c8ce | 6444 | |
0df68c9f RD |
6445 | Get the application's class name. |
6446 | """ | |
54f9ee45 | 6447 | return _core_.PyApp_GetClassName(*args, **kwargs) |
e811c8ce RD |
6448 | |
6449 | def SetClassName(*args, **kwargs): | |
0df68c9f | 6450 | """ |
a95a7133 | 6451 | SetClassName(self, String name) |
6c3b4aae | 6452 | |
66c033b4 RD |
6453 | Set the application's class name. This value may be used for |
6454 | X-resources if applicable for the platform | |
0df68c9f | 6455 | """ |
54f9ee45 | 6456 | return _core_.PyApp_SetClassName(*args, **kwargs) |
e811c8ce RD |
6457 | |
6458 | def GetVendorName(*args, **kwargs): | |
0df68c9f | 6459 | """ |
a95a7133 | 6460 | GetVendorName(self) -> String |
6c3b4aae | 6461 | |
0df68c9f RD |
6462 | Get the application's vendor name. |
6463 | """ | |
54f9ee45 | 6464 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
e811c8ce RD |
6465 | |
6466 | def SetVendorName(*args, **kwargs): | |
0df68c9f | 6467 | """ |
a95a7133 | 6468 | SetVendorName(self, String name) |
6c3b4aae | 6469 | |
66c033b4 RD |
6470 | Set the application's vendor name. This value may be used |
6471 | automatically by `wx.Config` and such. | |
0df68c9f | 6472 | """ |
54f9ee45 | 6473 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
e811c8ce RD |
6474 | |
6475 | def GetTraits(*args, **kwargs): | |
0df68c9f | 6476 | """ |
a95a7133 | 6477 | GetTraits(self) -> wxAppTraits |
6c3b4aae | 6478 | |
66c033b4 RD |
6479 | Return (and create if necessary) the app traits object to which we |
6480 | delegate for everything which either should be configurable by the | |
6481 | user (then he can change the default behaviour simply by overriding | |
6482 | CreateTraits() and returning his own traits object) or which is | |
6483 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
6484 | differences behind the common facade. | |
6485 | ||
6486 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
0df68c9f | 6487 | """ |
54f9ee45 | 6488 | return _core_.PyApp_GetTraits(*args, **kwargs) |
e811c8ce RD |
6489 | |
6490 | def ProcessPendingEvents(*args, **kwargs): | |
0df68c9f | 6491 | """ |
a95a7133 | 6492 | ProcessPendingEvents(self) |
6c3b4aae | 6493 | |
66c033b4 RD |
6494 | Process all events in the Pending Events list -- it is necessary to |
6495 | call this function to process posted events. This normally happens | |
6496 | during each event loop iteration. | |
0df68c9f | 6497 | """ |
54f9ee45 | 6498 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
6499 | |
6500 | def Yield(*args, **kwargs): | |
0df68c9f | 6501 | """ |
a95a7133 | 6502 | Yield(self, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 6503 | |
66c033b4 RD |
6504 | Process all currently pending events right now, instead of waiting |
6505 | until return to the event loop. It is an error to call ``Yield`` | |
6506 | recursively unless the value of ``onlyIfNeeded`` is True. | |
6c3b4aae | 6507 | |
66c033b4 | 6508 | :warning: This function is dangerous as it can lead to unexpected |
41e2b43e RD |
6509 | reentrancies (i.e. when called from an event handler it may |
6510 | result in calling the same event handler again), use with | |
6511 | extreme care or, better, don't use at all! | |
0df68c9f | 6512 | |
66c033b4 | 6513 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
41e2b43e | 6514 | |
0df68c9f | 6515 | """ |
54f9ee45 | 6516 | return _core_.PyApp_Yield(*args, **kwargs) |
e811c8ce RD |
6517 | |
6518 | def WakeUpIdle(*args, **kwargs): | |
0df68c9f | 6519 | """ |
a95a7133 | 6520 | WakeUpIdle(self) |
6c3b4aae | 6521 | |
66c033b4 RD |
6522 | Make sure that idle events are sent again. |
6523 | :see: `wx.WakeUpIdle` | |
0df68c9f | 6524 | """ |
54f9ee45 | 6525 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
e811c8ce | 6526 | |
1fc3b23a RD |
6527 | def IsMainLoopRunning(*args, **kwargs): |
6528 | """ | |
6529 | IsMainLoopRunning() -> bool | |
6530 | ||
6531 | Returns True if we're running the main loop, i.e. if the events can | |
6532 | currently be dispatched. | |
6533 | """ | |
6534 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
6535 | ||
6536 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
e811c8ce | 6537 | def MainLoop(*args, **kwargs): |
0df68c9f | 6538 | """ |
a95a7133 | 6539 | MainLoop(self) -> int |
6c3b4aae | 6540 | |
66c033b4 RD |
6541 | Execute the main GUI loop, the function doesn't normally return until |
6542 | all top level windows have been closed and destroyed. | |
0df68c9f | 6543 | """ |
54f9ee45 | 6544 | return _core_.PyApp_MainLoop(*args, **kwargs) |
e811c8ce RD |
6545 | |
6546 | def Exit(*args, **kwargs): | |
0df68c9f | 6547 | """ |
a95a7133 | 6548 | Exit(self) |
6c3b4aae | 6549 | |
0df68c9f | 6550 | Exit the main loop thus terminating the application. |
66c033b4 | 6551 | :see: `wx.Exit` |
0df68c9f | 6552 | """ |
54f9ee45 | 6553 | return _core_.PyApp_Exit(*args, **kwargs) |
e811c8ce RD |
6554 | |
6555 | def ExitMainLoop(*args, **kwargs): | |
0df68c9f | 6556 | """ |
a95a7133 | 6557 | ExitMainLoop(self) |
6c3b4aae | 6558 | |
66c033b4 RD |
6559 | Exit the main GUI loop during the next iteration of the main |
6560 | loop, (i.e. it does not stop the program immediately!) | |
0df68c9f | 6561 | """ |
54f9ee45 | 6562 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
e811c8ce RD |
6563 | |
6564 | def Pending(*args, **kwargs): | |
0df68c9f | 6565 | """ |
a95a7133 | 6566 | Pending(self) -> bool |
6c3b4aae | 6567 | |
0df68c9f RD |
6568 | Returns True if there are unprocessed events in the event queue. |
6569 | """ | |
54f9ee45 | 6570 | return _core_.PyApp_Pending(*args, **kwargs) |
e811c8ce RD |
6571 | |
6572 | def Dispatch(*args, **kwargs): | |
0df68c9f | 6573 | """ |
a95a7133 | 6574 | Dispatch(self) -> bool |
6c3b4aae | 6575 | |
0df68c9f RD |
6576 | Process the first event in the event queue (blocks until an event |
6577 | appears if there are none currently) | |
6578 | """ | |
54f9ee45 | 6579 | return _core_.PyApp_Dispatch(*args, **kwargs) |
e811c8ce RD |
6580 | |
6581 | def ProcessIdle(*args, **kwargs): | |
0df68c9f | 6582 | """ |
a95a7133 | 6583 | ProcessIdle(self) -> bool |
6c3b4aae | 6584 | |
66c033b4 RD |
6585 | Called from the MainLoop when the application becomes idle (there are |
6586 | no pending events) and sends a `wx.IdleEvent` to all interested | |
6587 | parties. Returns True if more idle events are needed, False if not. | |
0df68c9f | 6588 | """ |
54f9ee45 | 6589 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
e811c8ce RD |
6590 | |
6591 | def SendIdleEvents(*args, **kwargs): | |
0df68c9f | 6592 | """ |
a95a7133 | 6593 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
e811c8ce | 6594 | |
66c033b4 RD |
6595 | Send idle event to window and all subwindows. Returns True if more |
6596 | idle time is requested. | |
0df68c9f | 6597 | """ |
54f9ee45 | 6598 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
e811c8ce RD |
6599 | |
6600 | def IsActive(*args, **kwargs): | |
0df68c9f | 6601 | """ |
a95a7133 | 6602 | IsActive(self) -> bool |
6c3b4aae | 6603 | |
0df68c9f RD |
6604 | Return True if our app has focus. |
6605 | """ | |
54f9ee45 | 6606 | return _core_.PyApp_IsActive(*args, **kwargs) |
e811c8ce RD |
6607 | |
6608 | def SetTopWindow(*args, **kwargs): | |
0df68c9f | 6609 | """ |
a95a7133 | 6610 | SetTopWindow(self, Window win) |
6c3b4aae | 6611 | |
66c033b4 | 6612 | Set the *main* top level window |
0df68c9f | 6613 | """ |
54f9ee45 | 6614 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
e811c8ce RD |
6615 | |
6616 | def GetTopWindow(*args, **kwargs): | |
0df68c9f | 6617 | """ |
a95a7133 | 6618 | GetTopWindow(self) -> Window |
6c3b4aae | 6619 | |
66c033b4 RD |
6620 | Return the *main* top level window (if it hadn't been set previously |
6621 | with SetTopWindow(), will return just some top level window and, if | |
6622 | there not any, will return None) | |
0df68c9f | 6623 | """ |
54f9ee45 | 6624 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
e811c8ce RD |
6625 | |
6626 | def SetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 6627 | """ |
a95a7133 | 6628 | SetExitOnFrameDelete(self, bool flag) |
0df68c9f | 6629 | |
66c033b4 RD |
6630 | Control the exit behaviour: by default, the program will exit the main |
6631 | loop (and so, usually, terminate) when the last top-level program | |
6632 | window is deleted. Beware that if you disable this behaviour (with | |
6633 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
6634 | explicitly from somewhere. | |
0df68c9f | 6635 | """ |
54f9ee45 | 6636 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
6637 | |
6638 | def GetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 6639 | """ |
a95a7133 | 6640 | GetExitOnFrameDelete(self) -> bool |
6c3b4aae | 6641 | |
0df68c9f RD |
6642 | Get the current exit behaviour setting. |
6643 | """ | |
54f9ee45 | 6644 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
6645 | |
6646 | def SetUseBestVisual(*args, **kwargs): | |
0df68c9f | 6647 | """ |
a95a7133 | 6648 | SetUseBestVisual(self, bool flag) |
6c3b4aae | 6649 | |
66c033b4 RD |
6650 | Set whether the app should try to use the best available visual on |
6651 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
0df68c9f | 6652 | """ |
54f9ee45 | 6653 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
6654 | |
6655 | def GetUseBestVisual(*args, **kwargs): | |
0df68c9f | 6656 | """ |
a95a7133 | 6657 | GetUseBestVisual(self) -> bool |
6c3b4aae | 6658 | |
0df68c9f RD |
6659 | Get current UseBestVisual setting. |
6660 | """ | |
54f9ee45 | 6661 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
6662 | |
6663 | def SetPrintMode(*args, **kwargs): | |
a95a7133 | 6664 | """SetPrintMode(self, int mode)""" |
54f9ee45 | 6665 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
e811c8ce RD |
6666 | |
6667 | def GetPrintMode(*args, **kwargs): | |
a95a7133 | 6668 | """GetPrintMode(self) -> int""" |
54f9ee45 | 6669 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
e811c8ce | 6670 | |
e811c8ce | 6671 | def SetAssertMode(*args, **kwargs): |
0df68c9f | 6672 | """ |
a95a7133 | 6673 | SetAssertMode(self, int mode) |
6c3b4aae | 6674 | |
41e2b43e | 6675 | Set the OnAssert behaviour for debug and hybrid builds. |
0df68c9f | 6676 | """ |
54f9ee45 | 6677 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
e811c8ce | 6678 | |
6c3b4aae | 6679 | def GetAssertMode(*args, **kwargs): |
0df68c9f | 6680 | """ |
a95a7133 | 6681 | GetAssertMode(self) -> int |
6c3b4aae | 6682 | |
0df68c9f RD |
6683 | Get the current OnAssert behaviour setting. |
6684 | """ | |
54f9ee45 | 6685 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
6c3b4aae | 6686 | |
e811c8ce | 6687 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): |
66c033b4 | 6688 | """GetMacSupportPCMenuShortcuts() -> bool""" |
54f9ee45 | 6689 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
6690 | |
6691 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
6692 | def GetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 6693 | """GetMacAboutMenuItemId() -> long""" |
54f9ee45 | 6694 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
6695 | |
6696 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
6697 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 6698 | """GetMacPreferencesMenuItemId() -> long""" |
54f9ee45 | 6699 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
6700 | |
6701 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
6702 | def GetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 6703 | """GetMacExitMenuItemId() -> long""" |
54f9ee45 | 6704 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
6705 | |
6706 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
6707 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 6708 | """GetMacHelpMenuTitleName() -> String""" |
54f9ee45 | 6709 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
6710 | |
6711 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
6712 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
66c033b4 | 6713 | """SetMacSupportPCMenuShortcuts(bool val)""" |
54f9ee45 | 6714 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
6715 | |
6716 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
6717 | def SetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 6718 | """SetMacAboutMenuItemId(long val)""" |
54f9ee45 | 6719 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
6720 | |
6721 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
6722 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 6723 | """SetMacPreferencesMenuItemId(long val)""" |
54f9ee45 | 6724 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
6725 | |
6726 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
6727 | def SetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 6728 | """SetMacExitMenuItemId(long val)""" |
54f9ee45 | 6729 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
6730 | |
6731 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
6732 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 6733 | """SetMacHelpMenuTitleName(String val)""" |
54f9ee45 | 6734 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
6735 | |
6736 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
6737 | def _BootstrapApp(*args, **kwargs): | |
0df68c9f | 6738 | """ |
a95a7133 | 6739 | _BootstrapApp(self) |
6c3b4aae | 6740 | |
0df68c9f RD |
6741 | For internal use only |
6742 | """ | |
54f9ee45 | 6743 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
e811c8ce RD |
6744 | |
6745 | def GetComCtl32Version(*args, **kwargs): | |
0df68c9f | 6746 | """ |
66c033b4 | 6747 | GetComCtl32Version() -> int |
6c3b4aae | 6748 | |
66c033b4 RD |
6749 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
6750 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 6751 | """ |
54f9ee45 | 6752 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
e811c8ce RD |
6753 | |
6754 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
2131d850 | 6755 | _core_.PyApp_swigregister(PyApp) |
d14a1e28 | 6756 | |
0085ce49 RD |
6757 | def PyApp_IsMainLoopRunning(*args): |
6758 | """ | |
1fc3b23a RD |
6759 | PyApp_IsMainLoopRunning() -> bool |
6760 | ||
6761 | Returns True if we're running the main loop, i.e. if the events can | |
6762 | currently be dispatched. | |
6763 | """ | |
0085ce49 | 6764 | return _core_.PyApp_IsMainLoopRunning(*args) |
1fc3b23a | 6765 | |
0085ce49 RD |
6766 | def PyApp_GetMacSupportPCMenuShortcuts(*args): |
6767 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
6768 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args) | |
d14a1e28 | 6769 | |
0085ce49 RD |
6770 | def PyApp_GetMacAboutMenuItemId(*args): |
6771 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
6772 | return _core_.PyApp_GetMacAboutMenuItemId(*args) | |
d14a1e28 | 6773 | |
0085ce49 RD |
6774 | def PyApp_GetMacPreferencesMenuItemId(*args): |
6775 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
6776 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args) | |
d14a1e28 | 6777 | |
0085ce49 RD |
6778 | def PyApp_GetMacExitMenuItemId(*args): |
6779 | """PyApp_GetMacExitMenuItemId() -> long""" | |
6780 | return _core_.PyApp_GetMacExitMenuItemId(*args) | |
d14a1e28 | 6781 | |
0085ce49 RD |
6782 | def PyApp_GetMacHelpMenuTitleName(*args): |
6783 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
6784 | return _core_.PyApp_GetMacHelpMenuTitleName(*args) | |
d14a1e28 | 6785 | |
e811c8ce | 6786 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
0085ce49 RD |
6787 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" |
6788 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d14a1e28 | 6789 | |
e811c8ce | 6790 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
0085ce49 RD |
6791 | """PyApp_SetMacAboutMenuItemId(long val)""" |
6792 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
d14a1e28 | 6793 | |
e811c8ce | 6794 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
0085ce49 RD |
6795 | """PyApp_SetMacPreferencesMenuItemId(long val)""" |
6796 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
d14a1e28 | 6797 | |
e811c8ce | 6798 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
0085ce49 RD |
6799 | """PyApp_SetMacExitMenuItemId(long val)""" |
6800 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
d14a1e28 | 6801 | |
e811c8ce | 6802 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
0085ce49 RD |
6803 | """PyApp_SetMacHelpMenuTitleName(String val)""" |
6804 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d14a1e28 | 6805 | |
0085ce49 RD |
6806 | def PyApp_GetComCtl32Version(*args): |
6807 | """ | |
0df68c9f | 6808 | PyApp_GetComCtl32Version() -> int |
6c3b4aae | 6809 | |
66c033b4 RD |
6810 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
6811 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 6812 | """ |
0085ce49 | 6813 | return _core_.PyApp_GetComCtl32Version(*args) |
d14a1e28 RD |
6814 | |
6815 | #--------------------------------------------------------------------------- | |
6816 | ||
6817 | ||
0085ce49 RD |
6818 | def Exit(*args): |
6819 | """ | |
0df68c9f | 6820 | Exit() |
6c3b4aae | 6821 | |
0df68c9f RD |
6822 | Force an exit of the application. Convenience for wx.GetApp().Exit() |
6823 | """ | |
0085ce49 | 6824 | return _core_.Exit(*args) |
d14a1e28 | 6825 | |
0085ce49 RD |
6826 | def Yield(*args): |
6827 | """ | |
0df68c9f | 6828 | Yield() -> bool |
6c3b4aae | 6829 | |
0df68c9f RD |
6830 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() |
6831 | """ | |
0085ce49 | 6832 | return _core_.Yield(*args) |
d14a1e28 | 6833 | |
0085ce49 RD |
6834 | def YieldIfNeeded(*args): |
6835 | """ | |
0df68c9f | 6836 | YieldIfNeeded() -> bool |
6c3b4aae | 6837 | |
0df68c9f RD |
6838 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) |
6839 | """ | |
0085ce49 | 6840 | return _core_.YieldIfNeeded(*args) |
d14a1e28 | 6841 | |
e811c8ce | 6842 | def SafeYield(*args, **kwargs): |
0085ce49 | 6843 | """ |
0df68c9f | 6844 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 6845 | |
66c033b4 RD |
6846 | This function is similar to `wx.Yield`, except that it disables the |
6847 | user input to all program windows before calling `wx.Yield` and | |
6848 | re-enables it again afterwards. If ``win`` is not None, this window | |
6849 | will remain enabled, allowing the implementation of some limited user | |
6850 | interaction. | |
6c3b4aae | 6851 | |
66c033b4 | 6852 | :Returns: the result of the call to `wx.Yield`. |
0df68c9f | 6853 | """ |
0085ce49 | 6854 | return _core_.SafeYield(*args, **kwargs) |
d14a1e28 | 6855 | |
0085ce49 RD |
6856 | def WakeUpIdle(*args): |
6857 | """ | |
0df68c9f | 6858 | WakeUpIdle() |
6c3b4aae | 6859 | |
66c033b4 RD |
6860 | Cause the message queue to become empty again, so idle events will be |
6861 | sent. | |
0df68c9f | 6862 | """ |
0085ce49 | 6863 | return _core_.WakeUpIdle(*args) |
d14a1e28 | 6864 | |
e811c8ce | 6865 | def PostEvent(*args, **kwargs): |
0085ce49 | 6866 | """ |
0df68c9f | 6867 | PostEvent(EvtHandler dest, Event event) |
6c3b4aae | 6868 | |
66c033b4 RD |
6869 | Send an event to a window or other wx.EvtHandler to be processed |
6870 | later. | |
0df68c9f | 6871 | """ |
0085ce49 | 6872 | return _core_.PostEvent(*args, **kwargs) |
d14a1e28 | 6873 | |
0085ce49 RD |
6874 | def App_CleanUp(*args): |
6875 | """ | |
0df68c9f | 6876 | App_CleanUp() |
6c3b4aae | 6877 | |
41e2b43e | 6878 | For internal use only, it is used to cleanup after wxWidgets when |
66c033b4 | 6879 | Python shuts down. |
0df68c9f | 6880 | """ |
0085ce49 | 6881 | return _core_.App_CleanUp(*args) |
d14a1e28 | 6882 | |
0085ce49 RD |
6883 | def GetApp(*args): |
6884 | """ | |
0df68c9f | 6885 | GetApp() -> PyApp |
6c3b4aae | 6886 | |
196addbf | 6887 | Return a reference to the current wx.App object. |
0df68c9f | 6888 | """ |
0085ce49 | 6889 | return _core_.GetApp(*args) |
5cbf236d RD |
6890 | |
6891 | def SetDefaultPyEncoding(*args, **kwargs): | |
0085ce49 | 6892 | """ |
5cbf236d RD |
6893 | SetDefaultPyEncoding(string encoding) |
6894 | ||
6895 | Sets the encoding that wxPython will use when it needs to convert a | |
6896 | Python string or unicode object to or from a wxString. | |
e505d15e RD |
6897 | |
6898 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
6899 | but please be aware that the default encoding within the same locale | |
6900 | may be slightly different on different platforms. For example, please | |
6901 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
6902 | between the common latin/roman encodings. | |
5cbf236d | 6903 | """ |
0085ce49 | 6904 | return _core_.SetDefaultPyEncoding(*args, **kwargs) |
5cbf236d | 6905 | |
0085ce49 RD |
6906 | def GetDefaultPyEncoding(*args): |
6907 | """ | |
5cbf236d RD |
6908 | GetDefaultPyEncoding() -> string |
6909 | ||
6910 | Gets the current encoding that wxPython will use when it needs to | |
6911 | convert a Python string or unicode object to or from a wxString. | |
6912 | """ | |
0085ce49 | 6913 | return _core_.GetDefaultPyEncoding(*args) |
d14a1e28 RD |
6914 | #---------------------------------------------------------------------- |
6915 | ||
6916 | class PyOnDemandOutputWindow: | |
6c3b4aae RD |
6917 | """ |
6918 | A class that can be used for redirecting Python's stdout and | |
6919 | stderr streams. It will do nothing until something is wrriten to | |
6920 | the stream at which point it will create a Frame with a text area | |
6921 | and write the text there. | |
6922 | """ | |
d14a1e28 RD |
6923 | def __init__(self, title = "wxPython: stdout/stderr"): |
6924 | self.frame = None | |
6925 | self.title = title | |
412d302d RD |
6926 | self.pos = wx.DefaultPosition |
6927 | self.size = (450, 300) | |
d14a1e28 RD |
6928 | self.parent = None |
6929 | ||
6930 | def SetParent(self, parent): | |
6c3b4aae | 6931 | """Set the window to be used as the popup Frame's parent.""" |
d14a1e28 RD |
6932 | self.parent = parent |
6933 | ||
6c3b4aae RD |
6934 | |
6935 | def CreateOutputWindow(self, st): | |
412d302d RD |
6936 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
6937 | style=wx.DEFAULT_FRAME_STYLE) | |
196addbf | 6938 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 6939 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d1e20054 | 6940 | self.text.AppendText(st) |
6c3b4aae | 6941 | self.frame.Show(True) |
2131d850 | 6942 | self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
6c3b4aae | 6943 | |
d14a1e28 | 6944 | |
7409c0c6 RD |
6945 | def OnCloseWindow(self, event): |
6946 | if self.frame is not None: | |
6947 | self.frame.Destroy() | |
6948 | self.frame = None | |
6949 | self.text = None | |
6950 | ||
6951 | ||
d14a1e28 | 6952 | # These methods provide the file-like output behaviour. |
6c3b4aae RD |
6953 | def write(self, text): |
6954 | """ | |
6955 | Create the output window if needed and write the string to it. | |
6956 | If not called in the context of the gui thread then uses | |
6957 | CallAfter to do the work there. | |
6958 | """ | |
6959 | if self.frame is None: | |
6960 | if not wx.Thread_IsMain(): | |
6961 | wx.CallAfter(self.CreateOutputWindow, text) | |
6962 | else: | |
6963 | self.CreateOutputWindow(text) | |
6964 | else: | |
6965 | if not wx.Thread_IsMain(): | |
6966 | wx.CallAfter(self.text.AppendText, text) | |
6967 | else: | |
6968 | self.text.AppendText(text) | |
6969 | ||
d14a1e28 RD |
6970 | |
6971 | def close(self): | |
6c3b4aae RD |
6972 | if self.frame is not None: |
6973 | wx.CallAfter(self.frame.Close) | |
6974 | ||
d14a1e28 | 6975 | |
19272049 RD |
6976 | def flush(self): |
6977 | pass | |
6978 | ||
6979 | ||
d14a1e28 RD |
6980 | |
6981 | #---------------------------------------------------------------------- | |
d14a1e28 RD |
6982 | |
6983 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
6984 | ||
6985 | class App(wx.PyApp): | |
6c3b4aae | 6986 | """ |
66c033b4 RD |
6987 | The ``wx.App`` class represents the application and is used to: |
6988 | ||
6989 | * bootstrap the wxPython system and initialize the underlying | |
6990 | gui toolkit | |
6991 | * set and get application-wide properties | |
6992 | * implement the windowing system main message or event loop, | |
6993 | and to dispatch events to window instances | |
6994 | * etc. | |
6995 | ||
6996 | Every application must have a ``wx.App`` instance, and all | |
6997 | creation of UI objects should be delayed until after the | |
03e37cd5 RD |
6998 | ``wx.App`` object has been created in order to ensure that the gui |
6999 | platform and wxWidgets have been fully initialized. | |
66c033b4 RD |
7000 | |
7001 | Normally you would derive from this class and implement an | |
7002 | ``OnInit`` method that creates a frame and then calls | |
7003 | ``self.SetTopWindow(frame)``. | |
7004 | ||
03e37cd5 | 7005 | :see: `wx.PySimpleApp` for a simpler app class that can be used |
1c0f361b | 7006 | directly. |
6c3b4aae | 7007 | """ |
66c033b4 | 7008 | |
d14a1e28 RD |
7009 | outputWindowClass = PyOnDemandOutputWindow |
7010 | ||
03e37cd5 RD |
7011 | def __init__(self, redirect=_defRedirect, filename=None, |
7012 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7013 | """ |
7014 | Construct a ``wx.App`` object. | |
7015 | ||
03e37cd5 RD |
7016 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be |
7017 | redirected? Defaults to True on Windows and Mac, False | |
7018 | otherwise. If `filename` is None then output will be | |
7019 | redirected to a window that pops up as needed. (You can | |
7020 | control what kind of window is created for the output by | |
7021 | resetting the class variable ``outputWindowClass`` to a | |
7022 | class of your choosing.) | |
66c033b4 | 7023 | |
03e37cd5 RD |
7024 | :param filename: The name of a file to redirect output to, if |
7025 | redirect is True. | |
66c033b4 RD |
7026 | |
7027 | :param useBestVisual: Should the app try to use the best | |
03e37cd5 RD |
7028 | available visual provided by the system (only relevant on |
7029 | systems that have more than one visual.) This parameter | |
7030 | must be used instead of calling `SetUseBestVisual` later | |
7031 | on because it must be set before the underlying GUI | |
7032 | toolkit is initialized. | |
7033 | ||
7034 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7035 | app to terminate upon a Ctrl-C in the console like other | |
7036 | GUI apps will. | |
66c033b4 RD |
7037 | |
7038 | :note: You should override OnInit to do applicaition | |
7039 | initialization to ensure that the system, toolkit and | |
7040 | wxWidgets are fully initialized. | |
7041 | """ | |
d14a1e28 RD |
7042 | wx.PyApp.__init__(self) |
7043 | ||
7044 | if wx.Platform == "__WXMAC__": | |
7045 | try: | |
7046 | import MacOS | |
7047 | if not MacOS.WMAvailable(): | |
7048 | print """\ | |
7049 | This program needs access to the screen. Please run with 'pythonw', | |
7050 | not 'python', and only when you are logged in on the main display of | |
7051 | your Mac.""" | |
7052 | _sys.exit(1) | |
36cadbf7 RD |
7053 | except SystemExit: |
7054 | raise | |
d14a1e28 RD |
7055 | except: |
7056 | pass | |
7057 | ||
7058 | # This has to be done before OnInit | |
7059 | self.SetUseBestVisual(useBestVisual) | |
7060 | ||
7061 | # Set the default handler for SIGINT. This fixes a problem | |
7062 | # where if Ctrl-C is pressed in the console that started this | |
7063 | # app then it will not appear to do anything, (not even send | |
7064 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7065 | # setting the default handler then the app will exit, as | |
7066 | # expected (depending on platform.) | |
03e37cd5 RD |
7067 | if clearSigInt: |
7068 | try: | |
7069 | import signal | |
7070 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7071 | except: | |
7072 | pass | |
d14a1e28 RD |
7073 | |
7074 | # Save and redirect the stdio to a window? | |
7075 | self.stdioWin = None | |
7076 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7077 | if redirect: | |
7078 | self.RedirectStdio(filename) | |
7079 | ||
8fb0e70a RD |
7080 | # Use Python's install prefix as the default |
7081 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7082 | ||
d14a1e28 RD |
7083 | # This finishes the initialization of wxWindows and then calls |
7084 | # the OnInit that should be present in the derived class | |
7085 | self._BootstrapApp() | |
7086 | ||
7087 | ||
01f6b6d3 RD |
7088 | def OnPreInit(self): |
7089 | """ | |
7090 | Things that must be done after _BootstrapApp has done its | |
7091 | thing, but would be nice if they were already done by the time | |
7092 | that OnInit is called. | |
7093 | """ | |
7094 | wx.StockGDI._initStockObjects() | |
7095 | ||
7096 | ||
02b455f2 RD |
7097 | def __del__(self, destroy=wx.PyApp.__del__): |
7098 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7099 | destroy(self) | |
d14a1e28 | 7100 | |
70b7a5fe RD |
7101 | def Destroy(self): |
7102 | wx.PyApp.Destroy(self) | |
7103 | self.thisown = 0 | |
d14a1e28 RD |
7104 | |
7105 | def SetTopWindow(self, frame): | |
1e0c8722 | 7106 | """Set the \"main\" top level window""" |
d14a1e28 RD |
7107 | if self.stdioWin: |
7108 | self.stdioWin.SetParent(frame) | |
7109 | wx.PyApp.SetTopWindow(self, frame) | |
7110 | ||
7111 | ||
7112 | def MainLoop(self): | |
1e0c8722 | 7113 | """Execute the main GUI event loop""" |
d14a1e28 RD |
7114 | wx.PyApp.MainLoop(self) |
7115 | self.RestoreStdio() | |
7116 | ||
7117 | ||
7409c0c6 | 7118 | def RedirectStdio(self, filename=None): |
1e0c8722 | 7119 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" |
d14a1e28 RD |
7120 | if filename: |
7121 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7122 | else: | |
7123 | self.stdioWin = self.outputWindowClass() | |
7124 | _sys.stdout = _sys.stderr = self.stdioWin | |
7125 | ||
7126 | ||
7127 | def RestoreStdio(self): | |
02b455f2 RD |
7128 | try: |
7129 | _sys.stdout, _sys.stderr = self.saveStdio | |
7130 | except: | |
7131 | pass | |
d14a1e28 RD |
7132 | |
7133 | ||
412d302d RD |
7134 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7135 | """ | |
7136 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7137 | the stdio has been redirected. This should be called before |
7138 | any output would cause the output window to be created. | |
412d302d RD |
7139 | """ |
7140 | if self.stdioWin: | |
7141 | if title is not None: | |
7142 | self.stdioWin.title = title | |
7143 | if pos is not None: | |
7144 | self.stdioWin.pos = pos | |
7145 | if size is not None: | |
7146 | self.stdioWin.size = size | |
7147 | ||
7148 | ||
7149 | ||
d14a1e28 | 7150 | |
66c033b4 | 7151 | # change from wx.PyApp_XX to wx.App_XX |
54f9ee45 RD |
7152 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7153 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7154 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7155 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7156 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7157 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7158 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7159 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7160 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7161 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7162 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
d14a1e28 RD |
7163 | |
7164 | #---------------------------------------------------------------------------- | |
7165 | ||
7166 | class PySimpleApp(wx.App): | |
6c3b4aae RD |
7167 | """ |
7168 | A simple application class. You can just create one of these and | |
7169 | then then make your top level windows later, and not have to worry | |
66c033b4 RD |
7170 | about OnInit. For example:: |
7171 | ||
7172 | app = wx.PySimpleApp() | |
7173 | frame = wx.Frame(None, title='Hello World') | |
7174 | frame.Show() | |
7175 | app.MainLoop() | |
7176 | ||
7177 | :see: `wx.App` | |
7178 | """ | |
6c3b4aae | 7179 | |
03e37cd5 RD |
7180 | def __init__(self, redirect=False, filename=None, |
7181 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7182 | """ |
7183 | :see: `wx.App.__init__` | |
7184 | """ | |
03e37cd5 | 7185 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) |
6c3b4aae | 7186 | |
d14a1e28 | 7187 | def OnInit(self): |
d14a1e28 RD |
7188 | return True |
7189 | ||
7190 | ||
66c033b4 | 7191 | |
6c3b4aae | 7192 | # Is anybody using this one? |
d14a1e28 RD |
7193 | class PyWidgetTester(wx.App): |
7194 | def __init__(self, size = (250, 100)): | |
7195 | self.size = size | |
7196 | wx.App.__init__(self, 0) | |
7197 | ||
7198 | def OnInit(self): | |
196addbf | 7199 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) |
d14a1e28 RD |
7200 | self.SetTopWindow(self.frame) |
7201 | return True | |
7202 | ||
66c033b4 RD |
7203 | def SetWidget(self, widgetClass, *args, **kwargs): |
7204 | w = widgetClass(self.frame, *args, **kwargs) | |
d14a1e28 RD |
7205 | self.frame.Show(True) |
7206 | ||
7207 | #---------------------------------------------------------------------------- | |
7208 | # DO NOT hold any other references to this object. This is how we | |
66c033b4 | 7209 | # know when to cleanup system resources that wxWidgets is holding. When |
d14a1e28 | 7210 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
66c033b4 | 7211 | # goes to zero and it calls the wx.App_CleanUp function. |
d14a1e28 RD |
7212 | |
7213 | class __wxPyCleanup: | |
7214 | def __init__(self): | |
54f9ee45 | 7215 | self.cleanup = _core_.App_CleanUp |
d14a1e28 RD |
7216 | def __del__(self): |
7217 | self.cleanup() | |
7218 | ||
7219 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7220 | ||
7221 | ## # another possible solution, but it gets called too early... | |
66c033b4 RD |
7222 | ## import atexit |
7223 | ## atexit.register(_core_.wxApp_CleanUp) | |
d14a1e28 RD |
7224 | |
7225 | ||
7226 | #---------------------------------------------------------------------------- | |
7227 | ||
7228 | #--------------------------------------------------------------------------- | |
2ef75293 RD |
7229 | |
7230 | class EventLoop(object): | |
093d3ff1 | 7231 | """Proxy of C++ EventLoop class""" |
0085ce49 RD |
7232 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7233 | __repr__ = _swig_repr | |
7234 | def __init__(self, *args, **kwargs): | |
2ef75293 | 7235 | """__init__(self) -> EventLoop""" |
0085ce49 RD |
7236 | _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs)) |
7237 | __swig_destroy__ = _core_.delete_EventLoop | |
7238 | __del__ = lambda self : None; | |
2ef75293 RD |
7239 | def Run(*args, **kwargs): |
7240 | """Run(self) -> int""" | |
7241 | return _core_.EventLoop_Run(*args, **kwargs) | |
7242 | ||
7243 | def Exit(*args, **kwargs): | |
7244 | """Exit(self, int rc=0)""" | |
7245 | return _core_.EventLoop_Exit(*args, **kwargs) | |
7246 | ||
7247 | def Pending(*args, **kwargs): | |
7248 | """Pending(self) -> bool""" | |
7249 | return _core_.EventLoop_Pending(*args, **kwargs) | |
7250 | ||
7251 | def Dispatch(*args, **kwargs): | |
7252 | """Dispatch(self) -> bool""" | |
7253 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
7254 | ||
7255 | def IsRunning(*args, **kwargs): | |
7256 | """IsRunning(self) -> bool""" | |
7257 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
7258 | ||
7259 | def GetActive(*args, **kwargs): | |
7260 | """GetActive() -> EventLoop""" | |
7261 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
7262 | ||
7263 | GetActive = staticmethod(GetActive) | |
7264 | def SetActive(*args, **kwargs): | |
7265 | """SetActive(EventLoop loop)""" | |
7266 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
7267 | ||
7268 | SetActive = staticmethod(SetActive) | |
2131d850 | 7269 | _core_.EventLoop_swigregister(EventLoop) |
2ef75293 | 7270 | |
0085ce49 RD |
7271 | def EventLoop_GetActive(*args): |
7272 | """EventLoop_GetActive() -> EventLoop""" | |
7273 | return _core_.EventLoop_GetActive(*args) | |
2ef75293 RD |
7274 | |
7275 | def EventLoop_SetActive(*args, **kwargs): | |
0085ce49 RD |
7276 | """EventLoop_SetActive(EventLoop loop)""" |
7277 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
2ef75293 | 7278 | |
091f5bed RD |
7279 | class EventLoopActivator(object): |
7280 | """Proxy of C++ EventLoopActivator class""" | |
0085ce49 RD |
7281 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7282 | __repr__ = _swig_repr | |
7283 | def __init__(self, *args, **kwargs): | |
091f5bed | 7284 | """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" |
0085ce49 RD |
7285 | _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs)) |
7286 | __swig_destroy__ = _core_.delete_EventLoopActivator | |
7287 | __del__ = lambda self : None; | |
2131d850 | 7288 | _core_.EventLoopActivator_swigregister(EventLoopActivator) |
091f5bed | 7289 | |
2ef75293 | 7290 | #--------------------------------------------------------------------------- |
d14a1e28 | 7291 | |
1e0c8722 | 7292 | class AcceleratorEntry(object): |
66c033b4 RD |
7293 | """ |
7294 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
7295 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
7296 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
41e2b43e | 7297 | as well. See `__init__` for of the tuple values. |
66c033b4 RD |
7298 | |
7299 | :see: `wx.AcceleratorTable` | |
7300 | """ | |
0085ce49 RD |
7301 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7302 | __repr__ = _swig_repr | |
7303 | def __init__(self, *args, **kwargs): | |
66c033b4 RD |
7304 | """ |
7305 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
7306 | ||
7307 | Construct a wx.AcceleratorEntry. | |
66c033b4 | 7308 | """ |
0085ce49 RD |
7309 | _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs)) |
7310 | __swig_destroy__ = _core_.delete_AcceleratorEntry | |
7311 | __del__ = lambda self : None; | |
1e0c8722 | 7312 | def Set(*args, **kwargs): |
66c033b4 RD |
7313 | """ |
7314 | Set(self, int flags, int keyCode, int cmd) | |
1e0c8722 | 7315 | |
66c033b4 RD |
7316 | (Re)set the attributes of a wx.AcceleratorEntry. |
7317 | :see `__init__` | |
7318 | """ | |
7319 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
1e0c8722 RD |
7320 | |
7321 | def GetFlags(*args, **kwargs): | |
66c033b4 RD |
7322 | """ |
7323 | GetFlags(self) -> int | |
7324 | ||
7325 | Get the AcceleratorEntry's flags. | |
7326 | """ | |
54f9ee45 | 7327 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
1e0c8722 RD |
7328 | |
7329 | def GetKeyCode(*args, **kwargs): | |
66c033b4 RD |
7330 | """ |
7331 | GetKeyCode(self) -> int | |
7332 | ||
7333 | Get the AcceleratorEntry's keycode. | |
7334 | """ | |
54f9ee45 | 7335 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
1e0c8722 RD |
7336 | |
7337 | def GetCommand(*args, **kwargs): | |
66c033b4 RD |
7338 | """ |
7339 | GetCommand(self) -> int | |
7340 | ||
7341 | Get the AcceleratorEntry's command ID. | |
7342 | """ | |
54f9ee45 | 7343 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
1e0c8722 | 7344 | |
2131d850 | 7345 | _core_.AcceleratorEntry_swigregister(AcceleratorEntry) |
1e0c8722 RD |
7346 | |
7347 | class AcceleratorTable(Object): | |
66c033b4 RD |
7348 | """ |
7349 | An accelerator table allows the application to specify a table of | |
7350 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
7351 | button commands are supported; on GTK, only menu commands are | |
7352 | supported. | |
66c033b4 | 7353 | """ |
0085ce49 RD |
7354 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7355 | __repr__ = _swig_repr | |
7356 | def __init__(self, *args, **kwargs): | |
0df68c9f RD |
7357 | """ |
7358 | __init__(entries) -> AcceleratorTable | |
1e0c8722 | 7359 | |
66c033b4 RD |
7360 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
7361 | items or or of 3-tuples (flags, keyCode, cmdID) | |
7362 | ||
7363 | :see: `wx.AcceleratorEntry` | |
0df68c9f | 7364 | """ |
0085ce49 RD |
7365 | _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs)) |
7366 | __swig_destroy__ = _core_.delete_AcceleratorTable | |
7367 | __del__ = lambda self : None; | |
1e0c8722 | 7368 | def Ok(*args, **kwargs): |
a95a7133 | 7369 | """Ok(self) -> bool""" |
54f9ee45 | 7370 | return _core_.AcceleratorTable_Ok(*args, **kwargs) |
1e0c8722 | 7371 | |
2131d850 | 7372 | _core_.AcceleratorTable_swigregister(AcceleratorTable) |
1e0c8722 RD |
7373 | |
7374 | ||
7375 | def GetAccelFromString(*args, **kwargs): | |
0085ce49 RD |
7376 | """GetAccelFromString(String label) -> AcceleratorEntry""" |
7377 | return _core_.GetAccelFromString(*args, **kwargs) | |
1e0c8722 RD |
7378 | #--------------------------------------------------------------------------- |
7379 | ||
74a57fcd RD |
7380 | class VisualAttributes(object): |
7381 | """struct containing all the visual attributes of a control""" | |
0085ce49 RD |
7382 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7383 | __repr__ = _swig_repr | |
7384 | def __init__(self, *args, **kwargs): | |
74a57fcd | 7385 | """ |
a95a7133 | 7386 | __init__(self) -> VisualAttributes |
74a57fcd RD |
7387 | |
7388 | struct containing all the visual attributes of a control | |
7389 | """ | |
0085ce49 RD |
7390 | _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs)) |
7391 | __swig_destroy__ = _core_.delete_VisualAttributes | |
7392 | __del__ = lambda self : None; | |
54f9ee45 RD |
7393 | font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set) |
7394 | colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set) | |
7395 | colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set) | |
2131d850 | 7396 | _core_.VisualAttributes_swigregister(VisualAttributes) |
74a57fcd RD |
7397 | NullAcceleratorTable = cvar.NullAcceleratorTable |
7398 | PanelNameStr = cvar.PanelNameStr | |
7399 | ||
54f9ee45 RD |
7400 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
7401 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
7402 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
7403 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
7404 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
d14a1e28 | 7405 | class Window(EvtHandler): |
15afbcd0 RD |
7406 | """ |
7407 | wx.Window is the base class for all windows and represents any visible | |
7408 | object on the screen. All controls, top level windows and so on are | |
7409 | wx.Windows. Sizers and device contexts are not however, as they don't | |
7410 | appear on screen themselves. | |
7411 | ||
7412 | """ | |
0085ce49 RD |
7413 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7414 | __repr__ = _swig_repr | |
7415 | def __init__(self, *args, **kwargs): | |
0df68c9f | 7416 | """ |
a95a7133 | 7417 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7418 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window |
15afbcd0 RD |
7419 | |
7420 | Construct and show a generic Window. | |
0df68c9f | 7421 | """ |
0085ce49 | 7422 | _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs)) |
d14a1e28 | 7423 | self._setOORInfo(self) |
d14a1e28 | 7424 | |
e811c8ce | 7425 | def Create(*args, **kwargs): |
0df68c9f | 7426 | """ |
a95a7133 | 7427 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 7428 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool |
15afbcd0 RD |
7429 | |
7430 | Create the GUI part of the Window for 2-phase creation mode. | |
0df68c9f | 7431 | """ |
54f9ee45 | 7432 | return _core_.Window_Create(*args, **kwargs) |
d14a1e28 | 7433 | |
e811c8ce | 7434 | def Close(*args, **kwargs): |
15afbcd0 | 7435 | """ |
a95a7133 | 7436 | Close(self, bool force=False) -> bool |
15afbcd0 RD |
7437 | |
7438 | This function simply generates a EVT_CLOSE event whose handler usually | |
7439 | tries to close the window. It doesn't close the window itself, | |
7440 | however. If force is False (the default) then the window's close | |
7441 | handler will be allowed to veto the destruction of the window. | |
15afbcd0 | 7442 | """ |
54f9ee45 | 7443 | return _core_.Window_Close(*args, **kwargs) |
d14a1e28 | 7444 | |
e811c8ce | 7445 | def Destroy(*args, **kwargs): |
0df68c9f | 7446 | """ |
a95a7133 | 7447 | Destroy(self) -> bool |
d14a1e28 | 7448 | |
15afbcd0 RD |
7449 | Destroys the window safely. Frames and dialogs are not destroyed |
7450 | immediately when this function is called -- they are added to a list | |
7451 | of windows to be deleted on idle time, when all the window's events | |
7452 | have been processed. This prevents problems with events being sent to | |
7453 | non-existent windows. | |
7454 | ||
7455 | Returns True if the window has either been successfully deleted, or it | |
7456 | has been added to the list of windows pending real deletion. | |
0df68c9f | 7457 | """ |
7e08d4ef RD |
7458 | val = _core_.Window_Destroy(*args, **kwargs) |
7459 | args[0].thisown = 0 | |
7460 | return val | |
d14a1e28 | 7461 | |
e811c8ce | 7462 | def DestroyChildren(*args, **kwargs): |
15afbcd0 | 7463 | """ |
a95a7133 | 7464 | DestroyChildren(self) -> bool |
15afbcd0 | 7465 | |
41e2b43e RD |
7466 | Destroys all children of a window. Called automatically by the |
7467 | destructor. | |
15afbcd0 | 7468 | """ |
54f9ee45 | 7469 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d14a1e28 | 7470 | |
e811c8ce | 7471 | def IsBeingDeleted(*args, **kwargs): |
15afbcd0 | 7472 | """ |
a95a7133 | 7473 | IsBeingDeleted(self) -> bool |
15afbcd0 RD |
7474 | |
7475 | Is the window in the process of being deleted? | |
7476 | """ | |
54f9ee45 | 7477 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d14a1e28 | 7478 | |
e811c8ce | 7479 | def SetLabel(*args, **kwargs): |
15afbcd0 | 7480 | """ |
a95a7133 | 7481 | SetLabel(self, String label) |
15afbcd0 RD |
7482 | |
7483 | Set the text which the window shows in its label if applicable. | |
7484 | """ | |
54f9ee45 | 7485 | return _core_.Window_SetLabel(*args, **kwargs) |
d14a1e28 | 7486 | |
e811c8ce | 7487 | def GetLabel(*args, **kwargs): |
15afbcd0 | 7488 | """ |
a95a7133 | 7489 | GetLabel(self) -> String |
15afbcd0 | 7490 | |
41e2b43e RD |
7491 | Generic way of getting a label from any window, for identification |
7492 | purposes. The interpretation of this function differs from class to | |
7493 | class. For frames and dialogs, the value returned is the title. For | |
7494 | buttons or static text controls, it is the button text. This function | |
7495 | can be useful for meta-programs such as testing tools or special-needs | |
7496 | access programs)which need to identify windows by name. | |
15afbcd0 | 7497 | """ |
54f9ee45 | 7498 | return _core_.Window_GetLabel(*args, **kwargs) |
d14a1e28 | 7499 | |
e811c8ce | 7500 | def SetName(*args, **kwargs): |
15afbcd0 | 7501 | """ |
a95a7133 | 7502 | SetName(self, String name) |
15afbcd0 | 7503 | |
41e2b43e RD |
7504 | Sets the window's name. The window name is used for ressource setting |
7505 | in X, it is not the same as the window title/label | |
15afbcd0 | 7506 | """ |
54f9ee45 | 7507 | return _core_.Window_SetName(*args, **kwargs) |
d14a1e28 | 7508 | |
e811c8ce | 7509 | def GetName(*args, **kwargs): |
15afbcd0 | 7510 | """ |
a95a7133 | 7511 | GetName(self) -> String |
15afbcd0 | 7512 | |
41e2b43e RD |
7513 | Returns the windows name. This name is not guaranteed to be unique; |
7514 | it is up to the programmer to supply an appropriate name in the window | |
7515 | constructor or via wx.Window.SetName. | |
15afbcd0 | 7516 | """ |
54f9ee45 | 7517 | return _core_.Window_GetName(*args, **kwargs) |
d14a1e28 | 7518 | |
4276dc52 RD |
7519 | def SetWindowVariant(*args, **kwargs): |
7520 | """ | |
a95a7133 | 7521 | SetWindowVariant(self, int variant) |
4276dc52 | 7522 | |
41e2b43e RD |
7523 | Sets the variant of the window/font size to use for this window, if |
7524 | the platform supports variants, for example, wxMac. | |
4276dc52 | 7525 | """ |
54f9ee45 | 7526 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
4276dc52 RD |
7527 | |
7528 | def GetWindowVariant(*args, **kwargs): | |
a95a7133 | 7529 | """GetWindowVariant(self) -> int""" |
54f9ee45 | 7530 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
4276dc52 | 7531 | |
e811c8ce | 7532 | def SetId(*args, **kwargs): |
15afbcd0 | 7533 | """ |
a95a7133 | 7534 | SetId(self, int winid) |
15afbcd0 RD |
7535 | |
7536 | Sets the identifier of the window. Each window has an integer | |
7537 | identifier. If the application has not provided one, an identifier | |
7538 | will be generated. Normally, the identifier should be provided on | |
7539 | creation and should not be modified subsequently. | |
7540 | """ | |
54f9ee45 | 7541 | return _core_.Window_SetId(*args, **kwargs) |
d14a1e28 | 7542 | |
e811c8ce | 7543 | def GetId(*args, **kwargs): |
15afbcd0 | 7544 | """ |
a95a7133 | 7545 | GetId(self) -> int |
15afbcd0 RD |
7546 | |
7547 | Returns the identifier of the window. Each window has an integer | |
7548 | identifier. If the application has not provided one (or the default Id | |
7549 | -1 is used) then an unique identifier with a negative value will be | |
7550 | generated. | |
7551 | """ | |
54f9ee45 | 7552 | return _core_.Window_GetId(*args, **kwargs) |
d14a1e28 | 7553 | |
e811c8ce | 7554 | def NewControlId(*args, **kwargs): |
15afbcd0 | 7555 | """ |
66c033b4 | 7556 | NewControlId() -> int |
15afbcd0 RD |
7557 | |
7558 | Generate a control id for the controls which were not given one. | |
7559 | """ | |
54f9ee45 | 7560 | return _core_.Window_NewControlId(*args, **kwargs) |
d14a1e28 | 7561 | |
e811c8ce RD |
7562 | NewControlId = staticmethod(NewControlId) |
7563 | def NextControlId(*args, **kwargs): | |
15afbcd0 | 7564 | """ |
66c033b4 | 7565 | NextControlId(int winid) -> int |
15afbcd0 RD |
7566 | |
7567 | Get the id of the control following the one with the given | |
41e2b43e | 7568 | autogenerated) id |
15afbcd0 | 7569 | """ |
54f9ee45 | 7570 | return _core_.Window_NextControlId(*args, **kwargs) |
d14a1e28 | 7571 | |
e811c8ce RD |
7572 | NextControlId = staticmethod(NextControlId) |
7573 | def PrevControlId(*args, **kwargs): | |
15afbcd0 | 7574 | """ |
66c033b4 | 7575 | PrevControlId(int winid) -> int |
15afbcd0 RD |
7576 | |
7577 | Get the id of the control preceding the one with the given | |
41e2b43e | 7578 | autogenerated) id |
15afbcd0 | 7579 | """ |
54f9ee45 | 7580 | return _core_.Window_PrevControlId(*args, **kwargs) |
d14a1e28 | 7581 | |
e811c8ce RD |
7582 | PrevControlId = staticmethod(PrevControlId) |
7583 | def SetSize(*args, **kwargs): | |
15afbcd0 | 7584 | """ |
a95a7133 | 7585 | SetSize(self, Size size) |
15afbcd0 RD |
7586 | |
7587 | Sets the size of the window in pixels. | |
7588 | """ | |
54f9ee45 | 7589 | return _core_.Window_SetSize(*args, **kwargs) |
d14a1e28 | 7590 | |
e811c8ce | 7591 | def SetDimensions(*args, **kwargs): |
15afbcd0 | 7592 | """ |
a95a7133 | 7593 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
7594 | |
7595 | Sets the position and size of the window in pixels. The sizeFlags | |
7596 | parameter indicates the interpretation of the other params if they are | |
e505d15e RD |
7597 | equal to -1. |
7598 | ||
7599 | ======================== ====================================== | |
7600 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
7601 | default should be used. | |
7602 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
7603 | -1 values are supplied. | |
7604 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
7605 | interpreted as real dimensions, not | |
7606 | default values. | |
7607 | ======================== ====================================== | |
7608 | ||
15afbcd0 | 7609 | """ |
54f9ee45 | 7610 | return _core_.Window_SetDimensions(*args, **kwargs) |
d14a1e28 | 7611 | |
e811c8ce | 7612 | def SetRect(*args, **kwargs): |
15afbcd0 | 7613 | """ |
a95a7133 | 7614 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
7615 | |
7616 | Sets the position and size of the window in pixels using a wx.Rect. | |
7617 | """ | |
54f9ee45 | 7618 | return _core_.Window_SetRect(*args, **kwargs) |
d14a1e28 | 7619 | |
e811c8ce | 7620 | def SetSizeWH(*args, **kwargs): |
15afbcd0 | 7621 | """ |
a95a7133 | 7622 | SetSizeWH(self, int width, int height) |
15afbcd0 RD |
7623 | |
7624 | Sets the size of the window in pixels. | |
7625 | """ | |
54f9ee45 | 7626 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d14a1e28 | 7627 | |
e811c8ce | 7628 | def Move(*args, **kwargs): |
15afbcd0 | 7629 | """ |
a95a7133 | 7630 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
7631 | |
7632 | Moves the window to the given position. | |
7633 | """ | |
54f9ee45 | 7634 | return _core_.Window_Move(*args, **kwargs) |
d14a1e28 | 7635 | |
e811c8ce RD |
7636 | SetPosition = Move |
7637 | def MoveXY(*args, **kwargs): | |
15afbcd0 | 7638 | """ |
a95a7133 | 7639 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
7640 | |
7641 | Moves the window to the given position. | |
7642 | """ | |
54f9ee45 | 7643 | return _core_.Window_MoveXY(*args, **kwargs) |
e811c8ce | 7644 | |
f8167d6e RD |
7645 | def SetBestFittingSize(*args, **kwargs): |
7646 | """ | |
7647 | SetBestFittingSize(self, Size size=DefaultSize) | |
7648 | ||
7649 | A 'Smart' SetSize that will fill in default size components with the | |
7650 | window's *best size* values. Also set's the minsize for use with sizers. | |
7651 | """ | |
7652 | return _core_.Window_SetBestFittingSize(*args, **kwargs) | |
7653 | ||
e811c8ce | 7654 | def Raise(*args, **kwargs): |
15afbcd0 | 7655 | """ |
a95a7133 | 7656 | Raise(self) |
15afbcd0 | 7657 | |
943e8dfd RD |
7658 | Raises the window to the top of the window hierarchy. In current |
7659 | version of wxWidgets this works both for manage and child windows. | |
15afbcd0 | 7660 | """ |
54f9ee45 | 7661 | return _core_.Window_Raise(*args, **kwargs) |
e811c8ce RD |
7662 | |
7663 | def Lower(*args, **kwargs): | |
15afbcd0 | 7664 | """ |
a95a7133 | 7665 | Lower(self) |
15afbcd0 | 7666 | |
943e8dfd RD |
7667 | Lowers the window to the bottom of the window hierarchy. In current |
7668 | version of wxWidgets this works both for manage and child windows. | |
15afbcd0 | 7669 | """ |
54f9ee45 | 7670 | return _core_.Window_Lower(*args, **kwargs) |
e811c8ce RD |
7671 | |
7672 | def SetClientSize(*args, **kwargs): | |
15afbcd0 | 7673 | """ |
a95a7133 | 7674 | SetClientSize(self, Size size) |
15afbcd0 RD |
7675 | |
7676 | This sets the size of the window client area in pixels. Using this | |
7677 | function to size a window tends to be more device-independent than | |
7678 | wx.Window.SetSize, since the application need not worry about what | |
7679 | dimensions the border or title bar have when trying to fit the window | |
7680 | around panel items, for example. | |
7681 | """ | |
54f9ee45 | 7682 | return _core_.Window_SetClientSize(*args, **kwargs) |
e811c8ce RD |
7683 | |
7684 | def SetClientSizeWH(*args, **kwargs): | |
15afbcd0 | 7685 | """ |
a95a7133 | 7686 | SetClientSizeWH(self, int width, int height) |
15afbcd0 RD |
7687 | |
7688 | This sets the size of the window client area in pixels. Using this | |
7689 | function to size a window tends to be more device-independent than | |
7690 | wx.Window.SetSize, since the application need not worry about what | |
7691 | dimensions the border or title bar have when trying to fit the window | |
7692 | around panel items, for example. | |
7693 | """ | |
54f9ee45 | 7694 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
e811c8ce RD |
7695 | |
7696 | def SetClientRect(*args, **kwargs): | |
15afbcd0 | 7697 | """ |
a95a7133 | 7698 | SetClientRect(self, Rect rect) |
15afbcd0 RD |
7699 | |
7700 | This sets the size of the window client area in pixels. Using this | |
7701 | function to size a window tends to be more device-independent than | |
7702 | wx.Window.SetSize, since the application need not worry about what | |
7703 | dimensions the border or title bar have when trying to fit the window | |
7704 | around panel items, for example. | |
7705 | """ | |
54f9ee45 | 7706 | return _core_.Window_SetClientRect(*args, **kwargs) |
e811c8ce RD |
7707 | |
7708 | def GetPosition(*args, **kwargs): | |
0df68c9f | 7709 | """ |
a95a7133 | 7710 | GetPosition(self) -> Point |
e811c8ce | 7711 | |
75219dcb RD |
7712 | Get the window's position. Notice that the position is in client |
7713 | coordinates for child windows and screen coordinates for the top level | |
7714 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
7715 | kinds of windows. | |
0df68c9f | 7716 | """ |
54f9ee45 | 7717 | return _core_.Window_GetPosition(*args, **kwargs) |
e811c8ce RD |
7718 | |
7719 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
7720 | """ |
7721 | GetPositionTuple() -> (x,y) | |
e811c8ce | 7722 | |
75219dcb RD |
7723 | Get the window's position. Notice that the position is in client |
7724 | coordinates for child windows and screen coordinates for the top level | |
7725 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
7726 | kinds of windows. | |
0df68c9f | 7727 | """ |
54f9ee45 | 7728 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
e811c8ce | 7729 | |
75219dcb RD |
7730 | def GetScreenPosition(*args, **kwargs): |
7731 | """ | |
7732 | GetScreenPosition(self) -> Point | |
7733 | ||
7734 | Get the position of the window in screen coordinantes. | |
7735 | """ | |
7736 | return _core_.Window_GetScreenPosition(*args, **kwargs) | |
7737 | ||
7738 | def GetScreenPositionTuple(*args, **kwargs): | |
7739 | """ | |
7740 | GetScreenPositionTuple() -> (x,y) | |
7741 | ||
7742 | Get the position of the window in screen coordinantes. | |
7743 | """ | |
7744 | return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | |
7745 | ||
7746 | def GetScreenRect(*args, **kwargs): | |
7747 | """ | |
7748 | GetScreenRect(self) -> Rect | |
7749 | ||
7750 | Returns the size and position of the window in screen coordinantes as | |
7751 | a `wx.Rect` object. | |
7752 | """ | |
7753 | return _core_.Window_GetScreenRect(*args, **kwargs) | |
7754 | ||
e811c8ce | 7755 | def GetSize(*args, **kwargs): |
0df68c9f | 7756 | """ |
a95a7133 | 7757 | GetSize(self) -> Size |
e811c8ce | 7758 | |
0df68c9f RD |
7759 | Get the window size. |
7760 | """ | |
54f9ee45 | 7761 | return _core_.Window_GetSize(*args, **kwargs) |
e811c8ce RD |
7762 | |
7763 | def GetSizeTuple(*args, **kwargs): | |
0df68c9f RD |
7764 | """ |
7765 | GetSizeTuple() -> (width, height) | |
e811c8ce | 7766 | |
0df68c9f RD |
7767 | Get the window size. |
7768 | """ | |
54f9ee45 | 7769 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
e811c8ce RD |
7770 | |
7771 | def GetRect(*args, **kwargs): | |
15afbcd0 | 7772 | """ |
a95a7133 | 7773 | GetRect(self) -> Rect |
15afbcd0 | 7774 | |
75219dcb | 7775 | Returns the size and position of the window as a `wx.Rect` object. |
15afbcd0 | 7776 | """ |
54f9ee45 | 7777 | return _core_.Window_GetRect(*args, **kwargs) |
e811c8ce RD |
7778 | |
7779 | def GetClientSize(*args, **kwargs): | |
0df68c9f | 7780 | """ |
a95a7133 | 7781 | GetClientSize(self) -> Size |
e811c8ce | 7782 | |
15afbcd0 RD |
7783 | This gets the size of the window's 'client area' in pixels. The client |
7784 | area is the area which may be drawn on by the programmer, excluding | |
7785 | title bar, border, scrollbars, etc. | |
0df68c9f | 7786 | """ |
54f9ee45 | 7787 | return _core_.Window_GetClientSize(*args, **kwargs) |
e811c8ce RD |
7788 | |
7789 | def GetClientSizeTuple(*args, **kwargs): | |
0df68c9f RD |
7790 | """ |
7791 | GetClientSizeTuple() -> (width, height) | |
e811c8ce | 7792 | |
15afbcd0 RD |
7793 | This gets the size of the window's 'client area' in pixels. The client |
7794 | area is the area which may be drawn on by the programmer, excluding | |
7795 | title bar, border, scrollbars, etc. | |
0df68c9f | 7796 | """ |
54f9ee45 | 7797 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
e811c8ce RD |
7798 | |
7799 | def GetClientAreaOrigin(*args, **kwargs): | |
15afbcd0 | 7800 | """ |
a95a7133 | 7801 | GetClientAreaOrigin(self) -> Point |
15afbcd0 RD |
7802 | |
7803 | Get the origin of the client area of the window relative to the | |
7804 | window's top left corner (the client area may be shifted because of | |
7805 | the borders, scrollbars, other decorations...) | |
7806 | """ | |
54f9ee45 | 7807 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
e811c8ce RD |
7808 | |
7809 | def GetClientRect(*args, **kwargs): | |
15afbcd0 | 7810 | """ |
a95a7133 | 7811 | GetClientRect(self) -> Rect |
15afbcd0 | 7812 | |
61863841 | 7813 | Get the client area position and size as a `wx.Rect` object. |
15afbcd0 | 7814 | """ |
54f9ee45 | 7815 | return _core_.Window_GetClientRect(*args, **kwargs) |
e811c8ce RD |
7816 | |
7817 | def GetBestSize(*args, **kwargs): | |
0df68c9f | 7818 | """ |
a95a7133 | 7819 | GetBestSize(self) -> Size |
e811c8ce | 7820 | |
248ed943 | 7821 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
7822 | window, if applicable. For example, for a static text control, it will |
7823 | be the minimal size such that the control label is not truncated. For | |
7824 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
7825 | this function will be the same as the size the window would have had | |
7826 | after calling Fit. | |
0df68c9f | 7827 | """ |
54f9ee45 | 7828 | return _core_.Window_GetBestSize(*args, **kwargs) |
e811c8ce RD |
7829 | |
7830 | def GetBestSizeTuple(*args, **kwargs): | |
0df68c9f RD |
7831 | """ |
7832 | GetBestSizeTuple() -> (width, height) | |
e811c8ce | 7833 | |
248ed943 | 7834 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
7835 | window, if applicable. For example, for a static text control, it will |
7836 | be the minimal size such that the control label is not truncated. For | |
7837 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
7838 | this function will be the same as the size the window would have had | |
7839 | after calling Fit. | |
0df68c9f | 7840 | """ |
54f9ee45 | 7841 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
e811c8ce | 7842 | |
dfbb5885 RD |
7843 | def InvalidateBestSize(*args, **kwargs): |
7844 | """ | |
7845 | InvalidateBestSize(self) | |
7846 | ||
7847 | Reset the cached best size value so it will be recalculated the next | |
7848 | time it is needed. | |
7849 | """ | |
7850 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
7851 | ||
e2813725 RD |
7852 | def CacheBestSize(*args, **kwargs): |
7853 | """ | |
7854 | CacheBestSize(self, Size size) | |
7855 | ||
7856 | Cache the best size so it doesn't need to be calculated again, (at least until | |
7857 | some properties of the window change.) | |
7858 | """ | |
7859 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
7860 | ||
dfbb5885 RD |
7861 | def GetBestFittingSize(*args, **kwargs): |
7862 | """ | |
7863 | GetBestFittingSize(self) -> Size | |
7864 | ||
7865 | This function will merge the window's best size into the window's | |
7866 | minimum size, giving priority to the min size components, and returns | |
7867 | the results. | |
7868 | ||
7869 | """ | |
7870 | return _core_.Window_GetBestFittingSize(*args, **kwargs) | |
7871 | ||
e811c8ce | 7872 | def GetAdjustedBestSize(*args, **kwargs): |
15afbcd0 | 7873 | """ |
a95a7133 | 7874 | GetAdjustedBestSize(self) -> Size |
15afbcd0 RD |
7875 | |
7876 | This method is similar to GetBestSize, except in one | |
7877 | thing. GetBestSize should return the minimum untruncated size of the | |
7878 | window, while this method will return the largest of BestSize and any | |
7879 | user specified minimum size. ie. it is the minimum size the window | |
7880 | should currently be drawn at, not the minimal size it can possibly | |
7881 | tolerate. | |
7882 | """ | |
54f9ee45 | 7883 | return _core_.Window_GetAdjustedBestSize(*args, **kwargs) |
e811c8ce RD |
7884 | |
7885 | def Center(*args, **kwargs): | |
15afbcd0 | 7886 | """ |
a95a7133 | 7887 | Center(self, int direction=BOTH) |
15afbcd0 RD |
7888 | |
7889 | Centers the window. The parameter specifies the direction for | |
7890 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
7891 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
7892 | on the entire screen and not on its parent window. If it is a | |
7893 | top-level window and has no parent then it will always be centered | |
7894 | relative to the screen. | |
7895 | """ | |
54f9ee45 | 7896 | return _core_.Window_Center(*args, **kwargs) |
e811c8ce RD |
7897 | |
7898 | Centre = Center | |
e811c8ce | 7899 | def CenterOnParent(*args, **kwargs): |
15afbcd0 | 7900 | """ |
a95a7133 | 7901 | CenterOnParent(self, int dir=BOTH) |
15afbcd0 RD |
7902 | |
7903 | Center with respect to the the parent window | |
7904 | """ | |
54f9ee45 | 7905 | return _core_.Window_CenterOnParent(*args, **kwargs) |
e811c8ce RD |
7906 | |
7907 | CentreOnParent = CenterOnParent | |
7908 | def Fit(*args, **kwargs): | |
15afbcd0 | 7909 | """ |
a95a7133 | 7910 | Fit(self) |
15afbcd0 RD |
7911 | |
7912 | Sizes the window so that it fits around its subwindows. This function | |
7913 | won't do anything if there are no subwindows and will only really work | |
7914 | correctly if sizers are used for the subwindows layout. Also, if the | |
7915 | window has exactly one subwindow it is better (faster and the result | |
7916 | is more precise as Fit adds some margin to account for fuzziness of | |
7917 | its calculations) to call window.SetClientSize(child.GetSize()) | |
7918 | instead of calling Fit. | |
7919 | """ | |
54f9ee45 | 7920 | return _core_.Window_Fit(*args, **kwargs) |
e811c8ce RD |
7921 | |
7922 | def FitInside(*args, **kwargs): | |
15afbcd0 | 7923 | """ |
a95a7133 | 7924 | FitInside(self) |
15afbcd0 RD |
7925 | |
7926 | Similar to Fit, but sizes the interior (virtual) size of a | |
7927 | window. Mainly useful with scrolled windows to reset scrollbars after | |
7928 | sizing changes that do not trigger a size event, and/or scrolled | |
7929 | windows without an interior sizer. This function similarly won't do | |
7930 | anything if there are no subwindows. | |
7931 | """ | |
54f9ee45 | 7932 | return _core_.Window_FitInside(*args, **kwargs) |
e811c8ce | 7933 | |
f16ab95d | 7934 | def SetSizeHints(*args, **kwargs): |
0df68c9f | 7935 | """ |
a95a7133 | 7936 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, |
0df68c9f | 7937 | int incH=-1) |
15afbcd0 RD |
7938 | |
7939 | Allows specification of minimum and maximum window sizes, and window | |
7940 | size increments. If a pair of values is not set (or set to -1), the | |
7941 | default values will be used. If this function is called, the user | |
908b74cd RD |
7942 | will not be able to size the window outside the given bounds (if it is |
7943 | a top-level window.) Sizers will also inspect the minimum window size | |
7944 | and will use that value if set when calculating layout. | |
7945 | ||
7946 | The resizing increments are only significant under Motif or Xt. | |
0df68c9f | 7947 | """ |
f16ab95d | 7948 | return _core_.Window_SetSizeHints(*args, **kwargs) |
e811c8ce | 7949 | |
f16ab95d RD |
7950 | def SetSizeHintsSz(*args, **kwargs): |
7951 | """ | |
7952 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
7953 | ||
7954 | Allows specification of minimum and maximum window sizes, and window | |
7955 | size increments. If a pair of values is not set (or set to -1), the | |
7956 | default values will be used. If this function is called, the user | |
7957 | will not be able to size the window outside the given bounds (if it is | |
7958 | a top-level window.) Sizers will also inspect the minimum window size | |
7959 | and will use that value if set when calculating layout. | |
7960 | ||
7961 | The resizing increments are only significant under Motif or Xt. | |
7962 | """ | |
7963 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
7964 | ||
7965 | def SetVirtualSizeHints(*args, **kwargs): | |
15afbcd0 | 7966 | """ |
908b74cd | 7967 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
15afbcd0 RD |
7968 | |
7969 | Allows specification of minimum and maximum virtual window sizes. If a | |
7970 | pair of values is not set (or set to -1), the default values will be | |
7971 | used. If this function is called, the user will not be able to size | |
7972 | the virtual area of the window outside the given bounds. | |
7973 | """ | |
f16ab95d RD |
7974 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
7975 | ||
7976 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
7977 | """ | |
7978 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
7979 | ||
7980 | Allows specification of minimum and maximum virtual window sizes. If a | |
7981 | pair of values is not set (or set to -1), the default values will be | |
7982 | used. If this function is called, the user will not be able to size | |
7983 | the virtual area of the window outside the given bounds. | |
7984 | """ | |
7985 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
e811c8ce | 7986 | |
908b74cd RD |
7987 | def GetMaxSize(*args, **kwargs): |
7988 | """GetMaxSize(self) -> Size""" | |
7989 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
7990 | ||
7991 | def GetMinSize(*args, **kwargs): | |
7992 | """GetMinSize(self) -> Size""" | |
7993 | return _core_.Window_GetMinSize(*args, **kwargs) | |
7994 | ||
7995 | def SetMinSize(*args, **kwargs): | |
7996 | """ | |
7997 | SetMinSize(self, Size minSize) | |
7998 | ||
7999 | A more convenient method than `SetSizeHints` for setting just the | |
8000 | min size. | |
8001 | """ | |
8002 | return _core_.Window_SetMinSize(*args, **kwargs) | |
8003 | ||
8004 | def SetMaxSize(*args, **kwargs): | |
8005 | """ | |
8006 | SetMaxSize(self, Size maxSize) | |
8007 | ||
8008 | A more convenient method than `SetSizeHints` for setting just the | |
8009 | max size. | |
8010 | """ | |
8011 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
8012 | ||
e811c8ce | 8013 | def GetMinWidth(*args, **kwargs): |
a95a7133 | 8014 | """GetMinWidth(self) -> int""" |
54f9ee45 | 8015 | return _core_.Window_GetMinWidth(*args, **kwargs) |
e811c8ce RD |
8016 | |
8017 | def GetMinHeight(*args, **kwargs): | |
a95a7133 | 8018 | """GetMinHeight(self) -> int""" |
54f9ee45 | 8019 | return _core_.Window_GetMinHeight(*args, **kwargs) |
e811c8ce RD |
8020 | |
8021 | def GetMaxWidth(*args, **kwargs): | |
a95a7133 | 8022 | """GetMaxWidth(self) -> int""" |
54f9ee45 | 8023 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
e811c8ce RD |
8024 | |
8025 | def GetMaxHeight(*args, **kwargs): | |
a95a7133 | 8026 | """GetMaxHeight(self) -> int""" |
54f9ee45 | 8027 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
e811c8ce | 8028 | |
e811c8ce | 8029 | def SetVirtualSize(*args, **kwargs): |
0df68c9f | 8030 | """ |
a95a7133 | 8031 | SetVirtualSize(self, Size size) |
e811c8ce | 8032 | |
15afbcd0 RD |
8033 | Set the the virtual size of a window in pixels. For most windows this |
8034 | is just the client area of the window, but for some like scrolled | |
8035 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8036 | """ |
54f9ee45 | 8037 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8038 | |
8039 | def SetVirtualSizeWH(*args, **kwargs): | |
0df68c9f | 8040 | """ |
a95a7133 | 8041 | SetVirtualSizeWH(self, int w, int h) |
e811c8ce | 8042 | |
15afbcd0 RD |
8043 | Set the the virtual size of a window in pixels. For most windows this |
8044 | is just the client area of the window, but for some like scrolled | |
8045 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8046 | """ |
54f9ee45 | 8047 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
e811c8ce RD |
8048 | |
8049 | def GetVirtualSize(*args, **kwargs): | |
0df68c9f | 8050 | """ |
a95a7133 | 8051 | GetVirtualSize(self) -> Size |
e811c8ce | 8052 | |
15afbcd0 RD |
8053 | Get the the virtual size of the window in pixels. For most windows |
8054 | this is just the client area of the window, but for some like scrolled | |
8055 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8056 | """ |
54f9ee45 | 8057 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8058 | |
8059 | def GetVirtualSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8060 | """ |
8061 | GetVirtualSizeTuple() -> (width, height) | |
e811c8ce | 8062 | |
15afbcd0 RD |
8063 | Get the the virtual size of the window in pixels. For most windows |
8064 | this is just the client area of the window, but for some like scrolled | |
8065 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8066 | """ |
54f9ee45 | 8067 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
e811c8ce RD |
8068 | |
8069 | def GetBestVirtualSize(*args, **kwargs): | |
15afbcd0 | 8070 | """ |
a95a7133 | 8071 | GetBestVirtualSize(self) -> Size |
15afbcd0 RD |
8072 | |
8073 | Return the largest of ClientSize and BestSize (as determined by a | |
8074 | sizer, interior children, or other means) | |
8075 | """ | |
54f9ee45 | 8076 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
e811c8ce RD |
8077 | |
8078 | def Show(*args, **kwargs): | |
15afbcd0 | 8079 | """ |
a95a7133 | 8080 | Show(self, bool show=True) -> bool |
15afbcd0 RD |
8081 | |
8082 | Shows or hides the window. You may need to call Raise for a top level | |
8083 | window if you want to bring it to top, although this is not needed if | |
8084 | Show is called immediately after the frame creation. Returns True if | |
8085 | the window has been shown or hidden or False if nothing was done | |
8086 | because it already was in the requested state. | |
8087 | """ | |
54f9ee45 | 8088 | return _core_.Window_Show(*args, **kwargs) |
e811c8ce RD |
8089 | |
8090 | def Hide(*args, **kwargs): | |
15afbcd0 | 8091 | """ |
a95a7133 | 8092 | Hide(self) -> bool |
15afbcd0 RD |
8093 | |
8094 | Equivalent to calling Show(False). | |
8095 | """ | |
54f9ee45 | 8096 | return _core_.Window_Hide(*args, **kwargs) |
e811c8ce RD |
8097 | |
8098 | def Enable(*args, **kwargs): | |
15afbcd0 | 8099 | """ |
a95a7133 | 8100 | Enable(self, bool enable=True) -> bool |
15afbcd0 RD |
8101 | |
8102 | Enable or disable the window for user input. Note that when a parent | |
8103 | window is disabled, all of its children are disabled as well and they | |
8104 | are reenabled again when the parent is. Returns true if the window | |
8105 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8106 | window had already been in the specified state. | |
8107 | """ | |
54f9ee45 | 8108 | return _core_.Window_Enable(*args, **kwargs) |
e811c8ce RD |
8109 | |
8110 | def Disable(*args, **kwargs): | |
15afbcd0 | 8111 | """ |
a95a7133 | 8112 | Disable(self) -> bool |
15afbcd0 RD |
8113 | |
8114 | Disables the window, same as Enable(false). | |
8115 | """ | |
54f9ee45 | 8116 | return _core_.Window_Disable(*args, **kwargs) |
e811c8ce RD |
8117 | |
8118 | def IsShown(*args, **kwargs): | |
15afbcd0 | 8119 | """ |
a95a7133 | 8120 | IsShown(self) -> bool |
15afbcd0 RD |
8121 | |
8122 | Returns true if the window is shown, false if it has been hidden. | |
8123 | """ | |
54f9ee45 | 8124 | return _core_.Window_IsShown(*args, **kwargs) |
e811c8ce RD |
8125 | |
8126 | def IsEnabled(*args, **kwargs): | |
15afbcd0 | 8127 | """ |
a95a7133 | 8128 | IsEnabled(self) -> bool |
15afbcd0 RD |
8129 | |
8130 | Returns true if the window is enabled for input, false otherwise. | |
8131 | """ | |
54f9ee45 | 8132 | return _core_.Window_IsEnabled(*args, **kwargs) |
e811c8ce RD |
8133 | |
8134 | def SetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 8135 | """ |
a95a7133 | 8136 | SetWindowStyleFlag(self, long style) |
15afbcd0 | 8137 | |
41e2b43e RD |
8138 | Sets the style of the window. Please note that some styles cannot be |
8139 | changed after the window creation and that Refresh() might need to be | |
8140 | called after changing the others for the change to take place | |
8141 | immediately. | |
15afbcd0 | 8142 | """ |
54f9ee45 | 8143 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
e811c8ce RD |
8144 | |
8145 | def GetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 8146 | """ |
a95a7133 | 8147 | GetWindowStyleFlag(self) -> long |
e811c8ce | 8148 | |
15afbcd0 RD |
8149 | Gets the window style that was passed to the constructor or Create |
8150 | method. | |
8151 | """ | |
54f9ee45 | 8152 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
e811c8ce | 8153 | |
15afbcd0 | 8154 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag |
e811c8ce | 8155 | def HasFlag(*args, **kwargs): |
15afbcd0 | 8156 | """ |
a95a7133 | 8157 | HasFlag(self, int flag) -> bool |
15afbcd0 RD |
8158 | |
8159 | Test if the given style is set for this window. | |
8160 | """ | |
54f9ee45 | 8161 | return _core_.Window_HasFlag(*args, **kwargs) |
e811c8ce RD |
8162 | |
8163 | def IsRetained(*args, **kwargs): | |
15afbcd0 | 8164 | """ |
a95a7133 | 8165 | IsRetained(self) -> bool |
15afbcd0 RD |
8166 | |
8167 | Returns true if the window is retained, false otherwise. Retained | |
8168 | windows are only available on X platforms. | |
8169 | """ | |
54f9ee45 | 8170 | return _core_.Window_IsRetained(*args, **kwargs) |
e811c8ce RD |
8171 | |
8172 | def SetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8173 | """ |
a95a7133 | 8174 | SetExtraStyle(self, long exStyle) |
15afbcd0 RD |
8175 | |
8176 | Sets the extra style bits for the window. Extra styles are the less | |
8177 | often used style bits which can't be set with the constructor or with | |
8178 | SetWindowStyleFlag() | |
8179 | """ | |
54f9ee45 | 8180 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8181 | |
8182 | def GetExtraStyle(*args, **kwargs): | |
15afbcd0 | 8183 | """ |
a95a7133 | 8184 | GetExtraStyle(self) -> long |
15afbcd0 RD |
8185 | |
8186 | Returns the extra style bits for the window. | |
8187 | """ | |
54f9ee45 | 8188 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
e811c8ce RD |
8189 | |
8190 | def MakeModal(*args, **kwargs): | |
15afbcd0 | 8191 | """ |
a95a7133 | 8192 | MakeModal(self, bool modal=True) |
15afbcd0 RD |
8193 | |
8194 | Disables all other windows in the application so that the user can | |
8195 | only interact with this window. Passing False will reverse this | |
8196 | effect. | |
8197 | """ | |
54f9ee45 | 8198 | return _core_.Window_MakeModal(*args, **kwargs) |
e811c8ce RD |
8199 | |
8200 | def SetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8201 | """ |
a95a7133 | 8202 | SetThemeEnabled(self, bool enableTheme) |
15afbcd0 RD |
8203 | |
8204 | This function tells a window if it should use the system's "theme" | |
8205 | code to draw the windows' background instead if its own background | |
8206 | drawing code. This will only have an effect on platforms that support | |
8207 | the notion of themes in user defined windows. One such platform is | |
8208 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
8209 | user's selected theme. | |
8210 | ||
8211 | Dialogs, notebook pages and the status bar have this flag set to true | |
8212 | by default so that the default look and feel is simulated best. | |
8213 | """ | |
54f9ee45 | 8214 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8215 | |
8216 | def GetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 8217 | """ |
a95a7133 | 8218 | GetThemeEnabled(self) -> bool |
e811c8ce | 8219 | |
15afbcd0 RD |
8220 | Return the themeEnabled flag. |
8221 | """ | |
54f9ee45 | 8222 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
8223 | |
8224 | def SetFocus(*args, **kwargs): | |
15afbcd0 | 8225 | """ |
a95a7133 | 8226 | SetFocus(self) |
15afbcd0 RD |
8227 | |
8228 | Set's the focus to this window, allowing it to receive keyboard input. | |
8229 | """ | |
54f9ee45 | 8230 | return _core_.Window_SetFocus(*args, **kwargs) |
e811c8ce RD |
8231 | |
8232 | def SetFocusFromKbd(*args, **kwargs): | |
15afbcd0 | 8233 | """ |
a95a7133 | 8234 | SetFocusFromKbd(self) |
15afbcd0 RD |
8235 | |
8236 | Set focus to this window as the result of a keyboard action. Normally | |
8237 | only called internally. | |
8238 | """ | |
54f9ee45 | 8239 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
e811c8ce RD |
8240 | |
8241 | def FindFocus(*args, **kwargs): | |
15afbcd0 | 8242 | """ |
66c033b4 | 8243 | FindFocus() -> Window |
15afbcd0 RD |
8244 | |
8245 | Returns the window or control that currently has the keyboard focus, | |
8246 | or None. | |
8247 | """ | |
54f9ee45 | 8248 | return _core_.Window_FindFocus(*args, **kwargs) |
e811c8ce RD |
8249 | |
8250 | FindFocus = staticmethod(FindFocus) | |
8251 | def AcceptsFocus(*args, **kwargs): | |
15afbcd0 | 8252 | """ |
a95a7133 | 8253 | AcceptsFocus(self) -> bool |
15afbcd0 RD |
8254 | |
8255 | Can this window have focus? | |
8256 | """ | |
54f9ee45 | 8257 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
e811c8ce RD |
8258 | |
8259 | def AcceptsFocusFromKeyboard(*args, **kwargs): | |
15afbcd0 | 8260 | """ |
a95a7133 | 8261 | AcceptsFocusFromKeyboard(self) -> bool |
15afbcd0 RD |
8262 | |
8263 | Can this window be given focus by keyboard navigation? if not, the | |
8264 | only way to give it focus (provided it accepts it at all) is to click | |
8265 | it. | |
8266 | """ | |
54f9ee45 | 8267 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
e811c8ce RD |
8268 | |
8269 | def GetDefaultItem(*args, **kwargs): | |
15afbcd0 | 8270 | """ |
a95a7133 | 8271 | GetDefaultItem(self) -> Window |
15afbcd0 RD |
8272 | |
8273 | Get the default child of this parent, i.e. the one which is activated | |
8274 | by pressing <Enter> such as the OK button on a wx.Dialog. | |
8275 | """ | |
54f9ee45 | 8276 | return _core_.Window_GetDefaultItem(*args, **kwargs) |
e811c8ce RD |
8277 | |
8278 | def SetDefaultItem(*args, **kwargs): | |
15afbcd0 | 8279 | """ |
a95a7133 | 8280 | SetDefaultItem(self, Window child) -> Window |
15afbcd0 RD |
8281 | |
8282 | Set this child as default, return the old default. | |
8283 | """ | |
54f9ee45 | 8284 | return _core_.Window_SetDefaultItem(*args, **kwargs) |
e811c8ce RD |
8285 | |
8286 | def SetTmpDefaultItem(*args, **kwargs): | |
15afbcd0 | 8287 | """ |
a95a7133 | 8288 | SetTmpDefaultItem(self, Window win) |
15afbcd0 RD |
8289 | |
8290 | Set this child as temporary default | |
8291 | """ | |
54f9ee45 | 8292 | return _core_.Window_SetTmpDefaultItem(*args, **kwargs) |
e811c8ce | 8293 | |
908b74cd RD |
8294 | def Navigate(*args, **kwargs): |
8295 | """ | |
8296 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
8297 | ||
fd2dc343 RD |
8298 | Does keyboard navigation from this window to another, by sending a |
8299 | `wx.NavigationKeyEvent`. | |
908b74cd RD |
8300 | """ |
8301 | return _core_.Window_Navigate(*args, **kwargs) | |
8302 | ||
7f98d120 RD |
8303 | def MoveAfterInTabOrder(*args, **kwargs): |
8304 | """ | |
8305 | MoveAfterInTabOrder(self, Window win) | |
8306 | ||
8307 | Moves this window in the tab navigation order after the specified | |
8308 | sibling window. This means that when the user presses the TAB key on | |
8309 | that other window, the focus switches to this window. | |
8310 | ||
8311 | The default tab order is the same as creation order. This function | |
8312 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
8313 | windows. | |
8314 | ||
8315 | """ | |
8316 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
8317 | ||
8318 | def MoveBeforeInTabOrder(*args, **kwargs): | |
8319 | """ | |
8320 | MoveBeforeInTabOrder(self, Window win) | |
8321 | ||
8322 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
8323 | before win instead of putting it right after it. | |
8324 | """ | |
8325 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
8326 | ||
e811c8ce | 8327 | def GetChildren(*args, **kwargs): |
15afbcd0 | 8328 | """ |
a95a7133 | 8329 | GetChildren(self) -> PyObject |
15afbcd0 RD |
8330 | |
8331 | Returns a list of the window's children. NOTE: Currently this is a | |
8332 | copy of the child window list maintained by the window, so the return | |
8333 | value of this function is only valid as long as the window's children | |
8334 | do not change. | |
8335 | """ | |
54f9ee45 | 8336 | return _core_.Window_GetChildren(*args, **kwargs) |
e811c8ce RD |
8337 | |
8338 | def GetParent(*args, **kwargs): | |
15afbcd0 | 8339 | """ |
a95a7133 | 8340 | GetParent(self) -> Window |
15afbcd0 RD |
8341 | |
8342 | Returns the parent window of this window, or None if there isn't one. | |
8343 | """ | |
54f9ee45 | 8344 | return _core_.Window_GetParent(*args, **kwargs) |
e811c8ce RD |
8345 | |
8346 | def GetGrandParent(*args, **kwargs): | |
15afbcd0 | 8347 | """ |
a95a7133 | 8348 | GetGrandParent(self) -> Window |
15afbcd0 | 8349 | |
41e2b43e RD |
8350 | Returns the parent of the parent of this window, or None if there |
8351 | isn't one. | |
15afbcd0 | 8352 | """ |
54f9ee45 | 8353 | return _core_.Window_GetGrandParent(*args, **kwargs) |
e811c8ce RD |
8354 | |
8355 | def IsTopLevel(*args, **kwargs): | |
15afbcd0 | 8356 | """ |
a95a7133 | 8357 | IsTopLevel(self) -> bool |
15afbcd0 RD |
8358 | |
8359 | Returns true if the given window is a top-level one. Currently all | |
8360 | frames and dialogs are always considered to be top-level windows (even | |
8361 | if they have a parent window). | |
8362 | """ | |
54f9ee45 | 8363 | return _core_.Window_IsTopLevel(*args, **kwargs) |
e811c8ce RD |
8364 | |
8365 | def Reparent(*args, **kwargs): | |
15afbcd0 | 8366 | """ |
a95a7133 | 8367 | Reparent(self, Window newParent) -> bool |
15afbcd0 RD |
8368 | |
8369 | Reparents the window, i.e the window will be removed from its current | |
8370 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
8371 | re-inserted into another. Available on Windows and GTK. Returns True | |
8372 | if the parent was changed, False otherwise (error or newParent == | |
8373 | oldParent) | |
8374 | """ | |
54f9ee45 | 8375 | return _core_.Window_Reparent(*args, **kwargs) |
e811c8ce RD |
8376 | |
8377 | def AddChild(*args, **kwargs): | |
15afbcd0 | 8378 | """ |
a95a7133 | 8379 | AddChild(self, Window child) |
15afbcd0 RD |
8380 | |
8381 | Adds a child window. This is called automatically by window creation | |
8382 | functions so should not be required by the application programmer. | |
8383 | """ | |
54f9ee45 | 8384 | return _core_.Window_AddChild(*args, **kwargs) |
e811c8ce RD |
8385 | |
8386 | def RemoveChild(*args, **kwargs): | |
15afbcd0 | 8387 | """ |
a95a7133 | 8388 | RemoveChild(self, Window child) |
15afbcd0 RD |
8389 | |
8390 | Removes a child window. This is called automatically by window | |
8391 | deletion functions so should not be required by the application | |
8392 | programmer. | |
8393 | """ | |
54f9ee45 | 8394 | return _core_.Window_RemoveChild(*args, **kwargs) |
e811c8ce | 8395 | |
704eda0c RD |
8396 | def SetDoubleBuffered(*args, **kwargs): |
8397 | """ | |
8398 | SetDoubleBuffered(self, bool on) | |
8399 | ||
8400 | Currently wxGTK2 only. | |
8401 | """ | |
8402 | return _core_.Window_SetDoubleBuffered(*args, **kwargs) | |
8403 | ||
e811c8ce | 8404 | def FindWindowById(*args, **kwargs): |
15afbcd0 | 8405 | """ |
a95a7133 | 8406 | FindWindowById(self, long winid) -> Window |
15afbcd0 RD |
8407 | |
8408 | Find a chld of this window by window ID | |
8409 | """ | |
54f9ee45 | 8410 | return _core_.Window_FindWindowById(*args, **kwargs) |
e811c8ce RD |
8411 | |
8412 | def FindWindowByName(*args, **kwargs): | |
15afbcd0 | 8413 | """ |
a95a7133 | 8414 | FindWindowByName(self, String name) -> Window |
15afbcd0 RD |
8415 | |
8416 | Find a child of this window by name | |
8417 | """ | |
54f9ee45 | 8418 | return _core_.Window_FindWindowByName(*args, **kwargs) |
e811c8ce RD |
8419 | |
8420 | def GetEventHandler(*args, **kwargs): | |
15afbcd0 | 8421 | """ |
a95a7133 | 8422 | GetEventHandler(self) -> EvtHandler |
15afbcd0 RD |
8423 | |
8424 | Returns the event handler for this window. By default, the window is | |
8425 | its own event handler. | |
8426 | """ | |
54f9ee45 | 8427 | return _core_.Window_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
8428 | |
8429 | def SetEventHandler(*args, **kwargs): | |
15afbcd0 | 8430 | """ |
a95a7133 | 8431 | SetEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8432 | |
8433 | Sets the event handler for this window. An event handler is an object | |
8434 | that is capable of processing the events sent to a window. By default, | |
8435 | the window is its own event handler, but an application may wish to | |
8436 | substitute another, for example to allow central implementation of | |
8437 | event-handling for a variety of different window classes. | |
8438 | ||
41e2b43e | 8439 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
15afbcd0 RD |
8440 | up a chain of event handlers, where an event not handled by one event |
8441 | handler is handed to the next one in the chain. | |
8442 | """ | |
54f9ee45 | 8443 | return _core_.Window_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
8444 | |
8445 | def PushEventHandler(*args, **kwargs): | |
15afbcd0 | 8446 | """ |
a95a7133 | 8447 | PushEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
8448 | |
8449 | Pushes this event handler onto the event handler stack for the window. | |
8450 | An event handler is an object that is capable of processing the events | |
8451 | sent to a window. By default, the window is its own event handler, but | |
8452 | an application may wish to substitute another, for example to allow | |
8453 | central implementation of event-handling for a variety of different | |
8454 | window classes. | |
8455 | ||
8456 | wx.Window.PushEventHandler allows an application to set up a chain of | |
8457 | event handlers, where an event not handled by one event handler is | |
41e2b43e | 8458 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` to |
15afbcd0 RD |
8459 | remove the event handler. |
8460 | """ | |
54f9ee45 | 8461 | return _core_.Window_PushEventHandler(*args, **kwargs) |
e811c8ce RD |
8462 | |
8463 | def PopEventHandler(*args, **kwargs): | |
15afbcd0 | 8464 | """ |
a95a7133 | 8465 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
15afbcd0 RD |
8466 | |
8467 | Removes and returns the top-most event handler on the event handler | |
8468 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
8469 | destroyed after it is popped. | |
8470 | """ | |
54f9ee45 | 8471 | return _core_.Window_PopEventHandler(*args, **kwargs) |
e811c8ce RD |
8472 | |
8473 | def RemoveEventHandler(*args, **kwargs): | |
15afbcd0 | 8474 | """ |
a95a7133 | 8475 | RemoveEventHandler(self, EvtHandler handler) -> bool |
15afbcd0 | 8476 | |
41e2b43e RD |
8477 | Find the given handler in the event handler chain and remove (but not |
8478 | delete) it from the event handler chain, return True if it was found | |
8479 | and False otherwise (this also results in an assert failure so this | |
8480 | function should only be called when the handler is supposed to be | |
8481 | there.) | |
15afbcd0 | 8482 | """ |
54f9ee45 | 8483 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
e811c8ce RD |
8484 | |
8485 | def SetValidator(*args, **kwargs): | |
15afbcd0 | 8486 | """ |
a95a7133 | 8487 | SetValidator(self, Validator validator) |
15afbcd0 RD |
8488 | |
8489 | Deletes the current validator (if any) and sets the window validator, | |
8490 | having called wx.Validator.Clone to create a new validator of this | |
8491 | type. | |
8492 | """ | |
54f9ee45 | 8493 | return _core_.Window_SetValidator(*args, **kwargs) |
e811c8ce RD |
8494 | |
8495 | def GetValidator(*args, **kwargs): | |
15afbcd0 | 8496 | """ |
a95a7133 | 8497 | GetValidator(self) -> Validator |
15afbcd0 RD |
8498 | |
8499 | Returns a pointer to the current validator for the window, or None if | |
8500 | there is none. | |
8501 | """ | |
54f9ee45 | 8502 | return _core_.Window_GetValidator(*args, **kwargs) |
e811c8ce | 8503 | |
74a57fcd RD |
8504 | def Validate(*args, **kwargs): |
8505 | """ | |
a95a7133 | 8506 | Validate(self) -> bool |
74a57fcd RD |
8507 | |
8508 | Validates the current values of the child controls using their | |
41e2b43e RD |
8509 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
8510 | style flag set, the method will also call Validate() of all child | |
8511 | windows. Returns false if any of the validations failed. | |
74a57fcd | 8512 | """ |
54f9ee45 | 8513 | return _core_.Window_Validate(*args, **kwargs) |
74a57fcd RD |
8514 | |
8515 | def TransferDataToWindow(*args, **kwargs): | |
8516 | """ | |
a95a7133 | 8517 | TransferDataToWindow(self) -> bool |
74a57fcd | 8518 | |
41e2b43e RD |
8519 | Transfers values to child controls from data areas specified by their |
8520 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
8521 | style flag set, the method will also call TransferDataToWindow() of | |
8522 | all child windows. | |
74a57fcd | 8523 | """ |
54f9ee45 | 8524 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
74a57fcd RD |
8525 | |
8526 | def TransferDataFromWindow(*args, **kwargs): | |
8527 | """ | |
a95a7133 | 8528 | TransferDataFromWindow(self) -> bool |
74a57fcd | 8529 | |
41e2b43e RD |
8530 | Transfers values from child controls to data areas specified by their |
8531 | validators. Returns false if a transfer failed. If the window has | |
8532 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
8533 | also call TransferDataFromWindow() of all child windows. | |
74a57fcd | 8534 | """ |
54f9ee45 | 8535 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
74a57fcd RD |
8536 | |
8537 | def InitDialog(*args, **kwargs): | |
8538 | """ | |
a95a7133 | 8539 | InitDialog(self) |
74a57fcd | 8540 | |
41e2b43e RD |
8541 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
8542 | to the dialog via validators. | |
74a57fcd | 8543 | """ |
54f9ee45 | 8544 | return _core_.Window_InitDialog(*args, **kwargs) |
74a57fcd | 8545 | |
e811c8ce | 8546 | def SetAcceleratorTable(*args, **kwargs): |
15afbcd0 | 8547 | """ |
a95a7133 | 8548 | SetAcceleratorTable(self, AcceleratorTable accel) |
15afbcd0 RD |
8549 | |
8550 | Sets the accelerator table for this window. | |
8551 | """ | |
54f9ee45 | 8552 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
8553 | |
8554 | def GetAcceleratorTable(*args, **kwargs): | |
15afbcd0 | 8555 | """ |
a95a7133 | 8556 | GetAcceleratorTable(self) -> AcceleratorTable |
15afbcd0 RD |
8557 | |
8558 | Gets the accelerator table for this window. | |
8559 | """ | |
54f9ee45 | 8560 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
8561 | |
8562 | def RegisterHotKey(*args, **kwargs): | |
15afbcd0 | 8563 | """ |
a95a7133 | 8564 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool |
15afbcd0 RD |
8565 | |
8566 | Registers a system wide hotkey. Every time the user presses the hotkey | |
8567 | registered here, this window will receive a hotkey event. It will | |
8568 | receive the event even if the application is in the background and | |
8569 | does not have the input focus because the user is working with some | |
8570 | other application. To bind an event handler function to this hotkey | |
8571 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
8572 | hotkey was registered successfully. | |
8573 | """ | |
54f9ee45 | 8574 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
e811c8ce RD |
8575 | |
8576 | def UnregisterHotKey(*args, **kwargs): | |
15afbcd0 | 8577 | """ |
a95a7133 | 8578 | UnregisterHotKey(self, int hotkeyId) -> bool |
15afbcd0 RD |
8579 | |
8580 | Unregisters a system wide hotkey. | |
8581 | """ | |
54f9ee45 | 8582 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
e811c8ce RD |
8583 | |
8584 | def ConvertDialogPointToPixels(*args, **kwargs): | |
15afbcd0 | 8585 | """ |
a95a7133 | 8586 | ConvertDialogPointToPixels(self, Point pt) -> Point |
15afbcd0 RD |
8587 | |
8588 | Converts a point or size from dialog units to pixels. Dialog units | |
8589 | are used for maintaining a dialog's proportions even if the font | |
8590 | changes. For the x dimension, the dialog units are multiplied by the | |
8591 | average character width and then divided by 4. For the y dimension, | |
8592 | the dialog units are multiplied by the average character height and | |
8593 | then divided by 8. | |
8594 | """ | |
54f9ee45 | 8595 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
e811c8ce RD |
8596 | |
8597 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
15afbcd0 | 8598 | """ |
a95a7133 | 8599 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
15afbcd0 RD |
8600 | |
8601 | Converts a point or size from dialog units to pixels. Dialog units | |
8602 | are used for maintaining a dialog's proportions even if the font | |
8603 | changes. For the x dimension, the dialog units are multiplied by the | |
8604 | average character width and then divided by 4. For the y dimension, | |
8605 | the dialog units are multiplied by the average character height and | |
8606 | then divided by 8. | |
8607 | """ | |
54f9ee45 | 8608 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
e811c8ce RD |
8609 | |
8610 | def DLG_PNT(*args, **kwargs): | |
15afbcd0 | 8611 | """ |
a95a7133 | 8612 | DLG_PNT(self, Point pt) -> Point |
15afbcd0 RD |
8613 | |
8614 | Converts a point or size from dialog units to pixels. Dialog units | |
8615 | are used for maintaining a dialog's proportions even if the font | |
8616 | changes. For the x dimension, the dialog units are multiplied by the | |
8617 | average character width and then divided by 4. For the y dimension, | |
8618 | the dialog units are multiplied by the average character height and | |
8619 | then divided by 8. | |
8620 | """ | |
54f9ee45 | 8621 | return _core_.Window_DLG_PNT(*args, **kwargs) |
e811c8ce RD |
8622 | |
8623 | def DLG_SZE(*args, **kwargs): | |
15afbcd0 | 8624 | """ |
a95a7133 | 8625 | DLG_SZE(self, Size sz) -> Size |
15afbcd0 RD |
8626 | |
8627 | Converts a point or size from dialog units to pixels. Dialog units | |
8628 | are used for maintaining a dialog's proportions even if the font | |
8629 | changes. For the x dimension, the dialog units are multiplied by the | |
8630 | average character width and then divided by 4. For the y dimension, | |
8631 | the dialog units are multiplied by the average character height and | |
8632 | then divided by 8. | |
8633 | """ | |
54f9ee45 | 8634 | return _core_.Window_DLG_SZE(*args, **kwargs) |
e811c8ce RD |
8635 | |
8636 | def ConvertPixelPointToDialog(*args, **kwargs): | |
a95a7133 | 8637 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
54f9ee45 | 8638 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) |
e811c8ce RD |
8639 | |
8640 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
a95a7133 | 8641 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
54f9ee45 | 8642 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) |
e811c8ce RD |
8643 | |
8644 | def WarpPointer(*args, **kwargs): | |
15afbcd0 | 8645 | """ |
a95a7133 | 8646 | WarpPointer(self, int x, int y) |
15afbcd0 RD |
8647 | |
8648 | Moves the pointer to the given position on the window. | |
8649 | ||
8650 | NOTE: This function is not supported under Mac because Apple Human | |
8651 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
8652 | """ | |
54f9ee45 | 8653 | return _core_.Window_WarpPointer(*args, **kwargs) |
e811c8ce RD |
8654 | |
8655 | def CaptureMouse(*args, **kwargs): | |
15afbcd0 | 8656 | """ |
a95a7133 | 8657 | CaptureMouse(self) |
15afbcd0 RD |
8658 | |
8659 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
8660 | release the capture. | |
8661 | ||
8662 | Note that wxWindows maintains the stack of windows having captured the | |
8663 | mouse and when the mouse is released the capture returns to the window | |
8664 | which had had captured it previously and it is only really released if | |
8665 | there were no previous window. In particular, this means that you must | |
8666 | release the mouse as many times as you capture it. | |
8667 | """ | |
54f9ee45 | 8668 | return _core_.Window_CaptureMouse(*args, **kwargs) |
e811c8ce RD |
8669 | |
8670 | def ReleaseMouse(*args, **kwargs): | |
15afbcd0 | 8671 | """ |
a95a7133 | 8672 | ReleaseMouse(self) |
15afbcd0 RD |
8673 | |
8674 | Releases mouse input captured with wx.Window.CaptureMouse. | |
8675 | """ | |
54f9ee45 | 8676 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
e811c8ce RD |
8677 | |
8678 | def GetCapture(*args, **kwargs): | |
15afbcd0 | 8679 | """ |
66c033b4 | 8680 | GetCapture() -> Window |
15afbcd0 RD |
8681 | |
8682 | Returns the window which currently captures the mouse or None | |
8683 | """ | |
54f9ee45 | 8684 | return _core_.Window_GetCapture(*args, **kwargs) |
e811c8ce RD |
8685 | |
8686 | GetCapture = staticmethod(GetCapture) | |
8687 | def HasCapture(*args, **kwargs): | |
15afbcd0 | 8688 | """ |
a95a7133 | 8689 | HasCapture(self) -> bool |
15afbcd0 RD |
8690 | |
8691 | Returns true if this window has the current mouse capture. | |
8692 | """ | |
54f9ee45 | 8693 | return _core_.Window_HasCapture(*args, **kwargs) |
e811c8ce RD |
8694 | |
8695 | def Refresh(*args, **kwargs): | |
15afbcd0 | 8696 | """ |
a95a7133 | 8697 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
15afbcd0 RD |
8698 | |
8699 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
8700 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
8701 | to the window. | |
8702 | """ | |
54f9ee45 | 8703 | return _core_.Window_Refresh(*args, **kwargs) |
e811c8ce RD |
8704 | |
8705 | def RefreshRect(*args, **kwargs): | |
15afbcd0 | 8706 | """ |
fef4c27a | 8707 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
15afbcd0 RD |
8708 | |
8709 | Redraws the contents of the given rectangle: the area inside it will | |
8710 | be repainted. This is the same as Refresh but has a nicer syntax. | |
8711 | """ | |
54f9ee45 | 8712 | return _core_.Window_RefreshRect(*args, **kwargs) |
e811c8ce RD |
8713 | |
8714 | def Update(*args, **kwargs): | |
15afbcd0 | 8715 | """ |
a95a7133 | 8716 | Update(self) |
15afbcd0 RD |
8717 | |
8718 | Calling this method immediately repaints the invalidated area of the | |
8719 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
8720 | this would usually only happen when the flow of control returns to the | |
8721 | event loop.) Notice that this function doesn't refresh the window and | |
8722 | does nothing if the window has been already repainted. Use Refresh | |
8723 | first if you want to immediately redraw the window (or some portion of | |
8724 | it) unconditionally. | |
8725 | """ | |
54f9ee45 | 8726 | return _core_.Window_Update(*args, **kwargs) |
e811c8ce RD |
8727 | |
8728 | def ClearBackground(*args, **kwargs): | |
15afbcd0 | 8729 | """ |
a95a7133 | 8730 | ClearBackground(self) |
15afbcd0 RD |
8731 | |
8732 | Clears the window by filling it with the current background | |
8733 | colour. Does not cause an erase background event to be generated. | |
8734 | """ | |
54f9ee45 | 8735 | return _core_.Window_ClearBackground(*args, **kwargs) |
e811c8ce RD |
8736 | |
8737 | def Freeze(*args, **kwargs): | |
15afbcd0 | 8738 | """ |
a95a7133 | 8739 | Freeze(self) |
15afbcd0 | 8740 | |
41e2b43e RD |
8741 | Freezes the window or, in other words, prevents any updates from |
8742 | taking place on screen, the window is not redrawn at all. Thaw must be | |
8743 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
8744 | nested, with the actual Thaw being delayed until all the nesting has | |
8745 | been undone. | |
15afbcd0 RD |
8746 | |
8747 | This method is useful for visual appearance optimization (for example, | |
8748 | it is a good idea to use it before inserting large amount of text into | |
8749 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
8750 | for all controls so it is mostly just a hint to wxWindows and not a | |
8751 | mandatory directive. | |
8752 | """ | |
54f9ee45 | 8753 | return _core_.Window_Freeze(*args, **kwargs) |
e811c8ce RD |
8754 | |
8755 | def Thaw(*args, **kwargs): | |
15afbcd0 | 8756 | """ |
a95a7133 | 8757 | Thaw(self) |
15afbcd0 | 8758 | |
4276dc52 | 8759 | Reenables window updating after a previous call to Freeze. Calls to |
41e2b43e RD |
8760 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
8761 | times that Freeze was before the window will be updated. | |
15afbcd0 | 8762 | """ |
54f9ee45 | 8763 | return _core_.Window_Thaw(*args, **kwargs) |
e811c8ce RD |
8764 | |
8765 | def PrepareDC(*args, **kwargs): | |
15afbcd0 | 8766 | """ |
a95a7133 | 8767 | PrepareDC(self, DC dc) |
15afbcd0 RD |
8768 | |
8769 | Call this function to prepare the device context for drawing a | |
8770 | scrolled image. It sets the device origin according to the current | |
8771 | scroll position. | |
8772 | """ | |
54f9ee45 | 8773 | return _core_.Window_PrepareDC(*args, **kwargs) |
e811c8ce RD |
8774 | |
8775 | def GetUpdateRegion(*args, **kwargs): | |
15afbcd0 | 8776 | """ |
a95a7133 | 8777 | GetUpdateRegion(self) -> Region |
15afbcd0 RD |
8778 | |
8779 | Returns the region specifying which parts of the window have been | |
8780 | damaged. Should only be called within an EVT_PAINT handler. | |
8781 | """ | |
54f9ee45 | 8782 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
e811c8ce RD |
8783 | |
8784 | def GetUpdateClientRect(*args, **kwargs): | |
15afbcd0 | 8785 | """ |
a95a7133 | 8786 | GetUpdateClientRect(self) -> Rect |
15afbcd0 RD |
8787 | |
8788 | Get the update rectangle region bounding box in client coords. | |
8789 | """ | |
54f9ee45 | 8790 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
e811c8ce RD |
8791 | |
8792 | def IsExposed(*args, **kwargs): | |
15afbcd0 | 8793 | """ |
a95a7133 | 8794 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool |
15afbcd0 RD |
8795 | |
8796 | Returns true if the given point or rectangle area has been exposed | |
8797 | since the last repaint. Call this in an paint event handler to | |
8798 | optimize redrawing by only redrawing those areas, which have been | |
8799 | exposed. | |
8800 | """ | |
54f9ee45 | 8801 | return _core_.Window_IsExposed(*args, **kwargs) |
e811c8ce RD |
8802 | |
8803 | def IsExposedPoint(*args, **kwargs): | |
15afbcd0 | 8804 | """ |
a95a7133 | 8805 | IsExposedPoint(self, Point pt) -> bool |
15afbcd0 RD |
8806 | |
8807 | Returns true if the given point or rectangle area has been exposed | |
8808 | since the last repaint. Call this in an paint event handler to | |
8809 | optimize redrawing by only redrawing those areas, which have been | |
8810 | exposed. | |
8811 | """ | |
54f9ee45 | 8812 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
e811c8ce | 8813 | |
4276dc52 | 8814 | def IsExposedRect(*args, **kwargs): |
15afbcd0 | 8815 | """ |
a95a7133 | 8816 | IsExposedRect(self, Rect rect) -> bool |
15afbcd0 RD |
8817 | |
8818 | Returns true if the given point or rectangle area has been exposed | |
8819 | since the last repaint. Call this in an paint event handler to | |
8820 | optimize redrawing by only redrawing those areas, which have been | |
8821 | exposed. | |
8822 | """ | |
54f9ee45 | 8823 | return _core_.Window_IsExposedRect(*args, **kwargs) |
e811c8ce | 8824 | |
74a57fcd RD |
8825 | def GetDefaultAttributes(*args, **kwargs): |
8826 | """ | |
a95a7133 | 8827 | GetDefaultAttributes(self) -> VisualAttributes |
74a57fcd | 8828 | |
41e2b43e RD |
8829 | Get the default attributes for an instance of this class. This is |
8830 | useful if you want to use the same font or colour in your own control | |
8831 | as in a standard control -- which is a much better idea than hard | |
8832 | coding specific colours or fonts which might look completely out of | |
db3e571a | 8833 | place on the user's system, especially if it uses themes. |
74a57fcd | 8834 | """ |
54f9ee45 | 8835 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
8836 | |
8837 | def GetClassDefaultAttributes(*args, **kwargs): | |
8838 | """ | |
66c033b4 | 8839 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
74a57fcd | 8840 | |
41e2b43e RD |
8841 | Get the default attributes for this class. This is useful if you want |
8842 | to use the same font or colour in your own control as in a standard | |
8843 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
8844 | colours or fonts which might look completely out of place on the |
8845 | user's system, especially if it uses themes. | |
74a57fcd RD |
8846 | |
8847 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 8848 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
8849 | the returned font. See `wx.Window.SetWindowVariant` for more about |
8850 | this. | |
74a57fcd | 8851 | """ |
54f9ee45 | 8852 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
8853 | |
8854 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
e811c8ce | 8855 | def SetBackgroundColour(*args, **kwargs): |
15afbcd0 | 8856 | """ |
a95a7133 | 8857 | SetBackgroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
8858 | |
8859 | Sets the background colour of the window. Returns True if the colour | |
8860 | was changed. The background colour is usually painted by the default | |
8861 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
8862 | automatically under GTK. Using `wx.NullColour` will reset the window |
8863 | to the default background colour. | |
15afbcd0 | 8864 | |
db3e571a | 8865 | Note that setting the background colour may not cause an immediate |
f8167d6e | 8866 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
15afbcd0 RD |
8867 | calling this function. |
8868 | ||
f8167d6e RD |
8869 | Using this function will disable attempts to use themes for this |
8870 | window, if the system supports them. Use with care since usually the | |
8871 | themes represent the appearance chosen by the user to be used for all | |
8872 | applications on the system. | |
15afbcd0 | 8873 | """ |
54f9ee45 | 8874 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
e811c8ce | 8875 | |
412d302d RD |
8876 | def SetOwnBackgroundColour(*args, **kwargs): |
8877 | """SetOwnBackgroundColour(self, Colour colour)""" | |
8878 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
b2df227b | 8879 | |
e811c8ce | 8880 | def SetForegroundColour(*args, **kwargs): |
15afbcd0 | 8881 | """ |
a95a7133 | 8882 | SetForegroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
8883 | |
8884 | Sets the foreground colour of the window. Returns True is the colour | |
8885 | was changed. The interpretation of foreground colour is dependent on | |
8886 | the window class; it may be the text colour or other colour, or it may | |
8887 | not be used at all. | |
8888 | """ | |
54f9ee45 | 8889 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
e811c8ce | 8890 | |
fa47d7a7 VS |
8891 | def SetOwnForegroundColour(*args, **kwargs): |
8892 | """SetOwnForegroundColour(self, Colour colour)""" | |
8893 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
b2df227b | 8894 | |
e811c8ce | 8895 | def GetBackgroundColour(*args, **kwargs): |
15afbcd0 | 8896 | """ |
a95a7133 | 8897 | GetBackgroundColour(self) -> Colour |
15afbcd0 RD |
8898 | |
8899 | Returns the background colour of the window. | |
8900 | """ | |
54f9ee45 | 8901 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
e811c8ce RD |
8902 | |
8903 | def GetForegroundColour(*args, **kwargs): | |
15afbcd0 | 8904 | """ |
a95a7133 | 8905 | GetForegroundColour(self) -> Colour |
15afbcd0 RD |
8906 | |
8907 | Returns the foreground colour of the window. The interpretation of | |
8908 | foreground colour is dependent on the window class; it may be the text | |
8909 | colour or other colour, or it may not be used at all. | |
8910 | """ | |
54f9ee45 | 8911 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
e811c8ce | 8912 | |
562ecc31 RD |
8913 | def InheritsBackgroundColour(*args, **kwargs): |
8914 | """InheritsBackgroundColour(self) -> bool""" | |
8915 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
8916 | ||
8917 | def UseBgCol(*args, **kwargs): | |
8918 | """UseBgCol(self) -> bool""" | |
8919 | return _core_.Window_UseBgCol(*args, **kwargs) | |
8920 | ||
7bc1e663 RD |
8921 | def SetBackgroundStyle(*args, **kwargs): |
8922 | """ | |
8923 | SetBackgroundStyle(self, int style) -> bool | |
8924 | ||
8925 | Returns the background style of the window. The background style | |
8926 | indicates how the background of the window is drawn. | |
8927 | ||
8928 | ====================== ======================================== | |
8929 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
8930 | be determined by the system | |
8931 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
8932 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
8933 | application. | |
8934 | ====================== ======================================== | |
8935 | ||
8936 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
8937 | a custom background, such as a tiled bitmap. Currently the style has | |
8938 | no effect on other platforms. | |
8939 | ||
8940 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
8941 | """ | |
8942 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
8943 | ||
8944 | def GetBackgroundStyle(*args, **kwargs): | |
8945 | """ | |
8946 | GetBackgroundStyle(self) -> int | |
8947 | ||
8948 | Returns the background style of the window. | |
8949 | ||
8950 | :see: `SetBackgroundStyle` | |
8951 | """ | |
8952 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
8953 | ||
51b83b37 RD |
8954 | def HasTransparentBackground(*args, **kwargs): |
8955 | """ | |
8956 | HasTransparentBackground(self) -> bool | |
8957 | ||
8958 | Returns True if this window's background is transparent (as, for | |
8959 | example, for `wx.StaticText`) and should show the parent window's | |
8960 | background. | |
8961 | ||
8962 | This method is mostly used internally by the library itself and you | |
8963 | normally shouldn't have to call it. You may, however, have to override | |
8964 | it in your custom control classes to ensure that background is painted | |
8965 | correctly. | |
8966 | """ | |
8967 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
8968 | ||
e811c8ce | 8969 | def SetCursor(*args, **kwargs): |
15afbcd0 | 8970 | """ |
a95a7133 | 8971 | SetCursor(self, Cursor cursor) -> bool |
15afbcd0 RD |
8972 | |
8973 | Sets the window's cursor. Notice that the window cursor also sets it | |
8974 | for the children of the window implicitly. | |
8975 | ||
8976 | The cursor may be wx.NullCursor in which case the window cursor will | |
8977 | be reset back to default. | |
8978 | """ | |
54f9ee45 | 8979 | return _core_.Window_SetCursor(*args, **kwargs) |
e811c8ce RD |
8980 | |
8981 | def GetCursor(*args, **kwargs): | |
15afbcd0 | 8982 | """ |
a95a7133 | 8983 | GetCursor(self) -> Cursor |
15afbcd0 RD |
8984 | |
8985 | Return the cursor associated with this window. | |
8986 | """ | |
54f9ee45 | 8987 | return _core_.Window_GetCursor(*args, **kwargs) |
e811c8ce RD |
8988 | |
8989 | def SetFont(*args, **kwargs): | |
15afbcd0 | 8990 | """ |
a95a7133 | 8991 | SetFont(self, Font font) -> bool |
15afbcd0 RD |
8992 | |
8993 | Sets the font for this window. | |
8994 | """ | |
54f9ee45 | 8995 | return _core_.Window_SetFont(*args, **kwargs) |
e811c8ce | 8996 | |
fa47d7a7 VS |
8997 | def SetOwnFont(*args, **kwargs): |
8998 | """SetOwnFont(self, Font font)""" | |
8999 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
b2df227b | 9000 | |
e811c8ce | 9001 | def GetFont(*args, **kwargs): |
15afbcd0 | 9002 | """ |
a95a7133 | 9003 | GetFont(self) -> Font |
15afbcd0 | 9004 | |
4276dc52 | 9005 | Returns the default font used for this window. |
15afbcd0 | 9006 | """ |
54f9ee45 | 9007 | return _core_.Window_GetFont(*args, **kwargs) |
e811c8ce RD |
9008 | |
9009 | def SetCaret(*args, **kwargs): | |
15afbcd0 | 9010 | """ |
a95a7133 | 9011 | SetCaret(self, Caret caret) |
15afbcd0 RD |
9012 | |
9013 | Sets the caret associated with the window. | |
9014 | """ | |
54f9ee45 | 9015 | return _core_.Window_SetCaret(*args, **kwargs) |
e811c8ce RD |
9016 | |
9017 | def GetCaret(*args, **kwargs): | |
15afbcd0 | 9018 | """ |
a95a7133 | 9019 | GetCaret(self) -> Caret |
15afbcd0 RD |
9020 | |
9021 | Returns the caret associated with the window. | |
9022 | """ | |
54f9ee45 | 9023 | return _core_.Window_GetCaret(*args, **kwargs) |
e811c8ce RD |
9024 | |
9025 | def GetCharHeight(*args, **kwargs): | |
15afbcd0 | 9026 | """ |
a95a7133 | 9027 | GetCharHeight(self) -> int |
15afbcd0 RD |
9028 | |
9029 | Get the (average) character size for the current font. | |
9030 | """ | |
54f9ee45 | 9031 | return _core_.Window_GetCharHeight(*args, **kwargs) |
e811c8ce RD |
9032 | |
9033 | def GetCharWidth(*args, **kwargs): | |
15afbcd0 | 9034 | """ |
a95a7133 | 9035 | GetCharWidth(self) -> int |
15afbcd0 RD |
9036 | |
9037 | Get the (average) character size for the current font. | |
9038 | """ | |
54f9ee45 | 9039 | return _core_.Window_GetCharWidth(*args, **kwargs) |
e811c8ce RD |
9040 | |
9041 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9042 | """ |
9043 | GetTextExtent(String string) -> (width, height) | |
9044 | ||
9045 | Get the width and height of the text using the current font. | |
9046 | """ | |
54f9ee45 | 9047 | return _core_.Window_GetTextExtent(*args, **kwargs) |
e811c8ce RD |
9048 | |
9049 | def GetFullTextExtent(*args, **kwargs): | |
0df68c9f | 9050 | """ |
196addbf | 9051 | GetFullTextExtent(String string, Font font=None) -> |
0df68c9f | 9052 | (width, height, descent, externalLeading) |
e811c8ce | 9053 | |
15afbcd0 RD |
9054 | Get the width, height, decent and leading of the text using the |
9055 | current or specified font. | |
0df68c9f | 9056 | """ |
54f9ee45 | 9057 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
e811c8ce RD |
9058 | |
9059 | def ClientToScreenXY(*args, **kwargs): | |
15afbcd0 RD |
9060 | """ |
9061 | ClientToScreenXY(int x, int y) -> (x,y) | |
9062 | ||
9063 | Converts to screen coordinates from coordinates relative to this window. | |
9064 | """ | |
54f9ee45 | 9065 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
e811c8ce RD |
9066 | |
9067 | def ScreenToClientXY(*args, **kwargs): | |
15afbcd0 RD |
9068 | """ |
9069 | ScreenToClientXY(int x, int y) -> (x,y) | |
9070 | ||
9071 | Converts from screen to client window coordinates. | |
9072 | """ | |
54f9ee45 | 9073 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
e811c8ce RD |
9074 | |
9075 | def ClientToScreen(*args, **kwargs): | |
15afbcd0 | 9076 | """ |
a95a7133 | 9077 | ClientToScreen(self, Point pt) -> Point |
15afbcd0 RD |
9078 | |
9079 | Converts to screen coordinates from coordinates relative to this window. | |
9080 | """ | |
54f9ee45 | 9081 | return _core_.Window_ClientToScreen(*args, **kwargs) |
e811c8ce RD |
9082 | |
9083 | def ScreenToClient(*args, **kwargs): | |
15afbcd0 | 9084 | """ |
a95a7133 | 9085 | ScreenToClient(self, Point pt) -> Point |
15afbcd0 RD |
9086 | |
9087 | Converts from screen to client window coordinates. | |
9088 | """ | |
54f9ee45 | 9089 | return _core_.Window_ScreenToClient(*args, **kwargs) |
e811c8ce RD |
9090 | |
9091 | def HitTestXY(*args, **kwargs): | |
15afbcd0 | 9092 | """ |
a95a7133 | 9093 | HitTestXY(self, int x, int y) -> int |
15afbcd0 RD |
9094 | |
9095 | Test where the given (in client coords) point lies | |
9096 | """ | |
54f9ee45 | 9097 | return _core_.Window_HitTestXY(*args, **kwargs) |
e811c8ce RD |
9098 | |
9099 | def HitTest(*args, **kwargs): | |
15afbcd0 | 9100 | """ |
a95a7133 | 9101 | HitTest(self, Point pt) -> int |
15afbcd0 RD |
9102 | |
9103 | Test where the given (in client coords) point lies | |
9104 | """ | |
54f9ee45 | 9105 | return _core_.Window_HitTest(*args, **kwargs) |
e811c8ce | 9106 | |
15afbcd0 RD |
9107 | def GetBorder(*args): |
9108 | """ | |
a95a7133 RD |
9109 | GetBorder(self, long flags) -> int |
9110 | GetBorder(self) -> int | |
e811c8ce | 9111 | |
15afbcd0 RD |
9112 | Get border for the flags of this window |
9113 | """ | |
54f9ee45 | 9114 | return _core_.Window_GetBorder(*args) |
e811c8ce RD |
9115 | |
9116 | def UpdateWindowUI(*args, **kwargs): | |
15afbcd0 | 9117 | """ |
a95a7133 | 9118 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
15afbcd0 RD |
9119 | |
9120 | This function sends EVT_UPDATE_UI events to the window. The particular | |
9121 | implementation depends on the window; for example a wx.ToolBar will | |
9122 | send an update UI event for each toolbar button, and a wx.Frame will | |
9123 | send an update UI event for each menubar menu item. You can call this | |
9124 | function from your application to ensure that your UI is up-to-date at | |
9125 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
9126 | concerned). This may be necessary if you have called | |
5ba5649b | 9127 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
15afbcd0 RD |
9128 | limit the overhead that wxWindows incurs by sending update UI events |
9129 | in idle time. | |
15afbcd0 | 9130 | """ |
54f9ee45 | 9131 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
e811c8ce RD |
9132 | |
9133 | def PopupMenuXY(*args, **kwargs): | |
15afbcd0 | 9134 | """ |
b0503257 | 9135 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
15afbcd0 | 9136 | |
b0503257 RD |
9137 | Pops up the given menu at the specified coordinates, relative to this window, |
9138 | and returns control when the user has dismissed the menu. If a menu item is | |
9139 | selected, the corresponding menu event is generated and will be processed as | |
9140 | usual. If the default position is given then the current position of the | |
9141 | mouse cursor will be used. | |
15afbcd0 | 9142 | """ |
54f9ee45 | 9143 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
e811c8ce | 9144 | |
15afbcd0 RD |
9145 | def PopupMenu(*args, **kwargs): |
9146 | """ | |
b0503257 | 9147 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
15afbcd0 | 9148 | |
b0503257 RD |
9149 | Pops up the given menu at the specified coordinates, relative to this window, |
9150 | and returns control when the user has dismissed the menu. If a menu item is | |
9151 | selected, the corresponding menu event is generated and will be processed as | |
9152 | usual. If the default position is given then the current position of the | |
9153 | mouse cursor will be used. | |
15afbcd0 | 9154 | """ |
54f9ee45 | 9155 | return _core_.Window_PopupMenu(*args, **kwargs) |
15afbcd0 RD |
9156 | |
9157 | def GetHandle(*args, **kwargs): | |
9158 | """ | |
a95a7133 | 9159 | GetHandle(self) -> long |
15afbcd0 RD |
9160 | |
9161 | Returns the platform-specific handle (as a long integer) of the | |
9162 | physical window. Currently on wxMac it returns the handle of the | |
9163 | toplevel parent of the window. | |
9164 | """ | |
54f9ee45 | 9165 | return _core_.Window_GetHandle(*args, **kwargs) |
15afbcd0 | 9166 | |
7e63a440 RD |
9167 | def AssociateHandle(*args, **kwargs): |
9168 | """ | |
9169 | AssociateHandle(self, long handle) | |
9170 | ||
9171 | Associate the window with a new native handle | |
9172 | """ | |
9173 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
9174 | ||
9175 | def DissociateHandle(*args, **kwargs): | |
9176 | """ | |
9177 | DissociateHandle(self) | |
9178 | ||
9179 | Dissociate the current native handle from the window | |
9180 | """ | |
9181 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
9182 | ||
15afbcd0 RD |
9183 | def HasScrollbar(*args, **kwargs): |
9184 | """ | |
a95a7133 | 9185 | HasScrollbar(self, int orient) -> bool |
15afbcd0 RD |
9186 | |
9187 | Does the window have the scrollbar for this orientation? | |
9188 | """ | |
54f9ee45 | 9189 | return _core_.Window_HasScrollbar(*args, **kwargs) |
15afbcd0 RD |
9190 | |
9191 | def SetScrollbar(*args, **kwargs): | |
9192 | """ | |
41e2b43e | 9193 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
15afbcd0 RD |
9194 | bool refresh=True) |
9195 | ||
9196 | Sets the scrollbar properties of a built-in scrollbar. | |
15afbcd0 | 9197 | """ |
54f9ee45 | 9198 | return _core_.Window_SetScrollbar(*args, **kwargs) |
e811c8ce RD |
9199 | |
9200 | def SetScrollPos(*args, **kwargs): | |
15afbcd0 | 9201 | """ |
a95a7133 | 9202 | SetScrollPos(self, int orientation, int pos, bool refresh=True) |
15afbcd0 RD |
9203 | |
9204 | Sets the position of one of the built-in scrollbars. | |
9205 | """ | |
54f9ee45 | 9206 | return _core_.Window_SetScrollPos(*args, **kwargs) |
e811c8ce RD |
9207 | |
9208 | def GetScrollPos(*args, **kwargs): | |
15afbcd0 | 9209 | """ |
a95a7133 | 9210 | GetScrollPos(self, int orientation) -> int |
15afbcd0 RD |
9211 | |
9212 | Returns the built-in scrollbar position. | |
9213 | """ | |
54f9ee45 | 9214 | return _core_.Window_GetScrollPos(*args, **kwargs) |
e811c8ce RD |
9215 | |
9216 | def GetScrollThumb(*args, **kwargs): | |
15afbcd0 | 9217 | """ |
a95a7133 | 9218 | GetScrollThumb(self, int orientation) -> int |
15afbcd0 RD |
9219 | |
9220 | Returns the built-in scrollbar thumb size. | |
9221 | """ | |
54f9ee45 | 9222 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
e811c8ce RD |
9223 | |
9224 | def GetScrollRange(*args, **kwargs): | |
15afbcd0 | 9225 | """ |
a95a7133 | 9226 | GetScrollRange(self, int orientation) -> int |
15afbcd0 RD |
9227 | |
9228 | Returns the built-in scrollbar range. | |
9229 | """ | |
54f9ee45 | 9230 | return _core_.Window_GetScrollRange(*args, **kwargs) |
e811c8ce RD |
9231 | |
9232 | def ScrollWindow(*args, **kwargs): | |
15afbcd0 | 9233 | """ |
a95a7133 | 9234 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
15afbcd0 RD |
9235 | |
9236 | Physically scrolls the pixels in the window and move child windows | |
9237 | accordingly. Use this function to optimise your scrolling | |
9238 | implementations, to minimise the area that must be redrawn. Note that | |
9239 | it is rarely required to call this function from a user program. | |
15afbcd0 | 9240 | """ |
54f9ee45 | 9241 | return _core_.Window_ScrollWindow(*args, **kwargs) |
e811c8ce RD |
9242 | |
9243 | def ScrollLines(*args, **kwargs): | |
15afbcd0 | 9244 | """ |
a95a7133 | 9245 | ScrollLines(self, int lines) -> bool |
15afbcd0 RD |
9246 | |
9247 | If the platform and window class supports it, scrolls the window by | |
9248 | the given number of lines down, if lines is positive, or up if lines | |
9249 | is negative. Returns True if the window was scrolled, False if it was | |
9250 | already on top/bottom and nothing was done. | |
9251 | """ | |
54f9ee45 | 9252 | return _core_.Window_ScrollLines(*args, **kwargs) |
e811c8ce RD |
9253 | |
9254 | def ScrollPages(*args, **kwargs): | |
15afbcd0 | 9255 | """ |
a95a7133 | 9256 | ScrollPages(self, int pages) -> bool |
15afbcd0 | 9257 | |
41e2b43e | 9258 | If the platform and window class supports it, scrolls the window by |
15afbcd0 RD |
9259 | the given number of pages down, if pages is positive, or up if pages |
9260 | is negative. Returns True if the window was scrolled, False if it was | |
9261 | already on top/bottom and nothing was done. | |
9262 | """ | |
54f9ee45 | 9263 | return _core_.Window_ScrollPages(*args, **kwargs) |
e811c8ce RD |
9264 | |
9265 | def LineUp(*args, **kwargs): | |
15afbcd0 | 9266 | """ |
a95a7133 | 9267 | LineUp(self) -> bool |
15afbcd0 RD |
9268 | |
9269 | This is just a wrapper for ScrollLines(-1). | |
9270 | """ | |
54f9ee45 | 9271 | return _core_.Window_LineUp(*args, **kwargs) |
e811c8ce RD |
9272 | |
9273 | def LineDown(*args, **kwargs): | |
15afbcd0 | 9274 | """ |
a95a7133 | 9275 | LineDown(self) -> bool |
15afbcd0 RD |
9276 | |
9277 | This is just a wrapper for ScrollLines(1). | |
9278 | """ | |
54f9ee45 | 9279 | return _core_.Window_LineDown(*args, **kwargs) |
e811c8ce RD |
9280 | |
9281 | def PageUp(*args, **kwargs): | |
15afbcd0 | 9282 | """ |
a95a7133 | 9283 | PageUp(self) -> bool |
15afbcd0 RD |
9284 | |
9285 | This is just a wrapper for ScrollPages(-1). | |
9286 | """ | |
54f9ee45 | 9287 | return _core_.Window_PageUp(*args, **kwargs) |
e811c8ce RD |
9288 | |
9289 | def PageDown(*args, **kwargs): | |
15afbcd0 | 9290 | """ |
a95a7133 | 9291 | PageDown(self) -> bool |
15afbcd0 RD |
9292 | |
9293 | This is just a wrapper for ScrollPages(1). | |
9294 | """ | |
54f9ee45 | 9295 | return _core_.Window_PageDown(*args, **kwargs) |
e811c8ce RD |
9296 | |
9297 | def SetHelpText(*args, **kwargs): | |
15afbcd0 | 9298 | """ |
a95a7133 | 9299 | SetHelpText(self, String text) |
15afbcd0 RD |
9300 | |
9301 | Sets the help text to be used as context-sensitive help for this | |
9302 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9303 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 9304 | """ |
54f9ee45 | 9305 | return _core_.Window_SetHelpText(*args, **kwargs) |
e811c8ce RD |
9306 | |
9307 | def SetHelpTextForId(*args, **kwargs): | |
15afbcd0 | 9308 | """ |
a95a7133 | 9309 | SetHelpTextForId(self, String text) |
15afbcd0 RD |
9310 | |
9311 | Associate this help text with all windows with the same id as this | |
9312 | one. | |
9313 | """ | |
54f9ee45 | 9314 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
e811c8ce RD |
9315 | |
9316 | def GetHelpText(*args, **kwargs): | |
15afbcd0 | 9317 | """ |
a95a7133 | 9318 | GetHelpText(self) -> String |
15afbcd0 RD |
9319 | |
9320 | Gets the help text to be used as context-sensitive help for this | |
9321 | window. Note that the text is actually stored by the current | |
f52cbe90 | 9322 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 9323 | """ |
54f9ee45 | 9324 | return _core_.Window_GetHelpText(*args, **kwargs) |
e811c8ce RD |
9325 | |
9326 | def SetToolTipString(*args, **kwargs): | |
15afbcd0 | 9327 | """ |
a95a7133 | 9328 | SetToolTipString(self, String tip) |
15afbcd0 RD |
9329 | |
9330 | Attach a tooltip to the window. | |
9331 | """ | |
54f9ee45 | 9332 | return _core_.Window_SetToolTipString(*args, **kwargs) |
e811c8ce RD |
9333 | |
9334 | def SetToolTip(*args, **kwargs): | |
15afbcd0 | 9335 | """ |
a95a7133 | 9336 | SetToolTip(self, ToolTip tip) |
15afbcd0 RD |
9337 | |
9338 | Attach a tooltip to the window. | |
9339 | """ | |
54f9ee45 | 9340 | return _core_.Window_SetToolTip(*args, **kwargs) |
e811c8ce RD |
9341 | |
9342 | def GetToolTip(*args, **kwargs): | |
15afbcd0 | 9343 | """ |
a95a7133 | 9344 | GetToolTip(self) -> ToolTip |
15afbcd0 RD |
9345 | |
9346 | get the associated tooltip or None if none | |
9347 | """ | |
54f9ee45 | 9348 | return _core_.Window_GetToolTip(*args, **kwargs) |
e811c8ce RD |
9349 | |
9350 | def SetDropTarget(*args, **kwargs): | |
15afbcd0 | 9351 | """ |
a95a7133 | 9352 | SetDropTarget(self, DropTarget dropTarget) |
15afbcd0 RD |
9353 | |
9354 | Associates a drop target with this window. If the window already has | |
9355 | a drop target, it is deleted. | |
9356 | """ | |
54f9ee45 | 9357 | return _core_.Window_SetDropTarget(*args, **kwargs) |
e811c8ce RD |
9358 | |
9359 | def GetDropTarget(*args, **kwargs): | |
15afbcd0 | 9360 | """ |
a95a7133 | 9361 | GetDropTarget(self) -> DropTarget |
15afbcd0 RD |
9362 | |
9363 | Returns the associated drop target, which may be None. | |
9364 | """ | |
54f9ee45 | 9365 | return _core_.Window_GetDropTarget(*args, **kwargs) |
e811c8ce | 9366 | |
5ba5649b RD |
9367 | def DragAcceptFiles(*args, **kwargs): |
9368 | """ | |
9369 | DragAcceptFiles(self, bool accept) | |
9370 | ||
9371 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
9372 | Only functional on Windows. | |
9373 | """ | |
9374 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
9375 | ||
e811c8ce | 9376 | def SetConstraints(*args, **kwargs): |
15afbcd0 | 9377 | """ |
a95a7133 | 9378 | SetConstraints(self, LayoutConstraints constraints) |
15afbcd0 RD |
9379 | |
9380 | Sets the window to have the given layout constraints. If an existing | |
9381 | layout constraints object is already owned by the window, it will be | |
9382 | deleted. Pass None to disassociate and delete the window's current | |
9383 | constraints. | |
9384 | ||
9385 | You must call SetAutoLayout to tell a window to use the constraints | |
9386 | automatically in its default EVT_SIZE handler; otherwise, you must | |
9387 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
9388 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
9389 | effect. | |
9390 | """ | |
54f9ee45 | 9391 | return _core_.Window_SetConstraints(*args, **kwargs) |
e811c8ce RD |
9392 | |
9393 | def GetConstraints(*args, **kwargs): | |
15afbcd0 | 9394 | """ |
a95a7133 | 9395 | GetConstraints(self) -> LayoutConstraints |
15afbcd0 RD |
9396 | |
9397 | Returns a pointer to the window's layout constraints, or None if there | |
9398 | are none. | |
9399 | """ | |
54f9ee45 | 9400 | return _core_.Window_GetConstraints(*args, **kwargs) |
e811c8ce RD |
9401 | |
9402 | def SetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9403 | """ |
a95a7133 | 9404 | SetAutoLayout(self, bool autoLayout) |
15afbcd0 RD |
9405 | |
9406 | Determines whether the Layout function will be called automatically | |
b1fcee84 RD |
9407 | when the window is resized. lease note that this only happens for the |
9408 | windows usually used to contain children, namely `wx.Panel` and | |
9409 | `wx.TopLevelWindow` (and the classes deriving from them). | |
9410 | ||
9411 | This method is called implicitly by `SetSizer` but if you use | |
9412 | `SetConstraints` you should call it manually or otherwise the window | |
9413 | layout won't be correctly updated when its size changes. | |
15afbcd0 | 9414 | """ |
54f9ee45 | 9415 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9416 | |
9417 | def GetAutoLayout(*args, **kwargs): | |
15afbcd0 | 9418 | """ |
a95a7133 | 9419 | GetAutoLayout(self) -> bool |
15afbcd0 RD |
9420 | |
9421 | Returns the current autoLayout setting | |
9422 | """ | |
54f9ee45 | 9423 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
e811c8ce RD |
9424 | |
9425 | def Layout(*args, **kwargs): | |
15afbcd0 | 9426 | """ |
a95a7133 | 9427 | Layout(self) -> bool |
15afbcd0 RD |
9428 | |
9429 | Invokes the constraint-based layout algorithm or the sizer-based | |
9430 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
9431 | this function gets called automatically by the default EVT_SIZE | |
9432 | handler when the window is resized. | |
9433 | """ | |
54f9ee45 | 9434 | return _core_.Window_Layout(*args, **kwargs) |
e811c8ce RD |
9435 | |
9436 | def SetSizer(*args, **kwargs): | |
15afbcd0 | 9437 | """ |
a95a7133 | 9438 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9439 | |
9440 | Sets the window to have the given layout sizer. The window will then | |
9441 | own the object, and will take care of its deletion. If an existing | |
9442 | layout sizer object is already owned by the window, it will be deleted | |
9443 | if the deleteOld parameter is true. Note that this function will also | |
9444 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
ae8162c8 | 9445 | non-None, and False otherwise. |
15afbcd0 | 9446 | """ |
54f9ee45 | 9447 | return _core_.Window_SetSizer(*args, **kwargs) |
e811c8ce RD |
9448 | |
9449 | def SetSizerAndFit(*args, **kwargs): | |
15afbcd0 | 9450 | """ |
a95a7133 | 9451 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
9452 | |
9453 | The same as SetSizer, except it also sets the size hints for the | |
9454 | window based on the sizer's minimum size. | |
9455 | """ | |
54f9ee45 | 9456 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
e811c8ce RD |
9457 | |
9458 | def GetSizer(*args, **kwargs): | |
15afbcd0 | 9459 | """ |
a95a7133 | 9460 | GetSizer(self) -> Sizer |
15afbcd0 RD |
9461 | |
9462 | Return the sizer associated with the window by a previous call to | |
9463 | SetSizer or None if there isn't one. | |
9464 | """ | |
54f9ee45 | 9465 | return _core_.Window_GetSizer(*args, **kwargs) |
e811c8ce RD |
9466 | |
9467 | def SetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9468 | """ |
a95a7133 | 9469 | SetContainingSizer(self, Sizer sizer) |
15afbcd0 RD |
9470 | |
9471 | This normally does not need to be called by application code. It is | |
9472 | called internally when a window is added to a sizer, and is used so | |
9473 | the window can remove itself from the sizer when it is destroyed. | |
9474 | """ | |
54f9ee45 | 9475 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
e811c8ce RD |
9476 | |
9477 | def GetContainingSizer(*args, **kwargs): | |
15afbcd0 | 9478 | """ |
a95a7133 | 9479 | GetContainingSizer(self) -> Sizer |
15afbcd0 RD |
9480 | |
9481 | Return the sizer that this window is a member of, if any, otherwise None. | |
9482 | """ | |
54f9ee45 | 9483 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
e811c8ce | 9484 | |
a95a7133 RD |
9485 | def InheritAttributes(*args, **kwargs): |
9486 | """ | |
9487 | InheritAttributes(self) | |
9488 | ||
41e2b43e RD |
9489 | This function is (or should be, in case of custom controls) called |
9490 | during window creation to intelligently set up the window visual | |
9491 | attributes, that is the font and the foreground and background | |
9492 | colours. | |
9493 | ||
9494 | By 'intelligently' the following is meant: by default, all windows use | |
9495 | their own default attributes. However if some of the parent's | |
9496 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 9497 | SetOwnFont) and if the corresponding attribute hadn't been |
41e2b43e RD |
9498 | explicitly set for this window itself, then this window takes the same |
9499 | value as used by the parent. In addition, if the window overrides | |
9500 | ShouldInheritColours to return false, the colours will not be changed | |
9501 | no matter what and only the font might. | |
9502 | ||
34621cc5 | 9503 | This rather complicated logic is necessary in order to accommodate the |
ec9b55ca | 9504 | different usage scenarios. The most common one is when all default |
41e2b43e RD |
9505 | attributes are used and in this case, nothing should be inherited as |
9506 | in modern GUIs different controls use different fonts (and colours) | |
9507 | than their siblings so they can't inherit the same value from the | |
9508 | parent. However it was also deemed desirable to allow to simply change | |
9509 | the attributes of all children at once by just changing the font or | |
9510 | colour of their common parent, hence in this case we do inherit the | |
9511 | parents attributes. | |
9512 | ||
a95a7133 | 9513 | """ |
54f9ee45 | 9514 | return _core_.Window_InheritAttributes(*args, **kwargs) |
a95a7133 RD |
9515 | |
9516 | def ShouldInheritColours(*args, **kwargs): | |
9517 | """ | |
9518 | ShouldInheritColours(self) -> bool | |
9519 | ||
9520 | Return true from here to allow the colours of this window to be | |
41e2b43e RD |
9521 | changed by InheritAttributes, returning false forbids inheriting them |
9522 | from the parent window. | |
a95a7133 | 9523 | |
41e2b43e RD |
9524 | The base class version returns false, but this method is overridden in |
9525 | wxControl where it returns true. | |
a95a7133 | 9526 | """ |
54f9ee45 | 9527 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
a95a7133 | 9528 | |
e811c8ce | 9529 | def PostCreate(self, pre): |
15afbcd0 RD |
9530 | """ |
9531 | Phase 3 of the 2-phase create <wink!> | |
9532 | Call this method after precreating the window with the 2-phase create method. | |
9533 | """ | |
e811c8ce RD |
9534 | self.this = pre.this |
9535 | self.thisown = pre.thisown | |
9536 | pre.thisown = 0 | |
9537 | if hasattr(self, '_setOORInfo'): | |
9538 | self._setOORInfo(self) | |
9539 | if hasattr(self, '_setCallbackInfo'): | |
9540 | self._setCallbackInfo(self, self.__class__) | |
9541 | ||
7e08d4ef RD |
9542 | def SendSizeEvent(self): |
9543 | self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1))) | |
9544 | ||
2131d850 | 9545 | _core_.Window_swigregister(Window) |
e811c8ce RD |
9546 | |
9547 | def PreWindow(*args, **kwargs): | |
15afbcd0 RD |
9548 | """ |
9549 | PreWindow() -> Window | |
9550 | ||
9551 | Precreate a Window for 2-phase creation. | |
9552 | """ | |
54f9ee45 | 9553 | val = _core_.new_PreWindow(*args, **kwargs) |
e811c8ce RD |
9554 | return val |
9555 | ||
0085ce49 RD |
9556 | def Window_NewControlId(*args): |
9557 | """ | |
15afbcd0 RD |
9558 | Window_NewControlId() -> int |
9559 | ||
9560 | Generate a control id for the controls which were not given one. | |
9561 | """ | |
0085ce49 | 9562 | return _core_.Window_NewControlId(*args) |
e811c8ce RD |
9563 | |
9564 | def Window_NextControlId(*args, **kwargs): | |
0085ce49 | 9565 | """ |
15afbcd0 RD |
9566 | Window_NextControlId(int winid) -> int |
9567 | ||
9568 | Get the id of the control following the one with the given | |
41e2b43e | 9569 | autogenerated) id |
15afbcd0 | 9570 | """ |
0085ce49 | 9571 | return _core_.Window_NextControlId(*args, **kwargs) |
e811c8ce RD |
9572 | |
9573 | def Window_PrevControlId(*args, **kwargs): | |
0085ce49 | 9574 | """ |
15afbcd0 RD |
9575 | Window_PrevControlId(int winid) -> int |
9576 | ||
9577 | Get the id of the control preceding the one with the given | |
41e2b43e | 9578 | autogenerated) id |
15afbcd0 | 9579 | """ |
0085ce49 | 9580 | return _core_.Window_PrevControlId(*args, **kwargs) |
e811c8ce | 9581 | |
0085ce49 RD |
9582 | def Window_FindFocus(*args): |
9583 | """ | |
15afbcd0 RD |
9584 | Window_FindFocus() -> Window |
9585 | ||
9586 | Returns the window or control that currently has the keyboard focus, | |
9587 | or None. | |
9588 | """ | |
0085ce49 | 9589 | return _core_.Window_FindFocus(*args) |
e811c8ce | 9590 | |
0085ce49 RD |
9591 | def Window_GetCapture(*args): |
9592 | """ | |
15afbcd0 RD |
9593 | Window_GetCapture() -> Window |
9594 | ||
9595 | Returns the window which currently captures the mouse or None | |
9596 | """ | |
0085ce49 | 9597 | return _core_.Window_GetCapture(*args) |
e811c8ce | 9598 | |
74a57fcd | 9599 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 9600 | """ |
74a57fcd RD |
9601 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
9602 | ||
41e2b43e RD |
9603 | Get the default attributes for this class. This is useful if you want |
9604 | to use the same font or colour in your own control as in a standard | |
9605 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
9606 | colours or fonts which might look completely out of place on the |
9607 | user's system, especially if it uses themes. | |
74a57fcd RD |
9608 | |
9609 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 9610 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
9611 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9612 | this. | |
74a57fcd | 9613 | """ |
0085ce49 | 9614 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 9615 | |
e811c8ce | 9616 | def DLG_PNT(win, point_or_x, y=None): |
15afbcd0 RD |
9617 | """ |
9618 | Convenience function for converting a Point or (x,y) in | |
9619 | dialog units to pixel units. | |
9620 | """ | |
e811c8ce RD |
9621 | if y is None: |
9622 | return win.ConvertDialogPointToPixels(point_or_x) | |
9623 | else: | |
fd3f2efe | 9624 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) |
e811c8ce RD |
9625 | |
9626 | def DLG_SZE(win, size_width, height=None): | |
15afbcd0 RD |
9627 | """ |
9628 | Convenience function for converting a Size or (w,h) in | |
9629 | dialog units to pixel units. | |
9630 | """ | |
e811c8ce RD |
9631 | if height is None: |
9632 | return win.ConvertDialogSizeToPixels(size_width) | |
9633 | else: | |
fd3f2efe | 9634 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) |
e811c8ce RD |
9635 | |
9636 | ||
9637 | def FindWindowById(*args, **kwargs): | |
0085ce49 | 9638 | """ |
15afbcd0 RD |
9639 | FindWindowById(long id, Window parent=None) -> Window |
9640 | ||
9641 | Find the first window in the application with the given id. If parent | |
9642 | is None, the search will start from all top-level frames and dialog | |
9643 | boxes; if non-None, the search will be limited to the given window | |
9644 | hierarchy. The search is recursive in both cases. | |
9645 | """ | |
0085ce49 | 9646 | return _core_.FindWindowById(*args, **kwargs) |
e811c8ce RD |
9647 | |
9648 | def FindWindowByName(*args, **kwargs): | |
0085ce49 | 9649 | """ |
15afbcd0 RD |
9650 | FindWindowByName(String name, Window parent=None) -> Window |
9651 | ||
9652 | Find a window by its name (as given in a window constructor or Create | |
9653 | function call). If parent is None, the search will start from all | |
9654 | top-level frames and dialog boxes; if non-None, the search will be | |
9655 | limited to the given window hierarchy. The search is recursive in both | |
9656 | cases. | |
9657 | ||
9658 | If no window with such name is found, wx.FindWindowByLabel is called. | |
9659 | """ | |
0085ce49 | 9660 | return _core_.FindWindowByName(*args, **kwargs) |
e811c8ce RD |
9661 | |
9662 | def FindWindowByLabel(*args, **kwargs): | |
0085ce49 | 9663 | """ |
15afbcd0 RD |
9664 | FindWindowByLabel(String label, Window parent=None) -> Window |
9665 | ||
9666 | Find a window by its label. Depending on the type of window, the label | |
9667 | may be a window title or panel item label. If parent is None, the | |
9668 | search will start from all top-level frames and dialog boxes; if | |
9669 | non-None, the search will be limited to the given window | |
9670 | hierarchy. The search is recursive in both cases. | |
9671 | """ | |
0085ce49 | 9672 | return _core_.FindWindowByLabel(*args, **kwargs) |
e811c8ce RD |
9673 | |
9674 | def Window_FromHWND(*args, **kwargs): | |
0085ce49 RD |
9675 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" |
9676 | return _core_.Window_FromHWND(*args, **kwargs) | |
b6b0383e | 9677 | |
0085ce49 RD |
9678 | def GetTopLevelWindows(*args): |
9679 | """ | |
b6b0383e RD |
9680 | GetTopLevelWindows() -> PyObject |
9681 | ||
9682 | Returns a list of the the application's top-level windows, (frames, | |
9683 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
9684 | by wxWidgets, and so it is only valid as long as no top-level windows | |
9685 | are closed or new top-level windows are created. | |
9686 | ||
9687 | """ | |
0085ce49 | 9688 | return _core_.GetTopLevelWindows(*args) |
e811c8ce RD |
9689 | #--------------------------------------------------------------------------- |
9690 | ||
9691 | class Validator(EvtHandler): | |
093d3ff1 | 9692 | """Proxy of C++ Validator class""" |
0085ce49 RD |
9693 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
9694 | __repr__ = _swig_repr | |
9695 | def __init__(self, *args, **kwargs): | |
a95a7133 | 9696 | """__init__(self) -> Validator""" |
0085ce49 | 9697 | _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs)) |
d14a1e28 | 9698 | self._setOORInfo(self) |
e811c8ce RD |
9699 | |
9700 | def Clone(*args, **kwargs): | |
a95a7133 | 9701 | """Clone(self) -> Validator""" |
54f9ee45 | 9702 | return _core_.Validator_Clone(*args, **kwargs) |
e811c8ce RD |
9703 | |
9704 | def Validate(*args, **kwargs): | |
a95a7133 | 9705 | """Validate(self, Window parent) -> bool""" |
54f9ee45 | 9706 | return _core_.Validator_Validate(*args, **kwargs) |
e811c8ce RD |
9707 | |
9708 | def TransferToWindow(*args, **kwargs): | |
a95a7133 | 9709 | """TransferToWindow(self) -> bool""" |
54f9ee45 | 9710 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
e811c8ce RD |
9711 | |
9712 | def TransferFromWindow(*args, **kwargs): | |
a95a7133 | 9713 | """TransferFromWindow(self) -> bool""" |
54f9ee45 | 9714 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
e811c8ce RD |
9715 | |
9716 | def GetWindow(*args, **kwargs): | |
a95a7133 | 9717 | """GetWindow(self) -> Window""" |
54f9ee45 | 9718 | return _core_.Validator_GetWindow(*args, **kwargs) |
e811c8ce RD |
9719 | |
9720 | def SetWindow(*args, **kwargs): | |
a95a7133 | 9721 | """SetWindow(self, Window window)""" |
54f9ee45 | 9722 | return _core_.Validator_SetWindow(*args, **kwargs) |
e811c8ce RD |
9723 | |
9724 | def IsSilent(*args, **kwargs): | |
66c033b4 | 9725 | """IsSilent() -> bool""" |
54f9ee45 | 9726 | return _core_.Validator_IsSilent(*args, **kwargs) |
e811c8ce RD |
9727 | |
9728 | IsSilent = staticmethod(IsSilent) | |
9729 | def SetBellOnError(*args, **kwargs): | |
66c033b4 | 9730 | """SetBellOnError(int doIt=True)""" |
54f9ee45 | 9731 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
e811c8ce RD |
9732 | |
9733 | SetBellOnError = staticmethod(SetBellOnError) | |
2131d850 | 9734 | _core_.Validator_swigregister(Validator) |
e811c8ce | 9735 | |
0085ce49 RD |
9736 | def Validator_IsSilent(*args): |
9737 | """Validator_IsSilent() -> bool""" | |
9738 | return _core_.Validator_IsSilent(*args) | |
e811c8ce RD |
9739 | |
9740 | def Validator_SetBellOnError(*args, **kwargs): | |
0085ce49 RD |
9741 | """Validator_SetBellOnError(int doIt=True)""" |
9742 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
e811c8ce RD |
9743 | |
9744 | class PyValidator(Validator): | |
093d3ff1 | 9745 | """Proxy of C++ PyValidator class""" |
0085ce49 RD |
9746 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
9747 | __repr__ = _swig_repr | |
9748 | def __init__(self, *args, **kwargs): | |
a95a7133 | 9749 | """__init__(self) -> PyValidator""" |
0085ce49 | 9750 | _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs)) |
e811c8ce RD |
9751 | |
9752 | self._setCallbackInfo(self, PyValidator, 1) | |
9753 | self._setOORInfo(self) | |
9754 | ||
9755 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 9756 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)""" |
54f9ee45 | 9757 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
e811c8ce | 9758 | |
2131d850 | 9759 | _core_.PyValidator_swigregister(PyValidator) |
e811c8ce RD |
9760 | |
9761 | #--------------------------------------------------------------------------- | |
9762 | ||
9763 | class Menu(EvtHandler): | |
093d3ff1 | 9764 | """Proxy of C++ Menu class""" |
0085ce49 RD |
9765 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
9766 | __repr__ = _swig_repr | |
9767 | def __init__(self, *args, **kwargs): | |
a95a7133 | 9768 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
0085ce49 | 9769 | _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs)) |
e811c8ce RD |
9770 | self._setOORInfo(self) |
9771 | ||
9772 | def Append(*args, **kwargs): | |
a95a7133 | 9773 | """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
54f9ee45 | 9774 | return _core_.Menu_Append(*args, **kwargs) |
e811c8ce RD |
9775 | |
9776 | def AppendSeparator(*args, **kwargs): | |
a95a7133 | 9777 | """AppendSeparator(self) -> MenuItem""" |
54f9ee45 | 9778 | return _core_.Menu_AppendSeparator(*args, **kwargs) |
e811c8ce RD |
9779 | |
9780 | def AppendCheckItem(*args, **kwargs): | |
a95a7133 | 9781 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9782 | return _core_.Menu_AppendCheckItem(*args, **kwargs) |
e811c8ce RD |
9783 | |
9784 | def AppendRadioItem(*args, **kwargs): | |
a95a7133 | 9785 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9786 | return _core_.Menu_AppendRadioItem(*args, **kwargs) |
e811c8ce RD |
9787 | |
9788 | def AppendMenu(*args, **kwargs): | |
a95a7133 | 9789 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9790 | return _core_.Menu_AppendMenu(*args, **kwargs) |
e811c8ce | 9791 | |
50efceee RD |
9792 | def AppendSubMenu(*args, **kwargs): |
9793 | """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem""" | |
9794 | return _core_.Menu_AppendSubMenu(*args, **kwargs) | |
9795 | ||
e811c8ce | 9796 | def AppendItem(*args, **kwargs): |
a95a7133 | 9797 | """AppendItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 9798 | return _core_.Menu_AppendItem(*args, **kwargs) |
e811c8ce | 9799 | |
e811c8ce | 9800 | def InsertItem(*args, **kwargs): |
a95a7133 | 9801 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
54f9ee45 | 9802 | return _core_.Menu_InsertItem(*args, **kwargs) |
e811c8ce | 9803 | |
0085ce49 RD |
9804 | def PrependItem(*args, **kwargs): |
9805 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
9806 | return _core_.Menu_PrependItem(*args, **kwargs) | |
9807 | ||
9808 | def Break(*args, **kwargs): | |
9809 | """Break(self)""" | |
9810 | return _core_.Menu_Break(*args, **kwargs) | |
9811 | ||
e811c8ce | 9812 | def Insert(*args, **kwargs): |
0df68c9f | 9813 | """ |
a95a7133 | 9814 | Insert(self, size_t pos, int id, String text, String help=EmptyString, |
a41e16b6 | 9815 | int kind=ITEM_NORMAL) -> MenuItem |
0df68c9f | 9816 | """ |
54f9ee45 | 9817 | return _core_.Menu_Insert(*args, **kwargs) |
e811c8ce RD |
9818 | |
9819 | def InsertSeparator(*args, **kwargs): | |
a95a7133 | 9820 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
54f9ee45 | 9821 | return _core_.Menu_InsertSeparator(*args, **kwargs) |
e811c8ce RD |
9822 | |
9823 | def InsertCheckItem(*args, **kwargs): | |
a95a7133 | 9824 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9825 | return _core_.Menu_InsertCheckItem(*args, **kwargs) |
e811c8ce RD |
9826 | |
9827 | def InsertRadioItem(*args, **kwargs): | |
a95a7133 | 9828 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9829 | return _core_.Menu_InsertRadioItem(*args, **kwargs) |
e811c8ce RD |
9830 | |
9831 | def InsertMenu(*args, **kwargs): | |
a95a7133 | 9832 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9833 | return _core_.Menu_InsertMenu(*args, **kwargs) |
e811c8ce | 9834 | |
e811c8ce | 9835 | def Prepend(*args, **kwargs): |
a95a7133 | 9836 | """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem""" |
54f9ee45 | 9837 | return _core_.Menu_Prepend(*args, **kwargs) |
e811c8ce RD |
9838 | |
9839 | def PrependSeparator(*args, **kwargs): | |
a95a7133 | 9840 | """PrependSeparator(self) -> MenuItem""" |
54f9ee45 | 9841 | return _core_.Menu_PrependSeparator(*args, **kwargs) |
e811c8ce RD |
9842 | |
9843 | def PrependCheckItem(*args, **kwargs): | |
a95a7133 | 9844 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9845 | return _core_.Menu_PrependCheckItem(*args, **kwargs) |
e811c8ce RD |
9846 | |
9847 | def PrependRadioItem(*args, **kwargs): | |
a95a7133 | 9848 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9849 | return _core_.Menu_PrependRadioItem(*args, **kwargs) |
e811c8ce RD |
9850 | |
9851 | def PrependMenu(*args, **kwargs): | |
a95a7133 | 9852 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 9853 | return _core_.Menu_PrependMenu(*args, **kwargs) |
e811c8ce RD |
9854 | |
9855 | def Remove(*args, **kwargs): | |
a95a7133 | 9856 | """Remove(self, int id) -> MenuItem""" |
54f9ee45 | 9857 | return _core_.Menu_Remove(*args, **kwargs) |
e811c8ce RD |
9858 | |
9859 | def RemoveItem(*args, **kwargs): | |
a95a7133 | 9860 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 9861 | return _core_.Menu_RemoveItem(*args, **kwargs) |
e811c8ce RD |
9862 | |
9863 | def Delete(*args, **kwargs): | |
a95a7133 | 9864 | """Delete(self, int id) -> bool""" |
54f9ee45 | 9865 | return _core_.Menu_Delete(*args, **kwargs) |
e811c8ce RD |
9866 | |
9867 | def DeleteItem(*args, **kwargs): | |
a95a7133 | 9868 | """DeleteItem(self, MenuItem item) -> bool""" |
54f9ee45 | 9869 | return _core_.Menu_DeleteItem(*args, **kwargs) |
e811c8ce RD |
9870 | |
9871 | def Destroy(*args, **kwargs): | |
0df68c9f | 9872 | """ |
a95a7133 | 9873 | Destroy(self) |
e811c8ce | 9874 | |
0df68c9f RD |
9875 | Deletes the C++ object this Python object is a proxy for. |
9876 | """ | |
7e08d4ef RD |
9877 | val = _core_.Menu_Destroy(*args, **kwargs) |
9878 | args[0].thisown = 0 | |
9879 | return val | |
e811c8ce RD |
9880 | |
9881 | def DestroyId(*args, **kwargs): | |
0df68c9f | 9882 | """ |
a95a7133 | 9883 | DestroyId(self, int id) -> bool |
e811c8ce | 9884 | |
0df68c9f RD |
9885 | Deletes the C++ object this Python object is a proxy for. |
9886 | """ | |
7e08d4ef RD |
9887 | val = _core_.Menu_DestroyId(*args, **kwargs) |
9888 | args[0].thisown = 0 | |
9889 | return val | |
e811c8ce RD |
9890 | |
9891 | def DestroyItem(*args, **kwargs): | |
0df68c9f | 9892 | """ |
a95a7133 | 9893 | DestroyItem(self, MenuItem item) -> bool |
e811c8ce | 9894 | |
0df68c9f RD |
9895 | Deletes the C++ object this Python object is a proxy for. |
9896 | """ | |
7e08d4ef RD |
9897 | val = _core_.Menu_DestroyItem(*args, **kwargs) |
9898 | args[0].thisown = 0 | |
9899 | return val | |
e811c8ce RD |
9900 | |
9901 | def GetMenuItemCount(*args, **kwargs): | |
a95a7133 | 9902 | """GetMenuItemCount(self) -> size_t""" |
54f9ee45 | 9903 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
e811c8ce RD |
9904 | |
9905 | def GetMenuItems(*args, **kwargs): | |
a95a7133 | 9906 | """GetMenuItems(self) -> PyObject""" |
54f9ee45 | 9907 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
e811c8ce RD |
9908 | |
9909 | def FindItem(*args, **kwargs): | |
a95a7133 | 9910 | """FindItem(self, String item) -> int""" |
54f9ee45 | 9911 | return _core_.Menu_FindItem(*args, **kwargs) |
e811c8ce RD |
9912 | |
9913 | def FindItemById(*args, **kwargs): | |
a95a7133 | 9914 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 9915 | return _core_.Menu_FindItemById(*args, **kwargs) |
e811c8ce RD |
9916 | |
9917 | def FindItemByPosition(*args, **kwargs): | |
a95a7133 | 9918 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
54f9ee45 | 9919 | return _core_.Menu_FindItemByPosition(*args, **kwargs) |
e811c8ce RD |
9920 | |
9921 | def Enable(*args, **kwargs): | |
a95a7133 | 9922 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 9923 | return _core_.Menu_Enable(*args, **kwargs) |
e811c8ce RD |
9924 | |
9925 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 9926 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 9927 | return _core_.Menu_IsEnabled(*args, **kwargs) |
e811c8ce RD |
9928 | |
9929 | def Check(*args, **kwargs): | |
a95a7133 | 9930 | """Check(self, int id, bool check)""" |
54f9ee45 | 9931 | return _core_.Menu_Check(*args, **kwargs) |
e811c8ce RD |
9932 | |
9933 | def IsChecked(*args, **kwargs): | |
a95a7133 | 9934 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 9935 | return _core_.Menu_IsChecked(*args, **kwargs) |
e811c8ce RD |
9936 | |
9937 | def SetLabel(*args, **kwargs): | |
a95a7133 | 9938 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 9939 | return _core_.Menu_SetLabel(*args, **kwargs) |
e811c8ce RD |
9940 | |
9941 | def GetLabel(*args, **kwargs): | |
a95a7133 | 9942 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 9943 | return _core_.Menu_GetLabel(*args, **kwargs) |
e811c8ce RD |
9944 | |
9945 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 9946 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 9947 | return _core_.Menu_SetHelpString(*args, **kwargs) |
e811c8ce RD |
9948 | |
9949 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 9950 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 9951 | return _core_.Menu_GetHelpString(*args, **kwargs) |
e811c8ce RD |
9952 | |
9953 | def SetTitle(*args, **kwargs): | |
a95a7133 | 9954 | """SetTitle(self, String title)""" |
54f9ee45 | 9955 | return _core_.Menu_SetTitle(*args, **kwargs) |
e811c8ce RD |
9956 | |
9957 | def GetTitle(*args, **kwargs): | |
a95a7133 | 9958 | """GetTitle(self) -> String""" |
54f9ee45 | 9959 | return _core_.Menu_GetTitle(*args, **kwargs) |
e811c8ce RD |
9960 | |
9961 | def SetEventHandler(*args, **kwargs): | |
a95a7133 | 9962 | """SetEventHandler(self, EvtHandler handler)""" |
54f9ee45 | 9963 | return _core_.Menu_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
9964 | |
9965 | def GetEventHandler(*args, **kwargs): | |
a95a7133 | 9966 | """GetEventHandler(self) -> EvtHandler""" |
54f9ee45 | 9967 | return _core_.Menu_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
9968 | |
9969 | def SetInvokingWindow(*args, **kwargs): | |
a95a7133 | 9970 | """SetInvokingWindow(self, Window win)""" |
54f9ee45 | 9971 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
9972 | |
9973 | def GetInvokingWindow(*args, **kwargs): | |
a95a7133 | 9974 | """GetInvokingWindow(self) -> Window""" |
54f9ee45 | 9975 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
9976 | |
9977 | def GetStyle(*args, **kwargs): | |
a95a7133 | 9978 | """GetStyle(self) -> long""" |
54f9ee45 | 9979 | return _core_.Menu_GetStyle(*args, **kwargs) |
e811c8ce RD |
9980 | |
9981 | def UpdateUI(*args, **kwargs): | |
a95a7133 | 9982 | """UpdateUI(self, EvtHandler source=None)""" |
54f9ee45 | 9983 | return _core_.Menu_UpdateUI(*args, **kwargs) |
e811c8ce RD |
9984 | |
9985 | def GetMenuBar(*args, **kwargs): | |
a95a7133 | 9986 | """GetMenuBar(self) -> MenuBar""" |
54f9ee45 | 9987 | return _core_.Menu_GetMenuBar(*args, **kwargs) |
e811c8ce RD |
9988 | |
9989 | def Attach(*args, **kwargs): | |
a95a7133 | 9990 | """Attach(self, wxMenuBarBase menubar)""" |
54f9ee45 | 9991 | return _core_.Menu_Attach(*args, **kwargs) |
e811c8ce RD |
9992 | |
9993 | def Detach(*args, **kwargs): | |
a95a7133 | 9994 | """Detach(self)""" |
54f9ee45 | 9995 | return _core_.Menu_Detach(*args, **kwargs) |
e811c8ce RD |
9996 | |
9997 | def IsAttached(*args, **kwargs): | |
a95a7133 | 9998 | """IsAttached(self) -> bool""" |
54f9ee45 | 9999 | return _core_.Menu_IsAttached(*args, **kwargs) |
e811c8ce RD |
10000 | |
10001 | def SetParent(*args, **kwargs): | |
a95a7133 | 10002 | """SetParent(self, Menu parent)""" |
54f9ee45 | 10003 | return _core_.Menu_SetParent(*args, **kwargs) |
e811c8ce RD |
10004 | |
10005 | def GetParent(*args, **kwargs): | |
a95a7133 | 10006 | """GetParent(self) -> Menu""" |
54f9ee45 | 10007 | return _core_.Menu_GetParent(*args, **kwargs) |
e811c8ce | 10008 | |
2131d850 | 10009 | _core_.Menu_swigregister(Menu) |
d14a1e28 RD |
10010 | DefaultValidator = cvar.DefaultValidator |
10011 | ||
10012 | #--------------------------------------------------------------------------- | |
10013 | ||
10014 | class MenuBar(Window): | |
093d3ff1 | 10015 | """Proxy of C++ MenuBar class""" |
0085ce49 RD |
10016 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10017 | __repr__ = _swig_repr | |
10018 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10019 | """__init__(self, long style=0) -> MenuBar""" |
0085ce49 | 10020 | _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs)) |
d14a1e28 | 10021 | self._setOORInfo(self) |
e811c8ce RD |
10022 | |
10023 | def Append(*args, **kwargs): | |
a95a7133 | 10024 | """Append(self, Menu menu, String title) -> bool""" |
54f9ee45 | 10025 | return _core_.MenuBar_Append(*args, **kwargs) |
e811c8ce RD |
10026 | |
10027 | def Insert(*args, **kwargs): | |
a95a7133 | 10028 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
54f9ee45 | 10029 | return _core_.MenuBar_Insert(*args, **kwargs) |
e811c8ce RD |
10030 | |
10031 | def GetMenuCount(*args, **kwargs): | |
a95a7133 | 10032 | """GetMenuCount(self) -> size_t""" |
54f9ee45 | 10033 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
e811c8ce RD |
10034 | |
10035 | def GetMenu(*args, **kwargs): | |
a95a7133 | 10036 | """GetMenu(self, size_t pos) -> Menu""" |
54f9ee45 | 10037 | return _core_.MenuBar_GetMenu(*args, **kwargs) |
e811c8ce RD |
10038 | |
10039 | def Replace(*args, **kwargs): | |
a95a7133 | 10040 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
54f9ee45 | 10041 | return _core_.MenuBar_Replace(*args, **kwargs) |
e811c8ce RD |
10042 | |
10043 | def Remove(*args, **kwargs): | |
a95a7133 | 10044 | """Remove(self, size_t pos) -> Menu""" |
54f9ee45 | 10045 | return _core_.MenuBar_Remove(*args, **kwargs) |
e811c8ce RD |
10046 | |
10047 | def EnableTop(*args, **kwargs): | |
a95a7133 | 10048 | """EnableTop(self, size_t pos, bool enable)""" |
54f9ee45 | 10049 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
e811c8ce RD |
10050 | |
10051 | def IsEnabledTop(*args, **kwargs): | |
a95a7133 | 10052 | """IsEnabledTop(self, size_t pos) -> bool""" |
54f9ee45 | 10053 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
e811c8ce RD |
10054 | |
10055 | def SetLabelTop(*args, **kwargs): | |
a95a7133 | 10056 | """SetLabelTop(self, size_t pos, String label)""" |
54f9ee45 | 10057 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) |
e811c8ce RD |
10058 | |
10059 | def GetLabelTop(*args, **kwargs): | |
a95a7133 | 10060 | """GetLabelTop(self, size_t pos) -> String""" |
54f9ee45 | 10061 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) |
e811c8ce RD |
10062 | |
10063 | def FindMenuItem(*args, **kwargs): | |
a95a7133 | 10064 | """FindMenuItem(self, String menu, String item) -> int""" |
54f9ee45 | 10065 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) |
e811c8ce RD |
10066 | |
10067 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10068 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10069 | return _core_.MenuBar_FindItemById(*args, **kwargs) |
e811c8ce RD |
10070 | |
10071 | def FindMenu(*args, **kwargs): | |
a95a7133 | 10072 | """FindMenu(self, String title) -> int""" |
54f9ee45 | 10073 | return _core_.MenuBar_FindMenu(*args, **kwargs) |
e811c8ce RD |
10074 | |
10075 | def Enable(*args, **kwargs): | |
a95a7133 | 10076 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10077 | return _core_.MenuBar_Enable(*args, **kwargs) |
e811c8ce RD |
10078 | |
10079 | def Check(*args, **kwargs): | |
a95a7133 | 10080 | """Check(self, int id, bool check)""" |
54f9ee45 | 10081 | return _core_.MenuBar_Check(*args, **kwargs) |
e811c8ce RD |
10082 | |
10083 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10084 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10085 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
e811c8ce RD |
10086 | |
10087 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10088 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10089 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10090 | |
10091 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10092 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10093 | return _core_.MenuBar_SetLabel(*args, **kwargs) |
e811c8ce RD |
10094 | |
10095 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10096 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10097 | return _core_.MenuBar_GetLabel(*args, **kwargs) |
e811c8ce RD |
10098 | |
10099 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10100 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10101 | return _core_.MenuBar_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10102 | |
10103 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10104 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10105 | return _core_.MenuBar_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10106 | |
10107 | def GetFrame(*args, **kwargs): | |
a95a7133 | 10108 | """GetFrame(self) -> wxFrame""" |
54f9ee45 | 10109 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
e811c8ce RD |
10110 | |
10111 | def IsAttached(*args, **kwargs): | |
a95a7133 | 10112 | """IsAttached(self) -> bool""" |
54f9ee45 | 10113 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
e811c8ce RD |
10114 | |
10115 | def Attach(*args, **kwargs): | |
a95a7133 | 10116 | """Attach(self, wxFrame frame)""" |
54f9ee45 | 10117 | return _core_.MenuBar_Attach(*args, **kwargs) |
e811c8ce RD |
10118 | |
10119 | def Detach(*args, **kwargs): | |
a95a7133 | 10120 | """Detach(self)""" |
54f9ee45 | 10121 | return _core_.MenuBar_Detach(*args, **kwargs) |
e811c8ce | 10122 | |
4f433fef RD |
10123 | def SetAutoWindowMenu(*args, **kwargs): |
10124 | """SetAutoWindowMenu(bool enable)""" | |
10125 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
10126 | ||
10127 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
10128 | def GetAutoWindowMenu(*args, **kwargs): | |
10129 | """GetAutoWindowMenu() -> bool""" | |
10130 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
10131 | ||
10132 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
2131d850 | 10133 | _core_.MenuBar_swigregister(MenuBar) |
d14a1e28 | 10134 | |
4f433fef | 10135 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
0085ce49 RD |
10136 | """MenuBar_SetAutoWindowMenu(bool enable)""" |
10137 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
4f433fef | 10138 | |
0085ce49 RD |
10139 | def MenuBar_GetAutoWindowMenu(*args): |
10140 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
10141 | return _core_.MenuBar_GetAutoWindowMenu(*args) | |
4f433fef | 10142 | |
d14a1e28 RD |
10143 | #--------------------------------------------------------------------------- |
10144 | ||
10145 | class MenuItem(Object): | |
093d3ff1 | 10146 | """Proxy of C++ MenuItem class""" |
0085ce49 RD |
10147 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10148 | __repr__ = _swig_repr | |
10149 | def __init__(self, *args, **kwargs): | |
0df68c9f | 10150 | """ |
a95a7133 | 10151 | __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString, |
196addbf RD |
10152 | String help=EmptyString, int kind=ITEM_NORMAL, |
10153 | Menu subMenu=None) -> MenuItem | |
0df68c9f | 10154 | """ |
0085ce49 RD |
10155 | _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs)) |
10156 | __swig_destroy__ = _core_.delete_MenuItem | |
10157 | __del__ = lambda self : None; | |
e811c8ce | 10158 | def GetMenu(*args, **kwargs): |
a95a7133 | 10159 | """GetMenu(self) -> Menu""" |
54f9ee45 | 10160 | return _core_.MenuItem_GetMenu(*args, **kwargs) |
e811c8ce RD |
10161 | |
10162 | def SetMenu(*args, **kwargs): | |
a95a7133 | 10163 | """SetMenu(self, Menu menu)""" |
54f9ee45 | 10164 | return _core_.MenuItem_SetMenu(*args, **kwargs) |
e811c8ce RD |
10165 | |
10166 | def SetId(*args, **kwargs): | |
a95a7133 | 10167 | """SetId(self, int id)""" |
54f9ee45 | 10168 | return _core_.MenuItem_SetId(*args, **kwargs) |
e811c8ce RD |
10169 | |
10170 | def GetId(*args, **kwargs): | |
a95a7133 | 10171 | """GetId(self) -> int""" |
54f9ee45 | 10172 | return _core_.MenuItem_GetId(*args, **kwargs) |
e811c8ce RD |
10173 | |
10174 | def IsSeparator(*args, **kwargs): | |
a95a7133 | 10175 | """IsSeparator(self) -> bool""" |
54f9ee45 | 10176 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
e811c8ce RD |
10177 | |
10178 | def SetText(*args, **kwargs): | |
a95a7133 | 10179 | """SetText(self, String str)""" |
54f9ee45 | 10180 | return _core_.MenuItem_SetText(*args, **kwargs) |
e811c8ce RD |
10181 | |
10182 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10183 | """GetLabel(self) -> String""" |
54f9ee45 | 10184 | return _core_.MenuItem_GetLabel(*args, **kwargs) |
e811c8ce RD |
10185 | |
10186 | def GetText(*args, **kwargs): | |
a95a7133 | 10187 | """GetText(self) -> String""" |
54f9ee45 | 10188 | return _core_.MenuItem_GetText(*args, **kwargs) |
e811c8ce RD |
10189 | |
10190 | def GetLabelFromText(*args, **kwargs): | |
66c033b4 | 10191 | """GetLabelFromText(String text) -> String""" |
54f9ee45 | 10192 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
e811c8ce RD |
10193 | |
10194 | GetLabelFromText = staticmethod(GetLabelFromText) | |
10195 | def GetKind(*args, **kwargs): | |
a95a7133 | 10196 | """GetKind(self) -> int""" |
54f9ee45 | 10197 | return _core_.MenuItem_GetKind(*args, **kwargs) |
e811c8ce | 10198 | |
a95a7133 RD |
10199 | def SetKind(*args, **kwargs): |
10200 | """SetKind(self, int kind)""" | |
54f9ee45 | 10201 | return _core_.MenuItem_SetKind(*args, **kwargs) |
a95a7133 | 10202 | |
e811c8ce | 10203 | def SetCheckable(*args, **kwargs): |
a95a7133 | 10204 | """SetCheckable(self, bool checkable)""" |
54f9ee45 | 10205 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
e811c8ce RD |
10206 | |
10207 | def IsCheckable(*args, **kwargs): | |
a95a7133 | 10208 | """IsCheckable(self) -> bool""" |
54f9ee45 | 10209 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
e811c8ce RD |
10210 | |
10211 | def IsSubMenu(*args, **kwargs): | |
a95a7133 | 10212 | """IsSubMenu(self) -> bool""" |
54f9ee45 | 10213 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
e811c8ce RD |
10214 | |
10215 | def SetSubMenu(*args, **kwargs): | |
a95a7133 | 10216 | """SetSubMenu(self, Menu menu)""" |
54f9ee45 | 10217 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) |
e811c8ce RD |
10218 | |
10219 | def GetSubMenu(*args, **kwargs): | |
a95a7133 | 10220 | """GetSubMenu(self) -> Menu""" |
54f9ee45 | 10221 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) |
e811c8ce RD |
10222 | |
10223 | def Enable(*args, **kwargs): | |
a95a7133 | 10224 | """Enable(self, bool enable=True)""" |
54f9ee45 | 10225 | return _core_.MenuItem_Enable(*args, **kwargs) |
e811c8ce RD |
10226 | |
10227 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10228 | """IsEnabled(self) -> bool""" |
54f9ee45 | 10229 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10230 | |
10231 | def Check(*args, **kwargs): | |
a95a7133 | 10232 | """Check(self, bool check=True)""" |
54f9ee45 | 10233 | return _core_.MenuItem_Check(*args, **kwargs) |
e811c8ce RD |
10234 | |
10235 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10236 | """IsChecked(self) -> bool""" |
54f9ee45 | 10237 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
e811c8ce RD |
10238 | |
10239 | def Toggle(*args, **kwargs): | |
a95a7133 | 10240 | """Toggle(self)""" |
54f9ee45 | 10241 | return _core_.MenuItem_Toggle(*args, **kwargs) |
e811c8ce RD |
10242 | |
10243 | def SetHelp(*args, **kwargs): | |
a95a7133 | 10244 | """SetHelp(self, String str)""" |
54f9ee45 | 10245 | return _core_.MenuItem_SetHelp(*args, **kwargs) |
e811c8ce RD |
10246 | |
10247 | def GetHelp(*args, **kwargs): | |
a95a7133 | 10248 | """GetHelp(self) -> String""" |
54f9ee45 | 10249 | return _core_.MenuItem_GetHelp(*args, **kwargs) |
e811c8ce RD |
10250 | |
10251 | def GetAccel(*args, **kwargs): | |
a95a7133 | 10252 | """GetAccel(self) -> AcceleratorEntry""" |
54f9ee45 | 10253 | return _core_.MenuItem_GetAccel(*args, **kwargs) |
e811c8ce RD |
10254 | |
10255 | def SetAccel(*args, **kwargs): | |
a95a7133 | 10256 | """SetAccel(self, AcceleratorEntry accel)""" |
54f9ee45 | 10257 | return _core_.MenuItem_SetAccel(*args, **kwargs) |
e811c8ce | 10258 | |
091f5bed RD |
10259 | def SetBitmap(*args, **kwargs): |
10260 | """SetBitmap(self, Bitmap bitmap)""" | |
10261 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
10262 | ||
10263 | def GetBitmap(*args, **kwargs): | |
10264 | """GetBitmap(self) -> Bitmap""" | |
10265 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
10266 | ||
c1280d1e RD |
10267 | def SetFont(*args, **kwargs): |
10268 | """SetFont(self, Font font)""" | |
10269 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
10270 | ||
10271 | def GetFont(*args, **kwargs): | |
10272 | """GetFont(self) -> Font""" | |
10273 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
10274 | ||
10275 | def SetTextColour(*args, **kwargs): | |
10276 | """SetTextColour(self, Colour colText)""" | |
10277 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
10278 | ||
10279 | def GetTextColour(*args, **kwargs): | |
10280 | """GetTextColour(self) -> Colour""" | |
10281 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
10282 | ||
10283 | def SetBackgroundColour(*args, **kwargs): | |
10284 | """SetBackgroundColour(self, Colour colBack)""" | |
10285 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
10286 | ||
10287 | def GetBackgroundColour(*args, **kwargs): | |
10288 | """GetBackgroundColour(self) -> Colour""" | |
10289 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
10290 | ||
10291 | def SetBitmaps(*args, **kwargs): | |
10292 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
10293 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
10294 | ||
10295 | def SetDisabledBitmap(*args, **kwargs): | |
10296 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
10297 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
10298 | ||
10299 | def GetDisabledBitmap(*args, **kwargs): | |
10300 | """GetDisabledBitmap(self) -> Bitmap""" | |
10301 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
10302 | ||
10303 | def SetMarginWidth(*args, **kwargs): | |
10304 | """SetMarginWidth(self, int nWidth)""" | |
10305 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
10306 | ||
10307 | def GetMarginWidth(*args, **kwargs): | |
10308 | """GetMarginWidth(self) -> int""" | |
10309 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
10310 | ||
e811c8ce | 10311 | def GetDefaultMarginWidth(*args, **kwargs): |
66c033b4 | 10312 | """GetDefaultMarginWidth() -> int""" |
54f9ee45 | 10313 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
e811c8ce RD |
10314 | |
10315 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
10316 | def IsOwnerDrawn(*args, **kwargs): |
10317 | """IsOwnerDrawn(self) -> bool""" | |
10318 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
10319 | ||
10320 | def SetOwnerDrawn(*args, **kwargs): | |
10321 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
10322 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
10323 | ||
10324 | def ResetOwnerDrawn(*args, **kwargs): | |
10325 | """ResetOwnerDrawn(self)""" | |
10326 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
10327 | ||
2131d850 | 10328 | _core_.MenuItem_swigregister(MenuItem) |
d14a1e28 | 10329 | |
e811c8ce | 10330 | def MenuItem_GetLabelFromText(*args, **kwargs): |
0085ce49 RD |
10331 | """MenuItem_GetLabelFromText(String text) -> String""" |
10332 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d14a1e28 | 10333 | |
0085ce49 RD |
10334 | def MenuItem_GetDefaultMarginWidth(*args): |
10335 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
10336 | return _core_.MenuItem_GetDefaultMarginWidth(*args) | |
d14a1e28 RD |
10337 | |
10338 | #--------------------------------------------------------------------------- | |
10339 | ||
10340 | class Control(Window): | |
15afbcd0 RD |
10341 | """ |
10342 | This is the base class for a control or 'widget'. | |
10343 | ||
41e2b43e RD |
10344 | A control is generally a small window which processes user input |
10345 | and/or displays one or more item of data. | |
15afbcd0 | 10346 | """ |
0085ce49 RD |
10347 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10348 | __repr__ = _swig_repr | |
10349 | def __init__(self, *args, **kwargs): | |
0df68c9f | 10350 | """ |
248ed943 RD |
10351 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10352 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10353 | String name=ControlNameStr) -> Control |
15afbcd0 | 10354 | |
41e2b43e RD |
10355 | Create a Control. Normally you should only call this from a subclass' |
10356 | __init__ as a plain old wx.Control is not very useful. | |
0df68c9f | 10357 | """ |
0085ce49 | 10358 | _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs)) |
d14a1e28 | 10359 | self._setOORInfo(self) |
e811c8ce RD |
10360 | |
10361 | def Create(*args, **kwargs): | |
0df68c9f | 10362 | """ |
248ed943 RD |
10363 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
10364 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 10365 | String name=ControlNameStr) -> bool |
15afbcd0 RD |
10366 | |
10367 | Do the 2nd phase and create the GUI control. | |
0df68c9f | 10368 | """ |
54f9ee45 | 10369 | return _core_.Control_Create(*args, **kwargs) |
e811c8ce RD |
10370 | |
10371 | def Command(*args, **kwargs): | |
15afbcd0 | 10372 | """ |
a95a7133 | 10373 | Command(self, CommandEvent event) |
15afbcd0 | 10374 | |
41e2b43e RD |
10375 | Simulates the effect of the user issuing a command to the item. |
10376 | ||
10377 | :see: `wx.CommandEvent` | |
10378 | ||
15afbcd0 | 10379 | """ |
54f9ee45 | 10380 | return _core_.Control_Command(*args, **kwargs) |
e811c8ce RD |
10381 | |
10382 | def GetLabel(*args, **kwargs): | |
15afbcd0 | 10383 | """ |
a95a7133 | 10384 | GetLabel(self) -> String |
15afbcd0 RD |
10385 | |
10386 | Return a control's text. | |
10387 | """ | |
54f9ee45 | 10388 | return _core_.Control_GetLabel(*args, **kwargs) |
e811c8ce | 10389 | |
74a57fcd | 10390 | def GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 RD |
10391 | """ |
10392 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
10393 | ||
10394 | Get the default attributes for this class. This is useful if you want | |
10395 | to use the same font or colour in your own control as in a standard | |
10396 | control -- which is a much better idea than hard coding specific | |
10397 | colours or fonts which might look completely out of place on the | |
10398 | user's system, especially if it uses themes. | |
10399 | ||
10400 | The variant parameter is only relevant under Mac currently and is | |
10401 | ignore under other platforms. Under Mac, it will change the size of | |
10402 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10403 | this. | |
10404 | """ | |
54f9ee45 | 10405 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
10406 | |
10407 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
2131d850 | 10408 | _core_.Control_swigregister(Control) |
b2dc1044 | 10409 | ControlNameStr = cvar.ControlNameStr |
d14a1e28 RD |
10410 | |
10411 | def PreControl(*args, **kwargs): | |
15afbcd0 RD |
10412 | """ |
10413 | PreControl() -> Control | |
10414 | ||
10415 | Precreate a Control control for 2-phase creation | |
10416 | """ | |
54f9ee45 | 10417 | val = _core_.new_PreControl(*args, **kwargs) |
d14a1e28 RD |
10418 | return val |
10419 | ||
74a57fcd | 10420 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 10421 | """ |
110da5b0 RD |
10422 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
10423 | ||
10424 | Get the default attributes for this class. This is useful if you want | |
10425 | to use the same font or colour in your own control as in a standard | |
10426 | control -- which is a much better idea than hard coding specific | |
10427 | colours or fonts which might look completely out of place on the | |
10428 | user's system, especially if it uses themes. | |
10429 | ||
10430 | The variant parameter is only relevant under Mac currently and is | |
10431 | ignore under other platforms. Under Mac, it will change the size of | |
10432 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
10433 | this. | |
10434 | """ | |
0085ce49 | 10435 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 10436 | |
d14a1e28 RD |
10437 | #--------------------------------------------------------------------------- |
10438 | ||
10439 | class ItemContainer(object): | |
15afbcd0 | 10440 | """ |
53aa7709 RD |
10441 | The wx.ItemContainer class defines an interface which is implemented |
10442 | by all controls which have string subitems, each of which may be | |
10443 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
10444 | as `wx.ComboBox` which implements an extended interface deriving from | |
41e2b43e | 10445 | this one. |
15afbcd0 | 10446 | |
41e2b43e RD |
10447 | It defines the methods for accessing the control's items and although |
10448 | each of the derived classes implements them differently, they still | |
10449 | all conform to the same interface. | |
15afbcd0 | 10450 | |
41e2b43e RD |
10451 | The items in a wx.ItemContainer have (non empty) string labels and, |
10452 | optionally, client data associated with them. | |
15afbcd0 RD |
10453 | |
10454 | """ | |
0085ce49 RD |
10455 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10456 | def __init__(self): raise AttributeError, "No constructor defined" | |
10457 | __repr__ = _swig_repr | |
e811c8ce | 10458 | def Append(*args, **kwargs): |
15afbcd0 | 10459 | """ |
a95a7133 | 10460 | Append(self, String item, PyObject clientData=None) -> int |
15afbcd0 | 10461 | |
41e2b43e RD |
10462 | Adds the item to the control, associating the given data with the item |
10463 | if not None. The return value is the index of the newly added item | |
10464 | which may be different from the last one if the control is sorted (e.g. | |
10465 | has wx.LB_SORT or wx.CB_SORT style). | |
15afbcd0 | 10466 | """ |
54f9ee45 | 10467 | return _core_.ItemContainer_Append(*args, **kwargs) |
e811c8ce RD |
10468 | |
10469 | def AppendItems(*args, **kwargs): | |
15afbcd0 | 10470 | """ |
f5b96ee1 | 10471 | AppendItems(self, List strings) |
15afbcd0 | 10472 | |
41e2b43e RD |
10473 | Apend several items at once to the control. Notice that calling this |
10474 | method may be much faster than appending the items one by one if you | |
10475 | need to add a lot of items. | |
15afbcd0 | 10476 | """ |
54f9ee45 | 10477 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
e811c8ce RD |
10478 | |
10479 | def Insert(*args, **kwargs): | |
15afbcd0 | 10480 | """ |
50f151d7 | 10481 | Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int |
15afbcd0 | 10482 | |
41e2b43e | 10483 | Insert an item into the control before the item at the ``pos`` index, |
15afbcd0 RD |
10484 | optionally associating some data object with the item. |
10485 | """ | |
54f9ee45 | 10486 | return _core_.ItemContainer_Insert(*args, **kwargs) |
e811c8ce RD |
10487 | |
10488 | def Clear(*args, **kwargs): | |
15afbcd0 | 10489 | """ |
a95a7133 | 10490 | Clear(self) |
15afbcd0 RD |
10491 | |
10492 | Removes all items from the control. | |
10493 | """ | |
54f9ee45 | 10494 | return _core_.ItemContainer_Clear(*args, **kwargs) |
e811c8ce RD |
10495 | |
10496 | def Delete(*args, **kwargs): | |
15afbcd0 | 10497 | """ |
50f151d7 | 10498 | Delete(self, unsigned int n) |
15afbcd0 | 10499 | |
41e2b43e RD |
10500 | Deletes the item at the zero-based index 'n' from the control. Note |
10501 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
10502 | enabled) to remove an item with the index negative or greater or equal | |
10503 | than the number of items in the control. | |
15afbcd0 | 10504 | """ |
54f9ee45 | 10505 | return _core_.ItemContainer_Delete(*args, **kwargs) |
e811c8ce | 10506 | |
53aa7709 RD |
10507 | def GetClientData(*args, **kwargs): |
10508 | """ | |
50f151d7 | 10509 | GetClientData(self, unsigned int n) -> PyObject |
53aa7709 RD |
10510 | |
10511 | Returns the client data associated with the given item, (if any.) | |
10512 | """ | |
10513 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
10514 | ||
10515 | def SetClientData(*args, **kwargs): | |
10516 | """ | |
50f151d7 | 10517 | SetClientData(self, unsigned int n, PyObject clientData) |
53aa7709 RD |
10518 | |
10519 | Associate the given client data with the item at position n. | |
10520 | """ | |
10521 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
10522 | ||
e811c8ce | 10523 | def GetCount(*args, **kwargs): |
15afbcd0 | 10524 | """ |
50f151d7 | 10525 | GetCount(self) -> unsigned int |
15afbcd0 RD |
10526 | |
10527 | Returns the number of items in the control. | |
10528 | """ | |
54f9ee45 | 10529 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
e811c8ce RD |
10530 | |
10531 | def IsEmpty(*args, **kwargs): | |
15afbcd0 | 10532 | """ |
a95a7133 | 10533 | IsEmpty(self) -> bool |
15afbcd0 RD |
10534 | |
10535 | Returns True if the control is empty or False if it has some items. | |
10536 | """ | |
54f9ee45 | 10537 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
e811c8ce RD |
10538 | |
10539 | def GetString(*args, **kwargs): | |
15afbcd0 | 10540 | """ |
50f151d7 | 10541 | GetString(self, unsigned int n) -> String |
15afbcd0 RD |
10542 | |
10543 | Returns the label of the item with the given index. | |
10544 | """ | |
54f9ee45 | 10545 | return _core_.ItemContainer_GetString(*args, **kwargs) |
e811c8ce RD |
10546 | |
10547 | def GetStrings(*args, **kwargs): | |
a95a7133 | 10548 | """GetStrings(self) -> wxArrayString""" |
54f9ee45 | 10549 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
e811c8ce RD |
10550 | |
10551 | def SetString(*args, **kwargs): | |
15afbcd0 | 10552 | """ |
50f151d7 | 10553 | SetString(self, unsigned int n, String s) |
15afbcd0 RD |
10554 | |
10555 | Sets the label for the given item. | |
10556 | """ | |
54f9ee45 | 10557 | return _core_.ItemContainer_SetString(*args, **kwargs) |
e811c8ce RD |
10558 | |
10559 | def FindString(*args, **kwargs): | |
15afbcd0 | 10560 | """ |
a95a7133 | 10561 | FindString(self, String s) -> int |
15afbcd0 RD |
10562 | |
10563 | Finds an item whose label matches the given string. Returns the | |
41e2b43e RD |
10564 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
10565 | found. | |
15afbcd0 | 10566 | """ |
54f9ee45 | 10567 | return _core_.ItemContainer_FindString(*args, **kwargs) |
e811c8ce | 10568 | |
53aa7709 | 10569 | def SetSelection(*args, **kwargs): |
15afbcd0 | 10570 | """ |
53aa7709 | 10571 | SetSelection(self, int n) |
15afbcd0 RD |
10572 | |
10573 | Sets the item at index 'n' to be the selected item. | |
10574 | """ | |
53aa7709 | 10575 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
e811c8ce RD |
10576 | |
10577 | def GetSelection(*args, **kwargs): | |
15afbcd0 | 10578 | """ |
a95a7133 | 10579 | GetSelection(self) -> int |
15afbcd0 | 10580 | |
41e2b43e RD |
10581 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
10582 | is selected. | |
15afbcd0 | 10583 | """ |
54f9ee45 | 10584 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
e811c8ce | 10585 | |
53aa7709 RD |
10586 | def SetStringSelection(*args, **kwargs): |
10587 | """SetStringSelection(self, String s) -> bool""" | |
10588 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
10589 | ||
e811c8ce | 10590 | def GetStringSelection(*args, **kwargs): |
15afbcd0 | 10591 | """ |
a95a7133 | 10592 | GetStringSelection(self) -> String |
15afbcd0 | 10593 | |
41e2b43e RD |
10594 | Returns the label of the selected item or an empty string if no item |
10595 | is selected. | |
15afbcd0 | 10596 | """ |
54f9ee45 | 10597 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
e811c8ce | 10598 | |
53aa7709 | 10599 | def Select(*args, **kwargs): |
15afbcd0 | 10600 | """ |
53aa7709 | 10601 | Select(self, int n) |
15afbcd0 | 10602 | |
53aa7709 RD |
10603 | This is the same as `SetSelection` and exists only because it is |
10604 | slightly more natural for controls which support multiple selection. | |
15afbcd0 | 10605 | """ |
53aa7709 | 10606 | return _core_.ItemContainer_Select(*args, **kwargs) |
e811c8ce | 10607 | |
2131d850 | 10608 | _core_.ItemContainer_swigregister(ItemContainer) |
d14a1e28 RD |
10609 | |
10610 | #--------------------------------------------------------------------------- | |
10611 | ||
10612 | class ControlWithItems(Control,ItemContainer): | |
15afbcd0 | 10613 | """ |
41e2b43e RD |
10614 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
10615 | wx.Control class, and is used for the base class of various controls | |
10616 | that have items. | |
15afbcd0 | 10617 | """ |
0085ce49 RD |
10618 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10619 | def __init__(self): raise AttributeError, "No constructor defined" | |
10620 | __repr__ = _swig_repr | |
2131d850 | 10621 | _core_.ControlWithItems_swigregister(ControlWithItems) |
d14a1e28 RD |
10622 | |
10623 | #--------------------------------------------------------------------------- | |
10624 | ||
10625 | class SizerItem(Object): | |
248ed943 RD |
10626 | """ |
10627 | The wx.SizerItem class is used to track the position, size and other | |
01f6b6d3 RD |
10628 | attributes of each item managed by a `wx.Sizer`. It is not usually |
10629 | necessary to use this class because the sizer elements can also be | |
10630 | identified by their positions or window or sizer references but | |
10631 | sometimes it may be more convenient to use wx.SizerItem directly. | |
10632 | Also, custom classes derived from `wx.PySizer` will probably need to | |
10633 | use the collection of wx.SizerItems held by wx.Sizer when calculating | |
10634 | layout. | |
248ed943 RD |
10635 | |
10636 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
10637 | """ | |
0085ce49 RD |
10638 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10639 | __repr__ = _swig_repr | |
10640 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
10641 | """ |
10642 | __init__(self) -> SizerItem | |
10643 | ||
10644 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
10645 | size will need to be set before this item can be used in a Sizer. | |
10646 | ||
10647 | You will probably never need to create a wx.SizerItem directly as they | |
10648 | are created automatically when the sizer's Add, Insert or Prepend | |
10649 | methods are called. | |
10650 | ||
10651 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
10652 | """ | |
0085ce49 RD |
10653 | _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs)) |
10654 | __swig_destroy__ = _core_.delete_SizerItem | |
10655 | __del__ = lambda self : None; | |
e811c8ce | 10656 | def DeleteWindows(*args, **kwargs): |
248ed943 RD |
10657 | """ |
10658 | DeleteWindows(self) | |
10659 | ||
10660 | Destroy the window or the windows in a subsizer, depending on the type | |
10661 | of item. | |
10662 | """ | |
54f9ee45 | 10663 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
10664 | |
10665 | def DetachSizer(*args, **kwargs): | |
248ed943 RD |
10666 | """ |
10667 | DetachSizer(self) | |
10668 | ||
10669 | Enable deleting the SizerItem without destroying the contained sizer. | |
10670 | """ | |
54f9ee45 | 10671 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
e811c8ce RD |
10672 | |
10673 | def GetSize(*args, **kwargs): | |
248ed943 RD |
10674 | """ |
10675 | GetSize(self) -> Size | |
10676 | ||
10677 | Get the current size of the item, as set in the last Layout. | |
10678 | """ | |
54f9ee45 | 10679 | return _core_.SizerItem_GetSize(*args, **kwargs) |
e811c8ce RD |
10680 | |
10681 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
10682 | """ |
10683 | CalcMin(self) -> Size | |
10684 | ||
10685 | Calculates the minimum desired size for the item, including any space | |
10686 | needed by borders. | |
10687 | """ | |
54f9ee45 | 10688 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
e811c8ce RD |
10689 | |
10690 | def SetDimension(*args, **kwargs): | |
248ed943 RD |
10691 | """ |
10692 | SetDimension(self, Point pos, Size size) | |
10693 | ||
10694 | Set the position and size of the space allocated for this item by the | |
10695 | sizer, and adjust the position and size of the item (window or | |
10696 | subsizer) to be within that space taking alignment and borders into | |
10697 | account. | |
10698 | """ | |
54f9ee45 | 10699 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
e811c8ce RD |
10700 | |
10701 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
10702 | """ |
10703 | GetMinSize(self) -> Size | |
10704 | ||
10705 | Get the minimum size needed for the item. | |
10706 | """ | |
54f9ee45 | 10707 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
e811c8ce | 10708 | |
dfbb5885 RD |
10709 | def GetMinSizeWithBorder(*args, **kwargs): |
10710 | """ | |
10711 | GetMinSizeWithBorder(self) -> Size | |
10712 | ||
10713 | Get the minimum size needed for the item with space for the borders | |
10714 | added, if needed. | |
10715 | """ | |
10716 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
10717 | ||
e811c8ce | 10718 | def SetInitSize(*args, **kwargs): |
a95a7133 | 10719 | """SetInitSize(self, int x, int y)""" |
54f9ee45 | 10720 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
e811c8ce RD |
10721 | |
10722 | def SetRatioWH(*args, **kwargs): | |
248ed943 RD |
10723 | """ |
10724 | SetRatioWH(self, int width, int height) | |
10725 | ||
10726 | Set the ratio item attribute. | |
10727 | """ | |
54f9ee45 | 10728 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
e811c8ce RD |
10729 | |
10730 | def SetRatioSize(*args, **kwargs): | |
248ed943 RD |
10731 | """ |
10732 | SetRatioSize(self, Size size) | |
10733 | ||
10734 | Set the ratio item attribute. | |
10735 | """ | |
54f9ee45 | 10736 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
e811c8ce RD |
10737 | |
10738 | def SetRatio(*args, **kwargs): | |
248ed943 RD |
10739 | """ |
10740 | SetRatio(self, float ratio) | |
10741 | ||
10742 | Set the ratio item attribute. | |
10743 | """ | |
54f9ee45 | 10744 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
e811c8ce RD |
10745 | |
10746 | def GetRatio(*args, **kwargs): | |
248ed943 RD |
10747 | """ |
10748 | GetRatio(self) -> float | |
10749 | ||
10750 | Set the ratio item attribute. | |
10751 | """ | |
54f9ee45 | 10752 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
e811c8ce | 10753 | |
d3b6e4ff RD |
10754 | def GetRect(*args, **kwargs): |
10755 | """ | |
10756 | GetRect(self) -> Rect | |
10757 | ||
10758 | Returns the rectangle that the sizer item should occupy | |
10759 | """ | |
10760 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
10761 | ||
e811c8ce | 10762 | def IsWindow(*args, **kwargs): |
248ed943 RD |
10763 | """ |
10764 | IsWindow(self) -> bool | |
10765 | ||
10766 | Is this sizer item a window? | |
10767 | """ | |
54f9ee45 | 10768 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
e811c8ce RD |
10769 | |
10770 | def IsSizer(*args, **kwargs): | |
248ed943 RD |
10771 | """ |
10772 | IsSizer(self) -> bool | |
10773 | ||
10774 | Is this sizer item a subsizer? | |
10775 | """ | |
54f9ee45 | 10776 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
e811c8ce RD |
10777 | |
10778 | def IsSpacer(*args, **kwargs): | |
248ed943 RD |
10779 | """ |
10780 | IsSpacer(self) -> bool | |
10781 | ||
10782 | Is this sizer item a spacer? | |
10783 | """ | |
54f9ee45 | 10784 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
e811c8ce RD |
10785 | |
10786 | def SetProportion(*args, **kwargs): | |
248ed943 RD |
10787 | """ |
10788 | SetProportion(self, int proportion) | |
10789 | ||
10790 | Set the proportion value for this item. | |
10791 | """ | |
54f9ee45 | 10792 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
e811c8ce RD |
10793 | |
10794 | def GetProportion(*args, **kwargs): | |
248ed943 RD |
10795 | """ |
10796 | GetProportion(self) -> int | |
10797 | ||
10798 | Get the proportion value for this item. | |
10799 | """ | |
54f9ee45 | 10800 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
e811c8ce | 10801 | |
248ed943 RD |
10802 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
10803 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
e811c8ce | 10804 | def SetFlag(*args, **kwargs): |
248ed943 RD |
10805 | """ |
10806 | SetFlag(self, int flag) | |
10807 | ||
10808 | Set the flag value for this item. | |
10809 | """ | |
54f9ee45 | 10810 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
e811c8ce RD |
10811 | |
10812 | def GetFlag(*args, **kwargs): | |
248ed943 RD |
10813 | """ |
10814 | GetFlag(self) -> int | |
10815 | ||
10816 | Get the flag value for this item. | |
10817 | """ | |
54f9ee45 | 10818 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
e811c8ce RD |
10819 | |
10820 | def SetBorder(*args, **kwargs): | |
248ed943 RD |
10821 | """ |
10822 | SetBorder(self, int border) | |
10823 | ||
10824 | Set the border value for this item. | |
10825 | """ | |
54f9ee45 | 10826 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
e811c8ce RD |
10827 | |
10828 | def GetBorder(*args, **kwargs): | |
248ed943 RD |
10829 | """ |
10830 | GetBorder(self) -> int | |
10831 | ||
10832 | Get the border value for this item. | |
10833 | """ | |
54f9ee45 | 10834 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
e811c8ce RD |
10835 | |
10836 | def GetWindow(*args, **kwargs): | |
248ed943 RD |
10837 | """ |
10838 | GetWindow(self) -> Window | |
10839 | ||
10840 | Get the window (if any) that is managed by this sizer item. | |
10841 | """ | |
54f9ee45 | 10842 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
e811c8ce RD |
10843 | |
10844 | def SetWindow(*args, **kwargs): | |
248ed943 RD |
10845 | """ |
10846 | SetWindow(self, Window window) | |
10847 | ||
10848 | Set the window to be managed by this sizer item. | |
10849 | """ | |
54f9ee45 | 10850 | return _core_.SizerItem_SetWindow(*args, **kwargs) |
e811c8ce RD |
10851 | |
10852 | def GetSizer(*args, **kwargs): | |
248ed943 RD |
10853 | """ |
10854 | GetSizer(self) -> Sizer | |
10855 | ||
10856 | Get the subsizer (if any) that is managed by this sizer item. | |
10857 | """ | |
54f9ee45 | 10858 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
e811c8ce RD |
10859 | |
10860 | def SetSizer(*args, **kwargs): | |
248ed943 RD |
10861 | """ |
10862 | SetSizer(self, Sizer sizer) | |
10863 | ||
10864 | Set the subsizer to be managed by this sizer item. | |
10865 | """ | |
54f9ee45 | 10866 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
e811c8ce RD |
10867 | |
10868 | def GetSpacer(*args, **kwargs): | |
248ed943 RD |
10869 | """ |
10870 | GetSpacer(self) -> Size | |
10871 | ||
10872 | Get the size of the spacer managed by this sizer item. | |
10873 | """ | |
54f9ee45 | 10874 | return _core_.SizerItem_GetSpacer(*args, **kwargs) |
e811c8ce RD |
10875 | |
10876 | def SetSpacer(*args, **kwargs): | |
248ed943 RD |
10877 | """ |
10878 | SetSpacer(self, Size size) | |
10879 | ||
10880 | Set the size of the spacer to be managed by this sizer item. | |
10881 | """ | |
54f9ee45 | 10882 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
e811c8ce RD |
10883 | |
10884 | def Show(*args, **kwargs): | |
248ed943 RD |
10885 | """ |
10886 | Show(self, bool show) | |
10887 | ||
10888 | Set the show item attribute, which sizers use to determine if the item | |
10889 | is to be made part of the layout or not. If the item is tracking a | |
10890 | window then it is shown or hidden as needed. | |
10891 | """ | |
54f9ee45 | 10892 | return _core_.SizerItem_Show(*args, **kwargs) |
e811c8ce RD |
10893 | |
10894 | def IsShown(*args, **kwargs): | |
248ed943 RD |
10895 | """ |
10896 | IsShown(self) -> bool | |
10897 | ||
10898 | Is the item to be shown in the layout? | |
10899 | """ | |
54f9ee45 | 10900 | return _core_.SizerItem_IsShown(*args, **kwargs) |
e811c8ce RD |
10901 | |
10902 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
10903 | """ |
10904 | GetPosition(self) -> Point | |
10905 | ||
10906 | Returns the current position of the item, as set in the last Layout. | |
10907 | """ | |
54f9ee45 | 10908 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
e811c8ce RD |
10909 | |
10910 | def GetUserData(*args, **kwargs): | |
248ed943 RD |
10911 | """ |
10912 | GetUserData(self) -> PyObject | |
10913 | ||
10914 | Returns the userData associated with this sizer item, or None if there | |
10915 | isn't any. | |
10916 | """ | |
54f9ee45 | 10917 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
e811c8ce | 10918 | |
091f5bed RD |
10919 | def SetUserData(*args, **kwargs): |
10920 | """ | |
10921 | SetUserData(self, PyObject userData) | |
10922 | ||
10923 | Associate a Python object with this sizer item. | |
10924 | """ | |
10925 | return _core_.SizerItem_SetUserData(*args, **kwargs) | |
10926 | ||
2131d850 | 10927 | _core_.SizerItem_swigregister(SizerItem) |
d14a1e28 | 10928 | |
248ed943 | 10929 | def SizerItemWindow(*args, **kwargs): |
0df68c9f | 10930 | """ |
248ed943 RD |
10931 | SizerItemWindow(Window window, int proportion, int flag, int border, |
10932 | PyObject userData=None) -> SizerItem | |
10933 | ||
10934 | Constructs a `wx.SizerItem` for tracking a window. | |
0df68c9f | 10935 | """ |
248ed943 | 10936 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
10937 | return val |
10938 | ||
248ed943 | 10939 | def SizerItemSpacer(*args, **kwargs): |
0df68c9f | 10940 | """ |
248ed943 RD |
10941 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
10942 | PyObject userData=None) -> SizerItem | |
10943 | ||
10944 | Constructs a `wx.SizerItem` for tracking a spacer. | |
0df68c9f | 10945 | """ |
248ed943 | 10946 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
10947 | return val |
10948 | ||
10949 | def SizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
10950 | """ |
10951 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
248ed943 RD |
10952 | PyObject userData=None) -> SizerItem |
10953 | ||
10954 | Constructs a `wx.SizerItem` for tracking a subsizer | |
0df68c9f | 10955 | """ |
54f9ee45 | 10956 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
10957 | return val |
10958 | ||
10959 | class Sizer(Object): | |
248ed943 RD |
10960 | """ |
10961 | wx.Sizer is the abstract base class used for laying out subwindows in | |
10962 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
10963 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
10964 | `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer` | |
10965 | and `wx.GridBagSizer`. | |
10966 | ||
10967 | The concept implemented by sizers in wxWidgets is closely related to | |
10968 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
10969 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
10970 | subwindows reporting their minimal required size and their ability to | |
10971 | get stretched if the size of the parent window has changed. This will | |
10972 | most often mean that the programmer does not set the original size of | |
10973 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
10974 | this sizer will be queried about the recommended size. The sizer in | |
10975 | turn will query its children, which can be normal windows or contorls, | |
10976 | empty space or other sizers, so that a hierarchy of sizers can be | |
10977 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
10978 | do not interfere with tab ordering and requires very little resources | |
10979 | compared to a real window on screen. | |
10980 | ||
10981 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
10982 | every control reports its own minimal size and the algorithm can | |
10983 | handle differences in font sizes or different window (dialog item) | |
10984 | sizes on different platforms without problems. If for example the | |
10985 | standard font as well as the overall design of Mac widgets requires | |
10986 | more space than on Windows, then the initial size of a dialog using a | |
10987 | sizer will automatically be bigger on Mac than on Windows. | |
10988 | """ | |
0085ce49 RD |
10989 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10990 | def __init__(self): raise AttributeError, "No constructor defined" | |
10991 | __repr__ = _swig_repr | |
10992 | __swig_destroy__ = _core_.delete_Sizer | |
10993 | __del__ = lambda self : None; | |
e811c8ce | 10994 | def _setOORInfo(*args, **kwargs): |
a95a7133 | 10995 | """_setOORInfo(self, PyObject _self)""" |
54f9ee45 | 10996 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
e811c8ce RD |
10997 | |
10998 | def Add(*args, **kwargs): | |
0df68c9f | 10999 | """ |
248ed943 | 11000 | Add(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11001 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11002 | |
11003 | Appends a child item to the sizer. | |
0df68c9f | 11004 | """ |
54f9ee45 | 11005 | return _core_.Sizer_Add(*args, **kwargs) |
e811c8ce RD |
11006 | |
11007 | def Insert(*args, **kwargs): | |
0df68c9f | 11008 | """ |
248ed943 | 11009 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11010 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11011 | |
11012 | Inserts a new item into the list of items managed by this sizer before | |
11013 | the item at index *before*. See `Add` for a description of the parameters. | |
0df68c9f | 11014 | """ |
54f9ee45 | 11015 | return _core_.Sizer_Insert(*args, **kwargs) |
e811c8ce RD |
11016 | |
11017 | def Prepend(*args, **kwargs): | |
0df68c9f | 11018 | """ |
248ed943 | 11019 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 11020 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
11021 | |
11022 | Adds a new item to the begining of the list of sizer items managed by | |
11023 | this sizer. See `Add` for a description of the parameters. | |
0df68c9f | 11024 | """ |
54f9ee45 | 11025 | return _core_.Sizer_Prepend(*args, **kwargs) |
e811c8ce RD |
11026 | |
11027 | def Remove(*args, **kwargs): | |
248ed943 RD |
11028 | """ |
11029 | Remove(self, item) -> bool | |
11030 | ||
11031 | Removes an item from the sizer and destroys it. This method does not | |
11032 | cause any layout or resizing to take place, call `Layout` to update | |
11033 | the layout on screen after removing a child from the sizer. The | |
11034 | *item* parameter can be either a window, a sizer, or the zero-based | |
11035 | index of an item to remove. Returns True if the child item was found | |
11036 | and removed. | |
11037 | """ | |
54f9ee45 | 11038 | return _core_.Sizer_Remove(*args, **kwargs) |
e811c8ce | 11039 | |
1c0f361b | 11040 | def Detach(*args, **kwargs): |
248ed943 RD |
11041 | """ |
11042 | Detach(self, item) -> bool | |
11043 | ||
11044 | Detaches an item from the sizer without destroying it. This method | |
11045 | does not cause any layout or resizing to take place, call `Layout` to | |
11046 | do so. The *item* parameter can be either a window, a sizer, or the | |
11047 | zero-based index of the item to be detached. Returns True if the child item | |
11048 | was found and detached. | |
11049 | """ | |
1c0f361b RD |
11050 | return _core_.Sizer_Detach(*args, **kwargs) |
11051 | ||
d3b6e4ff RD |
11052 | def GetItem(*args, **kwargs): |
11053 | """ | |
11054 | GetItem(self, item) -> wx.SizerItem | |
11055 | ||
11056 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
11057 | parameter can be either a window, a sizer, or the zero-based index of | |
4d170c95 | 11058 | the item to be found. |
d3b6e4ff RD |
11059 | """ |
11060 | return _core_.Sizer_GetItem(*args, **kwargs) | |
11061 | ||
e811c8ce | 11062 | def _SetItemMinSize(*args, **kwargs): |
a95a7133 | 11063 | """_SetItemMinSize(self, PyObject item, Size size)""" |
54f9ee45 | 11064 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) |
e811c8ce | 11065 | |
248ed943 RD |
11066 | def SetItemMinSize(self, item, *args): |
11067 | """ | |
11068 | SetItemMinSize(self, item, Size size) | |
11069 | ||
11070 | Sets the minimum size that will be allocated for an item in the sizer. | |
11071 | The *item* parameter can be either a window, a sizer, or the | |
11072 | zero-based index of the item. If a window or sizer is given then it | |
11073 | will be searched for recursivly in subsizers if neccessary. | |
11074 | """ | |
11075 | if len(args) == 2: | |
11076 | # for backward compatibility accept separate width,height args too | |
11077 | return self._SetItemMinSize(item, args) | |
11078 | else: | |
11079 | return self._SetItemMinSize(item, args[0]) | |
11080 | ||
e811c8ce | 11081 | def AddItem(*args, **kwargs): |
248ed943 RD |
11082 | """ |
11083 | AddItem(self, SizerItem item) | |
11084 | ||
11085 | Adds a `wx.SizerItem` to the sizer. | |
11086 | """ | |
54f9ee45 | 11087 | return _core_.Sizer_AddItem(*args, **kwargs) |
e811c8ce RD |
11088 | |
11089 | def InsertItem(*args, **kwargs): | |
248ed943 RD |
11090 | """ |
11091 | InsertItem(self, int index, SizerItem item) | |
11092 | ||
11093 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
11094 | """ | |
54f9ee45 | 11095 | return _core_.Sizer_InsertItem(*args, **kwargs) |
e811c8ce RD |
11096 | |
11097 | def PrependItem(*args, **kwargs): | |
248ed943 RD |
11098 | """ |
11099 | PrependItem(self, SizerItem item) | |
11100 | ||
11101 | Prepends a `wx.SizerItem` to the sizer. | |
11102 | """ | |
54f9ee45 | 11103 | return _core_.Sizer_PrependItem(*args, **kwargs) |
e811c8ce | 11104 | |
248ed943 | 11105 | def AddMany(self, items): |
66c033b4 RD |
11106 | """ |
11107 | AddMany is a convenience method for adding several items | |
11108 | to a sizer at one time. Simply pass it a list of tuples, | |
11109 | where each tuple consists of the parameters that you | |
11110 | would normally pass to the `Add` method. | |
11111 | """ | |
248ed943 RD |
11112 | for item in items: |
11113 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
11114 | item = (item, ) | |
11115 | self.Add(*item) | |
d14a1e28 | 11116 | |
74e96f3d | 11117 | # for backwards compatibility only, please do not use in new code |
b9d6a5f3 RD |
11118 | def AddWindow(self, *args, **kw): |
11119 | """Compatibility alias for `Add`.""" | |
11120 | return self.Add(*args, **kw) | |
11121 | def AddSizer(self, *args, **kw): | |
11122 | """Compatibility alias for `Add`.""" | |
11123 | return self.Add(*args, **kw) | |
11124 | def AddSpacer(self, *args, **kw): | |
11125 | """Compatibility alias for `Add`.""" | |
11126 | return self.Add(*args, **kw) | |
11127 | ||
11128 | def PrependWindow(self, *args, **kw): | |
11129 | """Compatibility alias for `Prepend`.""" | |
11130 | return self.Prepend(*args, **kw) | |
11131 | def PrependSizer(self, *args, **kw): | |
11132 | """Compatibility alias for `Prepend`.""" | |
11133 | return self.Prepend(*args, **kw) | |
11134 | def PrependSpacer(self, *args, **kw): | |
11135 | """Compatibility alias for `Prepend`.""" | |
11136 | return self.Prepend(*args, **kw) | |
11137 | ||
11138 | def InsertWindow(self, *args, **kw): | |
11139 | """Compatibility alias for `Insert`.""" | |
11140 | return self.Insert(*args, **kw) | |
11141 | def InsertSizer(self, *args, **kw): | |
11142 | """Compatibility alias for `Insert`.""" | |
11143 | return self.Insert(*args, **kw) | |
11144 | def InsertSpacer(self, *args, **kw): | |
11145 | """Compatibility alias for `Insert`.""" | |
11146 | return self.Insert(*args, **kw) | |
11147 | ||
11148 | def RemoveWindow(self, *args, **kw): | |
11149 | """Compatibility alias for `Remove`.""" | |
11150 | return self.Remove(*args, **kw) | |
11151 | def RemoveSizer(self, *args, **kw): | |
11152 | """Compatibility alias for `Remove`.""" | |
11153 | return self.Remove(*args, **kw) | |
11154 | def RemovePos(self, *args, **kw): | |
11155 | """Compatibility alias for `Remove`.""" | |
11156 | return self.Remove(*args, **kw) | |
d14a1e28 RD |
11157 | |
11158 | ||
e811c8ce | 11159 | def SetDimension(*args, **kwargs): |
248ed943 RD |
11160 | """ |
11161 | SetDimension(self, int x, int y, int width, int height) | |
11162 | ||
11163 | Call this to force the sizer to take the given dimension and thus | |
11164 | force the items owned by the sizer to resize themselves according to | |
11165 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
11166 | methods. | |
11167 | """ | |
54f9ee45 | 11168 | return _core_.Sizer_SetDimension(*args, **kwargs) |
e811c8ce RD |
11169 | |
11170 | def SetMinSize(*args, **kwargs): | |
248ed943 RD |
11171 | """ |
11172 | SetMinSize(self, Size size) | |
11173 | ||
11174 | Call this to give the sizer a minimal size. Normally, the sizer will | |
11175 | calculate its minimal size based purely on how much space its children | |
11176 | need. After calling this method `GetMinSize` will return either the | |
11177 | minimal size as requested by its children or the minimal size set | |
11178 | here, depending on which is bigger. | |
11179 | """ | |
54f9ee45 | 11180 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
e811c8ce RD |
11181 | |
11182 | def GetSize(*args, **kwargs): | |
248ed943 RD |
11183 | """ |
11184 | GetSize(self) -> Size | |
11185 | ||
11186 | Returns the current size of the space managed by the sizer. | |
11187 | """ | |
54f9ee45 | 11188 | return _core_.Sizer_GetSize(*args, **kwargs) |
e811c8ce RD |
11189 | |
11190 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
11191 | """ |
11192 | GetPosition(self) -> Point | |
11193 | ||
11194 | Returns the current position of the sizer's managed space. | |
11195 | """ | |
54f9ee45 | 11196 | return _core_.Sizer_GetPosition(*args, **kwargs) |
e811c8ce RD |
11197 | |
11198 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
11199 | """ |
11200 | GetMinSize(self) -> Size | |
11201 | ||
11202 | Returns the minimal size of the sizer. This is either the combined | |
11203 | minimal size of all the children and their borders or the minimal size | |
11204 | set by SetMinSize, depending on which is bigger. | |
11205 | """ | |
54f9ee45 | 11206 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
e811c8ce | 11207 | |
d14a1e28 | 11208 | def GetSizeTuple(self): |
1c0f361b | 11209 | return self.GetSize().Get() |
d14a1e28 | 11210 | def GetPositionTuple(self): |
1c0f361b | 11211 | return self.GetPosition().Get() |
d14a1e28 | 11212 | def GetMinSizeTuple(self): |
1c0f361b | 11213 | return self.GetMinSize().Get() |
d14a1e28 | 11214 | |
e811c8ce | 11215 | def RecalcSizes(*args, **kwargs): |
248ed943 RD |
11216 | """ |
11217 | RecalcSizes(self) | |
11218 | ||
11219 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
11220 | items managed by this sizer. You should not need to call this directly as | |
11221 | it is called by `Layout`. | |
11222 | """ | |
54f9ee45 | 11223 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
e811c8ce RD |
11224 | |
11225 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
11226 | """ |
11227 | CalcMin(self) -> Size | |
11228 | ||
11229 | This method is where the sizer will do the actual calculation of its | |
11230 | children's minimal sizes. You should not need to call this directly as | |
11231 | it is called by `Layout`. | |
11232 | """ | |
54f9ee45 | 11233 | return _core_.Sizer_CalcMin(*args, **kwargs) |
e811c8ce RD |
11234 | |
11235 | def Layout(*args, **kwargs): | |
248ed943 RD |
11236 | """ |
11237 | Layout(self) | |
11238 | ||
11239 | This method will force the recalculation and layout of the items | |
11240 | controlled by the sizer using the current space allocated to the | |
11241 | sizer. Normally this is called automatically from the owning window's | |
11242 | EVT_SIZE handler, but it is also useful to call it from user code when | |
11243 | one of the items in a sizer change size, or items are added or | |
11244 | removed. | |
11245 | """ | |
54f9ee45 | 11246 | return _core_.Sizer_Layout(*args, **kwargs) |
e811c8ce RD |
11247 | |
11248 | def Fit(*args, **kwargs): | |
248ed943 RD |
11249 | """ |
11250 | Fit(self, Window window) -> Size | |
11251 | ||
11252 | Tell the sizer to resize the *window* to match the sizer's minimal | |
11253 | size. This is commonly done in the constructor of the window itself in | |
11254 | order to set its initial size to match the needs of the children as | |
11255 | determined by the sizer. Returns the new size. | |
11256 | ||
11257 | For a top level window this is the total window size, not the client size. | |
11258 | """ | |
54f9ee45 | 11259 | return _core_.Sizer_Fit(*args, **kwargs) |
e811c8ce RD |
11260 | |
11261 | def FitInside(*args, **kwargs): | |
248ed943 RD |
11262 | """ |
11263 | FitInside(self, Window window) | |
11264 | ||
11265 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
11266 | sizer's minimal size. This will not alter the on screen size of the | |
11267 | window, but may cause the addition/removal/alteration of scrollbars | |
11268 | required to view the virtual area in windows which manage it. | |
11269 | ||
11270 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
11271 | ||
11272 | """ | |
54f9ee45 | 11273 | return _core_.Sizer_FitInside(*args, **kwargs) |
e811c8ce RD |
11274 | |
11275 | def SetSizeHints(*args, **kwargs): | |
248ed943 RD |
11276 | """ |
11277 | SetSizeHints(self, Window window) | |
11278 | ||
11279 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
11280 | match the sizer's minimal size. This is commonly done in the | |
11281 | constructor of the window itself if the window is resizable (as are | |
11282 | many dialogs under Unix and frames on probably all platforms) in order | |
11283 | to prevent the window from being sized smaller than the minimal size | |
11284 | required by the sizer. | |
11285 | """ | |
54f9ee45 | 11286 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
e811c8ce RD |
11287 | |
11288 | def SetVirtualSizeHints(*args, **kwargs): | |
248ed943 RD |
11289 | """ |
11290 | SetVirtualSizeHints(self, Window window) | |
11291 | ||
11292 | Tell the sizer to set the minimal size of the window virtual area to | |
11293 | match the sizer's minimal size. For windows with managed scrollbars | |
11294 | this will set them appropriately. | |
11295 | ||
11296 | :see: `wx.ScrolledWindow.SetScrollbars` | |
11297 | ||
11298 | """ | |
54f9ee45 | 11299 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
e811c8ce RD |
11300 | |
11301 | def Clear(*args, **kwargs): | |
248ed943 RD |
11302 | """ |
11303 | Clear(self, bool deleteWindows=False) | |
11304 | ||
11305 | Clear all items from the sizer, optionally destroying the window items | |
11306 | as well. | |
11307 | """ | |
54f9ee45 | 11308 | return _core_.Sizer_Clear(*args, **kwargs) |
e811c8ce RD |
11309 | |
11310 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
11311 | """ |
11312 | DeleteWindows(self) | |
11313 | ||
11314 | Destroy all windows managed by the sizer. | |
11315 | """ | |
54f9ee45 | 11316 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
11317 | |
11318 | def GetChildren(*args, **kwargs): | |
248ed943 | 11319 | """ |
51b83b37 | 11320 | GetChildren(self) -> list |
248ed943 RD |
11321 | |
11322 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
11323 | """ | |
54f9ee45 | 11324 | return _core_.Sizer_GetChildren(*args, **kwargs) |
e811c8ce RD |
11325 | |
11326 | def Show(*args, **kwargs): | |
248ed943 | 11327 | """ |
ae8162c8 | 11328 | Show(self, item, bool show=True, bool recursive=false) -> bool |
e811c8ce | 11329 | |
248ed943 RD |
11330 | Shows or hides an item managed by the sizer. To make a sizer item |
11331 | disappear or reappear, use Show followed by `Layout`. The *item* | |
11332 | parameter can be either a window, a sizer, or the zero-based index of | |
7e63a440 RD |
11333 | the item. Use the recursive parameter to show or hide an item in a |
11334 | subsizer. Returns True if the item was found. | |
248ed943 RD |
11335 | """ |
11336 | return _core_.Sizer_Show(*args, **kwargs) | |
e811c8ce RD |
11337 | |
11338 | def IsShown(*args, **kwargs): | |
248ed943 RD |
11339 | """ |
11340 | IsShown(self, item) | |
11341 | ||
b1fcee84 | 11342 | Determines if the item is currently shown. To make a sizer |
248ed943 RD |
11343 | item disappear or reappear, use Show followed by `Layout`. The *item* |
11344 | parameter can be either a window, a sizer, or the zero-based index of | |
11345 | the item. | |
11346 | """ | |
54f9ee45 | 11347 | return _core_.Sizer_IsShown(*args, **kwargs) |
e811c8ce | 11348 | |
7e63a440 | 11349 | def Hide(self, item, recursive=False): |
248ed943 | 11350 | """ |
27fb7603 | 11351 | A convenience method for `Show` (item, False, recursive). |
248ed943 | 11352 | """ |
06759a38 | 11353 | return self.Show(item, False, recursive) |
248ed943 | 11354 | |
e811c8ce | 11355 | def ShowItems(*args, **kwargs): |
248ed943 RD |
11356 | """ |
11357 | ShowItems(self, bool show) | |
11358 | ||
84f85550 | 11359 | Recursively call `wx.SizerItem.Show` on all sizer items. |
248ed943 | 11360 | """ |
54f9ee45 | 11361 | return _core_.Sizer_ShowItems(*args, **kwargs) |
e811c8ce | 11362 | |
2131d850 | 11363 | _core_.Sizer_swigregister(Sizer) |
d14a1e28 RD |
11364 | |
11365 | class PySizer(Sizer): | |
248ed943 RD |
11366 | """ |
11367 | wx.PySizer is a special version of `wx.Sizer` that has been | |
11368 | instrumented to allow the C++ virtual methods to be overloaded in | |
11369 | Python derived classes. You would derive from this class if you are | |
11370 | wanting to implement a custom sizer in Python code. Simply implement | |
11371 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
11372 | For example:: | |
11373 | ||
11374 | class MySizer(wx.PySizer): | |
11375 | def __init__(self): | |
11376 | wx.PySizer.__init__(self) | |
11377 | ||
11378 | def CalcMin(self): | |
11379 | for item in self.GetChildren(): | |
11380 | # calculate the total minimum width and height needed | |
11381 | # by all items in the sizer according to this sizer's | |
11382 | # layout algorithm. | |
11383 | ... | |
11384 | return wx.Size(width, height) | |
11385 | ||
11386 | def RecalcSizes(self): | |
11387 | # find the space allotted to this sizer | |
11388 | pos = self.GetPosition() | |
11389 | size = self.GetSize() | |
11390 | for item in self.GetChildren(): | |
11391 | # Recalculate (if necessary) the position and size of | |
11392 | # each item and then call item.SetDimension to do the | |
11393 | # actual positioning and sizing of the items within the | |
11394 | # space alloted to this sizer. | |
11395 | ... | |
11396 | item.SetDimension(itemPos, itemSize) | |
11397 | ||
11398 | ||
11399 | When `Layout` is called it first calls `CalcMin` followed by | |
11400 | `RecalcSizes` so you can optimize a bit by saving the results of | |
e505d15e | 11401 | `CalcMin` and reusing them in `RecalcSizes`. |
248ed943 RD |
11402 | |
11403 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
11404 | ||
11405 | ||
11406 | """ | |
0085ce49 RD |
11407 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11408 | __repr__ = _swig_repr | |
11409 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11410 | """ |
11411 | __init__(self) -> PySizer | |
11412 | ||
11413 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
11414 | class. | |
11415 | """ | |
0085ce49 | 11416 | _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs)) |
d14a1e28 | 11417 | self._setCallbackInfo(self, PySizer);self._setOORInfo(self) |
e811c8ce RD |
11418 | |
11419 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 11420 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 11421 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
e811c8ce | 11422 | |
2131d850 | 11423 | _core_.PySizer_swigregister(PySizer) |
d14a1e28 RD |
11424 | |
11425 | #--------------------------------------------------------------------------- | |
11426 | ||
11427 | class BoxSizer(Sizer): | |
248ed943 RD |
11428 | """ |
11429 | The basic idea behind a box sizer is that windows will most often be | |
11430 | laid out in rather simple basic geometry, typically in a row or a | |
11431 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
11432 | its items in a simple row or column, depending on the orientation | |
11433 | parameter passed to the constructor. | |
11434 | """ | |
0085ce49 RD |
11435 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11436 | __repr__ = _swig_repr | |
11437 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11438 | """ |
11439 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
11440 | ||
11441 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
11442 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
11443 | sizer. | |
11444 | """ | |
0085ce49 | 11445 | _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs)) |
d14a1e28 | 11446 | self._setOORInfo(self) |
e811c8ce RD |
11447 | |
11448 | def GetOrientation(*args, **kwargs): | |
248ed943 RD |
11449 | """ |
11450 | GetOrientation(self) -> int | |
11451 | ||
11452 | Returns the current orientation of the sizer. | |
11453 | """ | |
54f9ee45 | 11454 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
e811c8ce RD |
11455 | |
11456 | def SetOrientation(*args, **kwargs): | |
248ed943 RD |
11457 | """ |
11458 | SetOrientation(self, int orient) | |
e811c8ce | 11459 | |
248ed943 RD |
11460 | Resets the orientation of the sizer. |
11461 | """ | |
11462 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
e811c8ce | 11463 | |
2131d850 | 11464 | _core_.BoxSizer_swigregister(BoxSizer) |
d14a1e28 RD |
11465 | |
11466 | #--------------------------------------------------------------------------- | |
11467 | ||
11468 | class StaticBoxSizer(BoxSizer): | |
248ed943 RD |
11469 | """ |
11470 | wx.StaticBoxSizer derives from and functions identically to the | |
11471 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
11472 | manages. Note that this static box must be created separately and | |
11473 | passed to the sizer constructor. | |
11474 | """ | |
0085ce49 RD |
11475 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11476 | __repr__ = _swig_repr | |
11477 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11478 | """ |
11479 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
11480 | ||
11481 | Constructor. It takes an associated static box and the orientation | |
11482 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
11483 | ``wx.HORIZONTAL``. | |
11484 | """ | |
0085ce49 | 11485 | _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs)) |
d14a1e28 | 11486 | self._setOORInfo(self) |
e811c8ce RD |
11487 | |
11488 | def GetStaticBox(*args, **kwargs): | |
248ed943 RD |
11489 | """ |
11490 | GetStaticBox(self) -> StaticBox | |
e811c8ce | 11491 | |
248ed943 RD |
11492 | Returns the static box associated with this sizer. |
11493 | """ | |
11494 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
e811c8ce | 11495 | |
2131d850 | 11496 | _core_.StaticBoxSizer_swigregister(StaticBoxSizer) |
d14a1e28 RD |
11497 | |
11498 | #--------------------------------------------------------------------------- | |
11499 | ||
11500 | class GridSizer(Sizer): | |
248ed943 RD |
11501 | """ |
11502 | A grid sizer is a sizer which lays out its children in a | |
11503 | two-dimensional table with all cells having the same size. In other | |
11504 | words, the width of each cell within the grid is the width of the | |
11505 | widest item added to the sizer and the height of each grid cell is the | |
11506 | height of the tallest item. An optional vertical and/or horizontal | |
11507 | gap between items can also be specified (in pixels.) | |
11508 | ||
11509 | Items are placed in the cells of the grid in the order they are added, | |
11510 | in row-major order. In other words, the first row is filled first, | |
11511 | then the second, and so on until all items have been added. (If | |
11512 | neccessary, additional rows will be added as items are added.) If you | |
11513 | need to have greater control over the cells that items are placed in | |
11514 | then use the `wx.GridBagSizer`. | |
11515 | ||
11516 | """ | |
0085ce49 RD |
11517 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11518 | __repr__ = _swig_repr | |
11519 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11520 | """ |
11521 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
11522 | ||
11523 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
11524 | of columns and rows in the sizer - if either of the parameters is | |
11525 | zero, it will be calculated to from the total number of children in | |
11526 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
11527 | define extra space between all children. | |
11528 | """ | |
0085ce49 | 11529 | _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs)) |
d14a1e28 | 11530 | self._setOORInfo(self) |
e811c8ce | 11531 | |
e811c8ce | 11532 | def SetCols(*args, **kwargs): |
248ed943 RD |
11533 | """ |
11534 | SetCols(self, int cols) | |
11535 | ||
11536 | Sets the number of columns in the sizer. | |
11537 | """ | |
54f9ee45 | 11538 | return _core_.GridSizer_SetCols(*args, **kwargs) |
e811c8ce RD |
11539 | |
11540 | def SetRows(*args, **kwargs): | |
248ed943 RD |
11541 | """ |
11542 | SetRows(self, int rows) | |
11543 | ||
11544 | Sets the number of rows in the sizer. | |
11545 | """ | |
54f9ee45 | 11546 | return _core_.GridSizer_SetRows(*args, **kwargs) |
e811c8ce RD |
11547 | |
11548 | def SetVGap(*args, **kwargs): | |
248ed943 RD |
11549 | """ |
11550 | SetVGap(self, int gap) | |
11551 | ||
11552 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
11553 | """ | |
54f9ee45 | 11554 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
e811c8ce RD |
11555 | |
11556 | def SetHGap(*args, **kwargs): | |
248ed943 RD |
11557 | """ |
11558 | SetHGap(self, int gap) | |
11559 | ||
11560 | Sets the horizontal gap (in pixels) between cells in the sizer | |
11561 | """ | |
54f9ee45 | 11562 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
e811c8ce RD |
11563 | |
11564 | def GetCols(*args, **kwargs): | |
248ed943 RD |
11565 | """ |
11566 | GetCols(self) -> int | |
11567 | ||
11568 | Returns the number of columns in the sizer. | |
11569 | """ | |
54f9ee45 | 11570 | return _core_.GridSizer_GetCols(*args, **kwargs) |
e811c8ce RD |
11571 | |
11572 | def GetRows(*args, **kwargs): | |
248ed943 RD |
11573 | """ |
11574 | GetRows(self) -> int | |
11575 | ||
11576 | Returns the number of rows in the sizer. | |
11577 | """ | |
54f9ee45 | 11578 | return _core_.GridSizer_GetRows(*args, **kwargs) |
e811c8ce RD |
11579 | |
11580 | def GetVGap(*args, **kwargs): | |
248ed943 RD |
11581 | """ |
11582 | GetVGap(self) -> int | |
11583 | ||
11584 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
11585 | """ | |
54f9ee45 | 11586 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
e811c8ce RD |
11587 | |
11588 | def GetHGap(*args, **kwargs): | |
248ed943 RD |
11589 | """ |
11590 | GetHGap(self) -> int | |
11591 | ||
11592 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
11593 | """ | |
54f9ee45 | 11594 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
e811c8ce | 11595 | |
0085ce49 RD |
11596 | def CalcRowsCols(self): |
11597 | """ | |
11598 | CalcRowsCols() -> (rows, cols) | |
11599 | ||
11600 | Calculates how many rows and columns will be in the sizer based | |
11601 | on the current number of items and also the rows, cols specified | |
11602 | in the constructor. | |
11603 | """ | |
11604 | nitems = len(self.GetChildren()) | |
11605 | rows = self.GetRows() | |
11606 | cols = self.GetCols() | |
11607 | assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed" | |
11608 | if cols != 0: | |
11609 | rows = (nitems + cols - 1) / cols | |
11610 | elif rows != 0: | |
11611 | cols = (nitems + rows - 1) / rows | |
11612 | return (rows, cols) | |
d14a1e28 | 11613 | |
2131d850 | 11614 | _core_.GridSizer_swigregister(GridSizer) |
d14a1e28 RD |
11615 | |
11616 | #--------------------------------------------------------------------------- | |
11617 | ||
54f9ee45 RD |
11618 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
11619 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
11620 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
d14a1e28 | 11621 | class FlexGridSizer(GridSizer): |
248ed943 RD |
11622 | """ |
11623 | A flex grid sizer is a sizer which lays out its children in a | |
11624 | two-dimensional table with all table cells in one row having the same | |
11625 | height and all cells in one column having the same width, but all | |
11626 | rows or all columns are not necessarily the same height or width as in | |
11627 | the `wx.GridSizer`. | |
11628 | ||
11629 | wx.FlexGridSizer can also size items equally in one direction but | |
11630 | unequally ("flexibly") in the other. If the sizer is only flexible | |
11631 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
11632 | needs to be decided how the sizer should grow in the other ("non | |
11633 | flexible") direction in order to fill the available space. The | |
11634 | `SetNonFlexibleGrowMode` method serves this purpose. | |
11635 | ||
11636 | ||
11637 | """ | |
0085ce49 RD |
11638 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11639 | __repr__ = _swig_repr | |
11640 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11641 | """ |
11642 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
11643 | ||
11644 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
11645 | number of columns and rows in the sizer - if either of the parameters | |
11646 | is zero, it will be calculated to from the total number of children in | |
11647 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
11648 | define extra space between all children. | |
11649 | """ | |
0085ce49 | 11650 | _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs)) |
d14a1e28 | 11651 | self._setOORInfo(self) |
e811c8ce | 11652 | |
248ed943 RD |
11653 | def AddGrowableRow(*args, **kwargs): |
11654 | """ | |
11655 | AddGrowableRow(self, size_t idx, int proportion=0) | |
e811c8ce | 11656 | |
248ed943 RD |
11657 | Specifies that row *idx* (starting from zero) should be grown if there |
11658 | is extra space available to the sizer. | |
e811c8ce | 11659 | |
248ed943 RD |
11660 | The *proportion* parameter has the same meaning as the stretch factor |
11661 | for the box sizers except that if all proportions are 0, then all | |
11662 | columns are resized equally (instead of not being resized at all). | |
11663 | """ | |
54f9ee45 | 11664 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
e811c8ce RD |
11665 | |
11666 | def RemoveGrowableRow(*args, **kwargs): | |
248ed943 RD |
11667 | """ |
11668 | RemoveGrowableRow(self, size_t idx) | |
11669 | ||
11670 | Specifies that row *idx* is no longer growable. | |
11671 | """ | |
54f9ee45 | 11672 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
e811c8ce RD |
11673 | |
11674 | def AddGrowableCol(*args, **kwargs): | |
248ed943 RD |
11675 | """ |
11676 | AddGrowableCol(self, size_t idx, int proportion=0) | |
11677 | ||
11678 | Specifies that column *idx* (starting from zero) should be grown if | |
11679 | there is extra space available to the sizer. | |
11680 | ||
11681 | The *proportion* parameter has the same meaning as the stretch factor | |
11682 | for the box sizers except that if all proportions are 0, then all | |
11683 | columns are resized equally (instead of not being resized at all). | |
11684 | """ | |
54f9ee45 | 11685 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
e811c8ce RD |
11686 | |
11687 | def RemoveGrowableCol(*args, **kwargs): | |
248ed943 RD |
11688 | """ |
11689 | RemoveGrowableCol(self, size_t idx) | |
11690 | ||
11691 | Specifies that column *idx* is no longer growable. | |
11692 | """ | |
54f9ee45 | 11693 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
e811c8ce RD |
11694 | |
11695 | def SetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
11696 | """ |
11697 | SetFlexibleDirection(self, int direction) | |
11698 | ||
11699 | Specifies whether the sizer should flexibly resize its columns, rows, | |
11700 | or both. Argument *direction* can be one of the following values. Any | |
11701 | other value is ignored. | |
11702 | ||
11703 | ============== ======================================= | |
11704 | wx.VERTICAL Rows are flexibly sized. | |
11705 | wx.HORIZONTAL Columns are flexibly sized. | |
11706 | wx.BOTH Both rows and columns are flexibly sized | |
11707 | (this is the default value). | |
11708 | ============== ======================================= | |
11709 | ||
11710 | Note that this method does not trigger relayout. | |
11711 | ||
11712 | """ | |
54f9ee45 | 11713 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
11714 | |
11715 | def GetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
11716 | """ |
11717 | GetFlexibleDirection(self) -> int | |
11718 | ||
11719 | Returns a value that specifies whether the sizer | |
11720 | flexibly resizes its columns, rows, or both (default). | |
11721 | ||
11722 | :see: `SetFlexibleDirection` | |
11723 | """ | |
54f9ee45 | 11724 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
11725 | |
11726 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
11727 | """ |
11728 | SetNonFlexibleGrowMode(self, int mode) | |
11729 | ||
11730 | Specifies how the sizer should grow in the non-flexible direction if | |
11731 | there is one (so `SetFlexibleDirection` must have been called | |
11732 | previously). Argument *mode* can be one of the following values: | |
11733 | ||
11734 | ========================== ================================================= | |
11735 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
11736 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
11737 | `AddGrowableCol` and `AddGrowableRow`. In this | |
11738 | case equal sizing applies to minimum sizes of | |
11739 | columns or rows (this is the default value). | |
11740 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
11741 | the non flexible direction, whether they are | |
11742 | growable or not in the flexbile direction. | |
11743 | ========================== ================================================= | |
11744 | ||
11745 | Note that this method does not trigger relayout. | |
11746 | ||
11747 | ||
11748 | """ | |
54f9ee45 | 11749 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
11750 | |
11751 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
11752 | """ |
11753 | GetNonFlexibleGrowMode(self) -> int | |
11754 | ||
11755 | Returns the value that specifies how the sizer grows in the | |
11756 | non-flexible direction if there is one. | |
11757 | ||
11758 | :see: `SetNonFlexibleGrowMode` | |
11759 | """ | |
54f9ee45 | 11760 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
11761 | |
11762 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
11763 | """ |
11764 | GetRowHeights(self) -> list | |
11765 | ||
11766 | Returns a list of integers representing the heights of each of the | |
11767 | rows in the sizer. | |
11768 | """ | |
54f9ee45 | 11769 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
e811c8ce RD |
11770 | |
11771 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
11772 | """ |
11773 | GetColWidths(self) -> list | |
11774 | ||
11775 | Returns a list of integers representing the widths of each of the | |
11776 | columns in the sizer. | |
11777 | """ | |
54f9ee45 | 11778 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
e811c8ce | 11779 | |
2131d850 | 11780 | _core_.FlexGridSizer_swigregister(FlexGridSizer) |
d14a1e28 | 11781 | |
e505d15e RD |
11782 | class StdDialogButtonSizer(BoxSizer): |
11783 | """ | |
11784 | A special sizer that knows how to order and position standard buttons | |
11785 | in order to conform to the current platform's standards. You simply | |
11786 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 11787 | buttons using the standard ID's. Then call `Realize` and the sizer |
e505d15e RD |
11788 | will take care of the rest. |
11789 | ||
11790 | """ | |
0085ce49 RD |
11791 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11792 | __repr__ = _swig_repr | |
11793 | def __init__(self, *args, **kwargs): | |
e505d15e | 11794 | """__init__(self) -> StdDialogButtonSizer""" |
0085ce49 | 11795 | _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs)) |
e505d15e RD |
11796 | def AddButton(*args, **kwargs): |
11797 | """ | |
11798 | AddButton(self, wxButton button) | |
11799 | ||
11800 | Use this to add the buttons to this sizer. Do not use the `Add` | |
11801 | method in the base class. | |
11802 | """ | |
11803 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
11804 | ||
53aa7709 | 11805 | def Realize(*args, **kwargs): |
e505d15e | 11806 | """ |
53aa7709 | 11807 | Realize(self) |
e505d15e RD |
11808 | |
11809 | This funciton needs to be called after all the buttons have been added | |
11810 | to the sizer. It will reorder them and position them in a platform | |
11811 | specifc manner. | |
11812 | """ | |
53aa7709 | 11813 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
11814 | |
11815 | def SetAffirmativeButton(*args, **kwargs): | |
11816 | """SetAffirmativeButton(self, wxButton button)""" | |
11817 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
11818 | ||
11819 | def SetNegativeButton(*args, **kwargs): | |
11820 | """SetNegativeButton(self, wxButton button)""" | |
11821 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
11822 | ||
11823 | def SetCancelButton(*args, **kwargs): | |
11824 | """SetCancelButton(self, wxButton button)""" | |
11825 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
e505d15e RD |
11826 | |
11827 | def GetAffirmativeButton(*args, **kwargs): | |
11828 | """GetAffirmativeButton(self) -> wxButton""" | |
11829 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
11830 | ||
11831 | def GetApplyButton(*args, **kwargs): | |
11832 | """GetApplyButton(self) -> wxButton""" | |
11833 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
11834 | ||
11835 | def GetNegativeButton(*args, **kwargs): | |
11836 | """GetNegativeButton(self) -> wxButton""" | |
11837 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
11838 | ||
11839 | def GetCancelButton(*args, **kwargs): | |
11840 | """GetCancelButton(self) -> wxButton""" | |
11841 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
11842 | ||
11843 | def GetHelpButton(*args, **kwargs): | |
11844 | """GetHelpButton(self) -> wxButton""" | |
11845 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
11846 | ||
2131d850 | 11847 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer) |
e505d15e | 11848 | |
d14a1e28 RD |
11849 | #--------------------------------------------------------------------------- |
11850 | ||
11851 | class GBPosition(object): | |
248ed943 RD |
11852 | """ |
11853 | This class represents the position of an item in a virtual grid of | |
11854 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
11855 | typemaps that will automatically convert from a 2-element sequence of | |
11856 | integers to a wx.GBPosition, so you can use the more pythonic | |
11857 | representation of the position nearly transparently in Python code. | |
11858 | """ | |
0085ce49 RD |
11859 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11860 | __repr__ = _swig_repr | |
11861 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11862 | """ |
11863 | __init__(self, int row=0, int col=0) -> GBPosition | |
11864 | ||
11865 | This class represents the position of an item in a virtual grid of | |
11866 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
11867 | typemaps that will automatically convert from a 2-element sequence of | |
11868 | integers to a wx.GBPosition, so you can use the more pythonic | |
11869 | representation of the position nearly transparently in Python code. | |
11870 | """ | |
0085ce49 RD |
11871 | _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs)) |
11872 | __swig_destroy__ = _core_.delete_GBPosition | |
11873 | __del__ = lambda self : None; | |
e811c8ce | 11874 | def GetRow(*args, **kwargs): |
a95a7133 | 11875 | """GetRow(self) -> int""" |
54f9ee45 | 11876 | return _core_.GBPosition_GetRow(*args, **kwargs) |
e811c8ce RD |
11877 | |
11878 | def GetCol(*args, **kwargs): | |
a95a7133 | 11879 | """GetCol(self) -> int""" |
54f9ee45 | 11880 | return _core_.GBPosition_GetCol(*args, **kwargs) |
e811c8ce RD |
11881 | |
11882 | def SetRow(*args, **kwargs): | |
a95a7133 | 11883 | """SetRow(self, int row)""" |
54f9ee45 | 11884 | return _core_.GBPosition_SetRow(*args, **kwargs) |
e811c8ce RD |
11885 | |
11886 | def SetCol(*args, **kwargs): | |
a95a7133 | 11887 | """SetCol(self, int col)""" |
54f9ee45 | 11888 | return _core_.GBPosition_SetCol(*args, **kwargs) |
e811c8ce RD |
11889 | |
11890 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
11891 | """ |
11892 | __eq__(self, PyObject other) -> bool | |
11893 | ||
11894 | Compare GBPosition for equality. | |
11895 | """ | |
54f9ee45 | 11896 | return _core_.GBPosition___eq__(*args, **kwargs) |
e811c8ce RD |
11897 | |
11898 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
11899 | """ |
11900 | __ne__(self, PyObject other) -> bool | |
11901 | ||
11902 | Compare GBPosition for inequality. | |
11903 | """ | |
54f9ee45 | 11904 | return _core_.GBPosition___ne__(*args, **kwargs) |
e811c8ce RD |
11905 | |
11906 | def Set(*args, **kwargs): | |
a95a7133 | 11907 | """Set(self, int row=0, int col=0)""" |
54f9ee45 | 11908 | return _core_.GBPosition_Set(*args, **kwargs) |
e811c8ce RD |
11909 | |
11910 | def Get(*args, **kwargs): | |
a95a7133 | 11911 | """Get(self) -> PyObject""" |
54f9ee45 | 11912 | return _core_.GBPosition_Get(*args, **kwargs) |
e811c8ce | 11913 | |
41e2b43e | 11914 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
11915 | def __str__(self): return str(self.Get()) |
11916 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
11917 | def __len__(self): return len(self.Get()) | |
11918 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
11919 | def __setitem__(self, index, val): |
11920 | if index == 0: self.SetRow(val) | |
11921 | elif index == 1: self.SetCol(val) | |
11922 | else: raise IndexError | |
e811c8ce | 11923 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
11924 | __safe_for_unpickling__ = True |
11925 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
d14a1e28 RD |
11926 | |
11927 | row = property(GetRow, SetRow) | |
11928 | col = property(GetCol, SetCol) | |
11929 | ||
2131d850 | 11930 | _core_.GBPosition_swigregister(GBPosition) |
d14a1e28 RD |
11931 | |
11932 | class GBSpan(object): | |
248ed943 RD |
11933 | """ |
11934 | This class is used to hold the row and column spanning attributes of | |
11935 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
11936 | automatically convert from a 2-element sequence of integers to a | |
11937 | wx.GBSpan, so you can use the more pythonic representation of the span | |
11938 | nearly transparently in Python code. | |
11939 | ||
11940 | """ | |
0085ce49 RD |
11941 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11942 | __repr__ = _swig_repr | |
11943 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11944 | """ |
11945 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
11946 | ||
11947 | Construct a new wxGBSpan, optionally setting the rowspan and | |
11948 | colspan. The default is (1,1). (Meaning that the item occupies one | |
11949 | cell in each direction. | |
11950 | """ | |
0085ce49 RD |
11951 | _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs)) |
11952 | __swig_destroy__ = _core_.delete_GBSpan | |
11953 | __del__ = lambda self : None; | |
e811c8ce | 11954 | def GetRowspan(*args, **kwargs): |
a95a7133 | 11955 | """GetRowspan(self) -> int""" |
54f9ee45 | 11956 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
e811c8ce RD |
11957 | |
11958 | def GetColspan(*args, **kwargs): | |
a95a7133 | 11959 | """GetColspan(self) -> int""" |
54f9ee45 | 11960 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
e811c8ce RD |
11961 | |
11962 | def SetRowspan(*args, **kwargs): | |
a95a7133 | 11963 | """SetRowspan(self, int rowspan)""" |
54f9ee45 | 11964 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
e811c8ce RD |
11965 | |
11966 | def SetColspan(*args, **kwargs): | |
a95a7133 | 11967 | """SetColspan(self, int colspan)""" |
54f9ee45 | 11968 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
e811c8ce RD |
11969 | |
11970 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
11971 | """ |
11972 | __eq__(self, PyObject other) -> bool | |
11973 | ||
11974 | Compare wxGBSpan for equality. | |
11975 | """ | |
54f9ee45 | 11976 | return _core_.GBSpan___eq__(*args, **kwargs) |
e811c8ce RD |
11977 | |
11978 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
11979 | """ |
11980 | __ne__(self, PyObject other) -> bool | |
11981 | ||
11982 | Compare GBSpan for inequality. | |
11983 | """ | |
54f9ee45 | 11984 | return _core_.GBSpan___ne__(*args, **kwargs) |
e811c8ce RD |
11985 | |
11986 | def Set(*args, **kwargs): | |
a95a7133 | 11987 | """Set(self, int rowspan=1, int colspan=1)""" |
54f9ee45 | 11988 | return _core_.GBSpan_Set(*args, **kwargs) |
e811c8ce RD |
11989 | |
11990 | def Get(*args, **kwargs): | |
a95a7133 | 11991 | """Get(self) -> PyObject""" |
54f9ee45 | 11992 | return _core_.GBSpan_Get(*args, **kwargs) |
e811c8ce | 11993 | |
41e2b43e | 11994 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
11995 | def __str__(self): return str(self.Get()) |
11996 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
11997 | def __len__(self): return len(self.Get()) | |
11998 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
11999 | def __setitem__(self, index, val): |
12000 | if index == 0: self.SetRowspan(val) | |
12001 | elif index == 1: self.SetColspan(val) | |
12002 | else: raise IndexError | |
e811c8ce | 12003 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
12004 | __safe_for_unpickling__ = True |
12005 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
d14a1e28 RD |
12006 | |
12007 | rowspan = property(GetRowspan, SetRowspan) | |
12008 | colspan = property(GetColspan, SetColspan) | |
12009 | ||
2131d850 | 12010 | _core_.GBSpan_swigregister(GBSpan) |
d14a1e28 RD |
12011 | |
12012 | class GBSizerItem(SizerItem): | |
248ed943 RD |
12013 | """ |
12014 | The wx.GBSizerItem class is used to track the additional data about | |
12015 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
12016 | and how many rows or columns it spans. | |
12017 | ||
12018 | """ | |
0085ce49 RD |
12019 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12020 | __repr__ = _swig_repr | |
12021 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12022 | """ |
12023 | __init__(self) -> GBSizerItem | |
12024 | ||
12025 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
12026 | size will need to be set, as well as a position and span before this | |
12027 | item can be used in a Sizer. | |
12028 | ||
12029 | You will probably never need to create a wx.GBSizerItem directly as they | |
12030 | are created automatically when the sizer's Add method is called. | |
12031 | """ | |
0085ce49 RD |
12032 | _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs)) |
12033 | __swig_destroy__ = _core_.delete_GBSizerItem | |
12034 | __del__ = lambda self : None; | |
e811c8ce | 12035 | def GetPos(*args, **kwargs): |
248ed943 RD |
12036 | """ |
12037 | GetPos(self) -> GBPosition | |
12038 | ||
12039 | Get the grid position of the item | |
12040 | """ | |
54f9ee45 | 12041 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
e811c8ce RD |
12042 | |
12043 | def GetPosTuple(self): return self.GetPos().Get() | |
12044 | def GetSpan(*args, **kwargs): | |
248ed943 RD |
12045 | """ |
12046 | GetSpan(self) -> GBSpan | |
12047 | ||
12048 | Get the row and column spanning of the item | |
12049 | """ | |
54f9ee45 | 12050 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
e811c8ce RD |
12051 | |
12052 | def GetSpanTuple(self): return self.GetSpan().Get() | |
12053 | def SetPos(*args, **kwargs): | |
248ed943 RD |
12054 | """ |
12055 | SetPos(self, GBPosition pos) -> bool | |
12056 | ||
12057 | If the item is already a member of a sizer then first ensure that | |
12058 | there is no other item that would intersect with this one at the new | |
12059 | position, then set the new position. Returns True if the change is | |
12060 | successful and after the next Layout() the item will be moved. | |
12061 | """ | |
54f9ee45 | 12062 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
e811c8ce RD |
12063 | |
12064 | def SetSpan(*args, **kwargs): | |
248ed943 RD |
12065 | """ |
12066 | SetSpan(self, GBSpan span) -> bool | |
12067 | ||
12068 | If the item is already a member of a sizer then first ensure that | |
12069 | there is no other item that would intersect with this one with its new | |
12070 | spanning size, then set the new spanning. Returns True if the change | |
12071 | is successful and after the next Layout() the item will be resized. | |
12072 | ||
12073 | """ | |
54f9ee45 | 12074 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
e811c8ce | 12075 | |
248ed943 | 12076 | def Intersects(*args, **kwargs): |
0df68c9f | 12077 | """ |
a95a7133 | 12078 | Intersects(self, GBSizerItem other) -> bool |
248ed943 RD |
12079 | |
12080 | Returns True if this item and the other item instersect. | |
0df68c9f | 12081 | """ |
248ed943 RD |
12082 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
12083 | ||
12084 | def IntersectsPos(*args, **kwargs): | |
12085 | """ | |
12086 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
12087 | ||
12088 | Returns True if the given pos/span would intersect with this item. | |
12089 | """ | |
12090 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
e811c8ce RD |
12091 | |
12092 | def GetEndPos(*args, **kwargs): | |
248ed943 RD |
12093 | """ |
12094 | GetEndPos(self) -> GBPosition | |
12095 | ||
12096 | Get the row and column of the endpoint of this item. | |
12097 | """ | |
54f9ee45 | 12098 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
e811c8ce RD |
12099 | |
12100 | def GetGBSizer(*args, **kwargs): | |
248ed943 RD |
12101 | """ |
12102 | GetGBSizer(self) -> GridBagSizer | |
12103 | ||
12104 | Get the sizer this item is a member of. | |
12105 | """ | |
54f9ee45 | 12106 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
e811c8ce RD |
12107 | |
12108 | def SetGBSizer(*args, **kwargs): | |
248ed943 RD |
12109 | """ |
12110 | SetGBSizer(self, GridBagSizer sizer) | |
12111 | ||
12112 | Set the sizer this item is a member of. | |
12113 | """ | |
54f9ee45 | 12114 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
e811c8ce | 12115 | |
2131d850 | 12116 | _core_.GBSizerItem_swigregister(GBSizerItem) |
d14a1e28 RD |
12117 | DefaultSpan = cvar.DefaultSpan |
12118 | ||
12119 | def GBSizerItemWindow(*args, **kwargs): | |
0df68c9f RD |
12120 | """ |
12121 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12122 | int border, PyObject userData=None) -> GBSizerItem |
12123 | ||
12124 | Construct a `wx.GBSizerItem` for a window. | |
0df68c9f | 12125 | """ |
54f9ee45 | 12126 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
12127 | return val |
12128 | ||
12129 | def GBSizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
12130 | """ |
12131 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
12132 | int border, PyObject userData=None) -> GBSizerItem |
12133 | ||
12134 | Construct a `wx.GBSizerItem` for a sizer | |
0df68c9f | 12135 | """ |
54f9ee45 | 12136 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
12137 | return val |
12138 | ||
12139 | def GBSizerItemSpacer(*args, **kwargs): | |
0df68c9f RD |
12140 | """ |
12141 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
248ed943 RD |
12142 | int flag, int border, PyObject userData=None) -> GBSizerItem |
12143 | ||
12144 | Construct a `wx.GBSizerItem` for a spacer. | |
0df68c9f | 12145 | """ |
54f9ee45 | 12146 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
12147 | return val |
12148 | ||
12149 | class GridBagSizer(FlexGridSizer): | |
248ed943 RD |
12150 | """ |
12151 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
12152 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
12153 | is allowed using `wx.GBPosition`, and items can optionally span more | |
12154 | than one row and/or column using `wx.GBSpan`. The total size of the | |
12155 | virtual grid is determined by the largest row and column that items are | |
12156 | positioned at, adjusted for spanning. | |
12157 | ||
12158 | """ | |
0085ce49 RD |
12159 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12160 | __repr__ = _swig_repr | |
12161 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12162 | """ |
12163 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
12164 | ||
12165 | Constructor, with optional parameters to specify the gap between the | |
12166 | rows and columns. | |
12167 | """ | |
0085ce49 | 12168 | _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs)) |
1823fbb4 RD |
12169 | self._setOORInfo(self) |
12170 | ||
e811c8ce | 12171 | def Add(*args, **kwargs): |
0df68c9f | 12172 | """ |
248ed943 | 12173 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
d3b6e4ff | 12174 | int border=0, userData=None) -> wx.GBSizerItem |
248ed943 RD |
12175 | |
12176 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
12177 | more than one row or column as specified with *span*. The remaining | |
12178 | args behave similarly to `wx.Sizer.Add`. | |
12179 | ||
12180 | Returns True if the item was successfully placed at the given cell | |
12181 | position, False if something was already there. | |
12182 | ||
0df68c9f | 12183 | """ |
54f9ee45 | 12184 | return _core_.GridBagSizer_Add(*args, **kwargs) |
e811c8ce RD |
12185 | |
12186 | def AddItem(*args, **kwargs): | |
248ed943 | 12187 | """ |
d3b6e4ff | 12188 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
248ed943 RD |
12189 | |
12190 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
12191 | the item was successfully placed at its given cell position, False if | |
12192 | something was already there. | |
12193 | """ | |
54f9ee45 | 12194 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
e811c8ce | 12195 | |
84f85550 RD |
12196 | def GetCellSize(*args, **kwargs): |
12197 | """ | |
12198 | GetCellSize(self, int row, int col) -> Size | |
12199 | ||
12200 | Get the size of the specified cell, including hgap and | |
12201 | vgap. Only valid after a Layout. | |
12202 | """ | |
12203 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
12204 | ||
e811c8ce | 12205 | def GetEmptyCellSize(*args, **kwargs): |
248ed943 RD |
12206 | """ |
12207 | GetEmptyCellSize(self) -> Size | |
12208 | ||
12209 | Get the size used for cells in the grid with no item. | |
12210 | """ | |
54f9ee45 | 12211 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12212 | |
12213 | def SetEmptyCellSize(*args, **kwargs): | |
248ed943 RD |
12214 | """ |
12215 | SetEmptyCellSize(self, Size sz) | |
12216 | ||
12217 | Set the size used for cells in the grid with no item. | |
12218 | """ | |
54f9ee45 | 12219 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
12220 | |
12221 | def GetItemPosition(*args): | |
0df68c9f | 12222 | """ |
248ed943 RD |
12223 | GetItemPosition(self, item) -> GBPosition |
12224 | ||
12225 | Get the grid position of the specified *item* where *item* is either a | |
12226 | window or subsizer that is a member of this sizer, or a zero-based | |
12227 | index of an item. | |
0df68c9f | 12228 | """ |
54f9ee45 | 12229 | return _core_.GridBagSizer_GetItemPosition(*args) |
e811c8ce RD |
12230 | |
12231 | def SetItemPosition(*args): | |
0df68c9f | 12232 | """ |
248ed943 RD |
12233 | SetItemPosition(self, item, GBPosition pos) -> bool |
12234 | ||
12235 | Set the grid position of the specified *item* where *item* is either a | |
12236 | window or subsizer that is a member of this sizer, or a zero-based | |
12237 | index of an item. Returns True on success. If the move is not | |
12238 | allowed (because an item is already there) then False is returned. | |
12239 | ||
0df68c9f | 12240 | """ |
54f9ee45 | 12241 | return _core_.GridBagSizer_SetItemPosition(*args) |
e811c8ce RD |
12242 | |
12243 | def GetItemSpan(*args): | |
0df68c9f | 12244 | """ |
248ed943 RD |
12245 | GetItemSpan(self, item) -> GBSpan |
12246 | ||
12247 | Get the row/col spanning of the specified *item* where *item* is | |
12248 | either a window or subsizer that is a member of this sizer, or a | |
12249 | zero-based index of an item. | |
0df68c9f | 12250 | """ |
54f9ee45 | 12251 | return _core_.GridBagSizer_GetItemSpan(*args) |
e811c8ce RD |
12252 | |
12253 | def SetItemSpan(*args): | |
0df68c9f | 12254 | """ |
248ed943 RD |
12255 | SetItemSpan(self, item, GBSpan span) -> bool |
12256 | ||
12257 | Set the row/col spanning of the specified *item* where *item* is | |
12258 | either a window or subsizer that is a member of this sizer, or a | |
12259 | zero-based index of an item. Returns True on success. If the move is | |
12260 | not allowed (because an item is already there) then False is returned. | |
0df68c9f | 12261 | """ |
54f9ee45 | 12262 | return _core_.GridBagSizer_SetItemSpan(*args) |
e811c8ce RD |
12263 | |
12264 | def FindItem(*args): | |
0df68c9f | 12265 | """ |
248ed943 RD |
12266 | FindItem(self, item) -> GBSizerItem |
12267 | ||
12268 | Find the sizer item for the given window or subsizer, returns None if | |
12269 | not found. (non-recursive) | |
0df68c9f | 12270 | """ |
54f9ee45 | 12271 | return _core_.GridBagSizer_FindItem(*args) |
e811c8ce RD |
12272 | |
12273 | def FindItemAtPosition(*args, **kwargs): | |
248ed943 RD |
12274 | """ |
12275 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
12276 | ||
12277 | Return the sizer item for the given grid cell, or None if there is no | |
12278 | item at that position. (non-recursive) | |
12279 | """ | |
54f9ee45 | 12280 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
e811c8ce RD |
12281 | |
12282 | def FindItemAtPoint(*args, **kwargs): | |
248ed943 RD |
12283 | """ |
12284 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
12285 | ||
12286 | Return the sizer item located at the point given in *pt*, or None if | |
12287 | there is no item at that point. The (x,y) coordinates in pt correspond | |
12288 | to the client coordinates of the window using the sizer for | |
12289 | layout. (non-recursive) | |
12290 | """ | |
54f9ee45 | 12291 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
e811c8ce | 12292 | |
248ed943 RD |
12293 | def CheckForIntersection(*args, **kwargs): |
12294 | """ | |
12295 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
e811c8ce | 12296 | |
248ed943 RD |
12297 | Look at all items and see if any intersect (or would overlap) the |
12298 | given *item*. Returns True if so, False if there would be no overlap. | |
12299 | If an *excludeItem* is given then it will not be checked for | |
12300 | intersection, for example it may be the item we are checking the | |
12301 | position of. | |
e811c8ce | 12302 | |
248ed943 RD |
12303 | """ |
12304 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
e811c8ce | 12305 | |
248ed943 | 12306 | def CheckForIntersectionPos(*args, **kwargs): |
0df68c9f | 12307 | """ |
248ed943 RD |
12308 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
12309 | ||
12310 | Look at all items and see if any intersect (or would overlap) the | |
12311 | given position and span. Returns True if so, False if there would be | |
12312 | no overlap. If an *excludeItem* is given then it will not be checked | |
12313 | for intersection, for example it may be the item we are checking the | |
12314 | position of. | |
0df68c9f | 12315 | """ |
248ed943 | 12316 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
e811c8ce | 12317 | |
2131d850 | 12318 | _core_.GridBagSizer_swigregister(GridBagSizer) |
d14a1e28 RD |
12319 | |
12320 | #--------------------------------------------------------------------------- | |
12321 | ||
54f9ee45 RD |
12322 | Left = _core_.Left |
12323 | Top = _core_.Top | |
12324 | Right = _core_.Right | |
12325 | Bottom = _core_.Bottom | |
12326 | Width = _core_.Width | |
12327 | Height = _core_.Height | |
12328 | Centre = _core_.Centre | |
12329 | Center = _core_.Center | |
12330 | CentreX = _core_.CentreX | |
12331 | CentreY = _core_.CentreY | |
12332 | Unconstrained = _core_.Unconstrained | |
12333 | AsIs = _core_.AsIs | |
12334 | PercentOf = _core_.PercentOf | |
12335 | Above = _core_.Above | |
12336 | Below = _core_.Below | |
12337 | LeftOf = _core_.LeftOf | |
12338 | RightOf = _core_.RightOf | |
12339 | SameAs = _core_.SameAs | |
12340 | Absolute = _core_.Absolute | |
d14a1e28 | 12341 | class IndividualLayoutConstraint(Object): |
15afbcd0 | 12342 | """ |
41e2b43e RD |
12343 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
12344 | one of eight possible constraints that a window can be involved in. | |
12345 | You will never need to create an instance of | |
12346 | wx.IndividualLayoutConstraint, rather you should create a | |
12347 | `wx.LayoutConstraints` instance and use the individual contstraints | |
15afbcd0 | 12348 | that it contains. |
15afbcd0 | 12349 | """ |
0085ce49 RD |
12350 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12351 | def __init__(self): raise AttributeError, "No constructor defined" | |
12352 | __repr__ = _swig_repr | |
e811c8ce | 12353 | def Set(*args, **kwargs): |
41e2b43e RD |
12354 | """ |
12355 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
12356 | ||
12357 | Sets the properties of the constraint. Normally called by one of the | |
12358 | convenience functions such as Above, RightOf, SameAs. | |
12359 | """ | |
54f9ee45 | 12360 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
e811c8ce RD |
12361 | |
12362 | def LeftOf(*args, **kwargs): | |
15afbcd0 | 12363 | """ |
a95a7133 | 12364 | LeftOf(self, Window sibling, int marg=0) |
15afbcd0 | 12365 | |
41e2b43e RD |
12366 | Constrains this edge to be to the left of the given window, with an |
12367 | optional margin. Implicitly, this is relative to the left edge of the | |
12368 | other window. | |
15afbcd0 | 12369 | """ |
54f9ee45 | 12370 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
e811c8ce RD |
12371 | |
12372 | def RightOf(*args, **kwargs): | |
15afbcd0 | 12373 | """ |
a95a7133 | 12374 | RightOf(self, Window sibling, int marg=0) |
15afbcd0 | 12375 | |
41e2b43e RD |
12376 | Constrains this edge to be to the right of the given window, with an |
12377 | optional margin. Implicitly, this is relative to the right edge of the | |
12378 | other window. | |
15afbcd0 | 12379 | """ |
54f9ee45 | 12380 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
e811c8ce RD |
12381 | |
12382 | def Above(*args, **kwargs): | |
15afbcd0 | 12383 | """ |
a95a7133 | 12384 | Above(self, Window sibling, int marg=0) |
15afbcd0 | 12385 | |
41e2b43e RD |
12386 | Constrains this edge to be above the given window, with an optional |
12387 | margin. Implicitly, this is relative to the top edge of the other | |
12388 | window. | |
15afbcd0 | 12389 | """ |
54f9ee45 | 12390 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
e811c8ce RD |
12391 | |
12392 | def Below(*args, **kwargs): | |
15afbcd0 | 12393 | """ |
a95a7133 | 12394 | Below(self, Window sibling, int marg=0) |
15afbcd0 | 12395 | |
41e2b43e RD |
12396 | Constrains this edge to be below the given window, with an optional |
12397 | margin. Implicitly, this is relative to the bottom edge of the other | |
12398 | window. | |
15afbcd0 | 12399 | """ |
54f9ee45 | 12400 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
e811c8ce RD |
12401 | |
12402 | def SameAs(*args, **kwargs): | |
15afbcd0 | 12403 | """ |
a95a7133 | 12404 | SameAs(self, Window otherW, int edge, int marg=0) |
15afbcd0 | 12405 | |
41e2b43e RD |
12406 | Constrains this edge or dimension to be to the same as the edge of the |
12407 | given window, with an optional margin. | |
15afbcd0 | 12408 | """ |
54f9ee45 | 12409 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
e811c8ce RD |
12410 | |
12411 | def PercentOf(*args, **kwargs): | |
15afbcd0 | 12412 | """ |
a95a7133 | 12413 | PercentOf(self, Window otherW, int wh, int per) |
15afbcd0 | 12414 | |
41e2b43e RD |
12415 | Constrains this edge or dimension to be to a percentage of the given |
12416 | window, with an optional margin. | |
15afbcd0 | 12417 | """ |
54f9ee45 | 12418 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
e811c8ce RD |
12419 | |
12420 | def Absolute(*args, **kwargs): | |
15afbcd0 | 12421 | """ |
a95a7133 | 12422 | Absolute(self, int val) |
15afbcd0 | 12423 | |
41e2b43e | 12424 | Constrains this edge or dimension to be the given absolute value. |
15afbcd0 | 12425 | """ |
54f9ee45 | 12426 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
e811c8ce RD |
12427 | |
12428 | def Unconstrained(*args, **kwargs): | |
15afbcd0 | 12429 | """ |
a95a7133 | 12430 | Unconstrained(self) |
15afbcd0 | 12431 | |
41e2b43e RD |
12432 | Sets this edge or dimension to be unconstrained, that is, dependent on |
12433 | other edges and dimensions from which this value can be deduced. | |
15afbcd0 | 12434 | """ |
54f9ee45 | 12435 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
e811c8ce RD |
12436 | |
12437 | def AsIs(*args, **kwargs): | |
15afbcd0 | 12438 | """ |
a95a7133 | 12439 | AsIs(self) |
15afbcd0 | 12440 | |
41e2b43e RD |
12441 | Sets this edge or constraint to be whatever the window's value is at |
12442 | the moment. If either of the width and height constraints are *as is*, | |
12443 | the window will not be resized, but moved instead. This is important | |
12444 | when considering panel items which are intended to have a default | |
12445 | size, such as a button, which may take its size from the size of the | |
12446 | button label. | |
15afbcd0 | 12447 | """ |
54f9ee45 | 12448 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
e811c8ce RD |
12449 | |
12450 | def GetOtherWindow(*args, **kwargs): | |
a95a7133 | 12451 | """GetOtherWindow(self) -> Window""" |
54f9ee45 | 12452 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) |
e811c8ce RD |
12453 | |
12454 | def GetMyEdge(*args, **kwargs): | |
a95a7133 | 12455 | """GetMyEdge(self) -> int""" |
54f9ee45 | 12456 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
e811c8ce RD |
12457 | |
12458 | def SetEdge(*args, **kwargs): | |
a95a7133 | 12459 | """SetEdge(self, int which)""" |
54f9ee45 | 12460 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
e811c8ce RD |
12461 | |
12462 | def SetValue(*args, **kwargs): | |
a95a7133 | 12463 | """SetValue(self, int v)""" |
54f9ee45 | 12464 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
e811c8ce RD |
12465 | |
12466 | def GetMargin(*args, **kwargs): | |
a95a7133 | 12467 | """GetMargin(self) -> int""" |
54f9ee45 | 12468 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
e811c8ce RD |
12469 | |
12470 | def SetMargin(*args, **kwargs): | |
a95a7133 | 12471 | """SetMargin(self, int m)""" |
54f9ee45 | 12472 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
e811c8ce RD |
12473 | |
12474 | def GetValue(*args, **kwargs): | |
a95a7133 | 12475 | """GetValue(self) -> int""" |
54f9ee45 | 12476 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
e811c8ce RD |
12477 | |
12478 | def GetPercent(*args, **kwargs): | |
a95a7133 | 12479 | """GetPercent(self) -> int""" |
54f9ee45 | 12480 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
e811c8ce RD |
12481 | |
12482 | def GetOtherEdge(*args, **kwargs): | |
a95a7133 | 12483 | """GetOtherEdge(self) -> int""" |
54f9ee45 | 12484 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
e811c8ce RD |
12485 | |
12486 | def GetDone(*args, **kwargs): | |
a95a7133 | 12487 | """GetDone(self) -> bool""" |
54f9ee45 | 12488 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
e811c8ce RD |
12489 | |
12490 | def SetDone(*args, **kwargs): | |
a95a7133 | 12491 | """SetDone(self, bool d)""" |
54f9ee45 | 12492 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
e811c8ce RD |
12493 | |
12494 | def GetRelationship(*args, **kwargs): | |
a95a7133 | 12495 | """GetRelationship(self) -> int""" |
54f9ee45 | 12496 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
e811c8ce RD |
12497 | |
12498 | def SetRelationship(*args, **kwargs): | |
a95a7133 | 12499 | """SetRelationship(self, int r)""" |
54f9ee45 | 12500 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
e811c8ce RD |
12501 | |
12502 | def ResetIfWin(*args, **kwargs): | |
15afbcd0 | 12503 | """ |
a95a7133 | 12504 | ResetIfWin(self, Window otherW) -> bool |
15afbcd0 RD |
12505 | |
12506 | Reset constraint if it mentions otherWin | |
12507 | """ | |
54f9ee45 | 12508 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
e811c8ce RD |
12509 | |
12510 | def SatisfyConstraint(*args, **kwargs): | |
15afbcd0 | 12511 | """ |
a95a7133 | 12512 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
15afbcd0 RD |
12513 | |
12514 | Try to satisfy constraint | |
12515 | """ | |
54f9ee45 | 12516 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
e811c8ce RD |
12517 | |
12518 | def GetEdge(*args, **kwargs): | |
15afbcd0 | 12519 | """ |
a95a7133 | 12520 | GetEdge(self, int which, Window thisWin, Window other) -> int |
15afbcd0 RD |
12521 | |
12522 | Get the value of this edge or dimension, or if this | |
12523 | is not determinable, -1. | |
12524 | """ | |
54f9ee45 | 12525 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
e811c8ce | 12526 | |
2131d850 | 12527 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint) |
d14a1e28 RD |
12528 | |
12529 | class LayoutConstraints(Object): | |
15afbcd0 | 12530 | """ |
41e2b43e RD |
12531 | **Note:** constraints are now deprecated and you should use sizers |
12532 | instead. | |
15afbcd0 | 12533 | |
41e2b43e RD |
12534 | Objects of this class can be associated with a window to define its |
12535 | layout constraints, with respect to siblings or its parent. | |
15afbcd0 RD |
12536 | |
12537 | The class consists of the following eight constraints of class | |
12538 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
12539 | directly to set the appropriate constraints. | |
12540 | ||
12541 | * left: represents the left hand edge of the window | |
12542 | * right: represents the right hand edge of the window | |
12543 | * top: represents the top edge of the window | |
12544 | * bottom: represents the bottom edge of the window | |
12545 | * width: represents the width of the window | |
12546 | * height: represents the height of the window | |
12547 | * centreX: represents the horizontal centre point of the window | |
12548 | * centreY: represents the vertical centre point of the window | |
12549 | ||
41e2b43e RD |
12550 | Most constraints are initially set to have the relationship |
12551 | wxUnconstrained, which means that their values should be calculated by | |
12552 | looking at known constraints. The exceptions are width and height, | |
12553 | which are set to wxAsIs to ensure that if the user does not specify a | |
12554 | constraint, the existing width and height will be used, to be | |
12555 | compatible with panel items which often have take a default size. If | |
12556 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
12557 | ||
12558 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
15afbcd0 RD |
12559 | |
12560 | """ | |
0085ce49 RD |
12561 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12562 | __repr__ = _swig_repr | |
54f9ee45 RD |
12563 | left = property(_core_.LayoutConstraints_left_get) |
12564 | top = property(_core_.LayoutConstraints_top_get) | |
12565 | right = property(_core_.LayoutConstraints_right_get) | |
12566 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
12567 | width = property(_core_.LayoutConstraints_width_get) | |
12568 | height = property(_core_.LayoutConstraints_height_get) | |
12569 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
12570 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
0085ce49 | 12571 | def __init__(self, *args, **kwargs): |
a95a7133 | 12572 | """__init__(self) -> LayoutConstraints""" |
0085ce49 RD |
12573 | _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs)) |
12574 | __swig_destroy__ = _core_.delete_LayoutConstraints | |
12575 | __del__ = lambda self : None; | |
e811c8ce | 12576 | def SatisfyConstraints(*args, **kwargs): |
6c3b4aae | 12577 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" |
54f9ee45 | 12578 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
e811c8ce RD |
12579 | |
12580 | def AreSatisfied(*args, **kwargs): | |
a95a7133 | 12581 | """AreSatisfied(self) -> bool""" |
54f9ee45 | 12582 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
e811c8ce | 12583 | |
2131d850 | 12584 | _core_.LayoutConstraints_swigregister(LayoutConstraints) |
d14a1e28 RD |
12585 | |
12586 | #---------------------------------------------------------------------------- | |
12587 | ||
322913ce | 12588 | # Use Python's bool constants if available, make some if not |
d14a1e28 RD |
12589 | try: |
12590 | True | |
12591 | except NameError: | |
322913ce RD |
12592 | __builtins__.True = 1==1 |
12593 | __builtins__.False = 1==0 | |
4f89f6a3 RD |
12594 | def bool(value): return not not value |
12595 | __builtins__.bool = bool | |
d14a1e28 | 12596 | |
d14a1e28 RD |
12597 | |
12598 | ||
12599 | # workarounds for bad wxRTTI names | |
12600 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
12601 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
12602 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
12603 | ||
12604 | ||
12605 | #---------------------------------------------------------------------------- | |
12606 | # Load version numbers from __version__... Ensure that major and minor | |
7bc1e663 | 12607 | # versions are the same for both wxPython and wxWidgets. |
d14a1e28 RD |
12608 | |
12609 | from __version__ import * | |
12610 | __version__ = VERSION_STRING | |
12611 | ||
7bc1e663 RD |
12612 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
12613 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
54f9ee45 | 12614 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
d14a1e28 | 12615 | import warnings |
7bc1e663 | 12616 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d14a1e28 RD |
12617 | |
12618 | #---------------------------------------------------------------------------- | |
12619 | ||
70b7a5fe RD |
12620 | # Set wxPython's default string<-->unicode conversion encoding from |
12621 | # the locale, but only if Python's default hasn't been changed. (We | |
12622 | # assume that if the user has customized it already then that is the | |
12623 | # encoding we need to use as well.) | |
12624 | # | |
12625 | # The encoding selected here is used when string or unicode objects | |
12626 | # need to be converted in order to pass them to wxWidgets. Please be | |
12627 | # aware that the default encoding within the same locale may be | |
12628 | # slightly different on different platforms. For example, please see | |
e505d15e RD |
12629 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
12630 | # between the common latin/roman encodings. | |
396fb509 RD |
12631 | |
12632 | default = _sys.getdefaultencoding() | |
12633 | if default == 'ascii': | |
12634 | import locale | |
12635 | import codecs | |
12636 | try: | |
12637 | default = locale.getdefaultlocale()[1] | |
12638 | codecs.lookup(default) | |
70b7a5fe | 12639 | except (ValueError, LookupError, TypeError): |
396fb509 RD |
12640 | default = _sys.getdefaultencoding() |
12641 | del locale | |
12642 | del codecs | |
5cbf236d RD |
12643 | if default: |
12644 | wx.SetDefaultPyEncoding(default) | |
12645 | del default | |
5cbf236d RD |
12646 | |
12647 | #---------------------------------------------------------------------------- | |
12648 | ||
d14a1e28 RD |
12649 | class PyDeadObjectError(AttributeError): |
12650 | pass | |
12651 | ||
d14a1e28 RD |
12652 | class _wxPyDeadObject(object): |
12653 | """ | |
12654 | Instances of wx objects that are OOR capable will have their __class__ | |
12655 | changed to this class when the C++ object is deleted. This should help | |
12656 | prevent crashes due to referencing a bogus C++ pointer. | |
12657 | """ | |
12658 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
12659 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
12660 | ||
3a04f143 | 12661 | def __repr__(self): |
d14a1e28 RD |
12662 | if not hasattr(self, "_name"): |
12663 | self._name = "[unknown]" | |
12664 | return self.reprStr % self._name | |
12665 | ||
3a04f143 | 12666 | def __getattr__(self, *args): |
d14a1e28 RD |
12667 | if not hasattr(self, "_name"): |
12668 | self._name = "[unknown]" | |
3a04f143 RD |
12669 | raise PyDeadObjectError(self.attrStr % self._name) |
12670 | ||
12671 | def __nonzero__(self): | |
12672 | return 0 | |
12673 | ||
12674 | ||
12675 | ||
12676 | class PyUnbornObjectError(AttributeError): | |
12677 | pass | |
12678 | ||
12679 | class _wxPyUnbornObject(object): | |
12680 | """ | |
54f9ee45 | 12681 | Some stock objects are created when the wx._core module is |
3a04f143 RD |
12682 | imported, but their C++ instance is not created until the wx.App |
12683 | object is created and initialized. These object instances will | |
12684 | temporarily have their __class__ changed to this class so an | |
12685 | exception will be raised if they are used before the C++ instance | |
12686 | is ready. | |
12687 | """ | |
12688 | ||
12689 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
12690 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
12691 | ||
12692 | def __repr__(self): | |
12693 | #if not hasattr(self, "_name"): | |
12694 | # self._name = "[unknown]" | |
12695 | return self.reprStr #% self._name | |
12696 | ||
12697 | def __getattr__(self, *args): | |
12698 | #if not hasattr(self, "_name"): | |
12699 | # self._name = "[unknown]" | |
12700 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
d14a1e28 RD |
12701 | |
12702 | def __nonzero__(self): | |
12703 | return 0 | |
12704 | ||
12705 | ||
12706 | #---------------------------------------------------------------------------- | |
d14a1e28 RD |
12707 | |
12708 | def CallAfter(callable, *args, **kw): | |
12709 | """ | |
12710 | Call the specified function after the current and pending event | |
12711 | handlers have been completed. This is also good for making GUI | |
61863841 RD |
12712 | method calls from non-GUI threads. Any extra positional or |
12713 | keyword args are passed on to the callable when it is called. | |
12714 | ||
12715 | :see: `wx.FutureCall` | |
d14a1e28 RD |
12716 | """ |
12717 | app = wx.GetApp() | |
dfbb5885 | 12718 | assert app is not None, 'No wx.App created yet' |
d14a1e28 | 12719 | |
148275d3 RD |
12720 | if not hasattr(app, "_CallAfterId"): |
12721 | app._CallAfterId = wx.NewEventType() | |
12722 | app.Connect(-1, -1, app._CallAfterId, | |
12723 | lambda event: event.callable(*event.args, **event.kw) ) | |
d14a1e28 | 12724 | evt = wx.PyEvent() |
148275d3 | 12725 | evt.SetEventType(app._CallAfterId) |
d14a1e28 RD |
12726 | evt.callable = callable |
12727 | evt.args = args | |
12728 | evt.kw = kw | |
12729 | wx.PostEvent(app, evt) | |
12730 | ||
d14a1e28 RD |
12731 | #---------------------------------------------------------------------------- |
12732 | ||
12733 | ||
12734 | class FutureCall: | |
12735 | """ | |
8ac8dba0 | 12736 | A convenience class for `wx.Timer`, that calls the given callable |
d14a1e28 RD |
12737 | object once after the given amount of milliseconds, passing any |
12738 | positional or keyword args. The return value of the callable is | |
61863841 | 12739 | availbale after it has been run with the `GetResult` method. |
d14a1e28 RD |
12740 | |
12741 | If you don't need to get the return value or restart the timer | |
12742 | then there is no need to hold a reference to this object. It will | |
12743 | hold a reference to itself while the timer is running (the timer | |
12744 | has a reference to self.Notify) but the cycle will be broken when | |
12745 | the timer completes, automatically cleaning up the wx.FutureCall | |
12746 | object. | |
61863841 RD |
12747 | |
12748 | :see: `wx.CallAfter` | |
d14a1e28 RD |
12749 | """ |
12750 | def __init__(self, millis, callable, *args, **kwargs): | |
12751 | self.millis = millis | |
12752 | self.callable = callable | |
12753 | self.SetArgs(*args, **kwargs) | |
12754 | self.runCount = 0 | |
4276dc52 | 12755 | self.running = False |
d14a1e28 RD |
12756 | self.hasRun = False |
12757 | self.result = None | |
12758 | self.timer = None | |
12759 | self.Start() | |
12760 | ||
12761 | def __del__(self): | |
12762 | self.Stop() | |
12763 | ||
12764 | ||
12765 | def Start(self, millis=None, *args, **kwargs): | |
12766 | """ | |
12767 | (Re)start the timer | |
12768 | """ | |
12769 | self.hasRun = False | |
12770 | if millis is not None: | |
12771 | self.millis = millis | |
12772 | if args or kwargs: | |
12773 | self.SetArgs(*args, **kwargs) | |
12774 | self.Stop() | |
12775 | self.timer = wx.PyTimer(self.Notify) | |
12776 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
4276dc52 | 12777 | self.running = True |
d14a1e28 RD |
12778 | Restart = Start |
12779 | ||
12780 | ||
12781 | def Stop(self): | |
12782 | """ | |
12783 | Stop and destroy the timer. | |
12784 | """ | |
12785 | if self.timer is not None: | |
12786 | self.timer.Stop() | |
12787 | self.timer = None | |
12788 | ||
12789 | ||
12790 | def GetInterval(self): | |
12791 | if self.timer is not None: | |
12792 | return self.timer.GetInterval() | |
12793 | else: | |
12794 | return 0 | |
12795 | ||
12796 | ||
12797 | def IsRunning(self): | |
12798 | return self.timer is not None and self.timer.IsRunning() | |
12799 | ||
12800 | ||
12801 | def SetArgs(self, *args, **kwargs): | |
12802 | """ | |
12803 | (Re)set the args passed to the callable object. This is | |
12804 | useful in conjunction with Restart if you want to schedule a | |
12805 | new call to the same callable object but with different | |
12806 | parameters. | |
12807 | """ | |
12808 | self.args = args | |
12809 | self.kwargs = kwargs | |
12810 | ||
12811 | ||
12812 | def HasRun(self): | |
12813 | return self.hasRun | |
12814 | ||
12815 | def GetResult(self): | |
12816 | return self.result | |
12817 | ||
12818 | def Notify(self): | |
12819 | """ | |
12820 | The timer has expired so call the callable. | |
12821 | """ | |
12822 | if self.callable and getattr(self.callable, 'im_self', True): | |
12823 | self.runCount += 1 | |
4276dc52 | 12824 | self.running = False |
d14a1e28 RD |
12825 | self.result = self.callable(*self.args, **self.kwargs) |
12826 | self.hasRun = True | |
4276dc52 RD |
12827 | if not self.running: |
12828 | # if it wasn't restarted, then cleanup | |
12829 | wx.CallAfter(self.Stop) | |
d14a1e28 RD |
12830 | |
12831 | ||
a95a7133 RD |
12832 | |
12833 | #---------------------------------------------------------------------------- | |
12834 | # Control which items in this module should be documented by epydoc. | |
12835 | # We allow only classes and functions, which will help reduce the size | |
12836 | # of the docs by filtering out the zillions of constants, EVT objects, | |
12837 | # and etc that don't make much sense by themselves, but are instead | |
12838 | # documented (or will be) as part of the classes/functions/methods | |
12839 | # where they should be used. | |
12840 | ||
66c033b4 RD |
12841 | class __DocFilter: |
12842 | """ | |
12843 | A filter for epydoc that only allows non-Ptr classes and | |
12844 | fucntions, in order to reduce the clutter in the API docs. | |
12845 | """ | |
12846 | def __init__(self, globals): | |
12847 | self._globals = globals | |
12848 | ||
12849 | def __call__(self, name): | |
12850 | import types | |
12851 | obj = self._globals.get(name, None) | |
12852 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: | |
12853 | return False | |
0085ce49 | 12854 | if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') : |
66c033b4 RD |
12855 | return False |
12856 | return True | |
a95a7133 | 12857 | |
d14a1e28 RD |
12858 | #---------------------------------------------------------------------------- |
12859 | #---------------------------------------------------------------------------- | |
12860 | ||
12861 | # Import other modules in this package that should show up in the | |
12862 | # "core" wx namespace | |
54f9ee45 RD |
12863 | from _gdi import * |
12864 | from _windows import * | |
12865 | from _controls import * | |
12866 | from _misc import * | |
d14a1e28 RD |
12867 | |
12868 | #---------------------------------------------------------------------------- | |
12869 | #---------------------------------------------------------------------------- | |
12870 | ||
12871 | ||
32fe5131 | 12872 |