]>
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 | |
54f9ee45 RD |
119 | CB_SIMPLE = _core_.CB_SIMPLE |
120 | CB_DROPDOWN = _core_.CB_DROPDOWN | |
121 | CB_SORT = _core_.CB_SORT | |
122 | CB_READONLY = _core_.CB_READONLY | |
123 | RA_HORIZONTAL = _core_.RA_HORIZONTAL | |
124 | RA_VERTICAL = _core_.RA_VERTICAL | |
125 | RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS | |
126 | RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS | |
fef4c27a | 127 | RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX |
54f9ee45 RD |
128 | RB_GROUP = _core_.RB_GROUP |
129 | RB_SINGLE = _core_.RB_SINGLE | |
54f9ee45 RD |
130 | SB_HORIZONTAL = _core_.SB_HORIZONTAL |
131 | SB_VERTICAL = _core_.SB_VERTICAL | |
fef4c27a | 132 | RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX |
54f9ee45 | 133 | ST_SIZEGRIP = _core_.ST_SIZEGRIP |
54f9ee45 RD |
134 | FLOOD_SURFACE = _core_.FLOOD_SURFACE |
135 | FLOOD_BORDER = _core_.FLOOD_BORDER | |
136 | ODDEVEN_RULE = _core_.ODDEVEN_RULE | |
137 | WINDING_RULE = _core_.WINDING_RULE | |
138 | TOOL_TOP = _core_.TOOL_TOP | |
139 | TOOL_BOTTOM = _core_.TOOL_BOTTOM | |
140 | TOOL_LEFT = _core_.TOOL_LEFT | |
141 | TOOL_RIGHT = _core_.TOOL_RIGHT | |
142 | OK = _core_.OK | |
143 | YES_NO = _core_.YES_NO | |
144 | CANCEL = _core_.CANCEL | |
145 | YES = _core_.YES | |
146 | NO = _core_.NO | |
147 | NO_DEFAULT = _core_.NO_DEFAULT | |
148 | YES_DEFAULT = _core_.YES_DEFAULT | |
a7830320 RD |
149 | APPLY = _core_.APPLY |
150 | CLOSE = _core_.CLOSE | |
54f9ee45 RD |
151 | ICON_EXCLAMATION = _core_.ICON_EXCLAMATION |
152 | ICON_HAND = _core_.ICON_HAND | |
153 | ICON_QUESTION = _core_.ICON_QUESTION | |
154 | ICON_INFORMATION = _core_.ICON_INFORMATION | |
155 | ICON_STOP = _core_.ICON_STOP | |
156 | ICON_ASTERISK = _core_.ICON_ASTERISK | |
157 | ICON_MASK = _core_.ICON_MASK | |
158 | ICON_WARNING = _core_.ICON_WARNING | |
159 | ICON_ERROR = _core_.ICON_ERROR | |
160 | FORWARD = _core_.FORWARD | |
161 | BACKWARD = _core_.BACKWARD | |
162 | RESET = _core_.RESET | |
163 | HELP = _core_.HELP | |
164 | MORE = _core_.MORE | |
165 | SETUP = _core_.SETUP | |
166 | SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH | |
167 | SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT | |
168 | SIZE_AUTO = _core_.SIZE_AUTO | |
169 | SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING | |
170 | SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE | |
943e8dfd | 171 | SIZE_FORCE = _core_.SIZE_FORCE |
54f9ee45 RD |
172 | PORTRAIT = _core_.PORTRAIT |
173 | LANDSCAPE = _core_.LANDSCAPE | |
174 | PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH | |
175 | PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM | |
176 | PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW | |
177 | PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT | |
178 | ID_ANY = _core_.ID_ANY | |
179 | ID_SEPARATOR = _core_.ID_SEPARATOR | |
943e8dfd | 180 | ID_NONE = _core_.ID_NONE |
54f9ee45 RD |
181 | ID_LOWEST = _core_.ID_LOWEST |
182 | ID_OPEN = _core_.ID_OPEN | |
183 | ID_CLOSE = _core_.ID_CLOSE | |
184 | ID_NEW = _core_.ID_NEW | |
185 | ID_SAVE = _core_.ID_SAVE | |
186 | ID_SAVEAS = _core_.ID_SAVEAS | |
187 | ID_REVERT = _core_.ID_REVERT | |
188 | ID_EXIT = _core_.ID_EXIT | |
189 | ID_UNDO = _core_.ID_UNDO | |
190 | ID_REDO = _core_.ID_REDO | |
191 | ID_HELP = _core_.ID_HELP | |
192 | ID_PRINT = _core_.ID_PRINT | |
193 | ID_PRINT_SETUP = _core_.ID_PRINT_SETUP | |
fc46b7f3 | 194 | ID_PAGE_SETUP = _core_.ID_PAGE_SETUP |
54f9ee45 RD |
195 | ID_PREVIEW = _core_.ID_PREVIEW |
196 | ID_ABOUT = _core_.ID_ABOUT | |
197 | ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS | |
198 | ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS | |
199 | ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES | |
200 | ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT | |
10044bf1 RD |
201 | ID_HELP_INDEX = _core_.ID_HELP_INDEX |
202 | ID_HELP_SEARCH = _core_.ID_HELP_SEARCH | |
54f9ee45 RD |
203 | ID_CLOSE_ALL = _core_.ID_CLOSE_ALL |
204 | ID_PREFERENCES = _core_.ID_PREFERENCES | |
97ab0f6a | 205 | ID_EDIT = _core_.ID_EDIT |
54f9ee45 RD |
206 | ID_CUT = _core_.ID_CUT |
207 | ID_COPY = _core_.ID_COPY | |
208 | ID_PASTE = _core_.ID_PASTE | |
209 | ID_CLEAR = _core_.ID_CLEAR | |
210 | ID_FIND = _core_.ID_FIND | |
211 | ID_DUPLICATE = _core_.ID_DUPLICATE | |
212 | ID_SELECTALL = _core_.ID_SELECTALL | |
213 | ID_DELETE = _core_.ID_DELETE | |
214 | ID_REPLACE = _core_.ID_REPLACE | |
215 | ID_REPLACE_ALL = _core_.ID_REPLACE_ALL | |
216 | ID_PROPERTIES = _core_.ID_PROPERTIES | |
217 | ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS | |
218 | ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS | |
219 | ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS | |
220 | ID_VIEW_LIST = _core_.ID_VIEW_LIST | |
221 | ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE | |
222 | ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME | |
223 | ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE | |
224 | ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE | |
97ab0f6a | 225 | ID_FILE = _core_.ID_FILE |
54f9ee45 RD |
226 | ID_FILE1 = _core_.ID_FILE1 |
227 | ID_FILE2 = _core_.ID_FILE2 | |
228 | ID_FILE3 = _core_.ID_FILE3 | |
229 | ID_FILE4 = _core_.ID_FILE4 | |
230 | ID_FILE5 = _core_.ID_FILE5 | |
231 | ID_FILE6 = _core_.ID_FILE6 | |
232 | ID_FILE7 = _core_.ID_FILE7 | |
233 | ID_FILE8 = _core_.ID_FILE8 | |
234 | ID_FILE9 = _core_.ID_FILE9 | |
235 | ID_OK = _core_.ID_OK | |
236 | ID_CANCEL = _core_.ID_CANCEL | |
237 | ID_APPLY = _core_.ID_APPLY | |
238 | ID_YES = _core_.ID_YES | |
239 | ID_NO = _core_.ID_NO | |
240 | ID_STATIC = _core_.ID_STATIC | |
241 | ID_FORWARD = _core_.ID_FORWARD | |
242 | ID_BACKWARD = _core_.ID_BACKWARD | |
243 | ID_DEFAULT = _core_.ID_DEFAULT | |
244 | ID_MORE = _core_.ID_MORE | |
245 | ID_SETUP = _core_.ID_SETUP | |
246 | ID_RESET = _core_.ID_RESET | |
247 | ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP | |
248 | ID_YESTOALL = _core_.ID_YESTOALL | |
249 | ID_NOTOALL = _core_.ID_NOTOALL | |
250 | ID_ABORT = _core_.ID_ABORT | |
251 | ID_RETRY = _core_.ID_RETRY | |
252 | ID_IGNORE = _core_.ID_IGNORE | |
7bc1e663 RD |
253 | ID_ADD = _core_.ID_ADD |
254 | ID_REMOVE = _core_.ID_REMOVE | |
255 | ID_UP = _core_.ID_UP | |
256 | ID_DOWN = _core_.ID_DOWN | |
257 | ID_HOME = _core_.ID_HOME | |
258 | ID_REFRESH = _core_.ID_REFRESH | |
259 | ID_STOP = _core_.ID_STOP | |
260 | ID_INDEX = _core_.ID_INDEX | |
261 | ID_BOLD = _core_.ID_BOLD | |
262 | ID_ITALIC = _core_.ID_ITALIC | |
263 | ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER | |
264 | ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL | |
265 | ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT | |
266 | ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT | |
267 | ID_UNDERLINE = _core_.ID_UNDERLINE | |
268 | ID_INDENT = _core_.ID_INDENT | |
269 | ID_UNINDENT = _core_.ID_UNINDENT | |
270 | ID_ZOOM_100 = _core_.ID_ZOOM_100 | |
271 | ID_ZOOM_FIT = _core_.ID_ZOOM_FIT | |
272 | ID_ZOOM_IN = _core_.ID_ZOOM_IN | |
273 | ID_ZOOM_OUT = _core_.ID_ZOOM_OUT | |
274 | ID_UNDELETE = _core_.ID_UNDELETE | |
275 | ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED | |
54f9ee45 | 276 | ID_HIGHEST = _core_.ID_HIGHEST |
54f9ee45 RD |
277 | MENU_TEAROFF = _core_.MENU_TEAROFF |
278 | MB_DOCKABLE = _core_.MB_DOCKABLE | |
279 | NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE | |
280 | FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE | |
281 | LI_HORIZONTAL = _core_.LI_HORIZONTAL | |
282 | LI_VERTICAL = _core_.LI_VERTICAL | |
283 | WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY | |
284 | WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS | |
285 | WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT | |
286 | WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND | |
287 | WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE | |
288 | WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES | |
289 | MM_TEXT = _core_.MM_TEXT | |
290 | MM_LOMETRIC = _core_.MM_LOMETRIC | |
291 | MM_HIMETRIC = _core_.MM_HIMETRIC | |
292 | MM_LOENGLISH = _core_.MM_LOENGLISH | |
293 | MM_HIENGLISH = _core_.MM_HIENGLISH | |
294 | MM_TWIPS = _core_.MM_TWIPS | |
295 | MM_ISOTROPIC = _core_.MM_ISOTROPIC | |
296 | MM_ANISOTROPIC = _core_.MM_ANISOTROPIC | |
297 | MM_POINTS = _core_.MM_POINTS | |
298 | MM_METRIC = _core_.MM_METRIC | |
299 | CENTRE = _core_.CENTRE | |
300 | CENTER = _core_.CENTER | |
301 | HORIZONTAL = _core_.HORIZONTAL | |
302 | VERTICAL = _core_.VERTICAL | |
303 | BOTH = _core_.BOTH | |
304 | LEFT = _core_.LEFT | |
305 | RIGHT = _core_.RIGHT | |
306 | UP = _core_.UP | |
307 | DOWN = _core_.DOWN | |
308 | TOP = _core_.TOP | |
309 | BOTTOM = _core_.BOTTOM | |
310 | NORTH = _core_.NORTH | |
311 | SOUTH = _core_.SOUTH | |
312 | WEST = _core_.WEST | |
313 | EAST = _core_.EAST | |
314 | ALL = _core_.ALL | |
315 | ALIGN_NOT = _core_.ALIGN_NOT | |
316 | ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL | |
317 | ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL | |
318 | ALIGN_LEFT = _core_.ALIGN_LEFT | |
319 | ALIGN_TOP = _core_.ALIGN_TOP | |
320 | ALIGN_RIGHT = _core_.ALIGN_RIGHT | |
321 | ALIGN_BOTTOM = _core_.ALIGN_BOTTOM | |
322 | ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL | |
323 | ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL | |
324 | ALIGN_CENTER = _core_.ALIGN_CENTER | |
325 | ALIGN_CENTRE = _core_.ALIGN_CENTRE | |
326 | ALIGN_MASK = _core_.ALIGN_MASK | |
327 | STRETCH_NOT = _core_.STRETCH_NOT | |
328 | SHRINK = _core_.SHRINK | |
329 | GROW = _core_.GROW | |
330 | EXPAND = _core_.EXPAND | |
331 | SHAPED = _core_.SHAPED | |
332 | FIXED_MINSIZE = _core_.FIXED_MINSIZE | |
333 | TILE = _core_.TILE | |
cbfc9df6 | 334 | ADJUST_MINSIZE = 0 |
54f9ee45 RD |
335 | BORDER_DEFAULT = _core_.BORDER_DEFAULT |
336 | BORDER_NONE = _core_.BORDER_NONE | |
337 | BORDER_STATIC = _core_.BORDER_STATIC | |
338 | BORDER_SIMPLE = _core_.BORDER_SIMPLE | |
339 | BORDER_RAISED = _core_.BORDER_RAISED | |
340 | BORDER_SUNKEN = _core_.BORDER_SUNKEN | |
341 | BORDER_DOUBLE = _core_.BORDER_DOUBLE | |
342 | BORDER_MASK = _core_.BORDER_MASK | |
7bc1e663 RD |
343 | BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM |
344 | BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR | |
345 | BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM | |
54f9ee45 RD |
346 | DEFAULT = _core_.DEFAULT |
347 | DECORATIVE = _core_.DECORATIVE | |
348 | ROMAN = _core_.ROMAN | |
349 | SCRIPT = _core_.SCRIPT | |
350 | SWISS = _core_.SWISS | |
351 | MODERN = _core_.MODERN | |
352 | TELETYPE = _core_.TELETYPE | |
353 | VARIABLE = _core_.VARIABLE | |
354 | FIXED = _core_.FIXED | |
355 | NORMAL = _core_.NORMAL | |
356 | LIGHT = _core_.LIGHT | |
357 | BOLD = _core_.BOLD | |
358 | ITALIC = _core_.ITALIC | |
359 | SLANT = _core_.SLANT | |
360 | SOLID = _core_.SOLID | |
361 | DOT = _core_.DOT | |
362 | LONG_DASH = _core_.LONG_DASH | |
363 | SHORT_DASH = _core_.SHORT_DASH | |
364 | DOT_DASH = _core_.DOT_DASH | |
365 | USER_DASH = _core_.USER_DASH | |
366 | TRANSPARENT = _core_.TRANSPARENT | |
367 | STIPPLE = _core_.STIPPLE | |
d04418a7 RD |
368 | STIPPLE_MASK = _core_.STIPPLE_MASK |
369 | STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE | |
54f9ee45 RD |
370 | BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH |
371 | CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH | |
372 | FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH | |
373 | CROSS_HATCH = _core_.CROSS_HATCH | |
374 | HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH | |
375 | VERTICAL_HATCH = _core_.VERTICAL_HATCH | |
376 | JOIN_BEVEL = _core_.JOIN_BEVEL | |
377 | JOIN_MITER = _core_.JOIN_MITER | |
378 | JOIN_ROUND = _core_.JOIN_ROUND | |
379 | CAP_ROUND = _core_.CAP_ROUND | |
380 | CAP_PROJECTING = _core_.CAP_PROJECTING | |
381 | CAP_BUTT = _core_.CAP_BUTT | |
382 | CLEAR = _core_.CLEAR | |
383 | XOR = _core_.XOR | |
384 | INVERT = _core_.INVERT | |
385 | OR_REVERSE = _core_.OR_REVERSE | |
386 | AND_REVERSE = _core_.AND_REVERSE | |
387 | COPY = _core_.COPY | |
388 | AND = _core_.AND | |
389 | AND_INVERT = _core_.AND_INVERT | |
390 | NO_OP = _core_.NO_OP | |
391 | NOR = _core_.NOR | |
392 | EQUIV = _core_.EQUIV | |
393 | SRC_INVERT = _core_.SRC_INVERT | |
394 | OR_INVERT = _core_.OR_INVERT | |
395 | NAND = _core_.NAND | |
396 | OR = _core_.OR | |
397 | SET = _core_.SET | |
398 | WXK_BACK = _core_.WXK_BACK | |
399 | WXK_TAB = _core_.WXK_TAB | |
400 | WXK_RETURN = _core_.WXK_RETURN | |
401 | WXK_ESCAPE = _core_.WXK_ESCAPE | |
402 | WXK_SPACE = _core_.WXK_SPACE | |
403 | WXK_DELETE = _core_.WXK_DELETE | |
404 | WXK_START = _core_.WXK_START | |
405 | WXK_LBUTTON = _core_.WXK_LBUTTON | |
406 | WXK_RBUTTON = _core_.WXK_RBUTTON | |
407 | WXK_CANCEL = _core_.WXK_CANCEL | |
408 | WXK_MBUTTON = _core_.WXK_MBUTTON | |
409 | WXK_CLEAR = _core_.WXK_CLEAR | |
410 | WXK_SHIFT = _core_.WXK_SHIFT | |
411 | WXK_ALT = _core_.WXK_ALT | |
412 | WXK_CONTROL = _core_.WXK_CONTROL | |
413 | WXK_MENU = _core_.WXK_MENU | |
414 | WXK_PAUSE = _core_.WXK_PAUSE | |
415 | WXK_CAPITAL = _core_.WXK_CAPITAL | |
54f9ee45 RD |
416 | WXK_END = _core_.WXK_END |
417 | WXK_HOME = _core_.WXK_HOME | |
418 | WXK_LEFT = _core_.WXK_LEFT | |
419 | WXK_UP = _core_.WXK_UP | |
420 | WXK_RIGHT = _core_.WXK_RIGHT | |
421 | WXK_DOWN = _core_.WXK_DOWN | |
422 | WXK_SELECT = _core_.WXK_SELECT | |
423 | WXK_PRINT = _core_.WXK_PRINT | |
424 | WXK_EXECUTE = _core_.WXK_EXECUTE | |
425 | WXK_SNAPSHOT = _core_.WXK_SNAPSHOT | |
426 | WXK_INSERT = _core_.WXK_INSERT | |
427 | WXK_HELP = _core_.WXK_HELP | |
428 | WXK_NUMPAD0 = _core_.WXK_NUMPAD0 | |
429 | WXK_NUMPAD1 = _core_.WXK_NUMPAD1 | |
430 | WXK_NUMPAD2 = _core_.WXK_NUMPAD2 | |
431 | WXK_NUMPAD3 = _core_.WXK_NUMPAD3 | |
432 | WXK_NUMPAD4 = _core_.WXK_NUMPAD4 | |
433 | WXK_NUMPAD5 = _core_.WXK_NUMPAD5 | |
434 | WXK_NUMPAD6 = _core_.WXK_NUMPAD6 | |
435 | WXK_NUMPAD7 = _core_.WXK_NUMPAD7 | |
436 | WXK_NUMPAD8 = _core_.WXK_NUMPAD8 | |
437 | WXK_NUMPAD9 = _core_.WXK_NUMPAD9 | |
438 | WXK_MULTIPLY = _core_.WXK_MULTIPLY | |
439 | WXK_ADD = _core_.WXK_ADD | |
440 | WXK_SEPARATOR = _core_.WXK_SEPARATOR | |
441 | WXK_SUBTRACT = _core_.WXK_SUBTRACT | |
442 | WXK_DECIMAL = _core_.WXK_DECIMAL | |
443 | WXK_DIVIDE = _core_.WXK_DIVIDE | |
444 | WXK_F1 = _core_.WXK_F1 | |
445 | WXK_F2 = _core_.WXK_F2 | |
446 | WXK_F3 = _core_.WXK_F3 | |
447 | WXK_F4 = _core_.WXK_F4 | |
448 | WXK_F5 = _core_.WXK_F5 | |
449 | WXK_F6 = _core_.WXK_F6 | |
450 | WXK_F7 = _core_.WXK_F7 | |
451 | WXK_F8 = _core_.WXK_F8 | |
452 | WXK_F9 = _core_.WXK_F9 | |
453 | WXK_F10 = _core_.WXK_F10 | |
454 | WXK_F11 = _core_.WXK_F11 | |
455 | WXK_F12 = _core_.WXK_F12 | |
456 | WXK_F13 = _core_.WXK_F13 | |
457 | WXK_F14 = _core_.WXK_F14 | |
458 | WXK_F15 = _core_.WXK_F15 | |
459 | WXK_F16 = _core_.WXK_F16 | |
460 | WXK_F17 = _core_.WXK_F17 | |
461 | WXK_F18 = _core_.WXK_F18 | |
462 | WXK_F19 = _core_.WXK_F19 | |
463 | WXK_F20 = _core_.WXK_F20 | |
464 | WXK_F21 = _core_.WXK_F21 | |
465 | WXK_F22 = _core_.WXK_F22 | |
466 | WXK_F23 = _core_.WXK_F23 | |
467 | WXK_F24 = _core_.WXK_F24 | |
468 | WXK_NUMLOCK = _core_.WXK_NUMLOCK | |
469 | WXK_SCROLL = _core_.WXK_SCROLL | |
470 | WXK_PAGEUP = _core_.WXK_PAGEUP | |
471 | WXK_PAGEDOWN = _core_.WXK_PAGEDOWN | |
472 | WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE | |
473 | WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB | |
474 | WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER | |
475 | WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1 | |
476 | WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2 | |
477 | WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3 | |
478 | WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4 | |
479 | WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME | |
480 | WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT | |
481 | WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP | |
482 | WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT | |
483 | WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN | |
54f9ee45 | 484 | WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP |
54f9ee45 RD |
485 | WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN |
486 | WXK_NUMPAD_END = _core_.WXK_NUMPAD_END | |
487 | WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN | |
488 | WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT | |
489 | WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE | |
490 | WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL | |
491 | WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY | |
492 | WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD | |
493 | WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR | |
494 | WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT | |
495 | WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL | |
496 | WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE | |
497 | WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT | |
498 | WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT | |
499 | WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU | |
88c6b281 RD |
500 | WXK_COMMAND = _core_.WXK_COMMAND |
501 | WXK_SPECIAL1 = _core_.WXK_SPECIAL1 | |
502 | WXK_SPECIAL2 = _core_.WXK_SPECIAL2 | |
503 | WXK_SPECIAL3 = _core_.WXK_SPECIAL3 | |
504 | WXK_SPECIAL4 = _core_.WXK_SPECIAL4 | |
505 | WXK_SPECIAL5 = _core_.WXK_SPECIAL5 | |
506 | WXK_SPECIAL6 = _core_.WXK_SPECIAL6 | |
507 | WXK_SPECIAL7 = _core_.WXK_SPECIAL7 | |
508 | WXK_SPECIAL8 = _core_.WXK_SPECIAL8 | |
509 | WXK_SPECIAL9 = _core_.WXK_SPECIAL9 | |
510 | WXK_SPECIAL10 = _core_.WXK_SPECIAL10 | |
511 | WXK_SPECIAL11 = _core_.WXK_SPECIAL11 | |
512 | WXK_SPECIAL12 = _core_.WXK_SPECIAL12 | |
513 | WXK_SPECIAL13 = _core_.WXK_SPECIAL13 | |
514 | WXK_SPECIAL14 = _core_.WXK_SPECIAL14 | |
515 | WXK_SPECIAL15 = _core_.WXK_SPECIAL15 | |
516 | WXK_SPECIAL16 = _core_.WXK_SPECIAL16 | |
517 | WXK_SPECIAL17 = _core_.WXK_SPECIAL17 | |
518 | WXK_SPECIAL18 = _core_.WXK_SPECIAL18 | |
519 | WXK_SPECIAL19 = _core_.WXK_SPECIAL19 | |
520 | WXK_SPECIAL20 = _core_.WXK_SPECIAL20 | |
cbfc9df6 RD |
521 | WXK_PRIOR = WXK_PAGEUP |
522 | WXK_NEXT = WXK_PAGEDOWN | |
523 | WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP | |
524 | WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN | |
525 | ||
54f9ee45 RD |
526 | PAPER_NONE = _core_.PAPER_NONE |
527 | PAPER_LETTER = _core_.PAPER_LETTER | |
528 | PAPER_LEGAL = _core_.PAPER_LEGAL | |
529 | PAPER_A4 = _core_.PAPER_A4 | |
530 | PAPER_CSHEET = _core_.PAPER_CSHEET | |
531 | PAPER_DSHEET = _core_.PAPER_DSHEET | |
532 | PAPER_ESHEET = _core_.PAPER_ESHEET | |
533 | PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL | |
534 | PAPER_TABLOID = _core_.PAPER_TABLOID | |
535 | PAPER_LEDGER = _core_.PAPER_LEDGER | |
536 | PAPER_STATEMENT = _core_.PAPER_STATEMENT | |
537 | PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE | |
538 | PAPER_A3 = _core_.PAPER_A3 | |
539 | PAPER_A4SMALL = _core_.PAPER_A4SMALL | |
540 | PAPER_A5 = _core_.PAPER_A5 | |
541 | PAPER_B4 = _core_.PAPER_B4 | |
542 | PAPER_B5 = _core_.PAPER_B5 | |
543 | PAPER_FOLIO = _core_.PAPER_FOLIO | |
544 | PAPER_QUARTO = _core_.PAPER_QUARTO | |
545 | PAPER_10X14 = _core_.PAPER_10X14 | |
546 | PAPER_11X17 = _core_.PAPER_11X17 | |
547 | PAPER_NOTE = _core_.PAPER_NOTE | |
548 | PAPER_ENV_9 = _core_.PAPER_ENV_9 | |
549 | PAPER_ENV_10 = _core_.PAPER_ENV_10 | |
550 | PAPER_ENV_11 = _core_.PAPER_ENV_11 | |
551 | PAPER_ENV_12 = _core_.PAPER_ENV_12 | |
552 | PAPER_ENV_14 = _core_.PAPER_ENV_14 | |
553 | PAPER_ENV_DL = _core_.PAPER_ENV_DL | |
554 | PAPER_ENV_C5 = _core_.PAPER_ENV_C5 | |
555 | PAPER_ENV_C3 = _core_.PAPER_ENV_C3 | |
556 | PAPER_ENV_C4 = _core_.PAPER_ENV_C4 | |
557 | PAPER_ENV_C6 = _core_.PAPER_ENV_C6 | |
558 | PAPER_ENV_C65 = _core_.PAPER_ENV_C65 | |
559 | PAPER_ENV_B4 = _core_.PAPER_ENV_B4 | |
560 | PAPER_ENV_B5 = _core_.PAPER_ENV_B5 | |
561 | PAPER_ENV_B6 = _core_.PAPER_ENV_B6 | |
562 | PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY | |
563 | PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH | |
564 | PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL | |
565 | PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US | |
566 | PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN | |
567 | PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN | |
568 | PAPER_ISO_B4 = _core_.PAPER_ISO_B4 | |
569 | PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD | |
570 | PAPER_9X11 = _core_.PAPER_9X11 | |
571 | PAPER_10X11 = _core_.PAPER_10X11 | |
572 | PAPER_15X11 = _core_.PAPER_15X11 | |
573 | PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE | |
574 | PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA | |
575 | PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA | |
576 | PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA | |
577 | PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA | |
578 | PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE | |
579 | PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE | |
580 | PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE | |
581 | PAPER_A_PLUS = _core_.PAPER_A_PLUS | |
582 | PAPER_B_PLUS = _core_.PAPER_B_PLUS | |
583 | PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS | |
584 | PAPER_A4_PLUS = _core_.PAPER_A4_PLUS | |
585 | PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE | |
586 | PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE | |
587 | PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA | |
588 | PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA | |
589 | PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA | |
590 | PAPER_A2 = _core_.PAPER_A2 | |
591 | PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE | |
592 | PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE | |
6c75a4cf RD |
593 | PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD |
594 | PAPER_A6 = _core_.PAPER_A6 | |
595 | PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2 | |
596 | PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3 | |
597 | PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3 | |
598 | PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4 | |
599 | PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED | |
600 | PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED | |
601 | PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED | |
602 | PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED | |
603 | PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED | |
604 | PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED | |
605 | PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED | |
606 | PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED | |
607 | PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED | |
608 | PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED | |
609 | PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED | |
610 | PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED | |
611 | PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED | |
612 | PAPER_B6_JIS = _core_.PAPER_B6_JIS | |
613 | PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED | |
614 | PAPER_12X11 = _core_.PAPER_12X11 | |
615 | PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4 | |
616 | PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED | |
617 | PAPER_P16K = _core_.PAPER_P16K | |
618 | PAPER_P32K = _core_.PAPER_P32K | |
619 | PAPER_P32KBIG = _core_.PAPER_P32KBIG | |
620 | PAPER_PENV_1 = _core_.PAPER_PENV_1 | |
621 | PAPER_PENV_2 = _core_.PAPER_PENV_2 | |
622 | PAPER_PENV_3 = _core_.PAPER_PENV_3 | |
623 | PAPER_PENV_4 = _core_.PAPER_PENV_4 | |
624 | PAPER_PENV_5 = _core_.PAPER_PENV_5 | |
625 | PAPER_PENV_6 = _core_.PAPER_PENV_6 | |
626 | PAPER_PENV_7 = _core_.PAPER_PENV_7 | |
627 | PAPER_PENV_8 = _core_.PAPER_PENV_8 | |
628 | PAPER_PENV_9 = _core_.PAPER_PENV_9 | |
629 | PAPER_PENV_10 = _core_.PAPER_PENV_10 | |
630 | PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED | |
631 | PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED | |
632 | PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED | |
633 | PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED | |
634 | PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED | |
635 | PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED | |
636 | PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED | |
637 | PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED | |
638 | PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED | |
639 | PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED | |
640 | PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED | |
641 | PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED | |
642 | PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED | |
54f9ee45 RD |
643 | DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX |
644 | DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL | |
645 | DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL | |
646 | ITEM_SEPARATOR = _core_.ITEM_SEPARATOR | |
647 | ITEM_NORMAL = _core_.ITEM_NORMAL | |
648 | ITEM_CHECK = _core_.ITEM_CHECK | |
649 | ITEM_RADIO = _core_.ITEM_RADIO | |
650 | ITEM_MAX = _core_.ITEM_MAX | |
651 | HT_NOWHERE = _core_.HT_NOWHERE | |
652 | HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST | |
653 | HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1 | |
654 | HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2 | |
655 | HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1 | |
656 | HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2 | |
657 | HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB | |
658 | HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1 | |
659 | HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2 | |
660 | HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST | |
661 | HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE | |
662 | HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE | |
663 | HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR | |
664 | HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR | |
665 | HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER | |
666 | HT_MAX = _core_.HT_MAX | |
667 | MOD_NONE = _core_.MOD_NONE | |
668 | MOD_ALT = _core_.MOD_ALT | |
669 | MOD_CONTROL = _core_.MOD_CONTROL | |
943e8dfd | 670 | MOD_ALTGR = _core_.MOD_ALTGR |
54f9ee45 | 671 | MOD_SHIFT = _core_.MOD_SHIFT |
943e8dfd | 672 | MOD_META = _core_.MOD_META |
54f9ee45 | 673 | MOD_WIN = _core_.MOD_WIN |
943e8dfd RD |
674 | MOD_CMD = _core_.MOD_CMD |
675 | MOD_ALL = _core_.MOD_ALL | |
54f9ee45 RD |
676 | UPDATE_UI_NONE = _core_.UPDATE_UI_NONE |
677 | UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE | |
678 | UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE | |
994453b8 RD |
679 | Layout_Default = _core_.Layout_Default |
680 | Layout_LeftToRight = _core_.Layout_LeftToRight | |
681 | Layout_RightToLeft = _core_.Layout_RightToLeft | |
d14a1e28 RD |
682 | #--------------------------------------------------------------------------- |
683 | ||
684 | class Object(object): | |
0df68c9f RD |
685 | """ |
686 | The base class for most wx objects, although in wxPython not | |
687 | much functionality is needed nor exposed. | |
688 | """ | |
0085ce49 RD |
689 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
690 | def __init__(self): raise AttributeError, "No constructor defined" | |
691 | __repr__ = _swig_repr | |
e811c8ce | 692 | def GetClassName(*args, **kwargs): |
0df68c9f | 693 | """ |
a95a7133 | 694 | GetClassName(self) -> String |
e811c8ce | 695 | |
a95a7133 | 696 | Returns the class name of the C++ class using wxRTTI. |
0df68c9f | 697 | """ |
54f9ee45 | 698 | return _core_.Object_GetClassName(*args, **kwargs) |
e811c8ce RD |
699 | |
700 | def Destroy(*args, **kwargs): | |
0df68c9f | 701 | """ |
a95a7133 | 702 | Destroy(self) |
e811c8ce | 703 | |
0df68c9f RD |
704 | Deletes the C++ object this Python object is a proxy for. |
705 | """ | |
b39fe951 RD |
706 | args[0].this.own(False) |
707 | return _core_.Object_Destroy(*args, **kwargs) | |
e811c8ce | 708 | |
8f514ab4 RD |
709 | def IsSameAs(*args, **kwargs): |
710 | """ | |
711 | IsSameAs(self, Object p) -> bool | |
712 | ||
713 | For wx.Objects that use C++ reference counting internally, this method | |
714 | can be used to determine if two objects are referencing the same data | |
715 | object. | |
716 | """ | |
717 | return _core_.Object_IsSameAs(*args, **kwargs) | |
718 | ||
33d6fd3b | 719 | ClassName = property(GetClassName,doc="See `GetClassName`") |
2131d850 | 720 | _core_.Object_swigregister(Object) |
54f9ee45 | 721 | _wxPySetDictionary = _core_._wxPySetDictionary |
54f9ee45 | 722 | cvar = _core_.cvar |
196addbf | 723 | EmptyString = cvar.EmptyString |
d14a1e28 RD |
724 | |
725 | #--------------------------------------------------------------------------- | |
726 | ||
54f9ee45 RD |
727 | BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID |
728 | BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP | |
729 | BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO | |
730 | BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR | |
731 | BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM | |
732 | BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA | |
733 | BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM | |
734 | BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA | |
735 | BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF | |
736 | BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF | |
737 | BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG | |
738 | BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG | |
739 | BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM | |
740 | BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX | |
741 | BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT | |
742 | BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON | |
743 | BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI | |
744 | BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF | |
8f514ab4 | 745 | BITMAP_TYPE_TGA = _core_.BITMAP_TYPE_TGA |
54f9ee45 RD |
746 | BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR |
747 | BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY | |
748 | CURSOR_NONE = _core_.CURSOR_NONE | |
749 | CURSOR_ARROW = _core_.CURSOR_ARROW | |
750 | CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW | |
751 | CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE | |
752 | CURSOR_CHAR = _core_.CURSOR_CHAR | |
753 | CURSOR_CROSS = _core_.CURSOR_CROSS | |
754 | CURSOR_HAND = _core_.CURSOR_HAND | |
755 | CURSOR_IBEAM = _core_.CURSOR_IBEAM | |
756 | CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON | |
757 | CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER | |
758 | CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON | |
759 | CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY | |
760 | CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH | |
761 | CURSOR_PENCIL = _core_.CURSOR_PENCIL | |
762 | CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT | |
763 | CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT | |
764 | CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW | |
765 | CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON | |
766 | CURSOR_SIZENESW = _core_.CURSOR_SIZENESW | |
767 | CURSOR_SIZENS = _core_.CURSOR_SIZENS | |
768 | CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE | |
769 | CURSOR_SIZEWE = _core_.CURSOR_SIZEWE | |
770 | CURSOR_SIZING = _core_.CURSOR_SIZING | |
771 | CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN | |
772 | CURSOR_WAIT = _core_.CURSOR_WAIT | |
773 | CURSOR_WATCH = _core_.CURSOR_WATCH | |
774 | CURSOR_BLANK = _core_.CURSOR_BLANK | |
775 | CURSOR_DEFAULT = _core_.CURSOR_DEFAULT | |
776 | CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW | |
777 | CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT | |
778 | CURSOR_MAX = _core_.CURSOR_MAX | |
d14a1e28 RD |
779 | #--------------------------------------------------------------------------- |
780 | ||
781 | class Size(object): | |
0df68c9f | 782 | """ |
41e2b43e | 783 | wx.Size is a useful data structure used to represent the size of |
0085ce49 RD |
784 | something. It simply contains integer width and height |
785 | properties. In most places in wxPython where a wx.Size is | |
093d3ff1 | 786 | expected a (width, height) tuple can be used instead. |
0df68c9f | 787 | """ |
0085ce49 RD |
788 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
789 | __repr__ = _swig_repr | |
54f9ee45 RD |
790 | width = property(_core_.Size_width_get, _core_.Size_width_set) |
791 | height = property(_core_.Size_height_get, _core_.Size_height_set) | |
242b7b46 | 792 | x = width; y = height |
0085ce49 | 793 | def __init__(self, *args, **kwargs): |
0df68c9f | 794 | """ |
a95a7133 | 795 | __init__(self, int w=0, int h=0) -> Size |
e811c8ce | 796 | |
0df68c9f RD |
797 | Creates a size object. |
798 | """ | |
0085ce49 RD |
799 | _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs)) |
800 | __swig_destroy__ = _core_.delete_Size | |
801 | __del__ = lambda self : None; | |
e811c8ce | 802 | def __eq__(*args, **kwargs): |
0df68c9f | 803 | """ |
e9d6f3a4 | 804 | __eq__(self, PyObject other) -> bool |
e811c8ce | 805 | |
0df68c9f RD |
806 | Test for equality of wx.Size objects. |
807 | """ | |
54f9ee45 | 808 | return _core_.Size___eq__(*args, **kwargs) |
e811c8ce RD |
809 | |
810 | def __ne__(*args, **kwargs): | |
0df68c9f | 811 | """ |
e9d6f3a4 | 812 | __ne__(self, PyObject other) -> bool |
e811c8ce | 813 | |
e9d6f3a4 | 814 | Test for inequality of wx.Size objects. |
0df68c9f | 815 | """ |
54f9ee45 | 816 | return _core_.Size___ne__(*args, **kwargs) |
e811c8ce RD |
817 | |
818 | def __add__(*args, **kwargs): | |
0df68c9f | 819 | """ |
a95a7133 | 820 | __add__(self, Size sz) -> Size |
e811c8ce | 821 | |
0df68c9f RD |
822 | Add sz's proprties to this and return the result. |
823 | """ | |
54f9ee45 | 824 | return _core_.Size___add__(*args, **kwargs) |
e811c8ce RD |
825 | |
826 | def __sub__(*args, **kwargs): | |
0df68c9f | 827 | """ |
a95a7133 | 828 | __sub__(self, Size sz) -> Size |
e811c8ce | 829 | |
0df68c9f RD |
830 | Subtract sz's properties from this and return the result. |
831 | """ | |
54f9ee45 | 832 | return _core_.Size___sub__(*args, **kwargs) |
e811c8ce RD |
833 | |
834 | def IncTo(*args, **kwargs): | |
0df68c9f | 835 | """ |
a95a7133 | 836 | IncTo(self, Size sz) |
e811c8ce | 837 | |
0df68c9f RD |
838 | Increments this object so that both of its dimensions are not less |
839 | than the corresponding dimensions of the size. | |
840 | """ | |
54f9ee45 | 841 | return _core_.Size_IncTo(*args, **kwargs) |
e811c8ce RD |
842 | |
843 | def DecTo(*args, **kwargs): | |
0df68c9f | 844 | """ |
a95a7133 | 845 | DecTo(self, Size sz) |
e811c8ce | 846 | |
0df68c9f RD |
847 | Decrements this object so that both of its dimensions are not greater |
848 | than the corresponding dimensions of the size. | |
849 | """ | |
54f9ee45 | 850 | return _core_.Size_DecTo(*args, **kwargs) |
e811c8ce | 851 | |
f5263701 RD |
852 | def IncBy(*args, **kwargs): |
853 | """IncBy(self, int dx, int dy)""" | |
854 | return _core_.Size_IncBy(*args, **kwargs) | |
855 | ||
856 | def DecBy(*args, **kwargs): | |
857 | """DecBy(self, int dx, int dy)""" | |
858 | return _core_.Size_DecBy(*args, **kwargs) | |
859 | ||
10044bf1 RD |
860 | def Scale(*args, **kwargs): |
861 | """ | |
862 | Scale(self, float xscale, float yscale) | |
863 | ||
864 | Scales the dimensions of this object by the given factors. | |
865 | """ | |
866 | return _core_.Size_Scale(*args, **kwargs) | |
867 | ||
e811c8ce | 868 | def Set(*args, **kwargs): |
0df68c9f | 869 | """ |
a95a7133 | 870 | Set(self, int w, int h) |
e811c8ce | 871 | |
0df68c9f RD |
872 | Set both width and height. |
873 | """ | |
54f9ee45 | 874 | return _core_.Size_Set(*args, **kwargs) |
e811c8ce RD |
875 | |
876 | def SetWidth(*args, **kwargs): | |
a95a7133 | 877 | """SetWidth(self, int w)""" |
54f9ee45 | 878 | return _core_.Size_SetWidth(*args, **kwargs) |
e811c8ce RD |
879 | |
880 | def SetHeight(*args, **kwargs): | |
a95a7133 | 881 | """SetHeight(self, int h)""" |
54f9ee45 | 882 | return _core_.Size_SetHeight(*args, **kwargs) |
e811c8ce RD |
883 | |
884 | def GetWidth(*args, **kwargs): | |
a95a7133 | 885 | """GetWidth(self) -> int""" |
54f9ee45 | 886 | return _core_.Size_GetWidth(*args, **kwargs) |
e811c8ce RD |
887 | |
888 | def GetHeight(*args, **kwargs): | |
a95a7133 | 889 | """GetHeight(self) -> int""" |
54f9ee45 | 890 | return _core_.Size_GetHeight(*args, **kwargs) |
e811c8ce | 891 | |
74a57fcd RD |
892 | def IsFullySpecified(*args, **kwargs): |
893 | """ | |
a95a7133 | 894 | IsFullySpecified(self) -> bool |
74a57fcd RD |
895 | |
896 | Returns True if both components of the size are non-default values. | |
897 | """ | |
54f9ee45 | 898 | return _core_.Size_IsFullySpecified(*args, **kwargs) |
74a57fcd RD |
899 | |
900 | def SetDefaults(*args, **kwargs): | |
901 | """ | |
a95a7133 | 902 | SetDefaults(self, Size size) |
74a57fcd | 903 | |
41e2b43e RD |
904 | Combine this size with the other one replacing the default components |
905 | of this object (i.e. equal to -1) with those of the other. | |
74a57fcd | 906 | """ |
54f9ee45 | 907 | return _core_.Size_SetDefaults(*args, **kwargs) |
74a57fcd | 908 | |
e811c8ce | 909 | def Get(*args, **kwargs): |
0df68c9f RD |
910 | """ |
911 | Get() -> (width,height) | |
e811c8ce | 912 | |
0df68c9f RD |
913 | Returns the width and height properties as a tuple. |
914 | """ | |
54f9ee45 | 915 | return _core_.Size_Get(*args, **kwargs) |
e811c8ce | 916 | |
41e2b43e | 917 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
918 | def __str__(self): return str(self.Get()) |
919 | def __repr__(self): return 'wx.Size'+str(self.Get()) | |
920 | def __len__(self): return len(self.Get()) | |
921 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
922 | def __setitem__(self, index, val): |
923 | if index == 0: self.width = val | |
924 | elif index == 1: self.height = val | |
925 | else: raise IndexError | |
e811c8ce | 926 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
927 | __safe_for_unpickling__ = True |
928 | def __reduce__(self): return (wx.Size, self.Get()) | |
d14a1e28 | 929 | |
2131d850 | 930 | _core_.Size_swigregister(Size) |
d14a1e28 RD |
931 | |
932 | #--------------------------------------------------------------------------- | |
933 | ||
934 | class RealPoint(object): | |
0df68c9f | 935 | """ |
41e2b43e RD |
936 | A data structure for representing a point or position with floating |
937 | point x and y properties. In wxPython most places that expect a | |
938 | wx.RealPoint can also accept a (x,y) tuple. | |
0df68c9f | 939 | """ |
0085ce49 RD |
940 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
941 | __repr__ = _swig_repr | |
54f9ee45 RD |
942 | x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set) |
943 | y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set) | |
0085ce49 | 944 | def __init__(self, *args, **kwargs): |
0df68c9f | 945 | """ |
a95a7133 | 946 | __init__(self, double x=0.0, double y=0.0) -> RealPoint |
e811c8ce | 947 | |
0df68c9f RD |
948 | Create a wx.RealPoint object |
949 | """ | |
0085ce49 RD |
950 | _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs)) |
951 | __swig_destroy__ = _core_.delete_RealPoint | |
952 | __del__ = lambda self : None; | |
e811c8ce | 953 | def __eq__(*args, **kwargs): |
0df68c9f | 954 | """ |
e9d6f3a4 | 955 | __eq__(self, PyObject other) -> bool |
e811c8ce | 956 | |
0df68c9f RD |
957 | Test for equality of wx.RealPoint objects. |
958 | """ | |
54f9ee45 | 959 | return _core_.RealPoint___eq__(*args, **kwargs) |
e811c8ce RD |
960 | |
961 | def __ne__(*args, **kwargs): | |
0df68c9f | 962 | """ |
e9d6f3a4 | 963 | __ne__(self, PyObject other) -> bool |
e811c8ce | 964 | |
0df68c9f RD |
965 | Test for inequality of wx.RealPoint objects. |
966 | """ | |
54f9ee45 | 967 | return _core_.RealPoint___ne__(*args, **kwargs) |
e811c8ce RD |
968 | |
969 | def __add__(*args, **kwargs): | |
0df68c9f | 970 | """ |
a95a7133 | 971 | __add__(self, RealPoint pt) -> RealPoint |
e811c8ce | 972 | |
0df68c9f RD |
973 | Add pt's proprties to this and return the result. |
974 | """ | |
54f9ee45 | 975 | return _core_.RealPoint___add__(*args, **kwargs) |
e811c8ce RD |
976 | |
977 | def __sub__(*args, **kwargs): | |
0df68c9f | 978 | """ |
a95a7133 | 979 | __sub__(self, RealPoint pt) -> RealPoint |
e811c8ce | 980 | |
0df68c9f RD |
981 | Subtract pt's proprties from this and return the result |
982 | """ | |
54f9ee45 | 983 | return _core_.RealPoint___sub__(*args, **kwargs) |
e811c8ce RD |
984 | |
985 | def Set(*args, **kwargs): | |
0df68c9f | 986 | """ |
a95a7133 | 987 | Set(self, double x, double y) |
e811c8ce | 988 | |
0df68c9f RD |
989 | Set both the x and y properties |
990 | """ | |
54f9ee45 | 991 | return _core_.RealPoint_Set(*args, **kwargs) |
e811c8ce RD |
992 | |
993 | def Get(*args, **kwargs): | |
0df68c9f RD |
994 | """ |
995 | Get() -> (x,y) | |
e811c8ce | 996 | |
0df68c9f RD |
997 | Return the x and y properties as a tuple. |
998 | """ | |
54f9ee45 | 999 | return _core_.RealPoint_Get(*args, **kwargs) |
e811c8ce | 1000 | |
41e2b43e | 1001 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1002 | def __str__(self): return str(self.Get()) |
1003 | def __repr__(self): return 'wx.RealPoint'+str(self.Get()) | |
1004 | def __len__(self): return len(self.Get()) | |
1005 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 1006 | def __setitem__(self, index, val): |
e811c8ce RD |
1007 | if index == 0: self.x = val |
1008 | elif index == 1: self.y = val | |
d14a1e28 | 1009 | else: raise IndexError |
e811c8ce | 1010 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1011 | __safe_for_unpickling__ = True |
1012 | def __reduce__(self): return (wx.RealPoint, self.Get()) | |
d14a1e28 | 1013 | |
2131d850 | 1014 | _core_.RealPoint_swigregister(RealPoint) |
d14a1e28 RD |
1015 | |
1016 | #--------------------------------------------------------------------------- | |
1017 | ||
1018 | class Point(object): | |
0df68c9f | 1019 | """ |
41e2b43e RD |
1020 | A data structure for representing a point or position with integer x |
1021 | and y properties. Most places in wxPython that expect a wx.Point can | |
1022 | also accept a (x,y) tuple. | |
0df68c9f | 1023 | """ |
0085ce49 RD |
1024 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1025 | __repr__ = _swig_repr | |
54f9ee45 RD |
1026 | x = property(_core_.Point_x_get, _core_.Point_x_set) |
1027 | y = property(_core_.Point_y_get, _core_.Point_y_set) | |
0085ce49 | 1028 | def __init__(self, *args, **kwargs): |
0df68c9f | 1029 | """ |
a95a7133 | 1030 | __init__(self, int x=0, int y=0) -> Point |
e811c8ce | 1031 | |
0df68c9f RD |
1032 | Create a wx.Point object |
1033 | """ | |
0085ce49 RD |
1034 | _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs)) |
1035 | __swig_destroy__ = _core_.delete_Point | |
1036 | __del__ = lambda self : None; | |
e811c8ce | 1037 | def __eq__(*args, **kwargs): |
0df68c9f | 1038 | """ |
e9d6f3a4 | 1039 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1040 | |
0df68c9f RD |
1041 | Test for equality of wx.Point objects. |
1042 | """ | |
54f9ee45 | 1043 | return _core_.Point___eq__(*args, **kwargs) |
e811c8ce RD |
1044 | |
1045 | def __ne__(*args, **kwargs): | |
0df68c9f | 1046 | """ |
e9d6f3a4 | 1047 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1048 | |
0df68c9f RD |
1049 | Test for inequality of wx.Point objects. |
1050 | """ | |
54f9ee45 | 1051 | return _core_.Point___ne__(*args, **kwargs) |
e811c8ce RD |
1052 | |
1053 | def __add__(*args, **kwargs): | |
0df68c9f | 1054 | """ |
a95a7133 | 1055 | __add__(self, Point pt) -> Point |
e811c8ce | 1056 | |
0df68c9f RD |
1057 | Add pt's proprties to this and return the result. |
1058 | """ | |
54f9ee45 | 1059 | return _core_.Point___add__(*args, **kwargs) |
e811c8ce RD |
1060 | |
1061 | def __sub__(*args, **kwargs): | |
0df68c9f | 1062 | """ |
a95a7133 | 1063 | __sub__(self, Point pt) -> Point |
e811c8ce | 1064 | |
0df68c9f RD |
1065 | Subtract pt's proprties from this and return the result |
1066 | """ | |
54f9ee45 | 1067 | return _core_.Point___sub__(*args, **kwargs) |
e811c8ce RD |
1068 | |
1069 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1070 | """ |
a95a7133 | 1071 | __iadd__(self, Point pt) -> Point |
e811c8ce | 1072 | |
0df68c9f RD |
1073 | Add pt to this object. |
1074 | """ | |
54f9ee45 | 1075 | return _core_.Point___iadd__(*args, **kwargs) |
e811c8ce RD |
1076 | |
1077 | def __isub__(*args, **kwargs): | |
0df68c9f | 1078 | """ |
a95a7133 | 1079 | __isub__(self, Point pt) -> Point |
e811c8ce | 1080 | |
0df68c9f RD |
1081 | Subtract pt from this object. |
1082 | """ | |
54f9ee45 | 1083 | return _core_.Point___isub__(*args, **kwargs) |
e811c8ce RD |
1084 | |
1085 | def Set(*args, **kwargs): | |
0df68c9f | 1086 | """ |
a95a7133 | 1087 | Set(self, long x, long y) |
e811c8ce | 1088 | |
0df68c9f RD |
1089 | Set both the x and y properties |
1090 | """ | |
54f9ee45 | 1091 | return _core_.Point_Set(*args, **kwargs) |
e811c8ce RD |
1092 | |
1093 | def Get(*args, **kwargs): | |
0df68c9f RD |
1094 | """ |
1095 | Get() -> (x,y) | |
e811c8ce | 1096 | |
0df68c9f RD |
1097 | Return the x and y properties as a tuple. |
1098 | """ | |
54f9ee45 | 1099 | return _core_.Point_Get(*args, **kwargs) |
e811c8ce | 1100 | |
41e2b43e | 1101 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1102 | def __str__(self): return str(self.Get()) |
1103 | def __repr__(self): return 'wx.Point'+str(self.Get()) | |
1104 | def __len__(self): return len(self.Get()) | |
1105 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1106 | def __setitem__(self, index, val): |
1107 | if index == 0: self.x = val | |
1108 | elif index == 1: self.y = val | |
1109 | else: raise IndexError | |
e811c8ce | 1110 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
1111 | __safe_for_unpickling__ = True |
1112 | def __reduce__(self): return (wx.Point, self.Get()) | |
d14a1e28 | 1113 | |
2131d850 | 1114 | _core_.Point_swigregister(Point) |
d14a1e28 RD |
1115 | |
1116 | #--------------------------------------------------------------------------- | |
1117 | ||
1118 | class Rect(object): | |
0df68c9f | 1119 | """ |
41e2b43e RD |
1120 | A class for representing and manipulating rectangles. It has x, y, |
1121 | width and height properties. In wxPython most palces that expect a | |
1122 | wx.Rect can also accept a (x,y,width,height) tuple. | |
0df68c9f | 1123 | """ |
0085ce49 RD |
1124 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1125 | __repr__ = _swig_repr | |
1126 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1127 | """ |
a95a7133 | 1128 | __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect |
e811c8ce | 1129 | |
0df68c9f RD |
1130 | Create a new Rect object. |
1131 | """ | |
0085ce49 RD |
1132 | _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs)) |
1133 | __swig_destroy__ = _core_.delete_Rect | |
1134 | __del__ = lambda self : None; | |
e811c8ce | 1135 | def GetX(*args, **kwargs): |
a95a7133 | 1136 | """GetX(self) -> int""" |
54f9ee45 | 1137 | return _core_.Rect_GetX(*args, **kwargs) |
e811c8ce RD |
1138 | |
1139 | def SetX(*args, **kwargs): | |
a95a7133 | 1140 | """SetX(self, int x)""" |
54f9ee45 | 1141 | return _core_.Rect_SetX(*args, **kwargs) |
e811c8ce RD |
1142 | |
1143 | def GetY(*args, **kwargs): | |
a95a7133 | 1144 | """GetY(self) -> int""" |
54f9ee45 | 1145 | return _core_.Rect_GetY(*args, **kwargs) |
e811c8ce RD |
1146 | |
1147 | def SetY(*args, **kwargs): | |
a95a7133 | 1148 | """SetY(self, int y)""" |
54f9ee45 | 1149 | return _core_.Rect_SetY(*args, **kwargs) |
e811c8ce RD |
1150 | |
1151 | def GetWidth(*args, **kwargs): | |
a95a7133 | 1152 | """GetWidth(self) -> int""" |
54f9ee45 | 1153 | return _core_.Rect_GetWidth(*args, **kwargs) |
e811c8ce RD |
1154 | |
1155 | def SetWidth(*args, **kwargs): | |
a95a7133 | 1156 | """SetWidth(self, int w)""" |
54f9ee45 | 1157 | return _core_.Rect_SetWidth(*args, **kwargs) |
e811c8ce RD |
1158 | |
1159 | def GetHeight(*args, **kwargs): | |
a95a7133 | 1160 | """GetHeight(self) -> int""" |
54f9ee45 | 1161 | return _core_.Rect_GetHeight(*args, **kwargs) |
e811c8ce RD |
1162 | |
1163 | def SetHeight(*args, **kwargs): | |
a95a7133 | 1164 | """SetHeight(self, int h)""" |
54f9ee45 | 1165 | return _core_.Rect_SetHeight(*args, **kwargs) |
e811c8ce RD |
1166 | |
1167 | def GetPosition(*args, **kwargs): | |
a95a7133 | 1168 | """GetPosition(self) -> Point""" |
54f9ee45 | 1169 | return _core_.Rect_GetPosition(*args, **kwargs) |
e811c8ce RD |
1170 | |
1171 | def SetPosition(*args, **kwargs): | |
a95a7133 | 1172 | """SetPosition(self, Point p)""" |
54f9ee45 | 1173 | return _core_.Rect_SetPosition(*args, **kwargs) |
e811c8ce RD |
1174 | |
1175 | def GetSize(*args, **kwargs): | |
a95a7133 | 1176 | """GetSize(self) -> Size""" |
54f9ee45 | 1177 | return _core_.Rect_GetSize(*args, **kwargs) |
e811c8ce RD |
1178 | |
1179 | def SetSize(*args, **kwargs): | |
a95a7133 | 1180 | """SetSize(self, Size s)""" |
54f9ee45 | 1181 | return _core_.Rect_SetSize(*args, **kwargs) |
e811c8ce | 1182 | |
aff4cc5c RD |
1183 | def IsEmpty(*args, **kwargs): |
1184 | """IsEmpty(self) -> bool""" | |
1185 | return _core_.Rect_IsEmpty(*args, **kwargs) | |
1186 | ||
c9c7117a | 1187 | def GetTopLeft(*args, **kwargs): |
a95a7133 | 1188 | """GetTopLeft(self) -> Point""" |
54f9ee45 | 1189 | return _core_.Rect_GetTopLeft(*args, **kwargs) |
c9c7117a RD |
1190 | |
1191 | def SetTopLeft(*args, **kwargs): | |
a95a7133 | 1192 | """SetTopLeft(self, Point p)""" |
54f9ee45 | 1193 | return _core_.Rect_SetTopLeft(*args, **kwargs) |
c9c7117a RD |
1194 | |
1195 | def GetBottomRight(*args, **kwargs): | |
a95a7133 | 1196 | """GetBottomRight(self) -> Point""" |
54f9ee45 | 1197 | return _core_.Rect_GetBottomRight(*args, **kwargs) |
c9c7117a RD |
1198 | |
1199 | def SetBottomRight(*args, **kwargs): | |
a95a7133 | 1200 | """SetBottomRight(self, Point p)""" |
54f9ee45 | 1201 | return _core_.Rect_SetBottomRight(*args, **kwargs) |
c9c7117a | 1202 | |
5acb46e0 RD |
1203 | def GetTopRight(*args, **kwargs): |
1204 | """GetTopRight(self) -> Point""" | |
1205 | return _core_.Rect_GetTopRight(*args, **kwargs) | |
1206 | ||
1207 | def SetTopRight(*args, **kwargs): | |
1208 | """SetTopRight(self, Point p)""" | |
1209 | return _core_.Rect_SetTopRight(*args, **kwargs) | |
1210 | ||
1211 | def GetBottomLeft(*args, **kwargs): | |
1212 | """GetBottomLeft(self) -> Point""" | |
1213 | return _core_.Rect_GetBottomLeft(*args, **kwargs) | |
1214 | ||
1215 | def SetBottomLeft(*args, **kwargs): | |
1216 | """SetBottomLeft(self, Point p)""" | |
1217 | return _core_.Rect_SetBottomLeft(*args, **kwargs) | |
1218 | ||
e811c8ce | 1219 | def GetLeft(*args, **kwargs): |
a95a7133 | 1220 | """GetLeft(self) -> int""" |
54f9ee45 | 1221 | return _core_.Rect_GetLeft(*args, **kwargs) |
e811c8ce RD |
1222 | |
1223 | def GetTop(*args, **kwargs): | |
a95a7133 | 1224 | """GetTop(self) -> int""" |
54f9ee45 | 1225 | return _core_.Rect_GetTop(*args, **kwargs) |
e811c8ce RD |
1226 | |
1227 | def GetBottom(*args, **kwargs): | |
a95a7133 | 1228 | """GetBottom(self) -> int""" |
54f9ee45 | 1229 | return _core_.Rect_GetBottom(*args, **kwargs) |
e811c8ce RD |
1230 | |
1231 | def GetRight(*args, **kwargs): | |
a95a7133 | 1232 | """GetRight(self) -> int""" |
54f9ee45 | 1233 | return _core_.Rect_GetRight(*args, **kwargs) |
e811c8ce RD |
1234 | |
1235 | def SetLeft(*args, **kwargs): | |
a95a7133 | 1236 | """SetLeft(self, int left)""" |
54f9ee45 | 1237 | return _core_.Rect_SetLeft(*args, **kwargs) |
e811c8ce RD |
1238 | |
1239 | def SetRight(*args, **kwargs): | |
a95a7133 | 1240 | """SetRight(self, int right)""" |
54f9ee45 | 1241 | return _core_.Rect_SetRight(*args, **kwargs) |
e811c8ce RD |
1242 | |
1243 | def SetTop(*args, **kwargs): | |
a95a7133 | 1244 | """SetTop(self, int top)""" |
54f9ee45 | 1245 | return _core_.Rect_SetTop(*args, **kwargs) |
e811c8ce RD |
1246 | |
1247 | def SetBottom(*args, **kwargs): | |
a95a7133 | 1248 | """SetBottom(self, int bottom)""" |
54f9ee45 | 1249 | return _core_.Rect_SetBottom(*args, **kwargs) |
e811c8ce RD |
1250 | |
1251 | position = property(GetPosition, SetPosition) | |
1252 | size = property(GetSize, SetSize) | |
1253 | left = property(GetLeft, SetLeft) | |
1254 | right = property(GetRight, SetRight) | |
1255 | top = property(GetTop, SetTop) | |
1256 | bottom = property(GetBottom, SetBottom) | |
1257 | ||
1258 | def Inflate(*args, **kwargs): | |
0df68c9f | 1259 | """ |
a95a7133 | 1260 | Inflate(self, int dx, int dy) -> Rect |
e811c8ce | 1261 | |
8e738329 RD |
1262 | Increases the size of the rectangle. |
1263 | ||
1264 | The left border is moved farther left and the right border is moved | |
1265 | farther right by ``dx``. The upper border is moved farther up and the | |
1266 | bottom border is moved farther down by ``dy``. (Note the the width and | |
1267 | height of the rectangle thus change by ``2*dx`` and ``2*dy``, | |
1268 | respectively.) If one or both of ``dx`` and ``dy`` are negative, the | |
1269 | opposite happens: the rectangle size decreases in the respective | |
1270 | direction. | |
1271 | ||
1272 | The change is made to the rectangle inplace, if instead you need a | |
1273 | copy that is inflated, preserving the original then make the copy | |
1274 | first:: | |
1275 | ||
1276 | copy = wx.Rect(*original) | |
1277 | copy.Inflate(10,15) | |
1278 | ||
1279 | ||
0df68c9f | 1280 | """ |
54f9ee45 | 1281 | return _core_.Rect_Inflate(*args, **kwargs) |
e811c8ce RD |
1282 | |
1283 | def Deflate(*args, **kwargs): | |
0df68c9f | 1284 | """ |
a95a7133 | 1285 | Deflate(self, int dx, int dy) -> Rect |
e811c8ce | 1286 | |
8e738329 RD |
1287 | Decrease the rectangle size. This method is the opposite of `Inflate` |
1288 | in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to | |
1289 | `Inflate` for a full description. | |
0df68c9f | 1290 | """ |
54f9ee45 | 1291 | return _core_.Rect_Deflate(*args, **kwargs) |
e811c8ce RD |
1292 | |
1293 | def OffsetXY(*args, **kwargs): | |
0df68c9f | 1294 | """ |
a95a7133 | 1295 | OffsetXY(self, int dx, int dy) |
e811c8ce | 1296 | |
41e2b43e RD |
1297 | Moves the rectangle by the specified offset. If dx is positive, the |
1298 | rectangle is moved to the right, if dy is positive, it is moved to the | |
1299 | bottom, otherwise it is moved to the left or top respectively. | |
0df68c9f | 1300 | """ |
54f9ee45 | 1301 | return _core_.Rect_OffsetXY(*args, **kwargs) |
e811c8ce RD |
1302 | |
1303 | def Offset(*args, **kwargs): | |
0df68c9f | 1304 | """ |
a95a7133 | 1305 | Offset(self, Point pt) |
e811c8ce | 1306 | |
b1fcee84 | 1307 | Same as `OffsetXY` but uses dx,dy from Point |
0df68c9f | 1308 | """ |
54f9ee45 | 1309 | return _core_.Rect_Offset(*args, **kwargs) |
e811c8ce RD |
1310 | |
1311 | def Intersect(*args, **kwargs): | |
0df68c9f | 1312 | """ |
a95a7133 | 1313 | Intersect(self, Rect rect) -> Rect |
e811c8ce | 1314 | |
5cbf236d | 1315 | Returns the intersectsion of this rectangle and rect. |
0df68c9f | 1316 | """ |
54f9ee45 | 1317 | return _core_.Rect_Intersect(*args, **kwargs) |
e811c8ce | 1318 | |
5cbf236d RD |
1319 | def Union(*args, **kwargs): |
1320 | """ | |
1321 | Union(self, Rect rect) -> Rect | |
1322 | ||
1323 | Returns the union of this rectangle and rect. | |
1324 | """ | |
1325 | return _core_.Rect_Union(*args, **kwargs) | |
1326 | ||
e811c8ce | 1327 | def __add__(*args, **kwargs): |
0df68c9f | 1328 | """ |
a95a7133 | 1329 | __add__(self, Rect rect) -> Rect |
e811c8ce | 1330 | |
0df68c9f RD |
1331 | Add the properties of rect to this rectangle and return the result. |
1332 | """ | |
54f9ee45 | 1333 | return _core_.Rect___add__(*args, **kwargs) |
e811c8ce RD |
1334 | |
1335 | def __iadd__(*args, **kwargs): | |
0df68c9f | 1336 | """ |
a95a7133 | 1337 | __iadd__(self, Rect rect) -> Rect |
e811c8ce | 1338 | |
0df68c9f RD |
1339 | Add the properties of rect to this rectangle, updating this rectangle. |
1340 | """ | |
54f9ee45 | 1341 | return _core_.Rect___iadd__(*args, **kwargs) |
e811c8ce RD |
1342 | |
1343 | def __eq__(*args, **kwargs): | |
0df68c9f | 1344 | """ |
e9d6f3a4 | 1345 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1346 | |
e9d6f3a4 | 1347 | Test for equality of wx.Rect objects. |
0df68c9f | 1348 | """ |
54f9ee45 | 1349 | return _core_.Rect___eq__(*args, **kwargs) |
e811c8ce RD |
1350 | |
1351 | def __ne__(*args, **kwargs): | |
0df68c9f | 1352 | """ |
e9d6f3a4 | 1353 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1354 | |
e9d6f3a4 | 1355 | Test for inequality of wx.Rect objects. |
0df68c9f | 1356 | """ |
54f9ee45 | 1357 | return _core_.Rect___ne__(*args, **kwargs) |
e811c8ce | 1358 | |
33d6fd3b | 1359 | def ContainsXY(*args, **kwargs): |
0df68c9f | 1360 | """ |
33d6fd3b | 1361 | ContainsXY(self, int x, int y) -> bool |
e811c8ce | 1362 | |
33d6fd3b | 1363 | Return True if the point is inside the rect. |
0df68c9f | 1364 | """ |
33d6fd3b | 1365 | return _core_.Rect_ContainsXY(*args, **kwargs) |
e811c8ce | 1366 | |
33d6fd3b | 1367 | def Contains(*args, **kwargs): |
0df68c9f | 1368 | """ |
33d6fd3b | 1369 | Contains(self, Point pt) -> bool |
e811c8ce | 1370 | |
33d6fd3b | 1371 | Return True if the point is inside the rect. |
0df68c9f | 1372 | """ |
33d6fd3b | 1373 | return _core_.Rect_Contains(*args, **kwargs) |
e811c8ce | 1374 | |
33d6fd3b | 1375 | def ContainsRect(*args, **kwargs): |
fc46b7f3 | 1376 | """ |
33d6fd3b | 1377 | ContainsRect(self, Rect rect) -> bool |
fc46b7f3 RD |
1378 | |
1379 | Returns ``True`` if the given rectangle is completely inside this | |
1380 | rectangle or touches its boundary. | |
1381 | """ | |
33d6fd3b RD |
1382 | return _core_.Rect_ContainsRect(*args, **kwargs) |
1383 | ||
72ef6efb RD |
1384 | #Inside = wx._deprecated(Contains, "Use `Contains` instead.") |
1385 | #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.") | |
1386 | #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.") | |
1387 | Inside = Contains | |
1388 | InsideXY = ContainsXY | |
1389 | InsideRect = ContainsRect | |
fc46b7f3 | 1390 | |
e811c8ce | 1391 | def Intersects(*args, **kwargs): |
0df68c9f | 1392 | """ |
a95a7133 | 1393 | Intersects(self, Rect rect) -> bool |
e811c8ce | 1394 | |
0df68c9f RD |
1395 | Returns True if the rectangles have a non empty intersection. |
1396 | """ | |
54f9ee45 | 1397 | return _core_.Rect_Intersects(*args, **kwargs) |
e811c8ce | 1398 | |
b1fcee84 RD |
1399 | def CenterIn(*args, **kwargs): |
1400 | """ | |
1401 | CenterIn(self, Rect r, int dir=BOTH) -> Rect | |
1402 | ||
1403 | Center this rectangle within the one passed to the method, which is | |
1404 | usually, but not necessarily, the larger one. | |
1405 | """ | |
1406 | return _core_.Rect_CenterIn(*args, **kwargs) | |
1407 | ||
1408 | CentreIn = CenterIn | |
54f9ee45 RD |
1409 | x = property(_core_.Rect_x_get, _core_.Rect_x_set) |
1410 | y = property(_core_.Rect_y_get, _core_.Rect_y_set) | |
1411 | width = property(_core_.Rect_width_get, _core_.Rect_width_set) | |
1412 | height = property(_core_.Rect_height_get, _core_.Rect_height_set) | |
e811c8ce | 1413 | def Set(*args, **kwargs): |
0df68c9f | 1414 | """ |
a95a7133 | 1415 | Set(self, int x=0, int y=0, int width=0, int height=0) |
e811c8ce | 1416 | |
0df68c9f RD |
1417 | Set all rectangle properties. |
1418 | """ | |
54f9ee45 | 1419 | return _core_.Rect_Set(*args, **kwargs) |
e811c8ce RD |
1420 | |
1421 | def Get(*args, **kwargs): | |
0df68c9f RD |
1422 | """ |
1423 | Get() -> (x,y,width,height) | |
e811c8ce | 1424 | |
0df68c9f RD |
1425 | Return the rectangle properties as a tuple. |
1426 | """ | |
54f9ee45 | 1427 | return _core_.Rect_Get(*args, **kwargs) |
e811c8ce | 1428 | |
41e2b43e | 1429 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1430 | def __str__(self): return str(self.Get()) |
1431 | def __repr__(self): return 'wx.Rect'+str(self.Get()) | |
1432 | def __len__(self): return len(self.Get()) | |
1433 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
1434 | def __setitem__(self, index, val): |
1435 | if index == 0: self.x = val | |
1436 | elif index == 1: self.y = val | |
1437 | elif index == 2: self.width = val | |
1438 | elif index == 3: self.height = val | |
1439 | else: raise IndexError | |
e811c8ce | 1440 | def __nonzero__(self): return self.Get() != (0,0,0,0) |
74e96f3d RD |
1441 | __safe_for_unpickling__ = True |
1442 | def __reduce__(self): return (wx.Rect, self.Get()) | |
d14a1e28 | 1443 | |
33d6fd3b RD |
1444 | Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`") |
1445 | BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`") | |
5acb46e0 | 1446 | BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`") |
33d6fd3b RD |
1447 | Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`") |
1448 | Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`") | |
1449 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
1450 | Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`") | |
1451 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
1452 | Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`") | |
1453 | TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`") | |
5acb46e0 | 1454 | TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`") |
33d6fd3b RD |
1455 | Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`") |
1456 | X = property(GetX,SetX,doc="See `GetX` and `SetX`") | |
1457 | Y = property(GetY,SetY,doc="See `GetY` and `SetY`") | |
1458 | Empty = property(IsEmpty,doc="See `IsEmpty`") | |
2131d850 | 1459 | _core_.Rect_swigregister(Rect) |
d14a1e28 RD |
1460 | |
1461 | def RectPP(*args, **kwargs): | |
0df68c9f RD |
1462 | """ |
1463 | RectPP(Point topLeft, Point bottomRight) -> Rect | |
e811c8ce | 1464 | |
0df68c9f RD |
1465 | Create a new Rect object from Points representing two corners. |
1466 | """ | |
54f9ee45 | 1467 | val = _core_.new_RectPP(*args, **kwargs) |
d14a1e28 RD |
1468 | return val |
1469 | ||
1470 | def RectPS(*args, **kwargs): | |
0df68c9f RD |
1471 | """ |
1472 | RectPS(Point pos, Size size) -> Rect | |
e811c8ce | 1473 | |
0df68c9f RD |
1474 | Create a new Rect from a position and size. |
1475 | """ | |
54f9ee45 | 1476 | val = _core_.new_RectPS(*args, **kwargs) |
d14a1e28 RD |
1477 | return val |
1478 | ||
d3b6e4ff RD |
1479 | def RectS(*args, **kwargs): |
1480 | """ | |
1481 | RectS(Size size) -> Rect | |
1482 | ||
1483 | Create a new Rect from a size only. | |
1484 | """ | |
1485 | val = _core_.new_RectS(*args, **kwargs) | |
d3b6e4ff RD |
1486 | return val |
1487 | ||
d14a1e28 | 1488 | |
e811c8ce | 1489 | def IntersectRect(*args, **kwargs): |
0085ce49 | 1490 | """ |
0df68c9f | 1491 | IntersectRect(Rect r1, Rect r2) -> Rect |
e811c8ce | 1492 | |
0df68c9f RD |
1493 | Calculate and return the intersection of r1 and r2. |
1494 | """ | |
0085ce49 | 1495 | return _core_.IntersectRect(*args, **kwargs) |
d14a1e28 RD |
1496 | #--------------------------------------------------------------------------- |
1497 | ||
1498 | class Point2D(object): | |
41e2b43e RD |
1499 | """ |
1500 | wx.Point2Ds represent a point or a vector in a 2d coordinate system | |
1501 | with floating point values. | |
1502 | """ | |
0085ce49 RD |
1503 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1504 | __repr__ = _swig_repr | |
1505 | def __init__(self, *args, **kwargs): | |
0df68c9f | 1506 | """ |
a95a7133 | 1507 | __init__(self, double x=0.0, double y=0.0) -> Point2D |
e811c8ce | 1508 | |
0df68c9f RD |
1509 | Create a w.Point2D object. |
1510 | """ | |
0085ce49 | 1511 | _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs)) |
b39fe951 RD |
1512 | __swig_destroy__ = _core_.delete_Point2D |
1513 | __del__ = lambda self : None; | |
e811c8ce | 1514 | def GetFloor(*args, **kwargs): |
fd2dc343 RD |
1515 | """ |
1516 | GetFloor() -> (x,y) | |
1517 | ||
1518 | Convert to integer | |
1519 | """ | |
54f9ee45 | 1520 | return _core_.Point2D_GetFloor(*args, **kwargs) |
e811c8ce RD |
1521 | |
1522 | def GetRounded(*args, **kwargs): | |
fd2dc343 RD |
1523 | """ |
1524 | GetRounded() -> (x,y) | |
1525 | ||
1526 | Convert to integer | |
1527 | """ | |
54f9ee45 | 1528 | return _core_.Point2D_GetRounded(*args, **kwargs) |
e811c8ce RD |
1529 | |
1530 | def GetVectorLength(*args, **kwargs): | |
a95a7133 | 1531 | """GetVectorLength(self) -> double""" |
54f9ee45 | 1532 | return _core_.Point2D_GetVectorLength(*args, **kwargs) |
e811c8ce RD |
1533 | |
1534 | def GetVectorAngle(*args, **kwargs): | |
a95a7133 | 1535 | """GetVectorAngle(self) -> double""" |
54f9ee45 | 1536 | return _core_.Point2D_GetVectorAngle(*args, **kwargs) |
e811c8ce RD |
1537 | |
1538 | def SetVectorLength(*args, **kwargs): | |
a95a7133 | 1539 | """SetVectorLength(self, double length)""" |
54f9ee45 | 1540 | return _core_.Point2D_SetVectorLength(*args, **kwargs) |
e811c8ce RD |
1541 | |
1542 | def SetVectorAngle(*args, **kwargs): | |
a95a7133 | 1543 | """SetVectorAngle(self, double degrees)""" |
54f9ee45 | 1544 | return _core_.Point2D_SetVectorAngle(*args, **kwargs) |
e811c8ce | 1545 | |
d14a1e28 RD |
1546 | def SetPolarCoordinates(self, angle, length): |
1547 | self.SetVectorLength(length) | |
1548 | self.SetVectorAngle(angle) | |
1549 | def Normalize(self): | |
1550 | self.SetVectorLength(1.0) | |
1551 | ||
e811c8ce | 1552 | def GetDistance(*args, **kwargs): |
a95a7133 | 1553 | """GetDistance(self, Point2D pt) -> double""" |
54f9ee45 | 1554 | return _core_.Point2D_GetDistance(*args, **kwargs) |
e811c8ce RD |
1555 | |
1556 | def GetDistanceSquare(*args, **kwargs): | |
a95a7133 | 1557 | """GetDistanceSquare(self, Point2D pt) -> double""" |
54f9ee45 | 1558 | return _core_.Point2D_GetDistanceSquare(*args, **kwargs) |
e811c8ce RD |
1559 | |
1560 | def GetDotProduct(*args, **kwargs): | |
a95a7133 | 1561 | """GetDotProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1562 | return _core_.Point2D_GetDotProduct(*args, **kwargs) |
e811c8ce RD |
1563 | |
1564 | def GetCrossProduct(*args, **kwargs): | |
a95a7133 | 1565 | """GetCrossProduct(self, Point2D vec) -> double""" |
54f9ee45 | 1566 | return _core_.Point2D_GetCrossProduct(*args, **kwargs) |
e811c8ce RD |
1567 | |
1568 | def __neg__(*args, **kwargs): | |
0df68c9f | 1569 | """ |
a95a7133 | 1570 | __neg__(self) -> Point2D |
e811c8ce | 1571 | |
0df68c9f RD |
1572 | the reflection of this point |
1573 | """ | |
54f9ee45 | 1574 | return _core_.Point2D___neg__(*args, **kwargs) |
e811c8ce RD |
1575 | |
1576 | def __iadd__(*args, **kwargs): | |
a95a7133 | 1577 | """__iadd__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1578 | return _core_.Point2D___iadd__(*args, **kwargs) |
e811c8ce RD |
1579 | |
1580 | def __isub__(*args, **kwargs): | |
a95a7133 | 1581 | """__isub__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1582 | return _core_.Point2D___isub__(*args, **kwargs) |
e811c8ce RD |
1583 | |
1584 | def __imul__(*args, **kwargs): | |
a95a7133 | 1585 | """__imul__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1586 | return _core_.Point2D___imul__(*args, **kwargs) |
e811c8ce RD |
1587 | |
1588 | def __idiv__(*args, **kwargs): | |
a95a7133 | 1589 | """__idiv__(self, Point2D pt) -> Point2D""" |
54f9ee45 | 1590 | return _core_.Point2D___idiv__(*args, **kwargs) |
e811c8ce RD |
1591 | |
1592 | def __eq__(*args, **kwargs): | |
0df68c9f | 1593 | """ |
e9d6f3a4 | 1594 | __eq__(self, PyObject other) -> bool |
e811c8ce | 1595 | |
e9d6f3a4 | 1596 | Test for equality of wx.Point2D objects. |
0df68c9f | 1597 | """ |
54f9ee45 | 1598 | return _core_.Point2D___eq__(*args, **kwargs) |
e811c8ce RD |
1599 | |
1600 | def __ne__(*args, **kwargs): | |
0df68c9f | 1601 | """ |
e9d6f3a4 | 1602 | __ne__(self, PyObject other) -> bool |
e811c8ce | 1603 | |
e9d6f3a4 | 1604 | Test for inequality of wx.Point2D objects. |
0df68c9f | 1605 | """ |
54f9ee45 | 1606 | return _core_.Point2D___ne__(*args, **kwargs) |
e811c8ce | 1607 | |
54f9ee45 RD |
1608 | x = property(_core_.Point2D_x_get, _core_.Point2D_x_set) |
1609 | y = property(_core_.Point2D_y_get, _core_.Point2D_y_set) | |
e811c8ce | 1610 | def Set(*args, **kwargs): |
a95a7133 | 1611 | """Set(self, double x=0, double y=0)""" |
54f9ee45 | 1612 | return _core_.Point2D_Set(*args, **kwargs) |
e811c8ce RD |
1613 | |
1614 | def Get(*args, **kwargs): | |
0df68c9f RD |
1615 | """ |
1616 | Get() -> (x,y) | |
e811c8ce | 1617 | |
0df68c9f RD |
1618 | Return x and y properties as a tuple. |
1619 | """ | |
54f9ee45 | 1620 | return _core_.Point2D_Get(*args, **kwargs) |
e811c8ce | 1621 | |
41e2b43e | 1622 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
1623 | def __str__(self): return str(self.Get()) |
1624 | def __repr__(self): return 'wx.Point2D'+str(self.Get()) | |
1625 | def __len__(self): return len(self.Get()) | |
1626 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 | 1627 | def __setitem__(self, index, val): |
e811c8ce RD |
1628 | if index == 0: self.x = val |
1629 | elif index == 1: self.y = val | |
d14a1e28 | 1630 | else: raise IndexError |
e811c8ce | 1631 | def __nonzero__(self): return self.Get() != (0.0, 0.0) |
74e96f3d RD |
1632 | __safe_for_unpickling__ = True |
1633 | def __reduce__(self): return (wx.Point2D, self.Get()) | |
d14a1e28 | 1634 | |
33d6fd3b RD |
1635 | Floor = property(GetFloor,doc="See `GetFloor`") |
1636 | Rounded = property(GetRounded,doc="See `GetRounded`") | |
1637 | VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`") | |
1638 | VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`") | |
2131d850 | 1639 | _core_.Point2D_swigregister(Point2D) |
d14a1e28 RD |
1640 | |
1641 | def Point2DCopy(*args, **kwargs): | |
0df68c9f RD |
1642 | """ |
1643 | Point2DCopy(Point2D pt) -> Point2D | |
e811c8ce | 1644 | |
0df68c9f RD |
1645 | Create a w.Point2D object. |
1646 | """ | |
54f9ee45 | 1647 | val = _core_.new_Point2DCopy(*args, **kwargs) |
d14a1e28 RD |
1648 | return val |
1649 | ||
1650 | def Point2DFromPoint(*args, **kwargs): | |
0df68c9f RD |
1651 | """ |
1652 | Point2DFromPoint(Point pt) -> Point2D | |
e811c8ce | 1653 | |
0df68c9f RD |
1654 | Create a w.Point2D object. |
1655 | """ | |
54f9ee45 | 1656 | val = _core_.new_Point2DFromPoint(*args, **kwargs) |
d14a1e28 RD |
1657 | return val |
1658 | ||
1659 | #--------------------------------------------------------------------------- | |
1660 | ||
70d7cb34 RD |
1661 | Inside = _core_.Inside |
1662 | OutLeft = _core_.OutLeft | |
1663 | OutRight = _core_.OutRight | |
1664 | OutTop = _core_.OutTop | |
1665 | OutBottom = _core_.OutBottom | |
1666 | class Rect2D(object): | |
1667 | """ | |
1668 | wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system | |
1669 | with floating point component values. | |
1670 | """ | |
1671 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
1672 | __repr__ = _swig_repr | |
1673 | def __init__(self, *args, **kwargs): | |
1674 | """ | |
1675 | __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D | |
1676 | ||
1677 | wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system | |
1678 | with floating point component values. | |
1679 | """ | |
1680 | _core_.Rect2D_swiginit(self,_core_.new_Rect2D(*args, **kwargs)) | |
1681 | __swig_destroy__ = _core_.delete_Rect2D | |
1682 | __del__ = lambda self : None; | |
1683 | def GetPosition(*args, **kwargs): | |
1684 | """GetPosition(self) -> Point2D""" | |
1685 | return _core_.Rect2D_GetPosition(*args, **kwargs) | |
1686 | ||
1687 | def GetSize(*args, **kwargs): | |
1688 | """GetSize(self) -> Size""" | |
1689 | return _core_.Rect2D_GetSize(*args, **kwargs) | |
1690 | ||
1691 | def GetLeft(*args, **kwargs): | |
1692 | """GetLeft(self) -> wxDouble""" | |
1693 | return _core_.Rect2D_GetLeft(*args, **kwargs) | |
1694 | ||
1695 | def SetLeft(*args, **kwargs): | |
1696 | """SetLeft(self, wxDouble n)""" | |
1697 | return _core_.Rect2D_SetLeft(*args, **kwargs) | |
1698 | ||
1699 | def MoveLeftTo(*args, **kwargs): | |
1700 | """MoveLeftTo(self, wxDouble n)""" | |
1701 | return _core_.Rect2D_MoveLeftTo(*args, **kwargs) | |
1702 | ||
1703 | def GetTop(*args, **kwargs): | |
1704 | """GetTop(self) -> wxDouble""" | |
1705 | return _core_.Rect2D_GetTop(*args, **kwargs) | |
1706 | ||
1707 | def SetTop(*args, **kwargs): | |
1708 | """SetTop(self, wxDouble n)""" | |
1709 | return _core_.Rect2D_SetTop(*args, **kwargs) | |
1710 | ||
1711 | def MoveTopTo(*args, **kwargs): | |
1712 | """MoveTopTo(self, wxDouble n)""" | |
1713 | return _core_.Rect2D_MoveTopTo(*args, **kwargs) | |
1714 | ||
1715 | def GetBottom(*args, **kwargs): | |
1716 | """GetBottom(self) -> wxDouble""" | |
1717 | return _core_.Rect2D_GetBottom(*args, **kwargs) | |
1718 | ||
1719 | def SetBottom(*args, **kwargs): | |
1720 | """SetBottom(self, wxDouble n)""" | |
1721 | return _core_.Rect2D_SetBottom(*args, **kwargs) | |
1722 | ||
1723 | def MoveBottomTo(*args, **kwargs): | |
1724 | """MoveBottomTo(self, wxDouble n)""" | |
1725 | return _core_.Rect2D_MoveBottomTo(*args, **kwargs) | |
1726 | ||
1727 | def GetRight(*args, **kwargs): | |
1728 | """GetRight(self) -> wxDouble""" | |
1729 | return _core_.Rect2D_GetRight(*args, **kwargs) | |
1730 | ||
1731 | def SetRight(*args, **kwargs): | |
1732 | """SetRight(self, wxDouble n)""" | |
1733 | return _core_.Rect2D_SetRight(*args, **kwargs) | |
1734 | ||
1735 | def MoveRightTo(*args, **kwargs): | |
1736 | """MoveRightTo(self, wxDouble n)""" | |
1737 | return _core_.Rect2D_MoveRightTo(*args, **kwargs) | |
1738 | ||
1739 | def GetLeftTop(*args, **kwargs): | |
1740 | """GetLeftTop(self) -> Point2D""" | |
1741 | return _core_.Rect2D_GetLeftTop(*args, **kwargs) | |
1742 | ||
1743 | def SetLeftTop(*args, **kwargs): | |
1744 | """SetLeftTop(self, Point2D pt)""" | |
1745 | return _core_.Rect2D_SetLeftTop(*args, **kwargs) | |
1746 | ||
1747 | def MoveLeftTopTo(*args, **kwargs): | |
1748 | """MoveLeftTopTo(self, Point2D pt)""" | |
1749 | return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs) | |
1750 | ||
1751 | def GetLeftBottom(*args, **kwargs): | |
1752 | """GetLeftBottom(self) -> Point2D""" | |
1753 | return _core_.Rect2D_GetLeftBottom(*args, **kwargs) | |
1754 | ||
1755 | def SetLeftBottom(*args, **kwargs): | |
1756 | """SetLeftBottom(self, Point2D pt)""" | |
1757 | return _core_.Rect2D_SetLeftBottom(*args, **kwargs) | |
1758 | ||
1759 | def MoveLeftBottomTo(*args, **kwargs): | |
1760 | """MoveLeftBottomTo(self, Point2D pt)""" | |
1761 | return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs) | |
1762 | ||
1763 | def GetRightTop(*args, **kwargs): | |
1764 | """GetRightTop(self) -> Point2D""" | |
1765 | return _core_.Rect2D_GetRightTop(*args, **kwargs) | |
1766 | ||
1767 | def SetRightTop(*args, **kwargs): | |
1768 | """SetRightTop(self, Point2D pt)""" | |
1769 | return _core_.Rect2D_SetRightTop(*args, **kwargs) | |
1770 | ||
1771 | def MoveRightTopTo(*args, **kwargs): | |
1772 | """MoveRightTopTo(self, Point2D pt)""" | |
1773 | return _core_.Rect2D_MoveRightTopTo(*args, **kwargs) | |
1774 | ||
1775 | def GetRightBottom(*args, **kwargs): | |
1776 | """GetRightBottom(self) -> Point2D""" | |
1777 | return _core_.Rect2D_GetRightBottom(*args, **kwargs) | |
1778 | ||
1779 | def SetRightBottom(*args, **kwargs): | |
1780 | """SetRightBottom(self, Point2D pt)""" | |
1781 | return _core_.Rect2D_SetRightBottom(*args, **kwargs) | |
1782 | ||
1783 | def MoveRightBottomTo(*args, **kwargs): | |
1784 | """MoveRightBottomTo(self, Point2D pt)""" | |
1785 | return _core_.Rect2D_MoveRightBottomTo(*args, **kwargs) | |
1786 | ||
1787 | def GetCentre(*args, **kwargs): | |
1788 | """GetCentre(self) -> Point2D""" | |
1789 | return _core_.Rect2D_GetCentre(*args, **kwargs) | |
1790 | ||
1791 | def SetCentre(*args, **kwargs): | |
1792 | """SetCentre(self, Point2D pt)""" | |
1793 | return _core_.Rect2D_SetCentre(*args, **kwargs) | |
1794 | ||
1795 | def MoveCentreTo(*args, **kwargs): | |
1796 | """MoveCentreTo(self, Point2D pt)""" | |
1797 | return _core_.Rect2D_MoveCentreTo(*args, **kwargs) | |
1798 | ||
1799 | def GetOutcode(*args, **kwargs): | |
1800 | """GetOutcode(self, Point2D pt) -> int""" | |
1801 | return _core_.Rect2D_GetOutcode(*args, **kwargs) | |
1802 | ||
1803 | def Contains(*args, **kwargs): | |
1804 | """Contains(self, Point2D pt) -> bool""" | |
1805 | return _core_.Rect2D_Contains(*args, **kwargs) | |
1806 | ||
1807 | def ContainsRect(*args, **kwargs): | |
1808 | """ContainsRect(self, Rect2D rect) -> bool""" | |
1809 | return _core_.Rect2D_ContainsRect(*args, **kwargs) | |
1810 | ||
1811 | def IsEmpty(*args, **kwargs): | |
1812 | """IsEmpty(self) -> bool""" | |
1813 | return _core_.Rect2D_IsEmpty(*args, **kwargs) | |
1814 | ||
1815 | def HaveEqualSize(*args, **kwargs): | |
1816 | """HaveEqualSize(self, Rect2D rect) -> bool""" | |
1817 | return _core_.Rect2D_HaveEqualSize(*args, **kwargs) | |
1818 | ||
1819 | def Inset(*args): | |
1820 | """ | |
1821 | Inset(self, wxDouble x, wxDouble y) | |
1822 | Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom) | |
1823 | """ | |
1824 | return _core_.Rect2D_Inset(*args) | |
1825 | ||
1826 | def Offset(*args, **kwargs): | |
1827 | """Offset(self, Point2D pt)""" | |
1828 | return _core_.Rect2D_Offset(*args, **kwargs) | |
1829 | ||
1830 | def ConstrainTo(*args, **kwargs): | |
1831 | """ConstrainTo(self, Rect2D rect)""" | |
1832 | return _core_.Rect2D_ConstrainTo(*args, **kwargs) | |
1833 | ||
1834 | def Interpolate(*args, **kwargs): | |
1835 | """Interpolate(self, int widthfactor, int heightfactor) -> Point2D""" | |
1836 | return _core_.Rect2D_Interpolate(*args, **kwargs) | |
1837 | ||
1838 | def Intersect(*args, **kwargs): | |
1839 | """Intersect(self, Rect2D otherRect)""" | |
1840 | return _core_.Rect2D_Intersect(*args, **kwargs) | |
1841 | ||
1842 | def CreateIntersection(*args, **kwargs): | |
1843 | """CreateIntersection(self, Rect2D otherRect) -> Rect2D""" | |
1844 | return _core_.Rect2D_CreateIntersection(*args, **kwargs) | |
1845 | ||
1846 | def Intersects(*args, **kwargs): | |
1847 | """Intersects(self, Rect2D rect) -> bool""" | |
1848 | return _core_.Rect2D_Intersects(*args, **kwargs) | |
1849 | ||
1850 | def Union(*args, **kwargs): | |
1851 | """Union(self, Rect2D otherRect)""" | |
1852 | return _core_.Rect2D_Union(*args, **kwargs) | |
1853 | ||
1854 | def CreateUnion(*args, **kwargs): | |
1855 | """CreateUnion(self, Rect2D otherRect) -> Rect2D""" | |
1856 | return _core_.Rect2D_CreateUnion(*args, **kwargs) | |
1857 | ||
1858 | def Scale(*args): | |
1859 | """ | |
1860 | Scale(self, wxDouble f) | |
1861 | Scale(self, int num, int denum) | |
1862 | """ | |
1863 | return _core_.Rect2D_Scale(*args) | |
1864 | ||
1865 | def __eq__(*args, **kwargs): | |
1866 | """ | |
1867 | __eq__(self, PyObject other) -> bool | |
1868 | ||
1869 | Test for equality of wx.Rect2D objects. | |
1870 | """ | |
1871 | return _core_.Rect2D___eq__(*args, **kwargs) | |
1872 | ||
1873 | def __ne__(*args, **kwargs): | |
1874 | """ | |
1875 | __ne__(self, PyObject other) -> bool | |
1876 | ||
1877 | Test for inequality of wx.Rect2D objects. | |
1878 | """ | |
1879 | return _core_.Rect2D___ne__(*args, **kwargs) | |
1880 | ||
1881 | x = property(_core_.Rect2D_x_get, _core_.Rect2D_x_set) | |
1882 | y = property(_core_.Rect2D_y_get, _core_.Rect2D_y_set) | |
1883 | width = property(_core_.Rect2D_width_get, _core_.Rect2D_width_set) | |
1884 | height = property(_core_.Rect2D_height_get, _core_.Rect2D_height_set) | |
1885 | def Set(*args, **kwargs): | |
1886 | """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)""" | |
1887 | return _core_.Rect2D_Set(*args, **kwargs) | |
1888 | ||
1889 | def Get(*args, **kwargs): | |
1890 | """ | |
1891 | Get() -> (x,y, width, height) | |
1892 | ||
1893 | Return x, y, width and height y properties as a tuple. | |
1894 | """ | |
1895 | return _core_.Rect2D_Get(*args, **kwargs) | |
1896 | ||
1897 | def __str__(self): return str(self.Get()) | |
1898 | def __repr__(self): return 'wx.Rect2D'+str(self.Get()) | |
1899 | def __len__(self): return len(self.Get()) | |
1900 | def __getitem__(self, index): return self.Get()[index] | |
1901 | def __setitem__(self, index, val): | |
1902 | if index == 0: self.x = val | |
1903 | elif index == 1: self.y = val | |
1904 | elif index == 2: self.width = val | |
1905 | elif index == 3: self.height = val | |
1906 | else: raise IndexError | |
1907 | def __nonzero__(self): return self.Get() != (0.0, 0.0, 0.0, 0.0) | |
1908 | __safe_for_unpickling__ = True | |
1909 | def __reduce__(self): return (wx.Rect2D, self.Get()) | |
1910 | ||
1911 | _core_.Rect2D_swigregister(Rect2D) | |
1912 | ||
8c3a7183 RD |
1913 | class Position(object): |
1914 | """Proxy of C++ Position class""" | |
1915 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
1916 | __repr__ = _swig_repr | |
1917 | def __init__(self, *args, **kwargs): | |
1918 | """__init__(self, int row=0, int col=0) -> Position""" | |
1919 | _core_.Position_swiginit(self,_core_.new_Position(*args, **kwargs)) | |
1920 | __swig_destroy__ = _core_.delete_Position | |
1921 | __del__ = lambda self : None; | |
1922 | def GetRow(*args, **kwargs): | |
1923 | """GetRow(self) -> int""" | |
1924 | return _core_.Position_GetRow(*args, **kwargs) | |
1925 | ||
1926 | def GetColumn(*args, **kwargs): | |
1927 | """GetColumn(self) -> int""" | |
1928 | return _core_.Position_GetColumn(*args, **kwargs) | |
1929 | ||
1930 | def GetCol(*args, **kwargs): | |
1931 | """GetCol(self) -> int""" | |
1932 | return _core_.Position_GetCol(*args, **kwargs) | |
1933 | ||
1934 | def SetRow(*args, **kwargs): | |
1935 | """SetRow(self, int row)""" | |
1936 | return _core_.Position_SetRow(*args, **kwargs) | |
1937 | ||
1938 | def SetColumn(*args, **kwargs): | |
1939 | """SetColumn(self, int column)""" | |
1940 | return _core_.Position_SetColumn(*args, **kwargs) | |
1941 | ||
1942 | def SetCol(*args, **kwargs): | |
1943 | """SetCol(self, int column)""" | |
1944 | return _core_.Position_SetCol(*args, **kwargs) | |
1945 | ||
1946 | def __eq__(*args, **kwargs): | |
1947 | """ | |
1948 | __eq__(self, PyObject other) -> bool | |
1949 | ||
1950 | Test for equality of wx.Position objects. | |
1951 | """ | |
1952 | return _core_.Position___eq__(*args, **kwargs) | |
1953 | ||
1954 | def __ne__(*args, **kwargs): | |
1955 | """ | |
1956 | __ne__(self, PyObject other) -> bool | |
1957 | ||
1958 | Test for inequality of wx.Position objects. | |
1959 | """ | |
1960 | return _core_.Position___ne__(*args, **kwargs) | |
1961 | ||
1962 | def __add__(*args): | |
1963 | """ | |
1964 | __add__(self, Position p) -> Position | |
1965 | __add__(self, Size s) -> Position | |
1966 | """ | |
1967 | return _core_.Position___add__(*args) | |
1968 | ||
1969 | def __sub__(*args): | |
1970 | """ | |
1971 | __sub__(self, Position p) -> Position | |
1972 | __sub__(self, Size s) -> Position | |
1973 | """ | |
1974 | return _core_.Position___sub__(*args) | |
1975 | ||
1976 | row = property(GetRow,SetRow) | |
1977 | col = property(GetCol,SetCol) | |
1978 | _core_.Position_swigregister(Position) | |
1979 | ||
70d7cb34 RD |
1980 | #--------------------------------------------------------------------------- |
1981 | ||
54f9ee45 RD |
1982 | FromStart = _core_.FromStart |
1983 | FromCurrent = _core_.FromCurrent | |
1984 | FromEnd = _core_.FromEnd | |
d14a1e28 | 1985 | class InputStream(object): |
093d3ff1 | 1986 | """Proxy of C++ InputStream class""" |
0085ce49 RD |
1987 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
1988 | __repr__ = _swig_repr | |
1989 | def __init__(self, *args, **kwargs): | |
a95a7133 | 1990 | """__init__(self, PyObject p) -> InputStream""" |
0085ce49 RD |
1991 | _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs)) |
1992 | __swig_destroy__ = _core_.delete_InputStream | |
1993 | __del__ = lambda self : None; | |
e811c8ce | 1994 | def close(*args, **kwargs): |
a95a7133 | 1995 | """close(self)""" |
54f9ee45 | 1996 | return _core_.InputStream_close(*args, **kwargs) |
e811c8ce RD |
1997 | |
1998 | def flush(*args, **kwargs): | |
a95a7133 | 1999 | """flush(self)""" |
54f9ee45 | 2000 | return _core_.InputStream_flush(*args, **kwargs) |
e811c8ce RD |
2001 | |
2002 | def eof(*args, **kwargs): | |
a95a7133 | 2003 | """eof(self) -> bool""" |
54f9ee45 | 2004 | return _core_.InputStream_eof(*args, **kwargs) |
e811c8ce RD |
2005 | |
2006 | def read(*args, **kwargs): | |
a95a7133 | 2007 | """read(self, int size=-1) -> PyObject""" |
54f9ee45 | 2008 | return _core_.InputStream_read(*args, **kwargs) |
e811c8ce RD |
2009 | |
2010 | def readline(*args, **kwargs): | |
a95a7133 | 2011 | """readline(self, int size=-1) -> PyObject""" |
54f9ee45 | 2012 | return _core_.InputStream_readline(*args, **kwargs) |
e811c8ce RD |
2013 | |
2014 | def readlines(*args, **kwargs): | |
a95a7133 | 2015 | """readlines(self, int sizehint=-1) -> PyObject""" |
54f9ee45 | 2016 | return _core_.InputStream_readlines(*args, **kwargs) |
e811c8ce RD |
2017 | |
2018 | def seek(*args, **kwargs): | |
a95a7133 | 2019 | """seek(self, int offset, int whence=0)""" |
54f9ee45 | 2020 | return _core_.InputStream_seek(*args, **kwargs) |
e811c8ce RD |
2021 | |
2022 | def tell(*args, **kwargs): | |
a95a7133 | 2023 | """tell(self) -> int""" |
54f9ee45 | 2024 | return _core_.InputStream_tell(*args, **kwargs) |
e811c8ce RD |
2025 | |
2026 | def Peek(*args, **kwargs): | |
a95a7133 | 2027 | """Peek(self) -> char""" |
54f9ee45 | 2028 | return _core_.InputStream_Peek(*args, **kwargs) |
e811c8ce RD |
2029 | |
2030 | def GetC(*args, **kwargs): | |
a95a7133 | 2031 | """GetC(self) -> char""" |
54f9ee45 | 2032 | return _core_.InputStream_GetC(*args, **kwargs) |
e811c8ce RD |
2033 | |
2034 | def LastRead(*args, **kwargs): | |
a95a7133 | 2035 | """LastRead(self) -> size_t""" |
54f9ee45 | 2036 | return _core_.InputStream_LastRead(*args, **kwargs) |
e811c8ce RD |
2037 | |
2038 | def CanRead(*args, **kwargs): | |
a95a7133 | 2039 | """CanRead(self) -> bool""" |
54f9ee45 | 2040 | return _core_.InputStream_CanRead(*args, **kwargs) |
e811c8ce RD |
2041 | |
2042 | def Eof(*args, **kwargs): | |
a95a7133 | 2043 | """Eof(self) -> bool""" |
54f9ee45 | 2044 | return _core_.InputStream_Eof(*args, **kwargs) |
e811c8ce RD |
2045 | |
2046 | def Ungetch(*args, **kwargs): | |
a95a7133 | 2047 | """Ungetch(self, char c) -> bool""" |
54f9ee45 | 2048 | return _core_.InputStream_Ungetch(*args, **kwargs) |
e811c8ce RD |
2049 | |
2050 | def SeekI(*args, **kwargs): | |
a95a7133 | 2051 | """SeekI(self, long pos, int mode=FromStart) -> long""" |
54f9ee45 | 2052 | return _core_.InputStream_SeekI(*args, **kwargs) |
e811c8ce RD |
2053 | |
2054 | def TellI(*args, **kwargs): | |
a95a7133 | 2055 | """TellI(self) -> long""" |
54f9ee45 | 2056 | return _core_.InputStream_TellI(*args, **kwargs) |
e811c8ce | 2057 | |
2131d850 | 2058 | _core_.InputStream_swigregister(InputStream) |
d14a1e28 RD |
2059 | DefaultPosition = cvar.DefaultPosition |
2060 | DefaultSize = cvar.DefaultSize | |
2061 | ||
2062 | class OutputStream(object): | |
093d3ff1 | 2063 | """Proxy of C++ OutputStream class""" |
0085ce49 RD |
2064 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2065 | def __init__(self): raise AttributeError, "No constructor defined" | |
2066 | __repr__ = _swig_repr | |
e811c8ce | 2067 | def write(*args, **kwargs): |
a95a7133 | 2068 | """write(self, PyObject obj)""" |
54f9ee45 | 2069 | return _core_.OutputStream_write(*args, **kwargs) |
e811c8ce | 2070 | |
0085ce49 RD |
2071 | def LastWrite(*args, **kwargs): |
2072 | """LastWrite(self) -> size_t""" | |
2073 | return _core_.OutputStream_LastWrite(*args, **kwargs) | |
d14a1e28 | 2074 | |
2131d850 | 2075 | _core_.OutputStream_swigregister(OutputStream) |
d14a1e28 RD |
2076 | |
2077 | #--------------------------------------------------------------------------- | |
2078 | ||
2079 | class FSFile(Object): | |
093d3ff1 | 2080 | """Proxy of C++ FSFile class""" |
0085ce49 RD |
2081 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2082 | __repr__ = _swig_repr | |
2083 | def __init__(self, *args, **kwargs): | |
0df68c9f | 2084 | """ |
a95a7133 | 2085 | __init__(self, InputStream stream, String loc, String mimetype, String anchor, |
196addbf | 2086 | DateTime modif) -> FSFile |
0df68c9f | 2087 | """ |
0085ce49 | 2088 | _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs)) |
0085ce49 RD |
2089 | __swig_destroy__ = _core_.delete_FSFile |
2090 | __del__ = lambda self : None; | |
e811c8ce | 2091 | def GetStream(*args, **kwargs): |
a95a7133 | 2092 | """GetStream(self) -> InputStream""" |
54f9ee45 | 2093 | return _core_.FSFile_GetStream(*args, **kwargs) |
e811c8ce | 2094 | |
97ab0f6a RD |
2095 | def DetachStream(*args, **kwargs): |
2096 | """DetachStream(self)""" | |
2097 | return _core_.FSFile_DetachStream(*args, **kwargs) | |
2098 | ||
e811c8ce | 2099 | def GetMimeType(*args, **kwargs): |
a95a7133 | 2100 | """GetMimeType(self) -> String""" |
54f9ee45 | 2101 | return _core_.FSFile_GetMimeType(*args, **kwargs) |
e811c8ce RD |
2102 | |
2103 | def GetLocation(*args, **kwargs): | |
a95a7133 | 2104 | """GetLocation(self) -> String""" |
54f9ee45 | 2105 | return _core_.FSFile_GetLocation(*args, **kwargs) |
e811c8ce RD |
2106 | |
2107 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 2108 | """GetAnchor(self) -> String""" |
54f9ee45 | 2109 | return _core_.FSFile_GetAnchor(*args, **kwargs) |
e811c8ce RD |
2110 | |
2111 | def GetModificationTime(*args, **kwargs): | |
a95a7133 | 2112 | """GetModificationTime(self) -> DateTime""" |
54f9ee45 | 2113 | return _core_.FSFile_GetModificationTime(*args, **kwargs) |
e811c8ce | 2114 | |
97ab0f6a RD |
2115 | Anchor = property(GetAnchor,doc="See `GetAnchor`") |
2116 | Location = property(GetLocation,doc="See `GetLocation`") | |
2117 | MimeType = property(GetMimeType,doc="See `GetMimeType`") | |
2118 | ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`") | |
2119 | Stream = property(GetStream,doc="See `GetStream`") | |
2131d850 | 2120 | _core_.FSFile_swigregister(FSFile) |
d14a1e28 RD |
2121 | |
2122 | class CPPFileSystemHandler(object): | |
093d3ff1 | 2123 | """Proxy of C++ CPPFileSystemHandler class""" |
0085ce49 RD |
2124 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2125 | def __init__(self): raise AttributeError, "No constructor defined" | |
2126 | __repr__ = _swig_repr | |
50f151d7 RD |
2127 | __swig_destroy__ = _core_.delete_CPPFileSystemHandler |
2128 | __del__ = lambda self : None; | |
2131d850 | 2129 | _core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler) |
d14a1e28 RD |
2130 | |
2131 | class FileSystemHandler(CPPFileSystemHandler): | |
093d3ff1 | 2132 | """Proxy of C++ FileSystemHandler class""" |
0085ce49 RD |
2133 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2134 | __repr__ = _swig_repr | |
2135 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2136 | """__init__(self) -> FileSystemHandler""" |
0085ce49 | 2137 | _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs)) |
c25f90f6 | 2138 | FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler) |
e811c8ce RD |
2139 | |
2140 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 2141 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 2142 | return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
2143 | |
2144 | def CanOpen(*args, **kwargs): | |
a95a7133 | 2145 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 2146 | return _core_.FileSystemHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
2147 | |
2148 | def OpenFile(*args, **kwargs): | |
a95a7133 | 2149 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 2150 | return _core_.FileSystemHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
2151 | |
2152 | def FindFirst(*args, **kwargs): | |
a95a7133 | 2153 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 2154 | return _core_.FileSystemHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
2155 | |
2156 | def FindNext(*args, **kwargs): | |
a95a7133 | 2157 | """FindNext(self) -> String""" |
54f9ee45 | 2158 | return _core_.FileSystemHandler_FindNext(*args, **kwargs) |
e811c8ce RD |
2159 | |
2160 | def GetProtocol(*args, **kwargs): | |
a95a7133 | 2161 | """GetProtocol(self, String location) -> String""" |
54f9ee45 | 2162 | return _core_.FileSystemHandler_GetProtocol(*args, **kwargs) |
e811c8ce RD |
2163 | |
2164 | def GetLeftLocation(*args, **kwargs): | |
a95a7133 | 2165 | """GetLeftLocation(self, String location) -> String""" |
54f9ee45 | 2166 | return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs) |
e811c8ce RD |
2167 | |
2168 | def GetAnchor(*args, **kwargs): | |
a95a7133 | 2169 | """GetAnchor(self, String location) -> String""" |
54f9ee45 | 2170 | return _core_.FileSystemHandler_GetAnchor(*args, **kwargs) |
e811c8ce RD |
2171 | |
2172 | def GetRightLocation(*args, **kwargs): | |
a95a7133 | 2173 | """GetRightLocation(self, String location) -> String""" |
54f9ee45 | 2174 | return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs) |
e811c8ce RD |
2175 | |
2176 | def GetMimeTypeFromExt(*args, **kwargs): | |
a95a7133 | 2177 | """GetMimeTypeFromExt(self, String location) -> String""" |
54f9ee45 | 2178 | return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs) |
e811c8ce | 2179 | |
97ab0f6a RD |
2180 | Anchor = property(GetAnchor,doc="See `GetAnchor`") |
2181 | LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`") | |
2182 | MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`") | |
2183 | Protocol = property(GetProtocol,doc="See `GetProtocol`") | |
2184 | RightLocation = property(GetRightLocation,doc="See `GetRightLocation`") | |
2131d850 | 2185 | _core_.FileSystemHandler_swigregister(FileSystemHandler) |
d14a1e28 RD |
2186 | |
2187 | class FileSystem(Object): | |
093d3ff1 | 2188 | """Proxy of C++ FileSystem class""" |
0085ce49 RD |
2189 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2190 | __repr__ = _swig_repr | |
2191 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2192 | """__init__(self) -> FileSystem""" |
0085ce49 RD |
2193 | _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs)) |
2194 | __swig_destroy__ = _core_.delete_FileSystem | |
2195 | __del__ = lambda self : None; | |
e811c8ce | 2196 | def ChangePathTo(*args, **kwargs): |
a95a7133 | 2197 | """ChangePathTo(self, String location, bool is_dir=False)""" |
54f9ee45 | 2198 | return _core_.FileSystem_ChangePathTo(*args, **kwargs) |
e811c8ce RD |
2199 | |
2200 | def GetPath(*args, **kwargs): | |
a95a7133 | 2201 | """GetPath(self) -> String""" |
54f9ee45 | 2202 | return _core_.FileSystem_GetPath(*args, **kwargs) |
e811c8ce RD |
2203 | |
2204 | def OpenFile(*args, **kwargs): | |
a95a7133 | 2205 | """OpenFile(self, String location) -> FSFile""" |
54f9ee45 | 2206 | return _core_.FileSystem_OpenFile(*args, **kwargs) |
e811c8ce RD |
2207 | |
2208 | def FindFirst(*args, **kwargs): | |
a95a7133 | 2209 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 2210 | return _core_.FileSystem_FindFirst(*args, **kwargs) |
e811c8ce RD |
2211 | |
2212 | def FindNext(*args, **kwargs): | |
a95a7133 | 2213 | """FindNext(self) -> String""" |
54f9ee45 | 2214 | return _core_.FileSystem_FindNext(*args, **kwargs) |
e811c8ce RD |
2215 | |
2216 | def AddHandler(*args, **kwargs): | |
66c033b4 | 2217 | """AddHandler(CPPFileSystemHandler handler)""" |
54f9ee45 | 2218 | return _core_.FileSystem_AddHandler(*args, **kwargs) |
e811c8ce RD |
2219 | |
2220 | AddHandler = staticmethod(AddHandler) | |
97ab0f6a RD |
2221 | def RemoveHandler(*args, **kwargs): |
2222 | """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler""" | |
2223 | return _core_.FileSystem_RemoveHandler(*args, **kwargs) | |
2224 | ||
2225 | RemoveHandler = staticmethod(RemoveHandler) | |
e811c8ce | 2226 | def CleanUpHandlers(*args, **kwargs): |
66c033b4 | 2227 | """CleanUpHandlers()""" |
54f9ee45 | 2228 | return _core_.FileSystem_CleanUpHandlers(*args, **kwargs) |
e811c8ce RD |
2229 | |
2230 | CleanUpHandlers = staticmethod(CleanUpHandlers) | |
2231 | def FileNameToURL(*args, **kwargs): | |
66c033b4 | 2232 | """FileNameToURL(String filename) -> String""" |
54f9ee45 | 2233 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) |
e811c8ce RD |
2234 | |
2235 | FileNameToURL = staticmethod(FileNameToURL) | |
2ef75293 RD |
2236 | def URLToFileName(*args, **kwargs): |
2237 | """URLToFileName(String url) -> String""" | |
2238 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
2239 | ||
2240 | URLToFileName = staticmethod(URLToFileName) | |
97ab0f6a | 2241 | Path = property(GetPath,doc="See `GetPath`") |
2131d850 | 2242 | _core_.FileSystem_swigregister(FileSystem) |
d14a1e28 | 2243 | |
e811c8ce | 2244 | def FileSystem_AddHandler(*args, **kwargs): |
0085ce49 RD |
2245 | """FileSystem_AddHandler(CPPFileSystemHandler handler)""" |
2246 | return _core_.FileSystem_AddHandler(*args, **kwargs) | |
d14a1e28 | 2247 | |
97ab0f6a RD |
2248 | def FileSystem_RemoveHandler(*args, **kwargs): |
2249 | """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler""" | |
2250 | return _core_.FileSystem_RemoveHandler(*args, **kwargs) | |
2251 | ||
0085ce49 RD |
2252 | def FileSystem_CleanUpHandlers(*args): |
2253 | """FileSystem_CleanUpHandlers()""" | |
2254 | return _core_.FileSystem_CleanUpHandlers(*args) | |
d14a1e28 | 2255 | |
e811c8ce | 2256 | def FileSystem_FileNameToURL(*args, **kwargs): |
0085ce49 RD |
2257 | """FileSystem_FileNameToURL(String filename) -> String""" |
2258 | return _core_.FileSystem_FileNameToURL(*args, **kwargs) | |
d14a1e28 | 2259 | |
e811c8ce | 2260 | def FileSystem_URLToFileName(*args, **kwargs): |
0085ce49 RD |
2261 | """FileSystem_URLToFileName(String url) -> String""" |
2262 | return _core_.FileSystem_URLToFileName(*args, **kwargs) | |
2ef75293 | 2263 | |
d14a1e28 | 2264 | class InternetFSHandler(CPPFileSystemHandler): |
093d3ff1 | 2265 | """Proxy of C++ InternetFSHandler class""" |
0085ce49 RD |
2266 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2267 | __repr__ = _swig_repr | |
2268 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2269 | """__init__(self) -> InternetFSHandler""" |
0085ce49 | 2270 | _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs)) |
e811c8ce | 2271 | def CanOpen(*args, **kwargs): |
a95a7133 | 2272 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 2273 | return _core_.InternetFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
2274 | |
2275 | def OpenFile(*args, **kwargs): | |
a95a7133 | 2276 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 2277 | return _core_.InternetFSHandler_OpenFile(*args, **kwargs) |
e811c8ce | 2278 | |
2131d850 | 2279 | _core_.InternetFSHandler_swigregister(InternetFSHandler) |
d14a1e28 RD |
2280 | |
2281 | class ZipFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 2282 | """Proxy of C++ ZipFSHandler class""" |
0085ce49 RD |
2283 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2284 | __repr__ = _swig_repr | |
2285 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2286 | """__init__(self) -> ZipFSHandler""" |
0085ce49 | 2287 | _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs)) |
e811c8ce | 2288 | def CanOpen(*args, **kwargs): |
a95a7133 | 2289 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 2290 | return _core_.ZipFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
2291 | |
2292 | def OpenFile(*args, **kwargs): | |
a95a7133 | 2293 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 2294 | return _core_.ZipFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
2295 | |
2296 | def FindFirst(*args, **kwargs): | |
a95a7133 | 2297 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 2298 | return _core_.ZipFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
2299 | |
2300 | def FindNext(*args, **kwargs): | |
a95a7133 | 2301 | """FindNext(self) -> String""" |
54f9ee45 | 2302 | return _core_.ZipFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 2303 | |
2131d850 | 2304 | _core_.ZipFSHandler_swigregister(ZipFSHandler) |
d14a1e28 RD |
2305 | |
2306 | ||
e811c8ce | 2307 | def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs): |
0085ce49 RD |
2308 | """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)""" |
2309 | return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs) | |
d14a1e28 | 2310 | |
e811c8ce | 2311 | def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs): |
0085ce49 RD |
2312 | """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)""" |
2313 | return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs) | |
d14a1e28 | 2314 | |
e811c8ce | 2315 | def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs): |
0085ce49 RD |
2316 | """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)""" |
2317 | return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs) | |
2ef75293 RD |
2318 | def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1): |
2319 | """ | |
2320 | Add 'file' to the memory filesystem. The dataItem parameter can | |
2321 | either be a `wx.Bitmap`, `wx.Image` or a string that can contain | |
2322 | arbitrary data. If a bitmap or image is used then the imgType | |
2323 | parameter should specify what kind of image file it should be | |
2324 | written as, wx.BITMAP_TYPE_PNG, etc. | |
2325 | """ | |
2326 | if isinstance(dataItem, wx.Image): | |
2327 | __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType) | |
2328 | elif isinstance(dataItem, wx.Bitmap): | |
2329 | __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType) | |
2330 | elif type(dataItem) == str: | |
2331 | __wxMemoryFSHandler_AddFile_Data(filename, dataItem) | |
2332 | else: | |
2333 | raise TypeError, 'wx.Image, wx.Bitmap or string expected' | |
d14a1e28 RD |
2334 | |
2335 | class MemoryFSHandler(CPPFileSystemHandler): | |
093d3ff1 | 2336 | """Proxy of C++ MemoryFSHandler class""" |
0085ce49 RD |
2337 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2338 | __repr__ = _swig_repr | |
2339 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2340 | """__init__(self) -> MemoryFSHandler""" |
0085ce49 | 2341 | _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs)) |
e811c8ce | 2342 | def RemoveFile(*args, **kwargs): |
66c033b4 | 2343 | """RemoveFile(String filename)""" |
54f9ee45 | 2344 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) |
e811c8ce RD |
2345 | |
2346 | RemoveFile = staticmethod(RemoveFile) | |
d14a1e28 | 2347 | AddFile = staticmethod(MemoryFSHandler_AddFile) |
e811c8ce | 2348 | def CanOpen(*args, **kwargs): |
a95a7133 | 2349 | """CanOpen(self, String location) -> bool""" |
54f9ee45 | 2350 | return _core_.MemoryFSHandler_CanOpen(*args, **kwargs) |
e811c8ce RD |
2351 | |
2352 | def OpenFile(*args, **kwargs): | |
a95a7133 | 2353 | """OpenFile(self, FileSystem fs, String location) -> FSFile""" |
54f9ee45 | 2354 | return _core_.MemoryFSHandler_OpenFile(*args, **kwargs) |
e811c8ce RD |
2355 | |
2356 | def FindFirst(*args, **kwargs): | |
a95a7133 | 2357 | """FindFirst(self, String spec, int flags=0) -> String""" |
54f9ee45 | 2358 | return _core_.MemoryFSHandler_FindFirst(*args, **kwargs) |
e811c8ce RD |
2359 | |
2360 | def FindNext(*args, **kwargs): | |
a95a7133 | 2361 | """FindNext(self) -> String""" |
54f9ee45 | 2362 | return _core_.MemoryFSHandler_FindNext(*args, **kwargs) |
e811c8ce | 2363 | |
2131d850 | 2364 | _core_.MemoryFSHandler_swigregister(MemoryFSHandler) |
d14a1e28 | 2365 | |
e811c8ce | 2366 | def MemoryFSHandler_RemoveFile(*args, **kwargs): |
0085ce49 RD |
2367 | """MemoryFSHandler_RemoveFile(String filename)""" |
2368 | return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) | |
d14a1e28 | 2369 | |
bcd0d7b6 RD |
2370 | IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT |
2371 | IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD | |
2372 | IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE | |
f5263701 RD |
2373 | IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL |
2374 | IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH | |
d14a1e28 RD |
2375 | #--------------------------------------------------------------------------- |
2376 | ||
2377 | class ImageHandler(Object): | |
27fb7603 RD |
2378 | """ |
2379 | This is the base class for implementing image file loading/saving, and | |
2380 | image creation from data. It is used within `wx.Image` and is not | |
2381 | normally seen by the application. | |
2382 | """ | |
0085ce49 RD |
2383 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2384 | def __init__(self): raise AttributeError, "No constructor defined" | |
2385 | __repr__ = _swig_repr | |
e811c8ce | 2386 | def GetName(*args, **kwargs): |
a95a7133 | 2387 | """GetName(self) -> String""" |
54f9ee45 | 2388 | return _core_.ImageHandler_GetName(*args, **kwargs) |
e811c8ce RD |
2389 | |
2390 | def GetExtension(*args, **kwargs): | |
a95a7133 | 2391 | """GetExtension(self) -> String""" |
54f9ee45 | 2392 | return _core_.ImageHandler_GetExtension(*args, **kwargs) |
e811c8ce RD |
2393 | |
2394 | def GetType(*args, **kwargs): | |
a95a7133 | 2395 | """GetType(self) -> long""" |
54f9ee45 | 2396 | return _core_.ImageHandler_GetType(*args, **kwargs) |
e811c8ce RD |
2397 | |
2398 | def GetMimeType(*args, **kwargs): | |
a95a7133 | 2399 | """GetMimeType(self) -> String""" |
54f9ee45 | 2400 | return _core_.ImageHandler_GetMimeType(*args, **kwargs) |
e811c8ce RD |
2401 | |
2402 | def CanRead(*args, **kwargs): | |
a95a7133 | 2403 | """CanRead(self, String name) -> bool""" |
54f9ee45 | 2404 | return _core_.ImageHandler_CanRead(*args, **kwargs) |
e811c8ce | 2405 | |
b02396e8 RD |
2406 | def CanReadStream(*args, **kwargs): |
2407 | """CanReadStream(self, InputStream stream) -> bool""" | |
2408 | return _core_.ImageHandler_CanReadStream(*args, **kwargs) | |
2409 | ||
e811c8ce | 2410 | def SetName(*args, **kwargs): |
a95a7133 | 2411 | """SetName(self, String name)""" |
54f9ee45 | 2412 | return _core_.ImageHandler_SetName(*args, **kwargs) |
e811c8ce RD |
2413 | |
2414 | def SetExtension(*args, **kwargs): | |
a95a7133 | 2415 | """SetExtension(self, String extension)""" |
54f9ee45 | 2416 | return _core_.ImageHandler_SetExtension(*args, **kwargs) |
e811c8ce RD |
2417 | |
2418 | def SetType(*args, **kwargs): | |
a95a7133 | 2419 | """SetType(self, long type)""" |
54f9ee45 | 2420 | return _core_.ImageHandler_SetType(*args, **kwargs) |
e811c8ce RD |
2421 | |
2422 | def SetMimeType(*args, **kwargs): | |
a95a7133 | 2423 | """SetMimeType(self, String mimetype)""" |
54f9ee45 | 2424 | return _core_.ImageHandler_SetMimeType(*args, **kwargs) |
e811c8ce | 2425 | |
97ab0f6a RD |
2426 | Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`") |
2427 | MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`") | |
2428 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
2429 | Type = property(GetType,SetType,doc="See `GetType` and `SetType`") | |
2131d850 | 2430 | _core_.ImageHandler_swigregister(ImageHandler) |
d14a1e28 | 2431 | |
943e8dfd RD |
2432 | class PyImageHandler(ImageHandler): |
2433 | """ | |
2434 | This is the base class for implementing image file loading/saving, and | |
2435 | image creation from data, all written in Python. To create a custom | |
2436 | image handler derive a new class from wx.PyImageHandler and provide | |
2437 | the following methods:: | |
2438 | ||
2439 | def DoCanRead(self, stream) --> bool | |
2440 | '''Check if this handler can read the image on the stream''' | |
2441 | ||
2442 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2443 | '''Load image data from the stream and load it into image.''' | |
2444 | ||
2445 | def SaveFile(self, image, stream, verbose) --> bool | |
2446 | '''Save the iamge data in image to the stream using | |
2447 | this handler's image file format.''' | |
2448 | ||
2449 | def GetImageCount(self, stream) --> int | |
2450 | '''If this image format can hold more than one image, | |
2451 | how many does the image on the stream have?''' | |
2452 | ||
2453 | To activate your handler create an instance of it and pass it to | |
2454 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2455 | `SetExtension` from your constructor. | |
2456 | ||
2457 | """ | |
0085ce49 RD |
2458 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2459 | __repr__ = _swig_repr | |
2460 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2461 | """ |
2462 | __init__(self) -> PyImageHandler | |
2463 | ||
2464 | This is the base class for implementing image file loading/saving, and | |
2465 | image creation from data, all written in Python. To create a custom | |
2466 | image handler derive a new class from wx.PyImageHandler and provide | |
2467 | the following methods:: | |
2468 | ||
2469 | def DoCanRead(self, stream) --> bool | |
2470 | '''Check if this handler can read the image on the stream''' | |
2471 | ||
2472 | def LoadFile(self, image, stream, verbose, index) --> bool | |
2473 | '''Load image data from the stream and load it into image.''' | |
2474 | ||
2475 | def SaveFile(self, image, stream, verbose) --> bool | |
2476 | '''Save the iamge data in image to the stream using | |
2477 | this handler's image file format.''' | |
2478 | ||
2479 | def GetImageCount(self, stream) --> int | |
2480 | '''If this image format can hold more than one image, | |
2481 | how many does the image on the stream have?''' | |
2482 | ||
2483 | To activate your handler create an instance of it and pass it to | |
2484 | `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and | |
2485 | `SetExtension` from your constructor. | |
2486 | ||
2487 | """ | |
0085ce49 | 2488 | _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs)) |
943e8dfd RD |
2489 | self._SetSelf(self) |
2490 | ||
2491 | def _SetSelf(*args, **kwargs): | |
2492 | """_SetSelf(self, PyObject self)""" | |
2493 | return _core_.PyImageHandler__SetSelf(*args, **kwargs) | |
2494 | ||
2131d850 | 2495 | _core_.PyImageHandler_swigregister(PyImageHandler) |
943e8dfd | 2496 | |
d14a1e28 | 2497 | class ImageHistogram(object): |
093d3ff1 | 2498 | """Proxy of C++ ImageHistogram class""" |
0085ce49 RD |
2499 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2500 | __repr__ = _swig_repr | |
2501 | def __init__(self, *args, **kwargs): | |
a95a7133 | 2502 | """__init__(self) -> ImageHistogram""" |
0085ce49 | 2503 | _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs)) |
e811c8ce | 2504 | def MakeKey(*args, **kwargs): |
0df68c9f | 2505 | """ |
7a27cf7c | 2506 | MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2507 | |
0df68c9f RD |
2508 | Get the key in the histogram for the given RGB values |
2509 | """ | |
54f9ee45 | 2510 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
e811c8ce RD |
2511 | |
2512 | MakeKey = staticmethod(MakeKey) | |
2513 | def FindFirstUnusedColour(*args, **kwargs): | |
fd2dc343 RD |
2514 | """ |
2515 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2516 | ||
2517 | Find first colour that is not used in the image and has higher RGB | |
2518 | values than startR, startG, startB. Returns a tuple consisting of a | |
2519 | success flag and rgb values. | |
2520 | """ | |
54f9ee45 | 2521 | return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2522 | |
f1cbd8fa RD |
2523 | def GetCount(*args, **kwargs): |
2524 | """ | |
2525 | GetCount(self, unsigned long key) -> unsigned long | |
2526 | ||
2527 | Returns the pixel count for the given key. Use `MakeKey` to create a | |
2528 | key value from a RGB tripple. | |
2529 | """ | |
2530 | return _core_.ImageHistogram_GetCount(*args, **kwargs) | |
2531 | ||
2532 | def GetCountRGB(*args, **kwargs): | |
2533 | """ | |
7a27cf7c | 2534 | GetCountRGB(self, byte r, byte g, byte b) -> unsigned long |
f1cbd8fa RD |
2535 | |
2536 | Returns the pixel count for the given RGB values. | |
2537 | """ | |
2538 | return _core_.ImageHistogram_GetCountRGB(*args, **kwargs) | |
2539 | ||
2540 | def GetCountColour(*args, **kwargs): | |
2541 | """ | |
2542 | GetCountColour(self, Colour colour) -> unsigned long | |
2543 | ||
2544 | Returns the pixel count for the given `wx.Colour` value. | |
2545 | """ | |
2546 | return _core_.ImageHistogram_GetCountColour(*args, **kwargs) | |
2547 | ||
2131d850 | 2548 | _core_.ImageHistogram_swigregister(ImageHistogram) |
d14a1e28 | 2549 | |
e811c8ce | 2550 | def ImageHistogram_MakeKey(*args, **kwargs): |
0085ce49 | 2551 | """ |
7a27cf7c | 2552 | ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long |
e811c8ce | 2553 | |
0df68c9f RD |
2554 | Get the key in the histogram for the given RGB values |
2555 | """ | |
0085ce49 | 2556 | return _core_.ImageHistogram_MakeKey(*args, **kwargs) |
d14a1e28 | 2557 | |
943e8dfd RD |
2558 | class Image_RGBValue(object): |
2559 | """ | |
2560 | An object that contains values for red, green and blue which represent | |
2561 | the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2562 | `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB | |
2563 | color space. | |
2564 | """ | |
0085ce49 RD |
2565 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2566 | __repr__ = _swig_repr | |
2567 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2568 | """ |
2569 | __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue | |
2570 | ||
2571 | Constructor. | |
2572 | """ | |
0085ce49 | 2573 | _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs)) |
943e8dfd RD |
2574 | red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set) |
2575 | green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set) | |
2576 | blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set) | |
2131d850 | 2577 | _core_.Image_RGBValue_swigregister(Image_RGBValue) |
943e8dfd RD |
2578 | |
2579 | class Image_HSVValue(object): | |
2580 | """ | |
2581 | An object that contains values for hue, saturation and value which | |
2582 | represent the value of a color. It is used by `wx.Image.HSVtoRGB` and | |
2583 | `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB | |
2584 | color space. | |
2585 | """ | |
0085ce49 RD |
2586 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2587 | __repr__ = _swig_repr | |
2588 | def __init__(self, *args, **kwargs): | |
943e8dfd RD |
2589 | """ |
2590 | __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue | |
2591 | ||
2592 | Constructor. | |
2593 | """ | |
0085ce49 | 2594 | _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs)) |
943e8dfd RD |
2595 | hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set) |
2596 | saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set) | |
2597 | value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set) | |
2131d850 | 2598 | _core_.Image_HSVValue_swigregister(Image_HSVValue) |
943e8dfd | 2599 | |
d14a1e28 | 2600 | class Image(Object): |
7a27cf7c RD |
2601 | """ |
2602 | A platform-independent image class. An image can be created from | |
2603 | data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a | |
2604 | variety of formats. Functions are available to set and get image | |
2605 | bits, so it can be used for basic image manipulation. | |
2606 | ||
2607 | A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a | |
2608 | platform-specific `wx.Bitmap` object must be created from it using the | |
2609 | `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a | |
2610 | device context, using `wx.DC.DrawBitmap`. | |
2611 | ||
2612 | One colour value of the image may be used as a mask colour which will | |
2613 | lead to the automatic creation of a `wx.Mask` object associated to the | |
2614 | bitmap object. | |
2615 | ||
2616 | wx.Image supports alpha channel data, that is in addition to a byte | |
2617 | for the red, green and blue colour components for each pixel it also | |
2618 | stores a byte representing the pixel opacity. An alpha value of 0 | |
2619 | corresponds to a transparent pixel (null opacity) while a value of 255 | |
2620 | means that the pixel is 100% opaque. | |
2621 | ||
2622 | Unlike RGB data, not all images have an alpha channel and before using | |
2623 | `GetAlpha` you should check if this image contains an alpha channel | |
2624 | with `HasAlpha`. Note that currently only images loaded from PNG files | |
2625 | with transparency information will have an alpha channel. | |
2626 | """ | |
0085ce49 RD |
2627 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
2628 | __repr__ = _swig_repr | |
2629 | def __init__(self, *args, **kwargs): | |
7a27cf7c RD |
2630 | """ |
2631 | __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
2632 | ||
2633 | Loads an image from a file. | |
2634 | """ | |
0085ce49 RD |
2635 | _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs)) |
2636 | __swig_destroy__ = _core_.delete_Image | |
2637 | __del__ = lambda self : None; | |
e811c8ce | 2638 | def Create(*args, **kwargs): |
7a27cf7c RD |
2639 | """ |
2640 | Create(self, int width, int height, bool clear=True) | |
2641 | ||
2642 | Creates a fresh image. If clear is ``True``, the new image will be | |
2643 | initialized to black. Otherwise, the image data will be uninitialized. | |
2644 | """ | |
54f9ee45 | 2645 | return _core_.Image_Create(*args, **kwargs) |
e811c8ce RD |
2646 | |
2647 | def Destroy(*args, **kwargs): | |
0df68c9f | 2648 | """ |
a95a7133 | 2649 | Destroy(self) |
e811c8ce | 2650 | |
7a27cf7c | 2651 | Destroys the image data. |
0df68c9f | 2652 | """ |
b39fe951 RD |
2653 | args[0].this.own(False) |
2654 | return _core_.Image_Destroy(*args, **kwargs) | |
e811c8ce RD |
2655 | |
2656 | def Scale(*args, **kwargs): | |
7a27cf7c | 2657 | """ |
f5263701 | 2658 | Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image |
7a27cf7c RD |
2659 | |
2660 | Returns a scaled version of the image. This is also useful for scaling | |
2661 | bitmaps in general as the only other way to scale bitmaps is to blit a | |
f5263701 RD |
2662 | `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter |
2663 | specifies what method to use for resampling the image. It can be | |
2664 | either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling | |
2665 | method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses | |
2666 | bicubic and box averaging resampling methods for upsampling and | |
2667 | downsampling respectively. | |
7a27cf7c | 2668 | """ |
54f9ee45 | 2669 | return _core_.Image_Scale(*args, **kwargs) |
e811c8ce | 2670 | |
f5263701 RD |
2671 | def ResampleBox(*args, **kwargs): |
2672 | """ResampleBox(self, int width, int height) -> Image""" | |
2673 | return _core_.Image_ResampleBox(*args, **kwargs) | |
2674 | ||
2675 | def ResampleBicubic(*args, **kwargs): | |
2676 | """ResampleBicubic(self, int width, int height) -> Image""" | |
2677 | return _core_.Image_ResampleBicubic(*args, **kwargs) | |
2678 | ||
2679 | def Blur(*args, **kwargs): | |
2680 | """ | |
2681 | Blur(self, int radius) -> Image | |
2682 | ||
2683 | Blurs the image in both horizontal and vertical directions by the | |
2684 | specified pixel ``radius``. This should not be used when using a | |
2685 | single mask colour for transparency. | |
2686 | """ | |
2687 | return _core_.Image_Blur(*args, **kwargs) | |
2688 | ||
2689 | def BlurHorizontal(*args, **kwargs): | |
2690 | """ | |
2691 | BlurHorizontal(self, int radius) -> Image | |
2692 | ||
2693 | Blurs the image in the horizontal direction only. This should not be | |
2694 | used when using a single mask colour for transparency. | |
2695 | ||
2696 | """ | |
2697 | return _core_.Image_BlurHorizontal(*args, **kwargs) | |
2698 | ||
2699 | def BlurVertical(*args, **kwargs): | |
2700 | """ | |
2701 | BlurVertical(self, int radius) -> Image | |
2702 | ||
2703 | Blurs the image in the vertical direction only. This should not be | |
2704 | used when using a single mask colour for transparency. | |
2705 | """ | |
2706 | return _core_.Image_BlurVertical(*args, **kwargs) | |
2707 | ||
e811c8ce | 2708 | def ShrinkBy(*args, **kwargs): |
7a27cf7c RD |
2709 | """ |
2710 | ShrinkBy(self, int xFactor, int yFactor) -> Image | |
2711 | ||
2712 | Return a version of the image scaled smaller by the given factors. | |
2713 | """ | |
54f9ee45 | 2714 | return _core_.Image_ShrinkBy(*args, **kwargs) |
e811c8ce RD |
2715 | |
2716 | def Rescale(*args, **kwargs): | |
7a27cf7c | 2717 | """ |
f5263701 | 2718 | Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image |
7a27cf7c RD |
2719 | |
2720 | Changes the size of the image in-place by scaling it: after a call to | |
2721 | this function, the image will have the given width and height. | |
2722 | ||
2723 | Returns the (modified) image itself. | |
2724 | """ | |
54f9ee45 | 2725 | return _core_.Image_Rescale(*args, **kwargs) |
e811c8ce | 2726 | |
aff4cc5c | 2727 | def Resize(*args, **kwargs): |
7a27cf7c RD |
2728 | """ |
2729 | Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
2730 | ||
2731 | Changes the size of the image in-place without scaling it, by adding | |
2732 | either a border with the given colour or cropping as necessary. The | |
2733 | image is pasted into a new image with the given size and background | |
2734 | colour at the position pos relative to the upper left of the new | |
2735 | image. If red = green = blue = -1 then use either the current mask | |
2736 | colour if set or find, use, and set a suitable mask colour for any | |
2737 | newly exposed areas. | |
2738 | ||
2739 | Returns the (modified) image itself. | |
2740 | """ | |
aff4cc5c RD |
2741 | return _core_.Image_Resize(*args, **kwargs) |
2742 | ||
e811c8ce | 2743 | def SetRGB(*args, **kwargs): |
7a27cf7c RD |
2744 | """ |
2745 | SetRGB(self, int x, int y, byte r, byte g, byte b) | |
2746 | ||
2747 | Sets the pixel at the given coordinate. This routine performs | |
2748 | bounds-checks for the coordinate so it can be considered a safe way to | |
2749 | manipulate the data, but in some cases this might be too slow so that | |
2750 | the data will have to be set directly. In that case you will have to | |
2751 | get access to the image data using the `GetData` method. | |
2752 | """ | |
54f9ee45 | 2753 | return _core_.Image_SetRGB(*args, **kwargs) |
e811c8ce | 2754 | |
aff4cc5c | 2755 | def SetRGBRect(*args, **kwargs): |
7a27cf7c RD |
2756 | """ |
2757 | SetRGBRect(self, Rect rect, byte r, byte g, byte b) | |
2758 | ||
2759 | Sets the colour of the pixels within the given rectangle. This routine | |
2760 | performs bounds-checks for the rectangle so it can be considered a | |
2761 | safe way to manipulate the data. | |
2762 | """ | |
aff4cc5c RD |
2763 | return _core_.Image_SetRGBRect(*args, **kwargs) |
2764 | ||
e811c8ce | 2765 | def GetRed(*args, **kwargs): |
7a27cf7c RD |
2766 | """ |
2767 | GetRed(self, int x, int y) -> byte | |
2768 | ||
2769 | Returns the red intensity at the given coordinate. | |
2770 | """ | |
54f9ee45 | 2771 | return _core_.Image_GetRed(*args, **kwargs) |
e811c8ce RD |
2772 | |
2773 | def GetGreen(*args, **kwargs): | |
7a27cf7c RD |
2774 | """ |
2775 | GetGreen(self, int x, int y) -> byte | |
2776 | ||
2777 | Returns the green intensity at the given coordinate. | |
2778 | """ | |
54f9ee45 | 2779 | return _core_.Image_GetGreen(*args, **kwargs) |
e811c8ce RD |
2780 | |
2781 | def GetBlue(*args, **kwargs): | |
7a27cf7c RD |
2782 | """ |
2783 | GetBlue(self, int x, int y) -> byte | |
2784 | ||
2785 | Returns the blue intensity at the given coordinate. | |
2786 | """ | |
54f9ee45 | 2787 | return _core_.Image_GetBlue(*args, **kwargs) |
e811c8ce RD |
2788 | |
2789 | def SetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2790 | """ |
2791 | SetAlpha(self, int x, int y, byte alpha) | |
2792 | ||
2793 | Sets the alpha value for the given pixel. This function should only be | |
2794 | called if the image has alpha channel data, use `HasAlpha` to check | |
2795 | for this. | |
2796 | """ | |
54f9ee45 | 2797 | return _core_.Image_SetAlpha(*args, **kwargs) |
e811c8ce RD |
2798 | |
2799 | def GetAlpha(*args, **kwargs): | |
7a27cf7c RD |
2800 | """ |
2801 | GetAlpha(self, int x, int y) -> byte | |
2802 | ||
2803 | Returns the alpha value for the given pixel. This function may only be | |
2804 | called for the images with alpha channel, use `HasAlpha` to check for | |
2805 | this. | |
2806 | ||
2807 | The returned value is the *opacity* of the image, i.e. the value of 0 | |
2808 | corresponds to the fully transparent pixels while the value of 255 to | |
2809 | the fully opaque pixels. | |
2810 | """ | |
54f9ee45 | 2811 | return _core_.Image_GetAlpha(*args, **kwargs) |
e811c8ce RD |
2812 | |
2813 | def HasAlpha(*args, **kwargs): | |
7a27cf7c RD |
2814 | """ |
2815 | HasAlpha(self) -> bool | |
2816 | ||
2817 | Returns true if this image has alpha channel, false otherwise. | |
2818 | """ | |
54f9ee45 | 2819 | return _core_.Image_HasAlpha(*args, **kwargs) |
e811c8ce | 2820 | |
68350608 RD |
2821 | def InitAlpha(*args, **kwargs): |
2822 | """ | |
2823 | InitAlpha(self) | |
2824 | ||
2825 | Initializes the image alpha channel data. It is an error to call it if | |
2826 | the image already has alpha data. If it doesn't, alpha data will be by | |
2827 | default initialized to all pixels being fully opaque. But if the image | |
2828 | has a a mask colour, all mask pixels will be completely transparent. | |
2829 | """ | |
2830 | return _core_.Image_InitAlpha(*args, **kwargs) | |
2831 | ||
bcd0d7b6 RD |
2832 | def IsTransparent(*args, **kwargs): |
2833 | """ | |
7a27cf7c | 2834 | IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
bcd0d7b6 | 2835 | |
7a27cf7c RD |
2836 | Returns ``True`` if this pixel is masked or has an alpha value less |
2837 | than the spcified threshold. | |
bcd0d7b6 RD |
2838 | """ |
2839 | return _core_.Image_IsTransparent(*args, **kwargs) | |
2840 | ||
e811c8ce | 2841 | def FindFirstUnusedColour(*args, **kwargs): |
fd2dc343 RD |
2842 | """ |
2843 | FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) | |
2844 | ||
2845 | Find first colour that is not used in the image and has higher RGB | |
2846 | values than startR, startG, startB. Returns a tuple consisting of a | |
2847 | success flag and rgb values. | |
2848 | """ | |
54f9ee45 | 2849 | return _core_.Image_FindFirstUnusedColour(*args, **kwargs) |
e811c8ce | 2850 | |
4cf4100f RD |
2851 | def ConvertAlphaToMask(*args, **kwargs): |
2852 | """ | |
bcd0d7b6 | 2853 | ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool |
4cf4100f | 2854 | |
7a27cf7c RD |
2855 | If the image has alpha channel, this method converts it to mask. All |
2856 | pixels with alpha value less than ``threshold`` are replaced with the | |
2857 | mask colour and the alpha channel is removed. The mask colour is | |
2858 | chosen automatically using `FindFirstUnusedColour`. | |
4cf4100f RD |
2859 | |
2860 | If the image image doesn't have alpha channel, ConvertAlphaToMask does | |
2861 | nothing. | |
2862 | """ | |
2863 | return _core_.Image_ConvertAlphaToMask(*args, **kwargs) | |
2864 | ||
8fb0e70a RD |
2865 | def ConvertColourToAlpha(*args, **kwargs): |
2866 | """ | |
7a27cf7c | 2867 | ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool |
8fb0e70a RD |
2868 | |
2869 | This method converts an image where the original alpha information is | |
2870 | only available as a shades of a colour (actually shades of grey) | |
2871 | typically when you draw anti-aliased text into a bitmap. The DC | |
2872 | drawing routines draw grey values on the black background although | |
2873 | they actually mean to draw white with differnt alpha values. This | |
2874 | method reverses it, assuming a black (!) background and white text. | |
2875 | The method will then fill up the whole image with the colour given. | |
2876 | """ | |
2877 | return _core_.Image_ConvertColourToAlpha(*args, **kwargs) | |
2878 | ||
e811c8ce | 2879 | def SetMaskFromImage(*args, **kwargs): |
7a27cf7c RD |
2880 | """ |
2881 | SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool | |
2882 | ||
2883 | Sets the image's mask so that the pixels that have RGB value of | |
2884 | ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done | |
2885 | by first finding an unused colour in the image, setting this colour as | |
2886 | the mask colour and then using this colour to draw all pixels in the | |
2887 | image who corresponding pixel in mask has given RGB value. | |
2888 | ||
2889 | Returns ``False`` if ``mask`` does not have same dimensions as the | |
2890 | image or if there is no unused colour left. Returns ``True`` if the | |
2891 | mask was successfully applied. | |
2892 | ||
2893 | Note that this method involves computing the histogram, which is | |
2894 | computationally intensive operation. | |
2895 | """ | |
54f9ee45 | 2896 | return _core_.Image_SetMaskFromImage(*args, **kwargs) |
e811c8ce RD |
2897 | |
2898 | def CanRead(*args, **kwargs): | |
7a27cf7c RD |
2899 | """ |
2900 | CanRead(String filename) -> bool | |
2901 | ||
2902 | Returns True if the image handlers can read this file. | |
2903 | """ | |
54f9ee45 | 2904 | return _core_.Image_CanRead(*args, **kwargs) |
e811c8ce RD |
2905 | |
2906 | CanRead = staticmethod(CanRead) | |
2907 | def GetImageCount(*args, **kwargs): | |
7a27cf7c RD |
2908 | """ |
2909 | GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int | |
2910 | ||
2911 | If the image file contains more than one image and the image handler | |
2912 | is capable of retrieving these individually, this function will return | |
2913 | the number of available images. | |
2914 | """ | |
54f9ee45 | 2915 | return _core_.Image_GetImageCount(*args, **kwargs) |
e811c8ce RD |
2916 | |
2917 | GetImageCount = staticmethod(GetImageCount) | |
2918 | def LoadFile(*args, **kwargs): | |
7a27cf7c RD |
2919 | """ |
2920 | LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2921 | ||
2922 | Loads an image from a file. If no handler type is provided, the | |
2923 | library will try to autodetect the format. | |
2924 | """ | |
54f9ee45 | 2925 | return _core_.Image_LoadFile(*args, **kwargs) |
e811c8ce RD |
2926 | |
2927 | def LoadMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2928 | """ |
2929 | LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool | |
2930 | ||
2931 | Loads an image from a file, specifying the image type with a MIME type | |
2932 | string. | |
2933 | """ | |
54f9ee45 | 2934 | return _core_.Image_LoadMimeFile(*args, **kwargs) |
e811c8ce RD |
2935 | |
2936 | def SaveFile(*args, **kwargs): | |
7a27cf7c RD |
2937 | """ |
2938 | SaveFile(self, String name, int type) -> bool | |
2939 | ||
2940 | Saves an image in the named file. | |
2941 | """ | |
54f9ee45 | 2942 | return _core_.Image_SaveFile(*args, **kwargs) |
e811c8ce RD |
2943 | |
2944 | def SaveMimeFile(*args, **kwargs): | |
7a27cf7c RD |
2945 | """ |
2946 | SaveMimeFile(self, String name, String mimetype) -> bool | |
2947 | ||
2948 | Saves an image in the named file. | |
2949 | """ | |
54f9ee45 | 2950 | return _core_.Image_SaveMimeFile(*args, **kwargs) |
e811c8ce RD |
2951 | |
2952 | def CanReadStream(*args, **kwargs): | |
7a27cf7c RD |
2953 | """ |
2954 | CanReadStream(InputStream stream) -> bool | |
2955 | ||
2956 | Returns True if the image handlers can read an image file from the | |
2957 | data currently on the input stream, or a readable Python file-like | |
2958 | object. | |
2959 | """ | |
54f9ee45 | 2960 | return _core_.Image_CanReadStream(*args, **kwargs) |
e811c8ce RD |
2961 | |
2962 | CanReadStream = staticmethod(CanReadStream) | |
2963 | def LoadStream(*args, **kwargs): | |
7a27cf7c RD |
2964 | """ |
2965 | LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool | |
2966 | ||
2967 | Loads an image from an input stream or a readable Python file-like | |
2968 | object. If no handler type is provided, the library will try to | |
2969 | autodetect the format. | |
2970 | """ | |
54f9ee45 | 2971 | return _core_.Image_LoadStream(*args, **kwargs) |
e811c8ce RD |
2972 | |
2973 | def LoadMimeStream(*args, **kwargs): | |
7a27cf7c RD |
2974 | """ |
2975 | LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool | |
2976 | ||
2977 | Loads an image from an input stream or a readable Python file-like | |
2978 | object, using a MIME type string to specify the image file format. | |
2979 | """ | |
54f9ee45 | 2980 | return _core_.Image_LoadMimeStream(*args, **kwargs) |
e811c8ce | 2981 | |
b39fe951 | 2982 | def IsOk(*args, **kwargs): |
7a27cf7c | 2983 | """ |
b39fe951 | 2984 | IsOk(self) -> bool |
7a27cf7c RD |
2985 | |
2986 | Returns true if image data is present. | |
2987 | """ | |
b39fe951 | 2988 | return _core_.Image_IsOk(*args, **kwargs) |
e811c8ce | 2989 | |
b39fe951 | 2990 | Ok = IsOk |
e811c8ce | 2991 | def GetWidth(*args, **kwargs): |
7a27cf7c RD |
2992 | """ |
2993 | GetWidth(self) -> int | |
2994 | ||
2995 | Gets the width of the image in pixels. | |
2996 | """ | |
54f9ee45 | 2997 | return _core_.Image_GetWidth(*args, **kwargs) |
e811c8ce RD |
2998 | |
2999 | def GetHeight(*args, **kwargs): | |
7a27cf7c RD |
3000 | """ |
3001 | GetHeight(self) -> int | |
3002 | ||
3003 | Gets the height of the image in pixels. | |
3004 | """ | |
54f9ee45 | 3005 | return _core_.Image_GetHeight(*args, **kwargs) |
e811c8ce | 3006 | |
b2df227b | 3007 | def GetSize(*args, **kwargs): |
7a27cf7c RD |
3008 | """ |
3009 | GetSize(self) -> Size | |
3010 | ||
3011 | Returns the size of the image in pixels. | |
3012 | """ | |
54f9ee45 | 3013 | return _core_.Image_GetSize(*args, **kwargs) |
b2df227b | 3014 | |
e811c8ce | 3015 | def GetSubImage(*args, **kwargs): |
7a27cf7c RD |
3016 | """ |
3017 | GetSubImage(self, Rect rect) -> Image | |
3018 | ||
3019 | Returns a sub image of the current one as long as the rect belongs | |
3020 | entirely to the image. | |
3021 | """ | |
54f9ee45 | 3022 | return _core_.Image_GetSubImage(*args, **kwargs) |
e811c8ce | 3023 | |
aff4cc5c | 3024 | def Size(*args, **kwargs): |
7a27cf7c RD |
3025 | """ |
3026 | Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image | |
3027 | ||
3028 | Returns a resized version of this image without scaling it by adding | |
3029 | either a border with the given colour or cropping as necessary. The | |
3030 | image is pasted into a new image with the given size and background | |
3031 | colour at the position ``pos`` relative to the upper left of the new | |
3032 | image. If red = green = blue = -1 then use either the current mask | |
3033 | colour if set or find, use, and set a suitable mask colour for any | |
3034 | newly exposed areas. | |
3035 | """ | |
aff4cc5c RD |
3036 | return _core_.Image_Size(*args, **kwargs) |
3037 | ||
e811c8ce | 3038 | def Copy(*args, **kwargs): |
7a27cf7c RD |
3039 | """ |
3040 | Copy(self) -> Image | |
3041 | ||
3042 | Returns an identical copy of the image. | |
3043 | """ | |
54f9ee45 | 3044 | return _core_.Image_Copy(*args, **kwargs) |
e811c8ce RD |
3045 | |
3046 | def Paste(*args, **kwargs): | |
7a27cf7c RD |
3047 | """ |
3048 | Paste(self, Image image, int x, int y) | |
3049 | ||
3050 | Pastes ``image`` into this instance and takes care of the mask colour | |
3051 | and any out of bounds problems. | |
3052 | """ | |
54f9ee45 | 3053 | return _core_.Image_Paste(*args, **kwargs) |
e811c8ce RD |
3054 | |
3055 | def GetData(*args, **kwargs): | |
61d07ac7 RD |
3056 | """ |
3057 | GetData(self) -> PyObject | |
3058 | ||
3059 | Returns a string containing a copy of the RGB bytes of the image. | |
3060 | """ | |
54f9ee45 | 3061 | return _core_.Image_GetData(*args, **kwargs) |
e811c8ce RD |
3062 | |
3063 | def SetData(*args, **kwargs): | |
61d07ac7 RD |
3064 | """ |
3065 | SetData(self, buffer data) | |
3066 | ||
3067 | Resets the Image's RGB data from a buffer of RGB bytes. Accepts | |
3068 | either a string or a buffer object holding the data and the length of | |
3069 | the data must be width*height*3. | |
3070 | """ | |
54f9ee45 | 3071 | return _core_.Image_SetData(*args, **kwargs) |
e811c8ce RD |
3072 | |
3073 | def GetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
3074 | """ |
3075 | GetDataBuffer(self) -> PyObject | |
3076 | ||
3077 | Returns a writable Python buffer object that is pointing at the RGB | |
7a27cf7c RD |
3078 | image data buffer inside the wx.Image. You need to ensure that you do |
3079 | not use this buffer object after the image has been destroyed. | |
61d07ac7 | 3080 | """ |
54f9ee45 | 3081 | return _core_.Image_GetDataBuffer(*args, **kwargs) |
e811c8ce RD |
3082 | |
3083 | def SetDataBuffer(*args, **kwargs): | |
61d07ac7 RD |
3084 | """ |
3085 | SetDataBuffer(self, buffer data) | |
3086 | ||
3087 | Sets the internal image data pointer to point at a Python buffer | |
7a27cf7c RD |
3088 | object. This can save making an extra copy of the data but you must |
3089 | ensure that the buffer object lives longer than the wx.Image does. | |
61d07ac7 | 3090 | """ |
54f9ee45 | 3091 | return _core_.Image_SetDataBuffer(*args, **kwargs) |
e811c8ce RD |
3092 | |
3093 | def GetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
3094 | """ |
3095 | GetAlphaData(self) -> PyObject | |
3096 | ||
3097 | Returns a string containing a copy of the alpha bytes of the image. | |
3098 | """ | |
54f9ee45 | 3099 | return _core_.Image_GetAlphaData(*args, **kwargs) |
e811c8ce RD |
3100 | |
3101 | def SetAlphaData(*args, **kwargs): | |
61d07ac7 RD |
3102 | """ |
3103 | SetAlphaData(self, buffer alpha) | |
3104 | ||
3105 | Resets the Image's alpha data from a buffer of bytes. Accepts either | |
3106 | a string or a buffer object holding the data and the length of the | |
3107 | data must be width*height. | |
3108 | """ | |
54f9ee45 | 3109 | return _core_.Image_SetAlphaData(*args, **kwargs) |
e811c8ce RD |
3110 | |
3111 | def GetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
3112 | """ |
3113 | GetAlphaBuffer(self) -> PyObject | |
3114 | ||
3115 | Returns a writable Python buffer object that is pointing at the Alpha | |
3116 | data buffer inside the wx.Image. You need to ensure that you do not | |
3117 | use this buffer object after the image has been destroyed. | |
3118 | """ | |
54f9ee45 | 3119 | return _core_.Image_GetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
3120 | |
3121 | def SetAlphaBuffer(*args, **kwargs): | |
fc46b7f3 RD |
3122 | """ |
3123 | SetAlphaBuffer(self, buffer alpha) | |
3124 | ||
3125 | Sets the internal image alpha pointer to point at a Python buffer | |
3126 | object. This can save making an extra copy of the data but you must | |
3127 | ensure that the buffer object lives as long as the wx.Image does. | |
3128 | """ | |
54f9ee45 | 3129 | return _core_.Image_SetAlphaBuffer(*args, **kwargs) |
e811c8ce RD |
3130 | |
3131 | def SetMaskColour(*args, **kwargs): | |
7a27cf7c RD |
3132 | """ |
3133 | SetMaskColour(self, byte r, byte g, byte b) | |
3134 | ||
3135 | Sets the mask colour for this image (and tells the image to use the | |
3136 | mask). | |
3137 | """ | |
54f9ee45 | 3138 | return _core_.Image_SetMaskColour(*args, **kwargs) |
e811c8ce | 3139 | |
aff4cc5c RD |
3140 | def GetOrFindMaskColour(*args, **kwargs): |
3141 | """ | |
3142 | GetOrFindMaskColour() -> (r,g,b) | |
3143 | ||
3144 | Get the current mask colour or find a suitable colour. | |
3145 | """ | |
3146 | return _core_.Image_GetOrFindMaskColour(*args, **kwargs) | |
3147 | ||
e811c8ce | 3148 | def GetMaskRed(*args, **kwargs): |
7a27cf7c RD |
3149 | """ |
3150 | GetMaskRed(self) -> byte | |
3151 | ||
3152 | Gets the red component of the mask colour. | |
3153 | """ | |
54f9ee45 | 3154 | return _core_.Image_GetMaskRed(*args, **kwargs) |
e811c8ce RD |
3155 | |
3156 | def GetMaskGreen(*args, **kwargs): | |
7a27cf7c RD |
3157 | """ |
3158 | GetMaskGreen(self) -> byte | |
3159 | ||
3160 | Gets the green component of the mask colour. | |
3161 | """ | |
54f9ee45 | 3162 | return _core_.Image_GetMaskGreen(*args, **kwargs) |
e811c8ce RD |
3163 | |
3164 | def GetMaskBlue(*args, **kwargs): | |
7a27cf7c RD |
3165 | """ |
3166 | GetMaskBlue(self) -> byte | |
3167 | ||
3168 | Gets the blue component of the mask colour. | |
3169 | """ | |
54f9ee45 | 3170 | return _core_.Image_GetMaskBlue(*args, **kwargs) |
e811c8ce RD |
3171 | |
3172 | def SetMask(*args, **kwargs): | |
7a27cf7c RD |
3173 | """ |
3174 | SetMask(self, bool mask=True) | |
3175 | ||
3176 | Specifies whether there is a mask or not. The area of the mask is | |
3177 | determined by the current mask colour. | |
3178 | """ | |
54f9ee45 | 3179 | return _core_.Image_SetMask(*args, **kwargs) |
e811c8ce RD |
3180 | |
3181 | def HasMask(*args, **kwargs): | |
7a27cf7c RD |
3182 | """ |
3183 | HasMask(self) -> bool | |
3184 | ||
3185 | Returns ``True`` if there is a mask active, ``False`` otherwise. | |
3186 | """ | |
54f9ee45 | 3187 | return _core_.Image_HasMask(*args, **kwargs) |
e811c8ce RD |
3188 | |
3189 | def Rotate(*args, **kwargs): | |
0df68c9f | 3190 | """ |
a95a7133 | 3191 | Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True, |
0df68c9f | 3192 | Point offset_after_rotation=None) -> Image |
7a27cf7c RD |
3193 | |
3194 | Rotates the image about the given point, by ``angle`` radians. Passing | |
3195 | ``True`` to ``interpolating`` results in better image quality, but is | |
3196 | slower. If the image has a mask, then the mask colour is used for the | |
3197 | uncovered pixels in the rotated image background. Otherwise, black | |
3198 | will be used as the fill colour. | |
3199 | ||
3200 | Returns the rotated image, leaving this image intact. | |
0df68c9f | 3201 | """ |
54f9ee45 | 3202 | return _core_.Image_Rotate(*args, **kwargs) |
e811c8ce RD |
3203 | |
3204 | def Rotate90(*args, **kwargs): | |
7a27cf7c RD |
3205 | """ |
3206 | Rotate90(self, bool clockwise=True) -> Image | |
3207 | ||
3208 | Returns a copy of the image rotated 90 degrees in the direction | |
3209 | indicated by ``clockwise``. | |
3210 | """ | |
54f9ee45 | 3211 | return _core_.Image_Rotate90(*args, **kwargs) |
e811c8ce RD |
3212 | |
3213 | def Mirror(*args, **kwargs): | |
7a27cf7c RD |
3214 | """ |
3215 | Mirror(self, bool horizontally=True) -> Image | |
3216 | ||
3217 | Returns a mirrored copy of the image. The parameter ``horizontally`` | |
3218 | indicates the orientation. | |
3219 | """ | |
54f9ee45 | 3220 | return _core_.Image_Mirror(*args, **kwargs) |
e811c8ce RD |
3221 | |
3222 | def Replace(*args, **kwargs): | |
0df68c9f | 3223 | """ |
7a27cf7c RD |
3224 | Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2) |
3225 | ||
3226 | Replaces the colour specified by ``(r1,g1,b1)`` by the colour | |
3227 | ``(r2,g2,b2)``. | |
0df68c9f | 3228 | """ |
54f9ee45 | 3229 | return _core_.Image_Replace(*args, **kwargs) |
e811c8ce | 3230 | |
32fe5131 RD |
3231 | def ConvertToGreyscale(*args, **kwargs): |
3232 | """ | |
3233 | ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image | |
3234 | ||
3235 | Convert to greyscale image. Uses the luminance component (Y) of the | |
3236 | image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb), | |
3237 | defaults to ITU-T BT.601 | |
3238 | """ | |
3239 | return _core_.Image_ConvertToGreyscale(*args, **kwargs) | |
3240 | ||
e811c8ce | 3241 | def ConvertToMono(*args, **kwargs): |
7a27cf7c RD |
3242 | """ |
3243 | ConvertToMono(self, byte r, byte g, byte b) -> Image | |
3244 | ||
3245 | Returns monochromatic version of the image. The returned image has | |
3246 | white colour where the original has ``(r,g,b)`` colour and black | |
3247 | colour everywhere else. | |
3248 | """ | |
54f9ee45 | 3249 | return _core_.Image_ConvertToMono(*args, **kwargs) |
e811c8ce RD |
3250 | |
3251 | def SetOption(*args, **kwargs): | |
7a27cf7c RD |
3252 | """ |
3253 | SetOption(self, String name, String value) | |
3254 | ||
3255 | Sets an image handler defined option. For example, when saving as a | |
3256 | JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a | |
3257 | number between 0 and 100 (0 is terrible, 100 is very good). | |
3258 | """ | |
54f9ee45 | 3259 | return _core_.Image_SetOption(*args, **kwargs) |
e811c8ce RD |
3260 | |
3261 | def SetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
3262 | """ |
3263 | SetOptionInt(self, String name, int value) | |
3264 | ||
3265 | Sets an image option as an integer. | |
3266 | """ | |
54f9ee45 | 3267 | return _core_.Image_SetOptionInt(*args, **kwargs) |
e811c8ce RD |
3268 | |
3269 | def GetOption(*args, **kwargs): | |
7a27cf7c RD |
3270 | """ |
3271 | GetOption(self, String name) -> String | |
3272 | ||
3273 | Gets the value of an image handler option. | |
3274 | """ | |
54f9ee45 | 3275 | return _core_.Image_GetOption(*args, **kwargs) |
e811c8ce RD |
3276 | |
3277 | def GetOptionInt(*args, **kwargs): | |
7a27cf7c RD |
3278 | """ |
3279 | GetOptionInt(self, String name) -> int | |
3280 | ||
3281 | Gets the value of an image handler option as an integer. If the given | |
3282 | option is not present, the function returns 0. | |
3283 | """ | |
54f9ee45 | 3284 | return _core_.Image_GetOptionInt(*args, **kwargs) |
e811c8ce RD |
3285 | |
3286 | def HasOption(*args, **kwargs): | |
7a27cf7c RD |
3287 | """ |
3288 | HasOption(self, String name) -> bool | |
3289 | ||
3290 | Returns true if the given option is present. | |
3291 | """ | |
54f9ee45 | 3292 | return _core_.Image_HasOption(*args, **kwargs) |
e811c8ce RD |
3293 | |
3294 | def CountColours(*args, **kwargs): | |
a95a7133 | 3295 | """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long""" |
54f9ee45 | 3296 | return _core_.Image_CountColours(*args, **kwargs) |
e811c8ce RD |
3297 | |
3298 | def ComputeHistogram(*args, **kwargs): | |
a95a7133 | 3299 | """ComputeHistogram(self, ImageHistogram h) -> unsigned long""" |
54f9ee45 | 3300 | return _core_.Image_ComputeHistogram(*args, **kwargs) |
e811c8ce RD |
3301 | |
3302 | def AddHandler(*args, **kwargs): | |
66c033b4 | 3303 | """AddHandler(ImageHandler handler)""" |
54f9ee45 | 3304 | return _core_.Image_AddHandler(*args, **kwargs) |
e811c8ce RD |
3305 | |
3306 | AddHandler = staticmethod(AddHandler) | |
3307 | def InsertHandler(*args, **kwargs): | |
66c033b4 | 3308 | """InsertHandler(ImageHandler handler)""" |
54f9ee45 | 3309 | return _core_.Image_InsertHandler(*args, **kwargs) |
e811c8ce RD |
3310 | |
3311 | InsertHandler = staticmethod(InsertHandler) | |
3312 | def RemoveHandler(*args, **kwargs): | |
66c033b4 | 3313 | """RemoveHandler(String name) -> bool""" |
54f9ee45 | 3314 | return _core_.Image_RemoveHandler(*args, **kwargs) |
e811c8ce RD |
3315 | |
3316 | RemoveHandler = staticmethod(RemoveHandler) | |
0085ce49 RD |
3317 | def GetHandlers(*args, **kwargs): |
3318 | """GetHandlers() -> PyObject""" | |
3319 | return _core_.Image_GetHandlers(*args, **kwargs) | |
3320 | ||
3321 | GetHandlers = staticmethod(GetHandlers) | |
e811c8ce | 3322 | def GetImageExtWildcard(*args, **kwargs): |
7a27cf7c RD |
3323 | """ |
3324 | GetImageExtWildcard() -> String | |
3325 | ||
3326 | Iterates all registered wxImageHandler objects, and returns a string | |
3327 | containing file extension masks suitable for passing to file open/save | |
3328 | dialog boxes. | |
3329 | """ | |
54f9ee45 | 3330 | return _core_.Image_GetImageExtWildcard(*args, **kwargs) |
e811c8ce RD |
3331 | |
3332 | GetImageExtWildcard = staticmethod(GetImageExtWildcard) | |
3333 | def ConvertToBitmap(*args, **kwargs): | |
1fbf26be | 3334 | """ConvertToBitmap(self, int depth=-1) -> Bitmap""" |
54f9ee45 | 3335 | return _core_.Image_ConvertToBitmap(*args, **kwargs) |
e811c8ce RD |
3336 | |
3337 | def ConvertToMonoBitmap(*args, **kwargs): | |
7a27cf7c | 3338 | """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap""" |
54f9ee45 | 3339 | return _core_.Image_ConvertToMonoBitmap(*args, **kwargs) |
e811c8ce | 3340 | |
943e8dfd RD |
3341 | def RotateHue(*args, **kwargs): |
3342 | """ | |
3343 | RotateHue(self, double angle) | |
3344 | ||
3345 | Rotates the hue of each pixel of the image. Hue is a double in the | |
3346 | range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees | |
3347 | """ | |
3348 | return _core_.Image_RotateHue(*args, **kwargs) | |
3349 | ||
3350 | def RGBtoHSV(*args, **kwargs): | |
3351 | """ | |
3352 | RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue | |
3353 | ||
3354 | Converts a color in RGB color space to HSV color space. | |
3355 | """ | |
3356 | return _core_.Image_RGBtoHSV(*args, **kwargs) | |
3357 | ||
3358 | RGBtoHSV = staticmethod(RGBtoHSV) | |
3359 | def HSVtoRGB(*args, **kwargs): | |
3360 | """ | |
3361 | HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue | |
3362 | ||
3363 | Converts a color in HSV color space to RGB color space. | |
3364 | """ | |
3365 | return _core_.Image_HSVtoRGB(*args, **kwargs) | |
3366 | ||
3367 | HSVtoRGB = staticmethod(HSVtoRGB) | |
b39fe951 | 3368 | def __nonzero__(self): return self.IsOk() |
97ab0f6a RD |
3369 | AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`") |
3370 | AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`") | |
3371 | Data = property(GetData,SetData,doc="See `GetData` and `SetData`") | |
3372 | DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`") | |
3373 | Height = property(GetHeight,doc="See `GetHeight`") | |
3374 | MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`") | |
3375 | MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`") | |
3376 | MaskRed = property(GetMaskRed,doc="See `GetMaskRed`") | |
97ab0f6a | 3377 | Width = property(GetWidth,doc="See `GetWidth`") |
2131d850 | 3378 | _core_.Image_swigregister(Image) |
d14a1e28 RD |
3379 | |
3380 | def ImageFromMime(*args, **kwargs): | |
7a27cf7c RD |
3381 | """ |
3382 | ImageFromMime(String name, String mimetype, int index=-1) -> Image | |
3383 | ||
3384 | Loads an image from a file, using a MIME type string (such as | |
3385 | 'image/jpeg') to specify image type. | |
3386 | """ | |
54f9ee45 | 3387 | val = _core_.new_ImageFromMime(*args, **kwargs) |
d14a1e28 RD |
3388 | return val |
3389 | ||
3390 | def ImageFromStream(*args, **kwargs): | |
7a27cf7c RD |
3391 | """ |
3392 | ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image | |
3393 | ||
3394 | Loads an image from an input stream, or any readable Python file-like | |
3395 | object. | |
3396 | """ | |
54f9ee45 | 3397 | val = _core_.new_ImageFromStream(*args, **kwargs) |
d14a1e28 RD |
3398 | return val |
3399 | ||
3400 | def ImageFromStreamMime(*args, **kwargs): | |
7a27cf7c RD |
3401 | """ |
3402 | ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image | |
3403 | ||
3404 | Loads an image from an input stream, or any readable Python file-like | |
3405 | object, specifying the image format with a MIME type string. | |
3406 | """ | |
54f9ee45 | 3407 | val = _core_.new_ImageFromStreamMime(*args, **kwargs) |
d14a1e28 RD |
3408 | return val |
3409 | ||
66c033b4 | 3410 | def EmptyImage(*args, **kwargs): |
61d07ac7 RD |
3411 | """ |
3412 | EmptyImage(int width=0, int height=0, bool clear=True) -> Image | |
3413 | ||
3414 | Construct an empty image of a given size, optionally setting all | |
3415 | pixels to black. | |
3416 | """ | |
66c033b4 | 3417 | val = _core_.new_EmptyImage(*args, **kwargs) |
d14a1e28 RD |
3418 | return val |
3419 | ||
3420 | def ImageFromBitmap(*args, **kwargs): | |
61d07ac7 RD |
3421 | """ |
3422 | ImageFromBitmap(Bitmap bitmap) -> Image | |
3423 | ||
3424 | Construct an Image from a `wx.Bitmap`. | |
3425 | """ | |
54f9ee45 | 3426 | val = _core_.new_ImageFromBitmap(*args, **kwargs) |
d14a1e28 RD |
3427 | return val |
3428 | ||
3429 | def ImageFromData(*args, **kwargs): | |
61d07ac7 RD |
3430 | """ |
3431 | ImageFromData(int width, int height, buffer data) -> Image | |
3432 | ||
3433 | Construct an Image from a buffer of RGB bytes. Accepts either a | |
3434 | string or a buffer object holding the data and the length of the data | |
3435 | must be width*height*3. | |
3436 | """ | |
54f9ee45 | 3437 | val = _core_.new_ImageFromData(*args, **kwargs) |
d14a1e28 RD |
3438 | return val |
3439 | ||
1823fbb4 | 3440 | def ImageFromDataWithAlpha(*args, **kwargs): |
61d07ac7 RD |
3441 | """ |
3442 | ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image | |
3443 | ||
3444 | Construct an Image from a buffer of RGB bytes with an Alpha channel. | |
3445 | Accepts either a string or a buffer object holding the data and the | |
7a27cf7c RD |
3446 | length of the data must be width*height*3 bytes, and the length of the |
3447 | alpha data must be width*height bytes. | |
61d07ac7 | 3448 | """ |
1823fbb4 | 3449 | val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs) |
1823fbb4 RD |
3450 | return val |
3451 | ||
e811c8ce | 3452 | def Image_CanRead(*args, **kwargs): |
0085ce49 | 3453 | """ |
7a27cf7c RD |
3454 | Image_CanRead(String filename) -> bool |
3455 | ||
3456 | Returns True if the image handlers can read this file. | |
3457 | """ | |
0085ce49 | 3458 | return _core_.Image_CanRead(*args, **kwargs) |
d14a1e28 | 3459 | |
e811c8ce | 3460 | def Image_GetImageCount(*args, **kwargs): |
0085ce49 | 3461 | """ |
7a27cf7c RD |
3462 | Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int |
3463 | ||
3464 | If the image file contains more than one image and the image handler | |
3465 | is capable of retrieving these individually, this function will return | |
3466 | the number of available images. | |
3467 | """ | |
0085ce49 | 3468 | return _core_.Image_GetImageCount(*args, **kwargs) |
d14a1e28 | 3469 | |
e811c8ce | 3470 | def Image_CanReadStream(*args, **kwargs): |
0085ce49 | 3471 | """ |
7a27cf7c RD |
3472 | Image_CanReadStream(InputStream stream) -> bool |
3473 | ||
3474 | Returns True if the image handlers can read an image file from the | |
3475 | data currently on the input stream, or a readable Python file-like | |
3476 | object. | |
3477 | """ | |
0085ce49 | 3478 | return _core_.Image_CanReadStream(*args, **kwargs) |
d14a1e28 | 3479 | |
e811c8ce | 3480 | def Image_AddHandler(*args, **kwargs): |
0085ce49 RD |
3481 | """Image_AddHandler(ImageHandler handler)""" |
3482 | return _core_.Image_AddHandler(*args, **kwargs) | |
d14a1e28 | 3483 | |
e811c8ce | 3484 | def Image_InsertHandler(*args, **kwargs): |
0085ce49 RD |
3485 | """Image_InsertHandler(ImageHandler handler)""" |
3486 | return _core_.Image_InsertHandler(*args, **kwargs) | |
d14a1e28 | 3487 | |
e811c8ce | 3488 | def Image_RemoveHandler(*args, **kwargs): |
0085ce49 RD |
3489 | """Image_RemoveHandler(String name) -> bool""" |
3490 | return _core_.Image_RemoveHandler(*args, **kwargs) | |
d14a1e28 | 3491 | |
0085ce49 RD |
3492 | def Image_GetHandlers(*args): |
3493 | """Image_GetHandlers() -> PyObject""" | |
3494 | return _core_.Image_GetHandlers(*args) | |
3495 | ||
3496 | def Image_GetImageExtWildcard(*args): | |
3497 | """ | |
7a27cf7c RD |
3498 | Image_GetImageExtWildcard() -> String |
3499 | ||
3500 | Iterates all registered wxImageHandler objects, and returns a string | |
3501 | containing file extension masks suitable for passing to file open/save | |
3502 | dialog boxes. | |
3503 | """ | |
0085ce49 | 3504 | return _core_.Image_GetImageExtWildcard(*args) |
d14a1e28 | 3505 | |
943e8dfd | 3506 | def Image_RGBtoHSV(*args, **kwargs): |
0085ce49 | 3507 | """ |
943e8dfd RD |
3508 | Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue |
3509 | ||
3510 | Converts a color in RGB color space to HSV color space. | |
3511 | """ | |
0085ce49 | 3512 | return _core_.Image_RGBtoHSV(*args, **kwargs) |
943e8dfd RD |
3513 | |
3514 | def Image_HSVtoRGB(*args, **kwargs): | |
0085ce49 | 3515 | """ |
943e8dfd RD |
3516 | Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue |
3517 | ||
3518 | Converts a color in HSV color space to RGB color space. | |
3519 | """ | |
0085ce49 | 3520 | return _core_.Image_HSVtoRGB(*args, **kwargs) |
943e8dfd | 3521 | |
fc46b7f3 RD |
3522 | |
3523 | def _ImageFromBuffer(*args, **kwargs): | |
3524 | """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image""" | |
3525 | return _core_._ImageFromBuffer(*args, **kwargs) | |
3526 | def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None): | |
3527 | """ | |
3528 | Creates a `wx.Image` from the data in dataBuffer. The dataBuffer | |
eec1c382 RD |
3529 | parameter must be a Python object that implements the buffer interface, |
3530 | such as a string, array, etc. The dataBuffer object is expected to | |
3531 | contain a series of RGB bytes and be width*height*3 bytes long. A buffer | |
3532 | object can optionally be supplied for the image's alpha channel data, and | |
3533 | it is expected to be width*height bytes long. | |
fc46b7f3 RD |
3534 | |
3535 | The wx.Image will be created with its data and alpha pointers initialized | |
3536 | to the memory address pointed to by the buffer objects, thus saving the | |
3537 | time needed to copy the image data from the buffer object to the wx.Image. | |
3538 | While this has advantages, it also has the shoot-yourself-in-the-foot | |
3539 | risks associated with sharing a C pointer between two objects. | |
3540 | ||
3541 | To help alleviate the risk a reference to the data and alpha buffer | |
3542 | objects are kept with the wx.Image, so that they won't get deleted until | |
3543 | after the wx.Image is deleted. However please be aware that it is not | |
3544 | guaranteed that an object won't move its memory buffer to a new location | |
3545 | when it needs to resize its contents. If that happens then the wx.Image | |
3546 | will end up referring to an invalid memory location and could cause the | |
3547 | application to crash. Therefore care should be taken to not manipulate | |
3548 | the objects used for the data and alpha buffers in a way that would cause | |
3549 | them to change size. | |
3550 | """ | |
fc46b7f3 RD |
3551 | image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer) |
3552 | image._buffer = dataBuffer | |
3553 | image._alpha = alphaBuffer | |
3554 | return image | |
3555 | ||
5e4ca4a8 RD |
3556 | def InitAllImageHandlers(): |
3557 | """ | |
3558 | The former functionality of InitAllImageHanders is now done internal to | |
3559 | the _core_ extension module and so this function has become a simple NOP. | |
3560 | """ | |
3561 | pass | |
d14a1e28 | 3562 | |
da9714b5 | 3563 | IMAGE_RESOLUTION_NONE = _core_.IMAGE_RESOLUTION_NONE |
54f9ee45 RD |
3564 | IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES |
3565 | IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM | |
b9d6a5f3 RD |
3566 | PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR |
3567 | PNG_TYPE_GREY = _core_.PNG_TYPE_GREY | |
3568 | PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED | |
54f9ee45 RD |
3569 | BMP_24BPP = _core_.BMP_24BPP |
3570 | BMP_8BPP = _core_.BMP_8BPP | |
3571 | BMP_8BPP_GREY = _core_.BMP_8BPP_GREY | |
3572 | BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY | |
3573 | BMP_8BPP_RED = _core_.BMP_8BPP_RED | |
3574 | BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE | |
3575 | BMP_4BPP = _core_.BMP_4BPP | |
3576 | BMP_1BPP = _core_.BMP_1BPP | |
3577 | BMP_1BPP_BW = _core_.BMP_1BPP_BW | |
d14a1e28 | 3578 | class BMPHandler(ImageHandler): |
27fb7603 | 3579 | """A `wx.ImageHandler` for \*.bmp bitmap files.""" |
0085ce49 RD |
3580 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3581 | __repr__ = _swig_repr | |
3582 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3583 | """ |
3584 | __init__(self) -> BMPHandler | |
3585 | ||
3586 | A `wx.ImageHandler` for \*.bmp bitmap files. | |
3587 | """ | |
0085ce49 | 3588 | _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs)) |
2131d850 | 3589 | _core_.BMPHandler_swigregister(BMPHandler) |
d14a1e28 | 3590 | NullImage = cvar.NullImage |
0c243d93 | 3591 | IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME |
d14a1e28 RD |
3592 | IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT |
3593 | IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X | |
3594 | IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y | |
3595 | IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION | |
0c243d93 RD |
3596 | IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX |
3597 | IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY | |
d14a1e28 | 3598 | IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT |
24d7cbea | 3599 | IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY |
0c243d93 RD |
3600 | IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE |
3601 | IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL | |
3602 | IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION | |
3603 | IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR | |
b9d6a5f3 RD |
3604 | IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT |
3605 | IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH | |
d14a1e28 RD |
3606 | |
3607 | class ICOHandler(BMPHandler): | |
27fb7603 | 3608 | """A `wx.ImageHandler` for \*.ico icon files.""" |
0085ce49 RD |
3609 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3610 | __repr__ = _swig_repr | |
3611 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3612 | """ |
3613 | __init__(self) -> ICOHandler | |
3614 | ||
3615 | A `wx.ImageHandler` for \*.ico icon files. | |
3616 | """ | |
0085ce49 | 3617 | _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs)) |
2131d850 | 3618 | _core_.ICOHandler_swigregister(ICOHandler) |
d14a1e28 RD |
3619 | |
3620 | class CURHandler(ICOHandler): | |
27fb7603 | 3621 | """A `wx.ImageHandler` for \*.cur cursor files.""" |
0085ce49 RD |
3622 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3623 | __repr__ = _swig_repr | |
3624 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3625 | """ |
3626 | __init__(self) -> CURHandler | |
3627 | ||
3628 | A `wx.ImageHandler` for \*.cur cursor files. | |
3629 | """ | |
0085ce49 | 3630 | _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs)) |
2131d850 | 3631 | _core_.CURHandler_swigregister(CURHandler) |
d14a1e28 RD |
3632 | |
3633 | class ANIHandler(CURHandler): | |
27fb7603 | 3634 | """A `wx.ImageHandler` for \*.ani animated cursor files.""" |
0085ce49 RD |
3635 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3636 | __repr__ = _swig_repr | |
3637 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3638 | """ |
3639 | __init__(self) -> ANIHandler | |
3640 | ||
3641 | A `wx.ImageHandler` for \*.ani animated cursor files. | |
3642 | """ | |
0085ce49 | 3643 | _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs)) |
2131d850 | 3644 | _core_.ANIHandler_swigregister(ANIHandler) |
d14a1e28 RD |
3645 | |
3646 | class PNGHandler(ImageHandler): | |
27fb7603 | 3647 | """A `wx.ImageHandler` for PNG image files.""" |
0085ce49 RD |
3648 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3649 | __repr__ = _swig_repr | |
3650 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3651 | """ |
3652 | __init__(self) -> PNGHandler | |
3653 | ||
3654 | A `wx.ImageHandler` for PNG image files. | |
3655 | """ | |
0085ce49 | 3656 | _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs)) |
2131d850 | 3657 | _core_.PNGHandler_swigregister(PNGHandler) |
d14a1e28 RD |
3658 | |
3659 | class GIFHandler(ImageHandler): | |
27fb7603 | 3660 | """A `wx.ImageHandler` for GIF image files.""" |
0085ce49 RD |
3661 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3662 | __repr__ = _swig_repr | |
3663 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3664 | """ |
3665 | __init__(self) -> GIFHandler | |
3666 | ||
3667 | A `wx.ImageHandler` for GIF image files. | |
3668 | """ | |
0085ce49 | 3669 | _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs)) |
2131d850 | 3670 | _core_.GIFHandler_swigregister(GIFHandler) |
d14a1e28 RD |
3671 | |
3672 | class PCXHandler(ImageHandler): | |
27fb7603 | 3673 | """A `wx.ImageHandler` for PCX imager files.""" |
0085ce49 RD |
3674 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3675 | __repr__ = _swig_repr | |
3676 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3677 | """ |
3678 | __init__(self) -> PCXHandler | |
3679 | ||
3680 | A `wx.ImageHandler` for PCX imager files. | |
3681 | """ | |
0085ce49 | 3682 | _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs)) |
2131d850 | 3683 | _core_.PCXHandler_swigregister(PCXHandler) |
d14a1e28 RD |
3684 | |
3685 | class JPEGHandler(ImageHandler): | |
27fb7603 | 3686 | """A `wx.ImageHandler` for JPEG/JPG image files.""" |
0085ce49 RD |
3687 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3688 | __repr__ = _swig_repr | |
3689 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3690 | """ |
3691 | __init__(self) -> JPEGHandler | |
3692 | ||
3693 | A `wx.ImageHandler` for JPEG/JPG image files. | |
3694 | """ | |
0085ce49 | 3695 | _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs)) |
2131d850 | 3696 | _core_.JPEGHandler_swigregister(JPEGHandler) |
d14a1e28 RD |
3697 | |
3698 | class PNMHandler(ImageHandler): | |
27fb7603 | 3699 | """A `wx.ImageHandler` for PNM image files.""" |
0085ce49 RD |
3700 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3701 | __repr__ = _swig_repr | |
3702 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3703 | """ |
3704 | __init__(self) -> PNMHandler | |
3705 | ||
3706 | A `wx.ImageHandler` for PNM image files. | |
3707 | """ | |
0085ce49 | 3708 | _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs)) |
2131d850 | 3709 | _core_.PNMHandler_swigregister(PNMHandler) |
d14a1e28 RD |
3710 | |
3711 | class XPMHandler(ImageHandler): | |
27fb7603 | 3712 | """A `wx.ImageHandler` for XPM image.""" |
0085ce49 RD |
3713 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3714 | __repr__ = _swig_repr | |
3715 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3716 | """ |
3717 | __init__(self) -> XPMHandler | |
3718 | ||
3719 | A `wx.ImageHandler` for XPM image. | |
3720 | """ | |
0085ce49 | 3721 | _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs)) |
2131d850 | 3722 | _core_.XPMHandler_swigregister(XPMHandler) |
d14a1e28 RD |
3723 | |
3724 | class TIFFHandler(ImageHandler): | |
27fb7603 | 3725 | """A `wx.ImageHandler` for TIFF image files.""" |
0085ce49 RD |
3726 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3727 | __repr__ = _swig_repr | |
3728 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
3729 | """ |
3730 | __init__(self) -> TIFFHandler | |
3731 | ||
3732 | A `wx.ImageHandler` for TIFF image files. | |
3733 | """ | |
0085ce49 | 3734 | _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs)) |
2131d850 | 3735 | _core_.TIFFHandler_swigregister(TIFFHandler) |
d14a1e28 | 3736 | |
580080c5 RD |
3737 | class TGAHandler(ImageHandler): |
3738 | """A `wx.ImageHandler` for TGA image files.""" | |
3739 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
3740 | __repr__ = _swig_repr | |
3741 | def __init__(self, *args, **kwargs): | |
3742 | """ | |
3743 | __init__(self) -> TGAHandler | |
3744 | ||
3745 | A `wx.ImageHandler` for TGA image files. | |
3746 | """ | |
3747 | _core_.TGAHandler_swiginit(self,_core_.new_TGAHandler(*args, **kwargs)) | |
3748 | _core_.TGAHandler_swigregister(TGAHandler) | |
3749 | ||
c0de73ae RD |
3750 | QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS |
3751 | QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE | |
3752 | class Quantize(object): | |
3753 | """Performs quantization, or colour reduction, on a wxImage.""" | |
0085ce49 RD |
3754 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3755 | def __init__(self): raise AttributeError, "No constructor defined" | |
3756 | __repr__ = _swig_repr | |
c0de73ae RD |
3757 | def Quantize(*args, **kwargs): |
3758 | """ | |
3759 | Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool | |
3760 | ||
3761 | Reduce the colours in the source image and put the result into the | |
3762 | destination image, setting the palette in the destination if | |
3763 | needed. Both images may be the same, to overwrite the source image. | |
3764 | """ | |
3765 | return _core_.Quantize_Quantize(*args, **kwargs) | |
3766 | ||
3767 | Quantize = staticmethod(Quantize) | |
2131d850 | 3768 | _core_.Quantize_swigregister(Quantize) |
c0de73ae RD |
3769 | |
3770 | def Quantize_Quantize(*args, **kwargs): | |
0085ce49 | 3771 | """ |
c0de73ae RD |
3772 | Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool |
3773 | ||
3774 | Reduce the colours in the source image and put the result into the | |
3775 | destination image, setting the palette in the destination if | |
3776 | needed. Both images may be the same, to overwrite the source image. | |
3777 | """ | |
0085ce49 | 3778 | return _core_.Quantize_Quantize(*args, **kwargs) |
c0de73ae | 3779 | |
d14a1e28 RD |
3780 | #--------------------------------------------------------------------------- |
3781 | ||
3782 | class EvtHandler(Object): | |
093d3ff1 | 3783 | """Proxy of C++ EvtHandler class""" |
0085ce49 RD |
3784 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
3785 | __repr__ = _swig_repr | |
3786 | def __init__(self, *args, **kwargs): | |
a95a7133 | 3787 | """__init__(self) -> EvtHandler""" |
0085ce49 | 3788 | _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs)) |
d49bdf34 RD |
3789 | self._setOORInfo(self) |
3790 | ||
e811c8ce | 3791 | def GetNextHandler(*args, **kwargs): |
a95a7133 | 3792 | """GetNextHandler(self) -> EvtHandler""" |
54f9ee45 | 3793 | return _core_.EvtHandler_GetNextHandler(*args, **kwargs) |
e811c8ce RD |
3794 | |
3795 | def GetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3796 | """GetPreviousHandler(self) -> EvtHandler""" |
54f9ee45 | 3797 | return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3798 | |
3799 | def SetNextHandler(*args, **kwargs): | |
a95a7133 | 3800 | """SetNextHandler(self, EvtHandler handler)""" |
54f9ee45 | 3801 | return _core_.EvtHandler_SetNextHandler(*args, **kwargs) |
e811c8ce RD |
3802 | |
3803 | def SetPreviousHandler(*args, **kwargs): | |
a95a7133 | 3804 | """SetPreviousHandler(self, EvtHandler handler)""" |
54f9ee45 | 3805 | return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs) |
e811c8ce RD |
3806 | |
3807 | def GetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3808 | """GetEvtHandlerEnabled(self) -> bool""" |
54f9ee45 | 3809 | return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3810 | |
3811 | def SetEvtHandlerEnabled(*args, **kwargs): | |
a95a7133 | 3812 | """SetEvtHandlerEnabled(self, bool enabled)""" |
54f9ee45 | 3813 | return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs) |
e811c8ce RD |
3814 | |
3815 | def ProcessEvent(*args, **kwargs): | |
a95a7133 | 3816 | """ProcessEvent(self, Event event) -> bool""" |
54f9ee45 | 3817 | return _core_.EvtHandler_ProcessEvent(*args, **kwargs) |
e811c8ce RD |
3818 | |
3819 | def AddPendingEvent(*args, **kwargs): | |
a95a7133 | 3820 | """AddPendingEvent(self, Event event)""" |
54f9ee45 | 3821 | return _core_.EvtHandler_AddPendingEvent(*args, **kwargs) |
e811c8ce RD |
3822 | |
3823 | def ProcessPendingEvents(*args, **kwargs): | |
a95a7133 | 3824 | """ProcessPendingEvents(self)""" |
54f9ee45 | 3825 | return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
3826 | |
3827 | def Connect(*args, **kwargs): | |
a95a7133 | 3828 | """Connect(self, int id, int lastId, int eventType, PyObject func)""" |
54f9ee45 | 3829 | return _core_.EvtHandler_Connect(*args, **kwargs) |
e811c8ce RD |
3830 | |
3831 | def Disconnect(*args, **kwargs): | |
2131d850 | 3832 | """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool""" |
54f9ee45 | 3833 | return _core_.EvtHandler_Disconnect(*args, **kwargs) |
e811c8ce RD |
3834 | |
3835 | def _setOORInfo(*args, **kwargs): | |
689b42ee | 3836 | """_setOORInfo(self, PyObject _self, bool incref=True)""" |
7e08d4ef | 3837 | val = _core_.EvtHandler__setOORInfo(*args, **kwargs) |
15665b47 | 3838 | args[0].this.own(False) |
7e08d4ef | 3839 | return val |
e811c8ce | 3840 | |
d14a1e28 RD |
3841 | def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3842 | """ | |
3843 | Bind an event to an event handler. | |
3844 | ||
db3e571a RD |
3845 | :param event: One of the EVT_* objects that specifies the |
3846 | type of event to bind, | |
d14a1e28 | 3847 | |
db3e571a RD |
3848 | :param handler: A callable object to be invoked when the |
3849 | event is delivered to self. Pass None to | |
3850 | disconnect an event handler. | |
d14a1e28 | 3851 | |
db3e571a RD |
3852 | :param source: Sometimes the event originates from a |
3853 | different window than self, but you still | |
3854 | want to catch it in self. (For example, a | |
3855 | button event delivered to a frame.) By | |
3856 | passing the source of the event, the event | |
3857 | handling system is able to differentiate | |
3858 | between the same event type from different | |
3859 | controls. | |
d14a1e28 | 3860 | |
db3e571a RD |
3861 | :param id: Used to spcify the event source by ID instead |
3862 | of instance. | |
3863 | ||
3864 | :param id2: Used when it is desirable to bind a handler | |
3865 | to a range of IDs, such as with EVT_MENU_RANGE. | |
d14a1e28 RD |
3866 | """ |
3867 | if source is not None: | |
3868 | id = source.GetId() | |
3869 | event.Bind(self, id, id2, handler) | |
3870 | ||
66c033b4 RD |
3871 | def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): |
3872 | """ | |
3873 | Disconencts the event handler binding for event from self. | |
3874 | Returns True if successful. | |
3875 | """ | |
3876 | if source is not None: | |
3877 | id = source.GetId() | |
3878 | return event.Unbind(self, id, id2) | |
d14a1e28 | 3879 | |
97ab0f6a RD |
3880 | EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`") |
3881 | NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`") | |
3882 | PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`") | |
2131d850 | 3883 | _core_.EvtHandler_swigregister(EvtHandler) |
d14a1e28 RD |
3884 | |
3885 | #--------------------------------------------------------------------------- | |
3886 | ||
3887 | class PyEventBinder(object): | |
3888 | """ | |
3889 | Instances of this class are used to bind specific events to event | |
3890 | handlers. | |
3891 | """ | |
3892 | def __init__(self, evtType, expectedIDs=0): | |
3893 | if expectedIDs not in [0, 1, 2]: | |
3894 | raise ValueError, "Invalid number of expectedIDs" | |
3895 | self.expectedIDs = expectedIDs | |
3896 | ||
3897 | if type(evtType) == list or type(evtType) == tuple: | |
3898 | self.evtType = evtType | |
3899 | else: | |
3900 | self.evtType = [evtType] | |
3901 | ||
3902 | ||
3903 | def Bind(self, target, id1, id2, function): | |
3904 | """Bind this set of event types to target.""" | |
3905 | for et in self.evtType: | |
3906 | target.Connect(id1, id2, et, function) | |
3907 | ||
66c033b4 RD |
3908 | |
3909 | def Unbind(self, target, id1, id2): | |
3910 | """Remove an event binding.""" | |
3911 | success = 0 | |
3912 | for et in self.evtType: | |
3913 | success += target.Disconnect(id1, id2, et) | |
3914 | return success != 0 | |
3915 | ||
b08d67c2 RD |
3916 | def _getEvtType(self): |
3917 | """ | |
3918 | Make it easy to get to the default wxEventType typeID for this | |
3919 | event binder. | |
3920 | """ | |
3921 | return self.evtType[0] | |
3922 | ||
3923 | typeId = property(_getEvtType) | |
3924 | ||
d14a1e28 RD |
3925 | |
3926 | def __call__(self, *args): | |
3927 | """ | |
3928 | For backwards compatibility with the old EVT_* functions. | |
3929 | Should be called with either (window, func), (window, ID, | |
3930 | func) or (window, ID1, ID2, func) parameters depending on the | |
3931 | type of the event. | |
3932 | """ | |
3933 | assert len(args) == 2 + self.expectedIDs | |
3934 | id1 = wx.ID_ANY | |
3935 | id2 = wx.ID_ANY | |
3936 | target = args[0] | |
3937 | if self.expectedIDs == 0: | |
3938 | func = args[1] | |
3939 | elif self.expectedIDs == 1: | |
3940 | id1 = args[1] | |
3941 | func = args[2] | |
3942 | elif self.expectedIDs == 2: | |
3943 | id1 = args[1] | |
3944 | id2 = args[2] | |
3945 | func = args[3] | |
3946 | else: | |
3947 | raise ValueError, "Unexpected number of IDs" | |
3948 | ||
3949 | self.Bind(target, id1, id2, func) | |
3950 | ||
3951 | ||
3952 | # These two are square pegs that don't fit the PyEventBinder hole... | |
3953 | def EVT_COMMAND(win, id, cmd, func): | |
3954 | win.Connect(id, -1, cmd, func) | |
3955 | def EVT_COMMAND_RANGE(win, id1, id2, cmd, func): | |
3956 | win.Connect(id1, id2, cmd, func) | |
3957 | ||
3958 | ||
3959 | #--------------------------------------------------------------------------- | |
3960 | ||
3961 | #--------------------------------------------------------------------------- | |
3962 | ||
54f9ee45 RD |
3963 | EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE |
3964 | EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX | |
d14a1e28 | 3965 | |
0085ce49 | 3966 | def NewEventType(*args): |
2131d850 | 3967 | """NewEventType() -> EventType""" |
0085ce49 | 3968 | return _core_.NewEventType(*args) |
4976f996 | 3969 | wxEVT_ANY = _core_.wxEVT_ANY |
54f9ee45 RD |
3970 | wxEVT_NULL = _core_.wxEVT_NULL |
3971 | wxEVT_FIRST = _core_.wxEVT_FIRST | |
3972 | wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST | |
3973 | wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED | |
3974 | wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED | |
3975 | wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED | |
3976 | wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED | |
3977 | wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED | |
3978 | wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED | |
3979 | wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED | |
3980 | wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED | |
3981 | wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED | |
3982 | wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED | |
3983 | wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED | |
3984 | wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED | |
3985 | wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED | |
3986 | wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED | |
3987 | wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED | |
3988 | wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER | |
3989 | wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN | |
3990 | wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP | |
3991 | wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN | |
3992 | wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP | |
3993 | wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN | |
3994 | wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP | |
3995 | wxEVT_MOTION = _core_.wxEVT_MOTION | |
3996 | wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW | |
3997 | wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW | |
3998 | wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK | |
3999 | wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK | |
4000 | wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK | |
4001 | wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS | |
4002 | wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS | |
4003 | wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS | |
4004 | wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL | |
4005 | wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN | |
4006 | wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP | |
4007 | wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN | |
4008 | wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP | |
4009 | wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN | |
4010 | wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP | |
4011 | wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION | |
4012 | wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW | |
4013 | wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW | |
4014 | wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK | |
4015 | wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK | |
4016 | wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK | |
4017 | wxEVT_CHAR = _core_.wxEVT_CHAR | |
4018 | wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK | |
4019 | wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY | |
4020 | wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN | |
4021 | wxEVT_KEY_UP = _core_.wxEVT_KEY_UP | |
4022 | wxEVT_HOTKEY = _core_.wxEVT_HOTKEY | |
4023 | wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR | |
4024 | wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP | |
4025 | wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM | |
4026 | wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP | |
4027 | wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN | |
4028 | wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP | |
4029 | wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN | |
4030 | wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK | |
4031 | wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE | |
4f433fef RD |
4032 | wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED |
4033 | wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED | |
54f9ee45 RD |
4034 | wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP |
4035 | wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM | |
4036 | wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP | |
4037 | wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN | |
4038 | wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP | |
4039 | wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN | |
4040 | wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK | |
4041 | wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE | |
4042 | wxEVT_SIZE = _core_.wxEVT_SIZE | |
4043 | wxEVT_MOVE = _core_.wxEVT_MOVE | |
4044 | wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW | |
4045 | wxEVT_END_SESSION = _core_.wxEVT_END_SESSION | |
4046 | wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION | |
4047 | wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP | |
54f9ee45 RD |
4048 | wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE |
4049 | wxEVT_CREATE = _core_.wxEVT_CREATE | |
4050 | wxEVT_DESTROY = _core_.wxEVT_DESTROY | |
4051 | wxEVT_SHOW = _core_.wxEVT_SHOW | |
4052 | wxEVT_ICONIZE = _core_.wxEVT_ICONIZE | |
4053 | wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE | |
4054 | wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED | |
34e0a3bb | 4055 | wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST |
54f9ee45 RD |
4056 | wxEVT_PAINT = _core_.wxEVT_PAINT |
4057 | wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND | |
4058 | wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT | |
4059 | wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON | |
4060 | wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN | |
4061 | wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE | |
4062 | wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT | |
4063 | wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU | |
4064 | wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED | |
4065 | wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED | |
4066 | wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED | |
4067 | wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE | |
4068 | wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED | |
4069 | wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES | |
4070 | wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM | |
4071 | wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM | |
4072 | wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM | |
4073 | wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG | |
4074 | wxEVT_IDLE = _core_.wxEVT_IDLE | |
4075 | wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI | |
4076 | wxEVT_SIZING = _core_.wxEVT_SIZING | |
4077 | wxEVT_MOVING = _core_.wxEVT_MOVING | |
88c6b281 | 4078 | wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE |
2131d850 RD |
4079 | wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY |
4080 | wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT | |
4081 | wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE | |
54f9ee45 RD |
4082 | wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK |
4083 | wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK | |
4084 | wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK | |
4085 | wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK | |
4086 | wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS | |
4087 | wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS | |
4088 | wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER | |
d14a1e28 RD |
4089 | # |
4090 | # Create some event binders | |
4091 | EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE ) | |
4092 | EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING ) | |
4093 | EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE ) | |
4094 | EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING ) | |
4095 | EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW ) | |
4096 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) | |
4097 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
4098 | EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT ) | |
4099 | EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT ) | |
4100 | EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND ) | |
4101 | EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR ) | |
4102 | EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN ) | |
4103 | EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP ) | |
704eda0c | 4104 | EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1) |
d14a1e28 RD |
4105 | EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK ) |
4106 | EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN ) | |
4107 | EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE ) | |
4108 | EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1) | |
4109 | EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT ) | |
4110 | EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS ) | |
4111 | EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS ) | |
4112 | EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS ) | |
4113 | EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE ) | |
4114 | EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP ) | |
704eda0c | 4115 | EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE ) |
d14a1e28 RD |
4116 | EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION ) |
4117 | EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION ) | |
4118 | EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES ) | |
4119 | EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG ) | |
4120 | EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED ) | |
4121 | EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED ) | |
4122 | EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW ) | |
4123 | EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE ) | |
4124 | EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE ) | |
4125 | EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY ) | |
4126 | EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED ) | |
4127 | EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE ) | |
4128 | EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE ) | |
4129 | EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY ) | |
4130 | EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR ) | |
4131 | EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED ) | |
34e0a3bb | 4132 | EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST ) |
d14a1e28 RD |
4133 | |
4134 | EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN ) | |
4135 | EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP ) | |
4136 | EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN ) | |
4137 | EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP ) | |
4138 | EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN ) | |
4139 | EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP ) | |
4140 | EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION ) | |
4141 | EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK ) | |
4142 | EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK ) | |
4143 | EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK ) | |
4144 | EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW ) | |
4145 | EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW ) | |
4146 | EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL ) | |
4147 | ||
4148 | EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN, | |
4149 | wxEVT_LEFT_UP, | |
4150 | wxEVT_MIDDLE_DOWN, | |
4151 | wxEVT_MIDDLE_UP, | |
4152 | wxEVT_RIGHT_DOWN, | |
4153 | wxEVT_RIGHT_UP, | |
4154 | wxEVT_MOTION, | |
4155 | wxEVT_LEFT_DCLICK, | |
4156 | wxEVT_MIDDLE_DCLICK, | |
4157 | wxEVT_RIGHT_DCLICK, | |
4158 | wxEVT_ENTER_WINDOW, | |
4159 | wxEVT_LEAVE_WINDOW, | |
4160 | wxEVT_MOUSEWHEEL | |
4161 | ]) | |
4162 | ||
4163 | ||
4164 | # Scrolling from wxWindow (sent to wxScrolledWindow) | |
704eda0c | 4165 | EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP, |
d14a1e28 RD |
4166 | wxEVT_SCROLLWIN_BOTTOM, |
4167 | wxEVT_SCROLLWIN_LINEUP, | |
4168 | wxEVT_SCROLLWIN_LINEDOWN, | |
704eda0c | 4169 | wxEVT_SCROLLWIN_PAGEUP, |
d14a1e28 RD |
4170 | wxEVT_SCROLLWIN_PAGEDOWN, |
4171 | wxEVT_SCROLLWIN_THUMBTRACK, | |
4172 | wxEVT_SCROLLWIN_THUMBRELEASE, | |
4173 | ]) | |
4174 | ||
4175 | EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP ) | |
4176 | EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM ) | |
4177 | EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP ) | |
4178 | EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN ) | |
4179 | EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP ) | |
4180 | EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN ) | |
4181 | EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK ) | |
4182 | EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE ) | |
4183 | ||
27fb7603 | 4184 | # Scrolling from wx.Slider and wx.ScrollBar |
704eda0c RD |
4185 | EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
4186 | wxEVT_SCROLL_BOTTOM, | |
4187 | wxEVT_SCROLL_LINEUP, | |
4188 | wxEVT_SCROLL_LINEDOWN, | |
4189 | wxEVT_SCROLL_PAGEUP, | |
4190 | wxEVT_SCROLL_PAGEDOWN, | |
4191 | wxEVT_SCROLL_THUMBTRACK, | |
4192 | wxEVT_SCROLL_THUMBRELEASE, | |
4f433fef | 4193 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
4194 | ]) |
4195 | ||
4196 | EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP ) | |
4197 | EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM ) | |
4198 | EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP ) | |
4199 | EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN ) | |
4200 | EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP ) | |
4201 | EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN ) | |
4202 | EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK ) | |
4203 | EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE ) | |
4f433fef RD |
4204 | EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED ) |
4205 | EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED | |
704eda0c | 4206 | |
27fb7603 | 4207 | # Scrolling from wx.Slider and wx.ScrollBar, with an id |
704eda0c RD |
4208 | EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP, |
4209 | wxEVT_SCROLL_BOTTOM, | |
4210 | wxEVT_SCROLL_LINEUP, | |
4211 | wxEVT_SCROLL_LINEDOWN, | |
4212 | wxEVT_SCROLL_PAGEUP, | |
4213 | wxEVT_SCROLL_PAGEDOWN, | |
4214 | wxEVT_SCROLL_THUMBTRACK, | |
d14a1e28 | 4215 | wxEVT_SCROLL_THUMBRELEASE, |
4f433fef | 4216 | wxEVT_SCROLL_CHANGED, |
d14a1e28 RD |
4217 | ], 1) |
4218 | ||
4219 | EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1) | |
4220 | EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1) | |
4221 | EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1) | |
4222 | EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1) | |
4223 | EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1) | |
4224 | EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1) | |
4225 | EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1) | |
4226 | EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1) | |
4f433fef RD |
4227 | EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1) |
4228 | EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED | |
d14a1e28 | 4229 | |
d14a1e28 RD |
4230 | EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1) |
4231 | EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1) | |
4232 | EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1) | |
4233 | EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1) | |
4234 | EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1) | |
4235 | EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1) | |
4236 | EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2) | |
4237 | EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1) | |
4238 | EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1) | |
4239 | EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1) | |
4240 | ||
4241 | EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1) | |
4242 | EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1) | |
4243 | EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1) | |
4244 | EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1) | |
4245 | EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2) | |
4246 | EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1) | |
4247 | EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2) | |
4248 | EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1) | |
4249 | EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1) | |
4250 | ||
4251 | ||
4252 | EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1) | |
4253 | EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1) | |
4254 | EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1) | |
4255 | EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1) | |
4256 | EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1) | |
4257 | EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1) | |
4258 | EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1) | |
4259 | ||
4260 | EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE ) | |
4261 | ||
4262 | EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1) | |
4263 | EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2) | |
4264 | ||
4265 | EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU ) | |
4266 | ||
2131d850 RD |
4267 | EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT ) |
4268 | EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY ) | |
4269 | EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE ) | |
d14a1e28 RD |
4270 | |
4271 | ||
4272 | #--------------------------------------------------------------------------- | |
4273 | ||
4274 | class Event(Object): | |
27fb7603 RD |
4275 | """ |
4276 | An event is a structure holding information about an event passed to a | |
4277 | callback or member function. wx.Event is an abstract base class for | |
4278 | other event classes | |
4279 | """ | |
0085ce49 RD |
4280 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4281 | def __init__(self): raise AttributeError, "No constructor defined" | |
4282 | __repr__ = _swig_repr | |
4283 | __swig_destroy__ = _core_.delete_Event | |
4284 | __del__ = lambda self : None; | |
e811c8ce | 4285 | def SetEventType(*args, **kwargs): |
27fb7603 | 4286 | """ |
2131d850 | 4287 | SetEventType(self, EventType typ) |
27fb7603 RD |
4288 | |
4289 | Sets the specific type of the event. | |
4290 | """ | |
54f9ee45 | 4291 | return _core_.Event_SetEventType(*args, **kwargs) |
e811c8ce RD |
4292 | |
4293 | def GetEventType(*args, **kwargs): | |
27fb7603 | 4294 | """ |
2131d850 | 4295 | GetEventType(self) -> EventType |
27fb7603 RD |
4296 | |
4297 | Returns the identifier of the given event type, such as | |
4298 | ``wxEVT_COMMAND_BUTTON_CLICKED``. | |
4299 | """ | |
54f9ee45 | 4300 | return _core_.Event_GetEventType(*args, **kwargs) |
e811c8ce RD |
4301 | |
4302 | def GetEventObject(*args, **kwargs): | |
27fb7603 RD |
4303 | """ |
4304 | GetEventObject(self) -> Object | |
4305 | ||
4306 | Returns the object (usually a window) associated with the event, if | |
4307 | any. | |
4308 | """ | |
54f9ee45 | 4309 | return _core_.Event_GetEventObject(*args, **kwargs) |
e811c8ce RD |
4310 | |
4311 | def SetEventObject(*args, **kwargs): | |
27fb7603 RD |
4312 | """ |
4313 | SetEventObject(self, Object obj) | |
4314 | ||
4315 | Sets the originating object, or in other words, obj is normally the | |
4316 | object that is sending the event. | |
4317 | """ | |
54f9ee45 | 4318 | return _core_.Event_SetEventObject(*args, **kwargs) |
e811c8ce RD |
4319 | |
4320 | def GetTimestamp(*args, **kwargs): | |
a95a7133 | 4321 | """GetTimestamp(self) -> long""" |
54f9ee45 | 4322 | return _core_.Event_GetTimestamp(*args, **kwargs) |
e811c8ce RD |
4323 | |
4324 | def SetTimestamp(*args, **kwargs): | |
a95a7133 | 4325 | """SetTimestamp(self, long ts=0)""" |
54f9ee45 | 4326 | return _core_.Event_SetTimestamp(*args, **kwargs) |
e811c8ce RD |
4327 | |
4328 | def GetId(*args, **kwargs): | |
27fb7603 RD |
4329 | """ |
4330 | GetId(self) -> int | |
4331 | ||
4332 | Returns the identifier associated with this event, such as a button | |
4333 | command id. | |
4334 | """ | |
54f9ee45 | 4335 | return _core_.Event_GetId(*args, **kwargs) |
e811c8ce RD |
4336 | |
4337 | def SetId(*args, **kwargs): | |
27fb7603 RD |
4338 | """ |
4339 | SetId(self, int Id) | |
4340 | ||
4341 | Set's the ID for the event. This is usually the ID of the window that | |
4342 | is sending the event, but it can also be a command id from a menu | |
4343 | item, etc. | |
4344 | """ | |
54f9ee45 | 4345 | return _core_.Event_SetId(*args, **kwargs) |
e811c8ce RD |
4346 | |
4347 | def IsCommandEvent(*args, **kwargs): | |
27fb7603 RD |
4348 | """ |
4349 | IsCommandEvent(self) -> bool | |
4350 | ||
4351 | Returns true if the event is or is derived from `wx.CommandEvent` else | |
4352 | it returns false. Note: Exists only for optimization purposes. | |
4353 | """ | |
54f9ee45 | 4354 | return _core_.Event_IsCommandEvent(*args, **kwargs) |
e811c8ce RD |
4355 | |
4356 | def Skip(*args, **kwargs): | |
51b83b37 RD |
4357 | """ |
4358 | Skip(self, bool skip=True) | |
4359 | ||
6b449b19 RD |
4360 | This method can be used inside an event handler to control whether |
4361 | further event handlers bound to this event will be called after the | |
4362 | current one returns. Without Skip() (or equivalently if Skip(False) is | |
4363 | used), the event will not be processed any more. If Skip(True) is | |
4364 | called, the event processing system continues searching for a further | |
4365 | handler function for this event, even though it has been processed | |
4366 | already in the current handler. | |
51b83b37 | 4367 | """ |
54f9ee45 | 4368 | return _core_.Event_Skip(*args, **kwargs) |
e811c8ce RD |
4369 | |
4370 | def GetSkipped(*args, **kwargs): | |
27fb7603 RD |
4371 | """ |
4372 | GetSkipped(self) -> bool | |
4373 | ||
4374 | Returns true if the event handler should be skipped, false otherwise. | |
4375 | :see: `Skip` | |
4376 | """ | |
54f9ee45 | 4377 | return _core_.Event_GetSkipped(*args, **kwargs) |
e811c8ce RD |
4378 | |
4379 | def ShouldPropagate(*args, **kwargs): | |
27fb7603 RD |
4380 | """ |
4381 | ShouldPropagate(self) -> bool | |
4382 | ||
4383 | Test if this event should be propagated to the parent window or not, | |
4384 | i.e. if the propagation level is currently greater than 0. | |
4385 | """ | |
54f9ee45 | 4386 | return _core_.Event_ShouldPropagate(*args, **kwargs) |
e811c8ce RD |
4387 | |
4388 | def StopPropagation(*args, **kwargs): | |
27fb7603 RD |
4389 | """ |
4390 | StopPropagation(self) -> int | |
4391 | ||
4392 | Stop the event from propagating to its parent window. Returns the old | |
4393 | propagation level value which may be later passed to | |
4394 | `ResumePropagation` to allow propagating the event again. | |
4395 | """ | |
54f9ee45 | 4396 | return _core_.Event_StopPropagation(*args, **kwargs) |
e811c8ce RD |
4397 | |
4398 | def ResumePropagation(*args, **kwargs): | |
27fb7603 RD |
4399 | """ |
4400 | ResumePropagation(self, int propagationLevel) | |
4401 | ||
4402 | Resume the event propagation by restoring the propagation level. (For | |
4403 | example, you can use the value returned by an earlier call to | |
4404 | `StopPropagation`.) | |
4405 | ||
4406 | """ | |
54f9ee45 | 4407 | return _core_.Event_ResumePropagation(*args, **kwargs) |
e811c8ce RD |
4408 | |
4409 | def Clone(*args, **kwargs): | |
a95a7133 | 4410 | """Clone(self) -> Event""" |
54f9ee45 | 4411 | return _core_.Event_Clone(*args, **kwargs) |
e811c8ce | 4412 | |
97ab0f6a RD |
4413 | EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`") |
4414 | EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`") | |
4415 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
4416 | Skipped = property(GetSkipped,doc="See `GetSkipped`") | |
4417 | Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`") | |
2131d850 | 4418 | _core_.Event_swigregister(Event) |
d14a1e28 RD |
4419 | |
4420 | #--------------------------------------------------------------------------- | |
4421 | ||
4422 | class PropagationDisabler(object): | |
27fb7603 RD |
4423 | """ |
4424 | Helper class to temporarily change an event not to propagate. Simply | |
4425 | create an instance of this class and then whe it is destroyed the | |
4426 | propogation of the event will be restored. | |
4427 | """ | |
0085ce49 RD |
4428 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4429 | __repr__ = _swig_repr | |
4430 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4431 | """ |
4432 | __init__(self, Event event) -> PropagationDisabler | |
4433 | ||
4434 | Helper class to temporarily change an event not to propagate. Simply | |
4435 | create an instance of this class and then whe it is destroyed the | |
4436 | propogation of the event will be restored. | |
4437 | """ | |
0085ce49 RD |
4438 | _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs)) |
4439 | __swig_destroy__ = _core_.delete_PropagationDisabler | |
4440 | __del__ = lambda self : None; | |
2131d850 | 4441 | _core_.PropagationDisabler_swigregister(PropagationDisabler) |
d14a1e28 RD |
4442 | |
4443 | class PropagateOnce(object): | |
27fb7603 RD |
4444 | """ |
4445 | A helper class that will temporarily lower propagation level of an | |
4446 | event. Simply create an instance of this class and then whe it is | |
4447 | destroyed the propogation of the event will be restored. | |
4448 | """ | |
0085ce49 RD |
4449 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4450 | __repr__ = _swig_repr | |
4451 | def __init__(self, *args, **kwargs): | |
27fb7603 RD |
4452 | """ |
4453 | __init__(self, Event event) -> PropagateOnce | |
4454 | ||
4455 | A helper class that will temporarily lower propagation level of an | |
4456 | event. Simply create an instance of this class and then whe it is | |
4457 | destroyed the propogation of the event will be restored. | |
4458 | """ | |
0085ce49 RD |
4459 | _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs)) |
4460 | __swig_destroy__ = _core_.delete_PropagateOnce | |
4461 | __del__ = lambda self : None; | |
2131d850 | 4462 | _core_.PropagateOnce_swigregister(PropagateOnce) |
d14a1e28 RD |
4463 | |
4464 | #--------------------------------------------------------------------------- | |
4465 | ||
4466 | class CommandEvent(Event): | |
27fb7603 RD |
4467 | """ |
4468 | This event class contains information about command events, which | |
4469 | originate from a variety of simple controls, as well as menus and | |
4470 | toolbars. | |
4471 | """ | |
0085ce49 RD |
4472 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4473 | __repr__ = _swig_repr | |
4474 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4475 | """ |
2131d850 | 4476 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent |
27fb7603 RD |
4477 | |
4478 | This event class contains information about command events, which | |
4479 | originate from a variety of simple controls, as well as menus and | |
4480 | toolbars. | |
4481 | """ | |
0085ce49 | 4482 | _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs)) |
e811c8ce | 4483 | def GetSelection(*args, **kwargs): |
27fb7603 RD |
4484 | """ |
4485 | GetSelection(self) -> int | |
4486 | ||
4487 | Returns item index for a listbox or choice selection event (not valid | |
4488 | for a deselection). | |
4489 | """ | |
54f9ee45 | 4490 | return _core_.CommandEvent_GetSelection(*args, **kwargs) |
e811c8ce RD |
4491 | |
4492 | def SetString(*args, **kwargs): | |
a95a7133 | 4493 | """SetString(self, String s)""" |
54f9ee45 | 4494 | return _core_.CommandEvent_SetString(*args, **kwargs) |
e811c8ce RD |
4495 | |
4496 | def GetString(*args, **kwargs): | |
27fb7603 RD |
4497 | """ |
4498 | GetString(self) -> String | |
4499 | ||
4500 | Returns item string for a listbox or choice selection event (not valid | |
4501 | for a deselection). | |
4502 | """ | |
54f9ee45 | 4503 | return _core_.CommandEvent_GetString(*args, **kwargs) |
e811c8ce RD |
4504 | |
4505 | def IsChecked(*args, **kwargs): | |
27fb7603 RD |
4506 | """ |
4507 | IsChecked(self) -> bool | |
4508 | ||
4509 | This method can be used with checkbox and menu events: for the | |
4510 | checkboxes, the method returns true for a selection event and false | |
4511 | for a deselection one. For the menu events, this method indicates if | |
4512 | the menu item just has become checked or unchecked (and thus only | |
4513 | makes sense for checkable menu items). | |
4514 | """ | |
54f9ee45 | 4515 | return _core_.CommandEvent_IsChecked(*args, **kwargs) |
e811c8ce | 4516 | |
242b7b46 | 4517 | Checked = IsChecked |
e811c8ce | 4518 | def IsSelection(*args, **kwargs): |
27fb7603 RD |
4519 | """ |
4520 | IsSelection(self) -> bool | |
4521 | ||
4522 | For a listbox or similar event, returns true if it is a selection, | |
4523 | false if it is a deselection. | |
4524 | """ | |
54f9ee45 | 4525 | return _core_.CommandEvent_IsSelection(*args, **kwargs) |
e811c8ce RD |
4526 | |
4527 | def SetExtraLong(*args, **kwargs): | |
a95a7133 | 4528 | """SetExtraLong(self, long extraLong)""" |
54f9ee45 | 4529 | return _core_.CommandEvent_SetExtraLong(*args, **kwargs) |
e811c8ce RD |
4530 | |
4531 | def GetExtraLong(*args, **kwargs): | |
27fb7603 RD |
4532 | """ |
4533 | GetExtraLong(self) -> long | |
4534 | ||
5ba5649b RD |
4535 | Returns extra information dependant on the event objects type. If the |
4536 | event comes from a listbox selection, it is a boolean determining | |
4537 | whether the event was a selection (true) or a deselection (false). A | |
4538 | listbox deselection only occurs for multiple-selection boxes, and in | |
4539 | this case the index and string values are indeterminate and the | |
4540 | listbox must be examined by the application. | |
27fb7603 | 4541 | """ |
54f9ee45 | 4542 | return _core_.CommandEvent_GetExtraLong(*args, **kwargs) |
e811c8ce RD |
4543 | |
4544 | def SetInt(*args, **kwargs): | |
a95a7133 | 4545 | """SetInt(self, int i)""" |
54f9ee45 | 4546 | return _core_.CommandEvent_SetInt(*args, **kwargs) |
e811c8ce RD |
4547 | |
4548 | def GetInt(*args, **kwargs): | |
27fb7603 | 4549 | """ |
01f6b6d3 | 4550 | GetInt(self) -> int |
27fb7603 | 4551 | |
5ba5649b RD |
4552 | Returns the integer identifier corresponding to a listbox, choice or |
4553 | radiobox selection (only if the event was a selection, not a | |
4554 | deselection), or a boolean value representing the value of a checkbox. | |
27fb7603 | 4555 | """ |
54f9ee45 | 4556 | return _core_.CommandEvent_GetInt(*args, **kwargs) |
e811c8ce | 4557 | |
0085ce49 RD |
4558 | def GetClientData(*args, **kwargs): |
4559 | """ | |
4560 | GetClientData(self) -> PyObject | |
4561 | ||
4562 | Returns the client data object for a listbox or choice selection event, (if any.) | |
4563 | """ | |
4564 | return _core_.CommandEvent_GetClientData(*args, **kwargs) | |
4565 | ||
4566 | def SetClientData(*args, **kwargs): | |
4567 | """ | |
4568 | SetClientData(self, PyObject clientData) | |
4569 | ||
4570 | Associate the given client data with the item at position n. | |
4571 | """ | |
4572 | return _core_.CommandEvent_SetClientData(*args, **kwargs) | |
4573 | ||
4574 | GetClientObject = GetClientData | |
4575 | SetClientObject = SetClientData | |
4576 | ||
e811c8ce | 4577 | def Clone(*args, **kwargs): |
a95a7133 | 4578 | """Clone(self) -> Event""" |
54f9ee45 | 4579 | return _core_.CommandEvent_Clone(*args, **kwargs) |
e811c8ce | 4580 | |
2bf58437 RD |
4581 | ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`") |
4582 | ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`") | |
4583 | ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`") | |
4584 | Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`") | |
4585 | Selection = property(GetSelection,doc="See `GetSelection`") | |
4586 | String = property(GetString,SetString,doc="See `GetString` and `SetString`") | |
2131d850 | 4587 | _core_.CommandEvent_swigregister(CommandEvent) |
d14a1e28 RD |
4588 | |
4589 | #--------------------------------------------------------------------------- | |
4590 | ||
4591 | class NotifyEvent(CommandEvent): | |
27fb7603 RD |
4592 | """ |
4593 | An instance of this class (or one of its derived classes) is sent from | |
4594 | a control when the control's state is being changed and the control | |
4595 | allows that change to be prevented from happening. The event handler | |
4596 | can call `Veto` or `Allow` to tell the control what to do. | |
4597 | """ | |
0085ce49 RD |
4598 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4599 | __repr__ = _swig_repr | |
4600 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4601 | """ |
2131d850 | 4602 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent |
27fb7603 RD |
4603 | |
4604 | An instance of this class (or one of its derived classes) is sent from | |
4605 | a control when the control's state is being changed and the control | |
4606 | allows that change to be prevented from happening. The event handler | |
4607 | can call `Veto` or `Allow` to tell the control what to do. | |
4608 | """ | |
0085ce49 | 4609 | _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs)) |
e811c8ce | 4610 | def Veto(*args, **kwargs): |
27fb7603 RD |
4611 | """ |
4612 | Veto(self) | |
4613 | ||
4614 | Prevents the change announced by this event from happening. | |
4615 | ||
4616 | It is in general a good idea to notify the user about the reasons for | |
4617 | vetoing the change because otherwise the applications behaviour (which | |
4618 | just refuses to do what the user wants) might be quite surprising. | |
4619 | """ | |
54f9ee45 | 4620 | return _core_.NotifyEvent_Veto(*args, **kwargs) |
e811c8ce RD |
4621 | |
4622 | def Allow(*args, **kwargs): | |
27fb7603 RD |
4623 | """ |
4624 | Allow(self) | |
4625 | ||
4626 | This is the opposite of `Veto`: it explicitly allows the event to be | |
4627 | processed. For most events it is not necessary to call this method as | |
4628 | the events are allowed anyhow but some are forbidden by default (this | |
4629 | will be mentioned in the corresponding event description). | |
4630 | """ | |
54f9ee45 | 4631 | return _core_.NotifyEvent_Allow(*args, **kwargs) |
e811c8ce RD |
4632 | |
4633 | def IsAllowed(*args, **kwargs): | |
27fb7603 RD |
4634 | """ |
4635 | IsAllowed(self) -> bool | |
4636 | ||
4637 | Returns true if the change is allowed (`Veto` hasn't been called) or | |
4638 | false otherwise (if it was). | |
4639 | """ | |
54f9ee45 | 4640 | return _core_.NotifyEvent_IsAllowed(*args, **kwargs) |
e811c8ce | 4641 | |
2131d850 | 4642 | _core_.NotifyEvent_swigregister(NotifyEvent) |
d14a1e28 RD |
4643 | |
4644 | #--------------------------------------------------------------------------- | |
4645 | ||
4646 | class ScrollEvent(CommandEvent): | |
27fb7603 RD |
4647 | """ |
4648 | A scroll event holds information about events sent from stand-alone | |
4649 | scrollbars and sliders. Note that scrolled windows do not send | |
cbfc9df6 | 4650 | instances of this event class, but send the `wx.ScrollWinEvent` |
27fb7603 RD |
4651 | instead. |
4652 | """ | |
0085ce49 RD |
4653 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4654 | __repr__ = _swig_repr | |
4655 | def __init__(self, *args, **kwargs): | |
0df68c9f | 4656 | """ |
2131d850 | 4657 | __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0, |
0df68c9f RD |
4658 | int orient=0) -> ScrollEvent |
4659 | """ | |
0085ce49 | 4660 | _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs)) |
e811c8ce | 4661 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4662 | """ |
4663 | GetOrientation(self) -> int | |
4664 | ||
4665 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4666 | the scrollbar. | |
4667 | """ | |
54f9ee45 | 4668 | return _core_.ScrollEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4669 | |
4670 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4671 | """ |
4672 | GetPosition(self) -> int | |
4673 | ||
4674 | Returns the position of the scrollbar. | |
4675 | """ | |
54f9ee45 | 4676 | return _core_.ScrollEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4677 | |
4678 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4679 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4680 | return _core_.ScrollEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4681 | |
4682 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4683 | """SetPosition(self, int pos)""" |
54f9ee45 | 4684 | return _core_.ScrollEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4685 | |
33d6fd3b RD |
4686 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
4687 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
2131d850 | 4688 | _core_.ScrollEvent_swigregister(ScrollEvent) |
d14a1e28 RD |
4689 | |
4690 | #--------------------------------------------------------------------------- | |
4691 | ||
4692 | class ScrollWinEvent(Event): | |
27fb7603 RD |
4693 | """ |
4694 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4695 | scrolling windows. | |
4696 | """ | |
0085ce49 RD |
4697 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4698 | __repr__ = _swig_repr | |
4699 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4700 | """ |
2131d850 | 4701 | __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent |
27fb7603 RD |
4702 | |
4703 | A wx.ScrollWinEvent holds information about scrolling and is sent from | |
4704 | scrolling windows. | |
4705 | """ | |
0085ce49 | 4706 | _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs)) |
e811c8ce | 4707 | def GetOrientation(*args, **kwargs): |
27fb7603 RD |
4708 | """ |
4709 | GetOrientation(self) -> int | |
4710 | ||
4711 | Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of | |
4712 | the scrollbar. | |
4713 | """ | |
54f9ee45 | 4714 | return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs) |
e811c8ce RD |
4715 | |
4716 | def GetPosition(*args, **kwargs): | |
27fb7603 RD |
4717 | """ |
4718 | GetPosition(self) -> int | |
4719 | ||
4720 | Returns the position of the scrollbar for the thumb track and release | |
4721 | events. Note that this field can't be used for the other events, you | |
4722 | need to query the window itself for the current position in that case. | |
4723 | """ | |
54f9ee45 | 4724 | return _core_.ScrollWinEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
4725 | |
4726 | def SetOrientation(*args, **kwargs): | |
a95a7133 | 4727 | """SetOrientation(self, int orient)""" |
54f9ee45 | 4728 | return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs) |
e811c8ce RD |
4729 | |
4730 | def SetPosition(*args, **kwargs): | |
a95a7133 | 4731 | """SetPosition(self, int pos)""" |
54f9ee45 | 4732 | return _core_.ScrollWinEvent_SetPosition(*args, **kwargs) |
e811c8ce | 4733 | |
33d6fd3b RD |
4734 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
4735 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
2131d850 | 4736 | _core_.ScrollWinEvent_swigregister(ScrollWinEvent) |
d14a1e28 RD |
4737 | |
4738 | #--------------------------------------------------------------------------- | |
4739 | ||
54f9ee45 RD |
4740 | MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY |
4741 | MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE | |
4742 | MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT | |
4743 | MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE | |
4744 | MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT | |
d14a1e28 | 4745 | class MouseEvent(Event): |
27fb7603 RD |
4746 | """ |
4747 | This event class contains information about the events generated by | |
4748 | the mouse: they include mouse buttons press and release events and | |
4749 | mouse move events. | |
4750 | ||
4751 | All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for | |
4752 | the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and | |
4753 | ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have | |
4754 | a middle button so a portable application should avoid relying on the | |
4755 | events from it. | |
4756 | ||
4757 | Note the difference between methods like `LeftDown` and `LeftIsDown`: | |
4758 | the former returns true when the event corresponds to the left mouse | |
4759 | button click while the latter returns true if the left mouse button is | |
4760 | currently being pressed. For example, when the user is dragging the | |
4761 | mouse you can use `LeftIsDown` to test whether the left mouse button | |
4762 | is (still) depressed. Also, by convention, if `LeftDown` returns true, | |
4763 | `LeftIsDown` will also return true in wxWidgets whatever the | |
4764 | underlying GUI behaviour is (which is platform-dependent). The same | |
4765 | applies, of course, to other mouse buttons as well. | |
4766 | """ | |
0085ce49 RD |
4767 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
4768 | __repr__ = _swig_repr | |
4769 | def __init__(self, *args, **kwargs): | |
27fb7603 | 4770 | """ |
2131d850 | 4771 | __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent |
27fb7603 RD |
4772 | |
4773 | Constructs a wx.MouseEvent. Valid event types are: | |
4774 | ||
4775 | * wxEVT_ENTER_WINDOW | |
4776 | * wxEVT_LEAVE_WINDOW | |
4777 | * wxEVT_LEFT_DOWN | |
4778 | * wxEVT_LEFT_UP | |
4779 | * wxEVT_LEFT_DCLICK | |
4780 | * wxEVT_MIDDLE_DOWN | |
4781 | * wxEVT_MIDDLE_UP | |
4782 | * wxEVT_MIDDLE_DCLICK | |
4783 | * wxEVT_RIGHT_DOWN | |
4784 | * wxEVT_RIGHT_UP | |
4785 | * wxEVT_RIGHT_DCLICK | |
4786 | * wxEVT_MOTION | |
4787 | * wxEVT_MOUSEWHEEL | |
4788 | """ | |
0085ce49 | 4789 | _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs)) |
e811c8ce | 4790 | def IsButton(*args, **kwargs): |
27fb7603 RD |
4791 | """ |
4792 | IsButton(self) -> bool | |
4793 | ||
4794 | Returns true if the event was a mouse button event (not necessarily a | |
4795 | button down event - that may be tested using `ButtonDown`). | |
4796 | """ | |
54f9ee45 | 4797 | return _core_.MouseEvent_IsButton(*args, **kwargs) |
e811c8ce RD |
4798 | |
4799 | def ButtonDown(*args, **kwargs): | |
27fb7603 RD |
4800 | """ |
4801 | ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool | |
4802 | ||
5ba5649b RD |
4803 | If the argument is omitted, this returns true if the event was any |
4804 | mouse button down event. Otherwise the argument specifies which | |
4805 | button-down event shold be checked for (see `Button` for the possible | |
4806 | values). | |
27fb7603 | 4807 | """ |
54f9ee45 | 4808 | return _core_.MouseEvent_ButtonDown(*args, **kwargs) |
e811c8ce RD |
4809 | |
4810 | def ButtonDClick(*args, **kwargs): | |
27fb7603 RD |
4811 | """ |
4812 | ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool | |
4813 | ||
4814 | If the argument is omitted, this returns true if the event was any | |
4815 | mouse double click event. Otherwise the argument specifies which | |
4816 | double click event to check for (see `Button` for the possible | |
4817 | values). | |
4818 | """ | |
54f9ee45 | 4819 | return _core_.MouseEvent_ButtonDClick(*args, **kwargs) |
e811c8ce RD |
4820 | |
4821 | def ButtonUp(*args, **kwargs): | |
27fb7603 RD |
4822 | """ |
4823 | ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool | |
4824 | ||
4825 | If the argument is omitted, this returns true if the event was any | |
5ba5649b RD |
4826 | mouse button up event. Otherwise the argument specifies which button |
4827 | up event to check for (see `Button` for the possible values). | |
27fb7603 | 4828 | """ |
54f9ee45 | 4829 | return _core_.MouseEvent_ButtonUp(*args, **kwargs) |
e811c8ce RD |
4830 | |
4831 | def Button(*args, **kwargs): | |
27fb7603 RD |
4832 | """ |
4833 | Button(self, int button) -> bool | |
4834 | ||
4835 | Returns true if the identified mouse button is changing state. Valid | |
4836 | values of button are: | |
4837 | ||
4838 | ==================== ===================================== | |
4839 | wx.MOUSE_BTN_LEFT check if left button was pressed | |
4840 | wx.MOUSE_BTN_MIDDLE check if middle button was pressed | |
4841 | wx.MOUSE_BTN_RIGHT check if right button was pressed | |
4842 | wx.MOUSE_BTN_ANY check if any button was pressed | |
4843 | ==================== ===================================== | |
4844 | ||
4845 | """ | |
54f9ee45 | 4846 | return _core_.MouseEvent_Button(*args, **kwargs) |
e811c8ce RD |
4847 | |
4848 | def ButtonIsDown(*args, **kwargs): | |
a95a7133 | 4849 | """ButtonIsDown(self, int but) -> bool""" |
54f9ee45 | 4850 | return _core_.MouseEvent_ButtonIsDown(*args, **kwargs) |
e811c8ce RD |
4851 | |
4852 | def GetButton(*args, **kwargs): | |
27fb7603 RD |
4853 | """ |
4854 | GetButton(self) -> int | |
4855 | ||
4856 | Returns the mouse button which generated this event or | |
4857 | wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or | |
4858 | leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for | |
4859 | the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE | |
4860 | and wx.MOUSE_BTN_RIGHT for the same events for the middle and the | |
4861 | right buttons respectively. | |
4862 | """ | |
54f9ee45 | 4863 | return _core_.MouseEvent_GetButton(*args, **kwargs) |
e811c8ce RD |
4864 | |
4865 | def ControlDown(*args, **kwargs): | |
27fb7603 RD |
4866 | """ |
4867 | ControlDown(self) -> bool | |
4868 | ||
4869 | Returns true if the control key was down at the time of the event. | |
4870 | """ | |
54f9ee45 | 4871 | return _core_.MouseEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
4872 | |
4873 | def MetaDown(*args, **kwargs): | |
27fb7603 RD |
4874 | """ |
4875 | MetaDown(self) -> bool | |
4876 | ||
4877 | Returns true if the Meta key was down at the time of the event. | |
4878 | """ | |
54f9ee45 | 4879 | return _core_.MouseEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
4880 | |
4881 | def AltDown(*args, **kwargs): | |
27fb7603 RD |
4882 | """ |
4883 | AltDown(self) -> bool | |
4884 | ||
4885 | Returns true if the Alt key was down at the time of the event. | |
4886 | """ | |
54f9ee45 | 4887 | return _core_.MouseEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
4888 | |
4889 | def ShiftDown(*args, **kwargs): | |
27fb7603 RD |
4890 | """ |
4891 | ShiftDown(self) -> bool | |
4892 | ||
4893 | Returns true if the Shift key was down at the time of the event. | |
4894 | """ | |
54f9ee45 | 4895 | return _core_.MouseEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 4896 | |
412d302d RD |
4897 | def CmdDown(*args, **kwargs): |
4898 | """ | |
4899 | CmdDown(self) -> bool | |
4900 | ||
4901 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
4902 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 4903 | Macs. It often makes sense to use it instead of, say, `ControlDown` |
412d302d | 4904 | because Cmd key is used for the same thing under Mac as Ctrl |
27fb7603 | 4905 | elsewhere. The Ctrl key still exists, it's just not used for this |
412d302d RD |
4906 | purpose. So for non-Mac platforms this is the same as `ControlDown` |
4907 | and Macs this is the same as `MetaDown`. | |
4908 | """ | |
4909 | return _core_.MouseEvent_CmdDown(*args, **kwargs) | |
4910 | ||
e811c8ce | 4911 | def LeftDown(*args, **kwargs): |
27fb7603 RD |
4912 | """ |
4913 | LeftDown(self) -> bool | |
4914 | ||
4915 | Returns true if the left mouse button state changed to down. | |
4916 | """ | |
54f9ee45 | 4917 | return _core_.MouseEvent_LeftDown(*args, **kwargs) |
e811c8ce RD |
4918 | |
4919 | def MiddleDown(*args, **kwargs): | |
27fb7603 RD |
4920 | """ |
4921 | MiddleDown(self) -> bool | |
4922 | ||
4923 | Returns true if the middle mouse button state changed to down. | |
4924 | """ | |
54f9ee45 | 4925 | return _core_.MouseEvent_MiddleDown(*args, **kwargs) |
e811c8ce RD |
4926 | |
4927 | def RightDown(*args, **kwargs): | |
27fb7603 RD |
4928 | """ |
4929 | RightDown(self) -> bool | |
4930 | ||
4931 | Returns true if the right mouse button state changed to down. | |
4932 | """ | |
54f9ee45 | 4933 | return _core_.MouseEvent_RightDown(*args, **kwargs) |
e811c8ce RD |
4934 | |
4935 | def LeftUp(*args, **kwargs): | |
27fb7603 RD |
4936 | """ |
4937 | LeftUp(self) -> bool | |
4938 | ||
4939 | Returns true if the left mouse button state changed to up. | |
4940 | """ | |
54f9ee45 | 4941 | return _core_.MouseEvent_LeftUp(*args, **kwargs) |
e811c8ce RD |
4942 | |
4943 | def MiddleUp(*args, **kwargs): | |
27fb7603 RD |
4944 | """ |
4945 | MiddleUp(self) -> bool | |
4946 | ||
4947 | Returns true if the middle mouse button state changed to up. | |
4948 | """ | |
54f9ee45 | 4949 | return _core_.MouseEvent_MiddleUp(*args, **kwargs) |
e811c8ce RD |
4950 | |
4951 | def RightUp(*args, **kwargs): | |
27fb7603 RD |
4952 | """ |
4953 | RightUp(self) -> bool | |
4954 | ||
4955 | Returns true if the right mouse button state changed to up. | |
4956 | """ | |
54f9ee45 | 4957 | return _core_.MouseEvent_RightUp(*args, **kwargs) |
e811c8ce RD |
4958 | |
4959 | def LeftDClick(*args, **kwargs): | |
27fb7603 RD |
4960 | """ |
4961 | LeftDClick(self) -> bool | |
4962 | ||
4963 | Returns true if the event was a left button double click. | |
4964 | """ | |
54f9ee45 | 4965 | return _core_.MouseEvent_LeftDClick(*args, **kwargs) |
e811c8ce RD |
4966 | |
4967 | def MiddleDClick(*args, **kwargs): | |
27fb7603 RD |
4968 | """ |
4969 | MiddleDClick(self) -> bool | |
4970 | ||
4971 | Returns true if the event was a middle button double click. | |
4972 | """ | |
54f9ee45 | 4973 | return _core_.MouseEvent_MiddleDClick(*args, **kwargs) |
e811c8ce RD |
4974 | |
4975 | def RightDClick(*args, **kwargs): | |
27fb7603 RD |
4976 | """ |
4977 | RightDClick(self) -> bool | |
4978 | ||
4979 | Returns true if the event was a right button double click. | |
4980 | """ | |
54f9ee45 | 4981 | return _core_.MouseEvent_RightDClick(*args, **kwargs) |
e811c8ce RD |
4982 | |
4983 | def LeftIsDown(*args, **kwargs): | |
27fb7603 RD |
4984 | """ |
4985 | LeftIsDown(self) -> bool | |
4986 | ||
4987 | Returns true if the left mouse button is currently down, independent | |
4988 | of the current event type. | |
4989 | ||
4990 | Please notice that it is not the same as LeftDown which returns true | |
4991 | if the left mouse button was just pressed. Rather, it describes the | |
4992 | state of the mouse button before the event happened. | |
4993 | ||
4994 | This event is usually used in the mouse event handlers which process | |
4995 | "move mouse" messages to determine whether the user is (still) | |
4996 | dragging the mouse. | |
4997 | """ | |
54f9ee45 | 4998 | return _core_.MouseEvent_LeftIsDown(*args, **kwargs) |
e811c8ce RD |
4999 | |
5000 | def MiddleIsDown(*args, **kwargs): | |
27fb7603 RD |
5001 | """ |
5002 | MiddleIsDown(self) -> bool | |
5003 | ||
5004 | Returns true if the middle mouse button is currently down, independent | |
5005 | of the current event type. | |
5006 | """ | |
54f9ee45 | 5007 | return _core_.MouseEvent_MiddleIsDown(*args, **kwargs) |
e811c8ce RD |
5008 | |
5009 | def RightIsDown(*args, **kwargs): | |
27fb7603 RD |
5010 | """ |
5011 | RightIsDown(self) -> bool | |
5012 | ||
5013 | Returns true if the right mouse button is currently down, independent | |
5014 | of the current event type. | |
5015 | """ | |
54f9ee45 | 5016 | return _core_.MouseEvent_RightIsDown(*args, **kwargs) |
e811c8ce RD |
5017 | |
5018 | def Dragging(*args, **kwargs): | |
27fb7603 RD |
5019 | """ |
5020 | Dragging(self) -> bool | |
5021 | ||
5022 | Returns true if this was a dragging event (motion while a button is | |
5023 | depressed). | |
5024 | """ | |
54f9ee45 | 5025 | return _core_.MouseEvent_Dragging(*args, **kwargs) |
e811c8ce RD |
5026 | |
5027 | def Moving(*args, **kwargs): | |
27fb7603 RD |
5028 | """ |
5029 | Moving(self) -> bool | |
5030 | ||
5031 | Returns true if this was a motion event and no mouse buttons were | |
5032 | pressed. If any mouse button is held pressed, then this method returns | |
5033 | false and Dragging returns true. | |
5034 | """ | |
54f9ee45 | 5035 | return _core_.MouseEvent_Moving(*args, **kwargs) |
e811c8ce RD |
5036 | |
5037 | def Entering(*args, **kwargs): | |
27fb7603 RD |
5038 | """ |
5039 | Entering(self) -> bool | |
5040 | ||
5041 | Returns true if the mouse was entering the window. | |
5042 | """ | |
54f9ee45 | 5043 | return _core_.MouseEvent_Entering(*args, **kwargs) |
e811c8ce RD |
5044 | |
5045 | def Leaving(*args, **kwargs): | |
27fb7603 RD |
5046 | """ |
5047 | Leaving(self) -> bool | |
5048 | ||
5049 | Returns true if the mouse was leaving the window. | |
5050 | """ | |
54f9ee45 | 5051 | return _core_.MouseEvent_Leaving(*args, **kwargs) |
e811c8ce RD |
5052 | |
5053 | def GetPosition(*args, **kwargs): | |
0df68c9f | 5054 | """ |
a95a7133 | 5055 | GetPosition(self) -> Point |
e811c8ce | 5056 | |
27fb7603 RD |
5057 | Returns the pixel position of the mouse in window coordinates when the |
5058 | event happened. | |
0df68c9f | 5059 | """ |
54f9ee45 | 5060 | return _core_.MouseEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5061 | |
5062 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
5063 | """ |
5064 | GetPositionTuple() -> (x,y) | |
e811c8ce | 5065 | |
27fb7603 RD |
5066 | Returns the pixel position of the mouse in window coordinates when the |
5067 | event happened. | |
0df68c9f | 5068 | """ |
54f9ee45 | 5069 | return _core_.MouseEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
5070 | |
5071 | def GetLogicalPosition(*args, **kwargs): | |
27fb7603 RD |
5072 | """ |
5073 | GetLogicalPosition(self, DC dc) -> Point | |
5074 | ||
5075 | Returns the logical mouse position in pixels (i.e. translated | |
5076 | according to the translation set for the DC, which usually indicates | |
5077 | that the window has been scrolled). | |
5078 | """ | |
54f9ee45 | 5079 | return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs) |
e811c8ce RD |
5080 | |
5081 | def GetX(*args, **kwargs): | |
27fb7603 RD |
5082 | """ |
5083 | GetX(self) -> int | |
5084 | ||
5085 | Returns X coordinate of the physical mouse event position. | |
5086 | """ | |
54f9ee45 | 5087 | return _core_.MouseEvent_GetX(*args, **kwargs) |
e811c8ce RD |
5088 | |
5089 | def GetY(*args, **kwargs): | |
27fb7603 RD |
5090 | """ |
5091 | GetY(self) -> int | |
5092 | ||
5093 | Returns Y coordinate of the physical mouse event position. | |
5094 | """ | |
54f9ee45 | 5095 | return _core_.MouseEvent_GetY(*args, **kwargs) |
e811c8ce RD |
5096 | |
5097 | def GetWheelRotation(*args, **kwargs): | |
27fb7603 RD |
5098 | """ |
5099 | GetWheelRotation(self) -> int | |
5100 | ||
5101 | Get wheel rotation, positive or negative indicates direction of | |
5102 | rotation. Current devices all send an event when rotation is equal to | |
5103 | +/-WheelDelta, but this allows for finer resolution devices to be | |
5104 | created in the future. Because of this you shouldn't assume that one | |
5105 | event is equal to 1 line or whatever, but you should be able to either | |
5106 | do partial line scrolling or wait until +/-WheelDelta rotation values | |
5107 | have been accumulated before scrolling. | |
5108 | """ | |
54f9ee45 | 5109 | return _core_.MouseEvent_GetWheelRotation(*args, **kwargs) |
e811c8ce RD |
5110 | |
5111 | def GetWheelDelta(*args, **kwargs): | |
27fb7603 RD |
5112 | """ |
5113 | GetWheelDelta(self) -> int | |
5114 | ||
5115 | Get wheel delta, normally 120. This is the threshold for action to be | |
5116 | taken, and one such action (for example, scrolling one increment) | |
5117 | should occur for each delta. | |
5118 | """ | |
54f9ee45 | 5119 | return _core_.MouseEvent_GetWheelDelta(*args, **kwargs) |
e811c8ce | 5120 | |
4976f996 RD |
5121 | def GetWheelAxis(*args, **kwargs): |
5122 | """ | |
5123 | GetWheelAxis(self) -> int | |
5124 | ||
5125 | Gets the axis the wheel operation concerns, 0 being the y axis as on | |
5126 | most mouse wheels, 1 is the x axis for things like MightyMouse scrolls | |
5127 | or horizontal trackpad scrolling. | |
5128 | """ | |
5129 | return _core_.MouseEvent_GetWheelAxis(*args, **kwargs) | |
5130 | ||
e811c8ce | 5131 | def GetLinesPerAction(*args, **kwargs): |
27fb7603 RD |
5132 | """ |
5133 | GetLinesPerAction(self) -> int | |
5134 | ||
5135 | Returns the configured number of lines (or whatever) to be scrolled | |
5136 | per wheel action. Defaults to three. | |
5137 | """ | |
54f9ee45 | 5138 | return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs) |
e811c8ce RD |
5139 | |
5140 | def IsPageScroll(*args, **kwargs): | |
27fb7603 RD |
5141 | """ |
5142 | IsPageScroll(self) -> bool | |
5143 | ||
5144 | Returns true if the system has been setup to do page scrolling with | |
5145 | the mouse wheel instead of line scrolling. | |
5146 | """ | |
54f9ee45 RD |
5147 | return _core_.MouseEvent_IsPageScroll(*args, **kwargs) |
5148 | ||
5149 | m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set) | |
5150 | m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set) | |
5151 | m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set) | |
5152 | m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set) | |
5153 | m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set) | |
5154 | m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set) | |
5155 | m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set) | |
5156 | m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set) | |
5157 | m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set) | |
5158 | m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set) | |
5159 | m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set) | |
5160 | m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set) | |
57332a5a RD |
5161 | Button = property(GetButton,doc="See `GetButton`") |
5162 | LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`") | |
5163 | LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`") | |
5164 | Position = property(GetPosition,doc="See `GetPosition`") | |
5165 | WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`") | |
5166 | WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`") | |
5167 | X = property(GetX,doc="See `GetX`") | |
5168 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 5169 | _core_.MouseEvent_swigregister(MouseEvent) |
d14a1e28 RD |
5170 | |
5171 | #--------------------------------------------------------------------------- | |
5172 | ||
5173 | class SetCursorEvent(Event): | |
5ba5649b RD |
5174 | """ |
5175 | A SetCursorEvent is generated when the mouse cursor is about to be set | |
5176 | as a result of mouse motion. This event gives the application the | |
5177 | chance to perform specific mouse cursor processing based on the | |
5178 | current position of the mouse within the window. Use the `SetCursor` | |
5179 | method to specify the cursor you want to be displayed. | |
5180 | """ | |
0085ce49 RD |
5181 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5182 | __repr__ = _swig_repr | |
5183 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5184 | """ |
5185 | __init__(self, int x=0, int y=0) -> SetCursorEvent | |
5186 | ||
5187 | Construct a new `wx.SetCursorEvent`. | |
5188 | """ | |
0085ce49 | 5189 | _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs)) |
e811c8ce | 5190 | def GetX(*args, **kwargs): |
5ba5649b RD |
5191 | """ |
5192 | GetX(self) -> int | |
5193 | ||
5194 | Returns the X coordinate of the mouse in client coordinates. | |
5195 | """ | |
54f9ee45 | 5196 | return _core_.SetCursorEvent_GetX(*args, **kwargs) |
e811c8ce RD |
5197 | |
5198 | def GetY(*args, **kwargs): | |
5ba5649b RD |
5199 | """ |
5200 | GetY(self) -> int | |
5201 | ||
5202 | Returns the Y coordinate of the mouse in client coordinates. | |
5203 | """ | |
54f9ee45 | 5204 | return _core_.SetCursorEvent_GetY(*args, **kwargs) |
e811c8ce RD |
5205 | |
5206 | def SetCursor(*args, **kwargs): | |
5ba5649b RD |
5207 | """ |
5208 | SetCursor(self, Cursor cursor) | |
5209 | ||
5210 | Sets the cursor associated with this event. | |
5211 | """ | |
54f9ee45 | 5212 | return _core_.SetCursorEvent_SetCursor(*args, **kwargs) |
e811c8ce RD |
5213 | |
5214 | def GetCursor(*args, **kwargs): | |
5ba5649b RD |
5215 | """ |
5216 | GetCursor(self) -> Cursor | |
5217 | ||
5218 | Returns a reference to the cursor specified by this event. | |
5219 | """ | |
54f9ee45 | 5220 | return _core_.SetCursorEvent_GetCursor(*args, **kwargs) |
e811c8ce RD |
5221 | |
5222 | def HasCursor(*args, **kwargs): | |
5ba5649b RD |
5223 | """ |
5224 | HasCursor(self) -> bool | |
5225 | ||
5226 | Returns true if the cursor specified by this event is a valid cursor. | |
5227 | """ | |
54f9ee45 | 5228 | return _core_.SetCursorEvent_HasCursor(*args, **kwargs) |
e811c8ce | 5229 | |
33d6fd3b RD |
5230 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") |
5231 | X = property(GetX,doc="See `GetX`") | |
5232 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 5233 | _core_.SetCursorEvent_swigregister(SetCursorEvent) |
d14a1e28 RD |
5234 | |
5235 | #--------------------------------------------------------------------------- | |
5236 | ||
5237 | class KeyEvent(Event): | |
5ba5649b RD |
5238 | """ |
5239 | This event class contains information about keypress and character | |
5240 | events. These events are only sent to the widget that currently has | |
5241 | the keyboard focus. | |
5242 | ||
5243 | Notice that there are three different kinds of keyboard events in | |
5244 | wxWidgets: key down and up events and char events. The difference | |
5245 | between the first two is clear - the first corresponds to a key press | |
5246 | and the second to a key release - otherwise they are identical. Just | |
5247 | note that if the key is maintained in a pressed state you will | |
5248 | typically get a lot of (automatically generated) down events but only | |
5249 | one up so it is wrong to assume that there is one up event | |
5250 | corresponding to each down one. | |
5251 | ||
5252 | Both key events provide untranslated key codes while the char event | |
5253 | carries the translated one. The untranslated code for alphanumeric | |
5254 | keys is always an upper case value. For the other keys it is one of | |
5255 | WXK_XXX values from the keycodes table. The translated key is, in | |
5256 | general, the character the user expects to appear as the result of the | |
5257 | key combination when typing the text into a text entry zone, for | |
5258 | example. | |
5259 | ||
5260 | A few examples to clarify this (all assume that CAPS LOCK is unpressed | |
5261 | and the standard US keyboard): when the 'A' key is pressed, the key | |
5262 | down event key code is equal to ASCII A == 65. But the char event key | |
5263 | code is ASCII a == 97. On the other hand, if you press both SHIFT and | |
5264 | 'A' keys simultaneously , the key code in key down event will still be | |
5265 | just 'A' while the char event key code parameter will now be 'A' as | |
5266 | well. | |
5267 | ||
5268 | Although in this simple case it is clear that the correct key code | |
5269 | could be found in the key down event handler by checking the value | |
5270 | returned by `ShiftDown`, in general you should use EVT_CHAR for this | |
5271 | as for non alphanumeric keys or non-US keyboard layouts the | |
5272 | translation is keyboard-layout dependent and can only be done properly | |
5273 | by the system itself. | |
5274 | ||
5275 | Another kind of translation is done when the control key is pressed: | |
5276 | for example, for CTRL-A key press the key down event still carries the | |
5277 | same key code 'A' as usual but the char event will have key code of 1, | |
5278 | the ASCII value of this key combination. | |
5279 | ||
5280 | You may discover how the other keys on your system behave | |
5281 | interactively by running the KeyEvents sample in the wxPython demo and | |
5282 | pressing some keys while the blue box at the top has the keyboard | |
5283 | focus. | |
5284 | ||
5285 | **Note**: If a key down event is caught and the event handler does not | |
5286 | call event.Skip() then the coresponding char event will not | |
5287 | happen. This is by design and enables the programs that handle both | |
5288 | types of events to be a bit simpler. | |
5289 | ||
5290 | **Note for Windows programmers**: The key and char events in wxWidgets | |
5291 | are similar to but slightly different from Windows WM_KEYDOWN and | |
5292 | WM_CHAR events. In particular, Alt-x combination will generate a char | |
5293 | event in wxWidgets (unless it is used as an accelerator). | |
5294 | ||
5295 | **Tip**: be sure to call event.Skip() for events that you don't | |
5296 | process in key event function, otherwise menu shortcuts may cease to | |
5297 | work under Windows. | |
5298 | ||
5299 | """ | |
0085ce49 RD |
5300 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5301 | __repr__ = _swig_repr | |
5302 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5303 | """ |
2131d850 | 5304 | __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent |
5ba5649b RD |
5305 | |
5306 | Construct a new `wx.KeyEvent`. Valid event types are: | |
5307 | * | |
5308 | """ | |
0085ce49 | 5309 | _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs)) |
b1fcee84 RD |
5310 | def GetModifiers(*args, **kwargs): |
5311 | """ | |
5312 | GetModifiers(self) -> int | |
5313 | ||
5314 | Returns a bitmask of the current modifier settings. Can be used to | |
5315 | check if the key event has exactly the given modifiers without having | |
5316 | to explicitly check that the other modifiers are not down. For | |
5317 | example:: | |
5318 | ||
5319 | if event.GetModifers() == wx.MOD_CONTROL: | |
5320 | DoSomething() | |
5321 | ||
5322 | """ | |
5323 | return _core_.KeyEvent_GetModifiers(*args, **kwargs) | |
5324 | ||
e811c8ce | 5325 | def ControlDown(*args, **kwargs): |
5ba5649b RD |
5326 | """ |
5327 | ControlDown(self) -> bool | |
5328 | ||
5329 | Returns ``True`` if the Control key was down at the time of the event. | |
5330 | """ | |
54f9ee45 | 5331 | return _core_.KeyEvent_ControlDown(*args, **kwargs) |
e811c8ce RD |
5332 | |
5333 | def MetaDown(*args, **kwargs): | |
5ba5649b RD |
5334 | """ |
5335 | MetaDown(self) -> bool | |
5336 | ||
5337 | Returns ``True`` if the Meta key was down at the time of the event. | |
5338 | """ | |
54f9ee45 | 5339 | return _core_.KeyEvent_MetaDown(*args, **kwargs) |
e811c8ce RD |
5340 | |
5341 | def AltDown(*args, **kwargs): | |
5ba5649b RD |
5342 | """ |
5343 | AltDown(self) -> bool | |
5344 | ||
5345 | Returns ``True`` if the Alt key was down at the time of the event. | |
5346 | """ | |
54f9ee45 | 5347 | return _core_.KeyEvent_AltDown(*args, **kwargs) |
e811c8ce RD |
5348 | |
5349 | def ShiftDown(*args, **kwargs): | |
5ba5649b RD |
5350 | """ |
5351 | ShiftDown(self) -> bool | |
5352 | ||
5353 | Returns ``True`` if the Shift key was down at the time of the event. | |
5354 | """ | |
54f9ee45 | 5355 | return _core_.KeyEvent_ShiftDown(*args, **kwargs) |
e811c8ce | 5356 | |
412d302d RD |
5357 | def CmdDown(*args, **kwargs): |
5358 | """ | |
5359 | CmdDown(self) -> bool | |
5360 | ||
5361 | "Cmd" is a pseudo key which is the same as Control for PC and Unix | |
5362 | platforms but the special "Apple" (a.k.a as "Command") key on | |
5ba5649b | 5363 | Macs. It makes often sense to use it instead of, say, `ControlDown` |
412d302d RD |
5364 | because Cmd key is used for the same thing under Mac as Ctrl |
5365 | elsewhere. The Ctrl still exists, it's just not used for this | |
5366 | purpose. So for non-Mac platforms this is the same as `ControlDown` | |
5367 | and Macs this is the same as `MetaDown`. | |
5368 | """ | |
5369 | return _core_.KeyEvent_CmdDown(*args, **kwargs) | |
5370 | ||
e811c8ce | 5371 | def HasModifiers(*args, **kwargs): |
5ba5649b RD |
5372 | """ |
5373 | HasModifiers(self) -> bool | |
5374 | ||
5375 | Returns true if either CTRL or ALT keys was down at the time of the | |
5376 | key event. Note that this function does not take into account neither | |
5377 | SHIFT nor META key states (the reason for ignoring the latter is that | |
5378 | it is common for NUMLOCK key to be configured as META under X but the | |
5379 | key presses even while NUMLOCK is on should be still processed | |
5380 | normally). | |
5381 | """ | |
54f9ee45 | 5382 | return _core_.KeyEvent_HasModifiers(*args, **kwargs) |
e811c8ce RD |
5383 | |
5384 | def GetKeyCode(*args, **kwargs): | |
5ba5649b RD |
5385 | """ |
5386 | GetKeyCode(self) -> int | |
5387 | ||
5388 | Returns the virtual key code. ASCII events return normal ASCII values, | |
5389 | while non-ASCII events return values such as WXK_LEFT for the left | |
5390 | cursor key. See `wx.KeyEvent` for a full list of the virtual key | |
5391 | codes. | |
5392 | ||
5393 | Note that in Unicode build, the returned value is meaningful only if | |
5394 | the user entered a character that can be represented in current | |
5395 | locale's default charset. You can obtain the corresponding Unicode | |
5396 | character using `GetUnicodeKey`. | |
5397 | """ | |
54f9ee45 | 5398 | return _core_.KeyEvent_GetKeyCode(*args, **kwargs) |
e811c8ce | 5399 | |
19272049 | 5400 | def GetUnicodeKey(*args, **kwargs): |
5ba5649b RD |
5401 | """ |
5402 | GetUnicodeKey(self) -> int | |
5403 | ||
5404 | Returns the Unicode character corresponding to this key event. This | |
5405 | function is only meaningfule in a Unicode build of wxPython. | |
5406 | """ | |
19272049 | 5407 | return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs) |
e811c8ce | 5408 | |
19272049 | 5409 | GetUniChar = GetUnicodeKey |
b850e7f3 RD |
5410 | def SetUnicodeKey(*args, **kwargs): |
5411 | """ | |
5412 | SetUnicodeKey(self, int uniChar) | |
5413 | ||
5414 | Set the Unicode value of the key event, but only if this is a Unicode | |
5415 | build of wxPython. | |
5416 | """ | |
5417 | return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs) | |
5418 | ||
e811c8ce | 5419 | def GetRawKeyCode(*args, **kwargs): |
5ba5649b RD |
5420 | """ |
5421 | GetRawKeyCode(self) -> unsigned int | |
5422 | ||
5423 | Returns the raw key code for this event. This is a platform-dependent | |
5424 | scan code which should only be used in advanced | |
5425 | applications. Currently the raw key codes are not supported by all | |
5426 | ports. | |
5427 | """ | |
54f9ee45 | 5428 | return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs) |
e811c8ce RD |
5429 | |
5430 | def GetRawKeyFlags(*args, **kwargs): | |
5ba5649b RD |
5431 | """ |
5432 | GetRawKeyFlags(self) -> unsigned int | |
5433 | ||
5434 | Returns the low level key flags for this event. The flags are | |
5435 | platform-dependent and should only be used in advanced applications. | |
5436 | Currently the raw key flags are not supported by all ports. | |
5437 | """ | |
54f9ee45 | 5438 | return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs) |
e811c8ce RD |
5439 | |
5440 | def GetPosition(*args, **kwargs): | |
0df68c9f | 5441 | """ |
a95a7133 | 5442 | GetPosition(self) -> Point |
e811c8ce | 5443 | |
5ba5649b | 5444 | Find the position of the event, if applicable. |
0df68c9f | 5445 | """ |
54f9ee45 | 5446 | return _core_.KeyEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5447 | |
5448 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
5449 | """ |
5450 | GetPositionTuple() -> (x,y) | |
e811c8ce | 5451 | |
5ba5649b | 5452 | Find the position of the event, if applicable. |
0df68c9f | 5453 | """ |
54f9ee45 | 5454 | return _core_.KeyEvent_GetPositionTuple(*args, **kwargs) |
e811c8ce RD |
5455 | |
5456 | def GetX(*args, **kwargs): | |
5ba5649b RD |
5457 | """ |
5458 | GetX(self) -> int | |
5459 | ||
5460 | Returns the X position (in client coordinates) of the event, if | |
5461 | applicable. | |
5462 | """ | |
54f9ee45 | 5463 | return _core_.KeyEvent_GetX(*args, **kwargs) |
e811c8ce RD |
5464 | |
5465 | def GetY(*args, **kwargs): | |
5ba5649b RD |
5466 | """ |
5467 | GetY(self) -> int | |
5468 | ||
5469 | Returns the Y position (in client coordinates) of the event, if | |
5470 | applicable. | |
5471 | """ | |
54f9ee45 RD |
5472 | return _core_.KeyEvent_GetY(*args, **kwargs) |
5473 | ||
5474 | m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set) | |
5475 | m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set) | |
5476 | m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set) | |
5477 | m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set) | |
5478 | m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set) | |
5479 | m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set) | |
5480 | m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set) | |
5481 | m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set) | |
5482 | m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set) | |
5483 | m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set) | |
97ab0f6a RD |
5484 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") |
5485 | Modifiers = property(GetModifiers,doc="See `GetModifiers`") | |
5486 | Position = property(GetPosition,doc="See `GetPosition`") | |
5487 | RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`") | |
5488 | RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`") | |
5489 | UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`") | |
5490 | X = property(GetX,doc="See `GetX`") | |
5491 | Y = property(GetY,doc="See `GetY`") | |
2131d850 | 5492 | _core_.KeyEvent_swigregister(KeyEvent) |
d14a1e28 RD |
5493 | |
5494 | #--------------------------------------------------------------------------- | |
5495 | ||
5496 | class SizeEvent(Event): | |
5ba5649b RD |
5497 | """ |
5498 | A size event holds information about size change events. The EVT_SIZE | |
5499 | handler function will be called when the window it is bound to has | |
5500 | been resized. | |
5501 | ||
5502 | Note that the size passed is of the whole window: call | |
5503 | `wx.Window.GetClientSize` for the area which may be used by the | |
5504 | application. | |
5505 | ||
5506 | When a window is resized, usually only a small part of the window is | |
5507 | damaged and and that area is all that is in the update region for the | |
5508 | next paint event. However, if your drawing depends on the size of the | |
5509 | window, you may need to clear the DC explicitly and repaint the whole | |
5510 | window. In which case, you may need to call `wx.Window.Refresh` to | |
5511 | invalidate the entire window. | |
5512 | ||
5513 | """ | |
0085ce49 RD |
5514 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5515 | __repr__ = _swig_repr | |
5516 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5517 | """ |
5518 | __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent | |
5519 | ||
5520 | Construct a new ``wx.SizeEvent``. | |
5521 | """ | |
0085ce49 | 5522 | _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs)) |
e811c8ce | 5523 | def GetSize(*args, **kwargs): |
5ba5649b RD |
5524 | """ |
5525 | GetSize(self) -> Size | |
5526 | ||
5527 | Returns the entire size of the window generating the size change | |
5528 | event. | |
5529 | """ | |
54f9ee45 | 5530 | return _core_.SizeEvent_GetSize(*args, **kwargs) |
e811c8ce RD |
5531 | |
5532 | def GetRect(*args, **kwargs): | |
a95a7133 | 5533 | """GetRect(self) -> Rect""" |
54f9ee45 | 5534 | return _core_.SizeEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5535 | |
5536 | def SetRect(*args, **kwargs): | |
a95a7133 | 5537 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5538 | return _core_.SizeEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5539 | |
5540 | def SetSize(*args, **kwargs): | |
a95a7133 | 5541 | """SetSize(self, Size size)""" |
54f9ee45 | 5542 | return _core_.SizeEvent_SetSize(*args, **kwargs) |
e811c8ce | 5543 | |
54f9ee45 RD |
5544 | m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set) |
5545 | m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set) | |
33d6fd3b RD |
5546 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") |
5547 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") | |
2131d850 | 5548 | _core_.SizeEvent_swigregister(SizeEvent) |
d14a1e28 RD |
5549 | |
5550 | #--------------------------------------------------------------------------- | |
5551 | ||
5552 | class MoveEvent(Event): | |
5ba5649b RD |
5553 | """ |
5554 | This event object is sent for EVT_MOVE event bindings when a window is | |
5555 | moved to a new position. | |
5556 | """ | |
0085ce49 RD |
5557 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5558 | __repr__ = _swig_repr | |
5559 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5560 | """ |
5561 | __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent | |
5562 | ||
5563 | Constructor. | |
5564 | """ | |
0085ce49 | 5565 | _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs)) |
e811c8ce | 5566 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
5567 | """ |
5568 | GetPosition(self) -> Point | |
5569 | ||
5570 | Returns the position of the window generating the move change event. | |
5571 | """ | |
54f9ee45 | 5572 | return _core_.MoveEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
5573 | |
5574 | def GetRect(*args, **kwargs): | |
a95a7133 | 5575 | """GetRect(self) -> Rect""" |
54f9ee45 | 5576 | return _core_.MoveEvent_GetRect(*args, **kwargs) |
e811c8ce RD |
5577 | |
5578 | def SetRect(*args, **kwargs): | |
a95a7133 | 5579 | """SetRect(self, Rect rect)""" |
54f9ee45 | 5580 | return _core_.MoveEvent_SetRect(*args, **kwargs) |
e811c8ce RD |
5581 | |
5582 | def SetPosition(*args, **kwargs): | |
a95a7133 | 5583 | """SetPosition(self, Point pos)""" |
54f9ee45 | 5584 | return _core_.MoveEvent_SetPosition(*args, **kwargs) |
e811c8ce | 5585 | |
7557b9b5 RD |
5586 | m_pos = property(GetPosition, SetPosition) |
5587 | m_rect = property(GetRect, SetRect) | |
5588 | ||
57332a5a RD |
5589 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") |
5590 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
2131d850 | 5591 | _core_.MoveEvent_swigregister(MoveEvent) |
d14a1e28 RD |
5592 | |
5593 | #--------------------------------------------------------------------------- | |
5594 | ||
5595 | class PaintEvent(Event): | |
5ba5649b RD |
5596 | """ |
5597 | A paint event is sent when a window's contents needs to be repainted. | |
5598 | Note that in an EVT_PAINT handler the application must *always* create | |
5599 | a `wx.PaintDC` object, even if you do not use it. Otherwise MS | |
5600 | Windows assumes that the window has not been painted yet and will send | |
5601 | the event again, causing endless refreshes. | |
5602 | ||
5603 | You can optimize painting by retrieving the rectangles that have been | |
5604 | damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`, | |
5605 | and only repainting these rectangles. The rectangles are in terms of | |
5606 | the client area, and are unscrolled, so you will need to do some | |
5607 | calculations using the current view position to obtain logical, | |
5608 | scrolled units. | |
5609 | ||
5610 | """ | |
0085ce49 RD |
5611 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5612 | __repr__ = _swig_repr | |
5613 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5614 | """__init__(self, int Id=0) -> PaintEvent""" |
0085ce49 | 5615 | _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs)) |
2131d850 | 5616 | _core_.PaintEvent_swigregister(PaintEvent) |
d14a1e28 RD |
5617 | |
5618 | class NcPaintEvent(Event): | |
093d3ff1 | 5619 | """Proxy of C++ NcPaintEvent class""" |
0085ce49 RD |
5620 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5621 | __repr__ = _swig_repr | |
5622 | def __init__(self, *args, **kwargs): | |
a95a7133 | 5623 | """__init__(self, int winid=0) -> NcPaintEvent""" |
0085ce49 | 5624 | _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs)) |
2131d850 | 5625 | _core_.NcPaintEvent_swigregister(NcPaintEvent) |
d14a1e28 RD |
5626 | |
5627 | #--------------------------------------------------------------------------- | |
5628 | ||
5629 | class EraseEvent(Event): | |
5ba5649b RD |
5630 | """ |
5631 | An erase event is sent whenever the background of a window needs to be | |
5632 | repainted. To intercept this event use the EVT_ERASE_BACKGROUND event | |
5633 | binder. On some platforms, such as GTK+, this event is simulated | |
5634 | (simply generated just before the paint event) and may cause flicker. | |
5635 | ||
5636 | To paint a custom background use the `GetDC` method and use the returned | |
5637 | device context if it is not ``None``, otherwise create a temporary | |
5638 | `wx.ClientDC` and draw on that. | |
5639 | ||
5640 | """ | |
0085ce49 RD |
5641 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5642 | __repr__ = _swig_repr | |
5643 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5644 | """ |
5645 | __init__(self, int Id=0, DC dc=None) -> EraseEvent | |
5646 | ||
5647 | Constructor | |
5648 | """ | |
0085ce49 | 5649 | _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs)) |
e811c8ce | 5650 | def GetDC(*args, **kwargs): |
5ba5649b RD |
5651 | """ |
5652 | GetDC(self) -> DC | |
5653 | ||
5654 | Returns the device context the event handler should draw upon. If | |
5655 | ``None`` is returned then create a temporary `wx.ClientDC` and use | |
5656 | that instead. | |
5657 | """ | |
54f9ee45 | 5658 | return _core_.EraseEvent_GetDC(*args, **kwargs) |
e811c8ce | 5659 | |
97ab0f6a | 5660 | DC = property(GetDC,doc="See `GetDC`") |
2131d850 | 5661 | _core_.EraseEvent_swigregister(EraseEvent) |
d14a1e28 RD |
5662 | |
5663 | #--------------------------------------------------------------------------- | |
5664 | ||
5665 | class FocusEvent(Event): | |
5ba5649b RD |
5666 | """ |
5667 | A focus event is sent when a window's focus changes. The window losing | |
5668 | focus receives an EVT_KILL_FOCUS event while the window gaining it | |
5669 | gets an EVT_SET_FOCUS event. | |
5670 | ||
5671 | Notice that the set focus event happens both when the user gives focus | |
5672 | to the window (whether using the mouse or keyboard) and when it is | |
5673 | done from the program itself using `wx.Window.SetFocus`. | |
5674 | ||
5675 | """ | |
0085ce49 RD |
5676 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5677 | __repr__ = _swig_repr | |
5678 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5679 | """ |
2131d850 | 5680 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent |
5ba5649b RD |
5681 | |
5682 | Constructor | |
5683 | """ | |
0085ce49 | 5684 | _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs)) |
e811c8ce | 5685 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5686 | """ |
5687 | GetWindow(self) -> Window | |
5688 | ||
5689 | Returns the other window associated with this event, that is the | |
5690 | window which had the focus before for the EVT_SET_FOCUS event and the | |
5691 | window which is going to receive focus for the wxEVT_KILL_FOCUS event. | |
5692 | ||
5693 | Warning: the window returned may be None! | |
5694 | """ | |
54f9ee45 | 5695 | return _core_.FocusEvent_GetWindow(*args, **kwargs) |
e811c8ce RD |
5696 | |
5697 | def SetWindow(*args, **kwargs): | |
a95a7133 | 5698 | """SetWindow(self, Window win)""" |
54f9ee45 | 5699 | return _core_.FocusEvent_SetWindow(*args, **kwargs) |
e811c8ce | 5700 | |
97ab0f6a | 5701 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") |
2131d850 | 5702 | _core_.FocusEvent_swigregister(FocusEvent) |
d14a1e28 RD |
5703 | |
5704 | #--------------------------------------------------------------------------- | |
5705 | ||
5706 | class ChildFocusEvent(CommandEvent): | |
5ba5649b | 5707 | """ |
33d6fd3b RD |
5708 | A child focus event is sent to a (parent-)window when one of its child |
5709 | windows gains focus, so that the window could restore the focus back | |
5710 | to its corresponding child if it loses it now and regains later. | |
5711 | ||
5712 | Notice that child window is the direct child of the window receiving | |
5713 | the event, and so may not be the actual widget recieving focus if it | |
5714 | is further down the containment heirarchy. Use `wx.Window.FindFocus` | |
5715 | to get the widget that is actually receiving focus. | |
5ba5649b | 5716 | """ |
0085ce49 RD |
5717 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5718 | __repr__ = _swig_repr | |
5719 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5720 | """ |
5721 | __init__(self, Window win=None) -> ChildFocusEvent | |
5722 | ||
5723 | Constructor | |
5724 | """ | |
0085ce49 | 5725 | _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs)) |
e811c8ce | 5726 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
5727 | """ |
5728 | GetWindow(self) -> Window | |
5729 | ||
33d6fd3b RD |
5730 | The window, or (grand)parent of the window which has just received the |
5731 | focus. | |
5ba5649b | 5732 | """ |
54f9ee45 | 5733 | return _core_.ChildFocusEvent_GetWindow(*args, **kwargs) |
e811c8ce | 5734 | |
2bf58437 | 5735 | Window = property(GetWindow,doc="See `GetWindow`") |
2131d850 | 5736 | _core_.ChildFocusEvent_swigregister(ChildFocusEvent) |
d14a1e28 RD |
5737 | |
5738 | #--------------------------------------------------------------------------- | |
5739 | ||
5740 | class ActivateEvent(Event): | |
5ba5649b RD |
5741 | """ |
5742 | An activate event is sent when a top-level window or the entire | |
5743 | application is being activated or deactivated. | |
5744 | ||
5745 | A top-level window (a dialog or frame) receives an activate event when | |
5746 | is being activated or deactivated. This is indicated visually by the | |
5747 | title bar changing colour, and a subwindow gaining the keyboard focus. | |
5748 | An application is activated or deactivated when one of its frames | |
5749 | becomes activated, or a frame becomes inactivate resulting in all | |
5750 | application frames being inactive. | |
5751 | ||
5752 | Please note that usually you should call event.Skip() in your handlers | |
5753 | for these events so the default handlers will still be called, as not | |
5754 | doing so can result in strange effects. | |
5755 | ||
5756 | """ | |
0085ce49 RD |
5757 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5758 | __repr__ = _swig_repr | |
5759 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5760 | """ |
2131d850 | 5761 | __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent |
5ba5649b RD |
5762 | |
5763 | Constructor | |
5764 | """ | |
0085ce49 | 5765 | _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs)) |
e811c8ce | 5766 | def GetActive(*args, **kwargs): |
5ba5649b RD |
5767 | """ |
5768 | GetActive(self) -> bool | |
5769 | ||
5770 | Returns true if the application or window is being activated, false | |
5771 | otherwise. | |
5772 | """ | |
54f9ee45 | 5773 | return _core_.ActivateEvent_GetActive(*args, **kwargs) |
e811c8ce | 5774 | |
2bf58437 | 5775 | Active = property(GetActive,doc="See `GetActive`") |
2131d850 | 5776 | _core_.ActivateEvent_swigregister(ActivateEvent) |
d14a1e28 RD |
5777 | |
5778 | #--------------------------------------------------------------------------- | |
5779 | ||
5780 | class InitDialogEvent(Event): | |
5ba5649b RD |
5781 | """ |
5782 | A wx.InitDialogEvent is sent as a dialog is being initialised, or for | |
5783 | any window when `wx.Window.InitDialog` is called. Handlers for this | |
5784 | event can transfer data to the window, or anything else that should be | |
5785 | done before the user begins editing the form. The default handler | |
5786 | calls `wx.Window.TransferDataToWindow`. | |
5787 | """ | |
0085ce49 RD |
5788 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5789 | __repr__ = _swig_repr | |
5790 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5791 | """ |
5792 | __init__(self, int Id=0) -> InitDialogEvent | |
5793 | ||
5794 | Constructor | |
5795 | """ | |
0085ce49 | 5796 | _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs)) |
2131d850 | 5797 | _core_.InitDialogEvent_swigregister(InitDialogEvent) |
d14a1e28 RD |
5798 | |
5799 | #--------------------------------------------------------------------------- | |
5800 | ||
5801 | class MenuEvent(Event): | |
5ba5649b RD |
5802 | """ |
5803 | This class is used for a variety of menu-related events. Note that | |
5804 | these do not include menu command events, which are handled by sending | |
5805 | `wx.CommandEvent` objects. | |
5806 | ||
5807 | The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help | |
5808 | text in the first field of the status bar. | |
5809 | """ | |
0085ce49 RD |
5810 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5811 | __repr__ = _swig_repr | |
5812 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5813 | """ |
2131d850 | 5814 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent |
5ba5649b RD |
5815 | |
5816 | Constructor | |
5817 | """ | |
0085ce49 | 5818 | _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs)) |
e811c8ce | 5819 | def GetMenuId(*args, **kwargs): |
5ba5649b RD |
5820 | """ |
5821 | GetMenuId(self) -> int | |
5822 | ||
5823 | Returns the menu identifier associated with the event. This method | |
5824 | should be only used with the HIGHLIGHT events. | |
5825 | """ | |
54f9ee45 | 5826 | return _core_.MenuEvent_GetMenuId(*args, **kwargs) |
e811c8ce RD |
5827 | |
5828 | def IsPopup(*args, **kwargs): | |
5ba5649b RD |
5829 | """ |
5830 | IsPopup(self) -> bool | |
5831 | ||
5832 | Returns ``True`` if the menu which is being opened or closed is a | |
5833 | popup menu, ``False`` if it is a normal one. This method should only | |
5834 | be used with the OPEN and CLOSE events. | |
5835 | """ | |
54f9ee45 | 5836 | return _core_.MenuEvent_IsPopup(*args, **kwargs) |
e811c8ce RD |
5837 | |
5838 | def GetMenu(*args, **kwargs): | |
5ba5649b RD |
5839 | """ |
5840 | GetMenu(self) -> Menu | |
5841 | ||
5842 | Returns the menu which is being opened or closed. This method should | |
5843 | only be used with the OPEN and CLOSE events. | |
5844 | """ | |
54f9ee45 | 5845 | return _core_.MenuEvent_GetMenu(*args, **kwargs) |
e811c8ce | 5846 | |
57332a5a RD |
5847 | Menu = property(GetMenu,doc="See `GetMenu`") |
5848 | MenuId = property(GetMenuId,doc="See `GetMenuId`") | |
2131d850 | 5849 | _core_.MenuEvent_swigregister(MenuEvent) |
d14a1e28 RD |
5850 | |
5851 | #--------------------------------------------------------------------------- | |
5852 | ||
5853 | class CloseEvent(Event): | |
5ba5649b RD |
5854 | """ |
5855 | This event class contains information about window and session close | |
5856 | events. | |
5857 | ||
5858 | The handler function for EVT_CLOSE is called when the user has tried | |
5859 | to close a a frame or dialog box using the window manager controls or | |
5860 | the system menu. It can also be invoked by the application itself | |
5861 | programmatically, for example by calling the `wx.Window.Close` | |
5862 | function. | |
5863 | ||
5864 | You should check whether the application is forcing the deletion of | |
5865 | the window using `CanVeto`. If it returns ``False``, you must destroy | |
5866 | the window using `wx.Window.Destroy`. If the return value is ``True``, | |
5867 | it is up to you whether you respond by destroying the window or not. | |
5868 | For example you may wish to display a message dialog prompting to save | |
5869 | files or to cancel the close. | |
5870 | ||
5871 | If you don't destroy the window, you should call `Veto` to let the | |
5872 | calling code know that you did not destroy the window. This allows the | |
5873 | `wx.Window.Close` function to return ``True`` or ``False`` depending | |
5874 | on whether the close instruction was honored or not. | |
5875 | """ | |
0085ce49 RD |
5876 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5877 | __repr__ = _swig_repr | |
5878 | def __init__(self, *args, **kwargs): | |
5ba5649b | 5879 | """ |
2131d850 | 5880 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent |
5ba5649b RD |
5881 | |
5882 | Constructor. | |
5883 | """ | |
0085ce49 | 5884 | _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs)) |
e811c8ce | 5885 | def SetLoggingOff(*args, **kwargs): |
5ba5649b RD |
5886 | """ |
5887 | SetLoggingOff(self, bool logOff) | |
5888 | ||
5889 | Sets the 'logging off' flag. | |
5890 | """ | |
54f9ee45 | 5891 | return _core_.CloseEvent_SetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5892 | |
5893 | def GetLoggingOff(*args, **kwargs): | |
5ba5649b RD |
5894 | """ |
5895 | GetLoggingOff(self) -> bool | |
5896 | ||
6c75a4cf RD |
5897 | Returns ``True`` if the user is logging off or ``False`` if the |
5898 | system is shutting down. This method can only be called for end | |
5899 | session and query end session events, it doesn't make sense for close | |
5900 | window event. | |
5ba5649b | 5901 | """ |
54f9ee45 | 5902 | return _core_.CloseEvent_GetLoggingOff(*args, **kwargs) |
e811c8ce RD |
5903 | |
5904 | def Veto(*args, **kwargs): | |
5ba5649b RD |
5905 | """ |
5906 | Veto(self, bool veto=True) | |
5907 | ||
5908 | Call this from your event handler to veto a system shutdown or to | |
5909 | signal to the calling application that a window close did not happen. | |
5910 | ||
5911 | You can only veto a shutdown or close if `CanVeto` returns true. | |
5912 | """ | |
54f9ee45 | 5913 | return _core_.CloseEvent_Veto(*args, **kwargs) |
e811c8ce | 5914 | |
5ba5649b RD |
5915 | def GetVeto(*args, **kwargs): |
5916 | """GetVeto(self) -> bool""" | |
5917 | return _core_.CloseEvent_GetVeto(*args, **kwargs) | |
5918 | ||
e811c8ce | 5919 | def SetCanVeto(*args, **kwargs): |
5ba5649b RD |
5920 | """ |
5921 | SetCanVeto(self, bool canVeto) | |
5922 | ||
5923 | Sets the 'can veto' flag. | |
5924 | """ | |
54f9ee45 | 5925 | return _core_.CloseEvent_SetCanVeto(*args, **kwargs) |
e811c8ce RD |
5926 | |
5927 | def CanVeto(*args, **kwargs): | |
5ba5649b RD |
5928 | """ |
5929 | CanVeto(self) -> bool | |
e811c8ce | 5930 | |
5ba5649b RD |
5931 | Returns true if you can veto a system shutdown or a window close |
5932 | event. Vetoing a window close event is not possible if the calling | |
5933 | code wishes to force the application to exit, and so this function | |
5934 | must be called to check this. | |
5935 | """ | |
5936 | return _core_.CloseEvent_CanVeto(*args, **kwargs) | |
e811c8ce | 5937 | |
2bf58437 | 5938 | LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`") |
2131d850 | 5939 | _core_.CloseEvent_swigregister(CloseEvent) |
d14a1e28 RD |
5940 | |
5941 | #--------------------------------------------------------------------------- | |
5942 | ||
5943 | class ShowEvent(Event): | |
5ba5649b | 5944 | """An EVT_SHOW event is sent when a window is shown or hidden.""" |
0085ce49 RD |
5945 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5946 | __repr__ = _swig_repr | |
5947 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5948 | """ |
5949 | __init__(self, int winid=0, bool show=False) -> ShowEvent | |
5950 | ||
5951 | An EVT_SHOW event is sent when a window is shown or hidden. | |
5952 | """ | |
0085ce49 | 5953 | _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs)) |
e811c8ce | 5954 | def SetShow(*args, **kwargs): |
a95a7133 | 5955 | """SetShow(self, bool show)""" |
54f9ee45 | 5956 | return _core_.ShowEvent_SetShow(*args, **kwargs) |
e811c8ce RD |
5957 | |
5958 | def GetShow(*args, **kwargs): | |
a95a7133 | 5959 | """GetShow(self) -> bool""" |
54f9ee45 | 5960 | return _core_.ShowEvent_GetShow(*args, **kwargs) |
e811c8ce | 5961 | |
33d6fd3b | 5962 | Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`") |
2131d850 | 5963 | _core_.ShowEvent_swigregister(ShowEvent) |
d14a1e28 RD |
5964 | |
5965 | #--------------------------------------------------------------------------- | |
5966 | ||
5967 | class IconizeEvent(Event): | |
5ba5649b RD |
5968 | """ |
5969 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5970 | restored. | |
5971 | """ | |
0085ce49 RD |
5972 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5973 | __repr__ = _swig_repr | |
5974 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
5975 | """ |
5976 | __init__(self, int id=0, bool iconized=True) -> IconizeEvent | |
5977 | ||
5978 | An EVT_ICONIZE event is sent when a frame is iconized (minimized) or | |
5979 | restored. | |
5980 | """ | |
0085ce49 | 5981 | _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs)) |
e811c8ce | 5982 | def Iconized(*args, **kwargs): |
5ba5649b RD |
5983 | """ |
5984 | Iconized(self) -> bool | |
5985 | ||
5986 | Returns ``True`` if the frame has been iconized, ``False`` if it has | |
5987 | been restored. | |
5988 | """ | |
54f9ee45 | 5989 | return _core_.IconizeEvent_Iconized(*args, **kwargs) |
e811c8ce | 5990 | |
2131d850 | 5991 | _core_.IconizeEvent_swigregister(IconizeEvent) |
d14a1e28 RD |
5992 | |
5993 | #--------------------------------------------------------------------------- | |
5994 | ||
5995 | class MaximizeEvent(Event): | |
5ba5649b | 5996 | """An EVT_MAXIMIZE event is sent when a frame is maximized or restored.""" |
0085ce49 RD |
5997 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
5998 | __repr__ = _swig_repr | |
5999 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6000 | """ |
6001 | __init__(self, int id=0) -> MaximizeEvent | |
6002 | ||
6003 | An EVT_MAXIMIZE event is sent when a frame is maximized or restored. | |
6004 | """ | |
0085ce49 | 6005 | _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs)) |
2131d850 | 6006 | _core_.MaximizeEvent_swigregister(MaximizeEvent) |
d14a1e28 RD |
6007 | |
6008 | #--------------------------------------------------------------------------- | |
6009 | ||
6010 | class DropFilesEvent(Event): | |
5ba5649b RD |
6011 | """ |
6012 | This class is used for drop files events, that is, when files have | |
6013 | been dropped onto the window. This functionality is only available | |
6014 | under Windows. The window must have previously been enabled for | |
6015 | dropping by calling `wx.Window.DragAcceptFiles`. | |
6016 | ||
6017 | Important note: this is a separate implementation to the more general | |
6018 | drag and drop implementation using `wx.FileDropTarget`, and etc. This | |
6019 | implementation uses the older, Windows message-based approach of | |
6020 | dropping files. | |
6021 | ||
6022 | Use wx.EVT_DROP_FILES to bind an event handler to receive file drop | |
6023 | events. | |
6024 | ||
6025 | """ | |
0085ce49 RD |
6026 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6027 | def __init__(self): raise AttributeError, "No constructor defined" | |
6028 | __repr__ = _swig_repr | |
e811c8ce | 6029 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
6030 | """ |
6031 | GetPosition(self) -> Point | |
6032 | ||
6033 | Returns the position at which the files were dropped. | |
6034 | """ | |
54f9ee45 | 6035 | return _core_.DropFilesEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
6036 | |
6037 | def GetNumberOfFiles(*args, **kwargs): | |
5ba5649b RD |
6038 | """ |
6039 | GetNumberOfFiles(self) -> int | |
6040 | ||
6041 | Returns the number of files dropped. | |
6042 | """ | |
54f9ee45 | 6043 | return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs) |
e811c8ce RD |
6044 | |
6045 | def GetFiles(*args, **kwargs): | |
5ba5649b RD |
6046 | """ |
6047 | GetFiles(self) -> PyObject | |
6048 | ||
6049 | Returns a list of the filenames that were dropped. | |
6050 | """ | |
54f9ee45 | 6051 | return _core_.DropFilesEvent_GetFiles(*args, **kwargs) |
e811c8ce | 6052 | |
2bf58437 RD |
6053 | Files = property(GetFiles,doc="See `GetFiles`") |
6054 | NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`") | |
6055 | Position = property(GetPosition,doc="See `GetPosition`") | |
2131d850 | 6056 | _core_.DropFilesEvent_swigregister(DropFilesEvent) |
d14a1e28 RD |
6057 | |
6058 | #--------------------------------------------------------------------------- | |
6059 | ||
54f9ee45 RD |
6060 | UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL |
6061 | UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED | |
d14a1e28 | 6062 | class UpdateUIEvent(CommandEvent): |
5ba5649b RD |
6063 | """ |
6064 | This class is used for EVT_UPDATE_UI pseudo-events which are sent by | |
6065 | wxWidgets to give an application the chance to update various user | |
6066 | interface elements. | |
6067 | ||
6068 | Without update UI events, an application has to work hard to | |
6069 | check/uncheck, enable/disable, and set the text for elements such as | |
6070 | menu items and toolbar buttons. The code for doing this has to be | |
6071 | mixed up with the code that is invoked when an action is invoked for a | |
6072 | menu item or button. | |
6073 | ||
6074 | With update UI events, you define an event handler to look at the | |
6075 | state of the application and change UI elements accordingly. wxWidgets | |
6076 | will call your handler functions in idle time, so you don't have to | |
6077 | worry where to call this code. In addition to being a clearer and more | |
6078 | declarative method, it also means you don't have to worry whether | |
6079 | you're updating a toolbar or menubar identifier. The same handler can | |
6080 | update a menu item and toolbar button, if the ID values are the same. | |
6081 | ||
6082 | Instead of directly manipulating the menu or button, you call | |
6083 | functions in the event object, such as `Check`. wxWidgets will | |
6084 | determine whether such a call has been made, and which UI element to | |
6085 | update. | |
6086 | ||
6087 | These events will work for popup menus as well as menubars. Just | |
6088 | before a menu is popped up, `wx.Menu.UpdateUI` is called to process | |
6089 | any UI events for the window that owns the menu. | |
6090 | ||
6091 | If you find that the overhead of UI update processing is affecting | |
6092 | your application, you can do one or both of the following: | |
6093 | ||
6094 | 1. Call `wx.UpdateUIEvent.SetMode` with a value of | |
6095 | wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style | |
6096 | wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should | |
6097 | receive update events. No other windows will receive update | |
6098 | events. | |
6099 | ||
6100 | 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond | |
6101 | value to set the delay between updates. You may need to call | |
6102 | `wx.Window.UpdateWindowUI` at critical points, for example when | |
6103 | a dialog is about to be shown, in case the user sees a slight | |
6104 | delay before windows are updated. | |
6105 | ||
6106 | Note that although events are sent in idle time, defining a EVT_IDLE | |
6107 | handler for a window does not affect this because the events are sent | |
6108 | from an internal idle handler. | |
6109 | ||
6110 | wxWidgets tries to optimize update events on some platforms. On | |
6111 | Windows and GTK+, events for menubar items are only sent when the menu | |
6112 | is about to be shown, and not in idle time. | |
6113 | ||
6114 | """ | |
0085ce49 RD |
6115 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6116 | __repr__ = _swig_repr | |
6117 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6118 | """ |
6119 | __init__(self, int commandId=0) -> UpdateUIEvent | |
6120 | ||
6121 | Constructor | |
6122 | """ | |
0085ce49 | 6123 | _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs)) |
e811c8ce | 6124 | def GetChecked(*args, **kwargs): |
5ba5649b RD |
6125 | """ |
6126 | GetChecked(self) -> bool | |
6127 | ||
6128 | Returns ``True`` if the UI element should be checked. | |
6129 | """ | |
54f9ee45 | 6130 | return _core_.UpdateUIEvent_GetChecked(*args, **kwargs) |
e811c8ce RD |
6131 | |
6132 | def GetEnabled(*args, **kwargs): | |
5ba5649b RD |
6133 | """ |
6134 | GetEnabled(self) -> bool | |
6135 | ||
6136 | Returns ``True`` if the UI element should be enabled. | |
6137 | """ | |
54f9ee45 | 6138 | return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs) |
e811c8ce | 6139 | |
b1fcee84 RD |
6140 | def GetShown(*args, **kwargs): |
6141 | """ | |
6142 | GetShown(self) -> bool | |
6143 | ||
6144 | Returns ``True`` if the UI element should be shown. | |
6145 | """ | |
6146 | return _core_.UpdateUIEvent_GetShown(*args, **kwargs) | |
6147 | ||
e811c8ce | 6148 | def GetText(*args, **kwargs): |
5ba5649b RD |
6149 | """ |
6150 | GetText(self) -> String | |
6151 | ||
6152 | Returns the text that should be set for the UI element. | |
6153 | """ | |
54f9ee45 | 6154 | return _core_.UpdateUIEvent_GetText(*args, **kwargs) |
e811c8ce RD |
6155 | |
6156 | def GetSetText(*args, **kwargs): | |
5ba5649b RD |
6157 | """ |
6158 | GetSetText(self) -> bool | |
6159 | ||
6160 | Returns ``True`` if the application has called `SetText`. For | |
6161 | wxWidgets internal use only. | |
6162 | """ | |
54f9ee45 | 6163 | return _core_.UpdateUIEvent_GetSetText(*args, **kwargs) |
e811c8ce RD |
6164 | |
6165 | def GetSetChecked(*args, **kwargs): | |
5ba5649b RD |
6166 | """ |
6167 | GetSetChecked(self) -> bool | |
6168 | ||
6169 | Returns ``True`` if the application has called `Check`. For wxWidgets | |
6170 | internal use only. | |
6171 | """ | |
54f9ee45 | 6172 | return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs) |
e811c8ce RD |
6173 | |
6174 | def GetSetEnabled(*args, **kwargs): | |
5ba5649b RD |
6175 | """ |
6176 | GetSetEnabled(self) -> bool | |
6177 | ||
6178 | Returns ``True`` if the application has called `Enable`. For wxWidgets | |
6179 | internal use only. | |
6180 | """ | |
54f9ee45 | 6181 | return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs) |
e811c8ce | 6182 | |
b1fcee84 RD |
6183 | def GetSetShown(*args, **kwargs): |
6184 | """ | |
6185 | GetSetShown(self) -> bool | |
6186 | ||
6187 | Returns ``True`` if the application has called `Show`. For wxWidgets | |
6188 | internal use only. | |
6189 | """ | |
6190 | return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs) | |
6191 | ||
e811c8ce | 6192 | def Check(*args, **kwargs): |
5ba5649b RD |
6193 | """ |
6194 | Check(self, bool check) | |
6195 | ||
6196 | Check or uncheck the UI element. | |
6197 | """ | |
54f9ee45 | 6198 | return _core_.UpdateUIEvent_Check(*args, **kwargs) |
e811c8ce RD |
6199 | |
6200 | def Enable(*args, **kwargs): | |
5ba5649b RD |
6201 | """ |
6202 | Enable(self, bool enable) | |
6203 | ||
6204 | Enable or disable the UI element. | |
6205 | """ | |
54f9ee45 | 6206 | return _core_.UpdateUIEvent_Enable(*args, **kwargs) |
e811c8ce | 6207 | |
b1fcee84 RD |
6208 | def Show(*args, **kwargs): |
6209 | """ | |
6210 | Show(self, bool show) | |
6211 | ||
6212 | Show or hide the UI element. | |
6213 | """ | |
6214 | return _core_.UpdateUIEvent_Show(*args, **kwargs) | |
6215 | ||
e811c8ce | 6216 | def SetText(*args, **kwargs): |
5ba5649b RD |
6217 | """ |
6218 | SetText(self, String text) | |
6219 | ||
6220 | Sets the text for this UI element. | |
6221 | """ | |
54f9ee45 | 6222 | return _core_.UpdateUIEvent_SetText(*args, **kwargs) |
e811c8ce RD |
6223 | |
6224 | def SetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
6225 | """ |
6226 | SetUpdateInterval(long updateInterval) | |
6227 | ||
6228 | Sets the interval between updates in milliseconds. Set to -1 to | |
6229 | disable updates, or to 0 to update as frequently as possible. The | |
6230 | default is 0. | |
6231 | ||
6232 | Use this to reduce the overhead of UI update events if your | |
6233 | application has a lot of windows. If you set the value to -1 or | |
6234 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
6235 | at appropriate points in your application, such as when a dialog is | |
6236 | about to be shown. | |
6237 | """ | |
54f9ee45 | 6238 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
6239 | |
6240 | SetUpdateInterval = staticmethod(SetUpdateInterval) | |
6241 | def GetUpdateInterval(*args, **kwargs): | |
5ba5649b RD |
6242 | """ |
6243 | GetUpdateInterval() -> long | |
6244 | ||
6245 | Returns the current interval between updates in milliseconds. -1 | |
6246 | disables updates, 0 updates as frequently as possible. | |
6247 | """ | |
54f9ee45 | 6248 | return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs) |
e811c8ce RD |
6249 | |
6250 | GetUpdateInterval = staticmethod(GetUpdateInterval) | |
6251 | def CanUpdate(*args, **kwargs): | |
5ba5649b RD |
6252 | """ |
6253 | CanUpdate(Window win) -> bool | |
6254 | ||
6255 | Returns ``True`` if it is appropriate to update (send UI update events | |
6256 | to) this window. | |
6257 | ||
6258 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6259 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6260 | events were last sent in idle time, and the update interval, to | |
6261 | determine whether events should be sent to this window now. By default | |
6262 | this will always return true because the update mode is initially | |
6263 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6264 | events will be sent as often as possible. You can reduce the frequency | |
6265 | that events are sent by changing the mode and/or setting an update | |
6266 | interval. | |
6267 | ||
6268 | """ | |
54f9ee45 | 6269 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
e811c8ce RD |
6270 | |
6271 | CanUpdate = staticmethod(CanUpdate) | |
6272 | def ResetUpdateTime(*args, **kwargs): | |
5ba5649b RD |
6273 | """ |
6274 | ResetUpdateTime() | |
6275 | ||
6276 | Used internally to reset the last-updated time to the current time. It | |
6277 | is assumed that update events are normally sent in idle time, so this | |
6278 | is called at the end of idle processing. | |
6279 | """ | |
54f9ee45 | 6280 | return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs) |
e811c8ce RD |
6281 | |
6282 | ResetUpdateTime = staticmethod(ResetUpdateTime) | |
6283 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6284 | """ |
6285 | SetMode(int mode) | |
6286 | ||
6287 | Specify how wxWidgets will send update events: to all windows, or only | |
6288 | to those which specify that they will process the events. | |
6289 | ||
6290 | The mode may be one of the following values: | |
6291 | ||
6292 | ============================= ========================================== | |
6293 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6294 | is the default setting. | |
6295 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6296 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6297 | style set. | |
6298 | ============================= ========================================== | |
6299 | ||
6300 | """ | |
54f9ee45 | 6301 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
6302 | |
6303 | SetMode = staticmethod(SetMode) | |
6304 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6305 | """ |
6306 | GetMode() -> int | |
6307 | ||
6308 | Returns a value specifying how wxWidgets will send update events: to | |
6309 | all windows, or only to those which specify that they will process the | |
6310 | events. | |
6311 | """ | |
54f9ee45 | 6312 | return _core_.UpdateUIEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
6313 | |
6314 | GetMode = staticmethod(GetMode) | |
dba7934c RD |
6315 | Checked = property(GetChecked,Check,doc="See `GetChecked`") |
6316 | Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`") | |
6317 | Shown = property(GetShown,Show,doc="See `GetShown`") | |
6318 | Text = property(GetText,SetText,doc="See `GetText` and `SetText`") | |
2131d850 | 6319 | _core_.UpdateUIEvent_swigregister(UpdateUIEvent) |
d14a1e28 | 6320 | |
e811c8ce | 6321 | def UpdateUIEvent_SetUpdateInterval(*args, **kwargs): |
0085ce49 | 6322 | """ |
5ba5649b RD |
6323 | UpdateUIEvent_SetUpdateInterval(long updateInterval) |
6324 | ||
6325 | Sets the interval between updates in milliseconds. Set to -1 to | |
6326 | disable updates, or to 0 to update as frequently as possible. The | |
6327 | default is 0. | |
6328 | ||
6329 | Use this to reduce the overhead of UI update events if your | |
6330 | application has a lot of windows. If you set the value to -1 or | |
6331 | greater than 0, you may also need to call `wx.Window.UpdateWindowUI` | |
6332 | at appropriate points in your application, such as when a dialog is | |
6333 | about to be shown. | |
6334 | """ | |
0085ce49 | 6335 | return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs) |
d14a1e28 | 6336 | |
0085ce49 RD |
6337 | def UpdateUIEvent_GetUpdateInterval(*args): |
6338 | """ | |
5ba5649b RD |
6339 | UpdateUIEvent_GetUpdateInterval() -> long |
6340 | ||
6341 | Returns the current interval between updates in milliseconds. -1 | |
6342 | disables updates, 0 updates as frequently as possible. | |
6343 | """ | |
0085ce49 | 6344 | return _core_.UpdateUIEvent_GetUpdateInterval(*args) |
d14a1e28 | 6345 | |
e811c8ce | 6346 | def UpdateUIEvent_CanUpdate(*args, **kwargs): |
0085ce49 | 6347 | """ |
5ba5649b RD |
6348 | UpdateUIEvent_CanUpdate(Window win) -> bool |
6349 | ||
6350 | Returns ``True`` if it is appropriate to update (send UI update events | |
6351 | to) this window. | |
6352 | ||
6353 | This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`), | |
6354 | the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update | |
6355 | events were last sent in idle time, and the update interval, to | |
6356 | determine whether events should be sent to this window now. By default | |
6357 | this will always return true because the update mode is initially | |
6358 | wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update | |
6359 | events will be sent as often as possible. You can reduce the frequency | |
6360 | that events are sent by changing the mode and/or setting an update | |
6361 | interval. | |
6362 | ||
6363 | """ | |
0085ce49 | 6364 | return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs) |
d14a1e28 | 6365 | |
0085ce49 RD |
6366 | def UpdateUIEvent_ResetUpdateTime(*args): |
6367 | """ | |
5ba5649b RD |
6368 | UpdateUIEvent_ResetUpdateTime() |
6369 | ||
6370 | Used internally to reset the last-updated time to the current time. It | |
6371 | is assumed that update events are normally sent in idle time, so this | |
6372 | is called at the end of idle processing. | |
6373 | """ | |
0085ce49 | 6374 | return _core_.UpdateUIEvent_ResetUpdateTime(*args) |
d14a1e28 | 6375 | |
e811c8ce | 6376 | def UpdateUIEvent_SetMode(*args, **kwargs): |
0085ce49 | 6377 | """ |
5ba5649b RD |
6378 | UpdateUIEvent_SetMode(int mode) |
6379 | ||
6380 | Specify how wxWidgets will send update events: to all windows, or only | |
6381 | to those which specify that they will process the events. | |
6382 | ||
6383 | The mode may be one of the following values: | |
6384 | ||
6385 | ============================= ========================================== | |
6386 | wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This | |
6387 | is the default setting. | |
6388 | wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that | |
6389 | have the wx.WS_EX_PROCESS_UI_UPDATES extra | |
6390 | style set. | |
6391 | ============================= ========================================== | |
6392 | ||
6393 | """ | |
0085ce49 | 6394 | return _core_.UpdateUIEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6395 | |
0085ce49 RD |
6396 | def UpdateUIEvent_GetMode(*args): |
6397 | """ | |
5ba5649b RD |
6398 | UpdateUIEvent_GetMode() -> int |
6399 | ||
6400 | Returns a value specifying how wxWidgets will send update events: to | |
6401 | all windows, or only to those which specify that they will process the | |
6402 | events. | |
6403 | """ | |
0085ce49 | 6404 | return _core_.UpdateUIEvent_GetMode(*args) |
d14a1e28 RD |
6405 | |
6406 | #--------------------------------------------------------------------------- | |
6407 | ||
6408 | class SysColourChangedEvent(Event): | |
5ba5649b RD |
6409 | """ |
6410 | This class is used for EVT_SYS_COLOUR_CHANGED, which are generated | |
6411 | when the user changes the colour settings using the control | |
6412 | panel. This is only applicable under Windows. | |
6413 | ||
6414 | The default event handler for this event propagates the event to child | |
6415 | windows, since Windows only sends the events to top-level windows. If | |
6416 | intercepting this event for a top-level window, remember to call | |
6417 | `Skip` so the the base class handler will still be executed, or to | |
6418 | pass the event on to the window's children explicitly. | |
6419 | ||
6420 | """ | |
0085ce49 RD |
6421 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6422 | __repr__ = _swig_repr | |
6423 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6424 | """ |
6425 | __init__(self) -> SysColourChangedEvent | |
6426 | ||
6427 | Constructor | |
6428 | """ | |
0085ce49 | 6429 | _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs)) |
2131d850 | 6430 | _core_.SysColourChangedEvent_swigregister(SysColourChangedEvent) |
d14a1e28 RD |
6431 | |
6432 | #--------------------------------------------------------------------------- | |
6433 | ||
6434 | class MouseCaptureChangedEvent(Event): | |
5ba5649b RD |
6435 | """ |
6436 | An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to | |
6437 | a window that loses its mouse capture. This is called even if | |
6438 | `wx.Window.ReleaseMouse` was called by the application code. Handling | |
6439 | this event allows an application to cater for unexpected capture | |
6440 | releases which might otherwise confuse mouse handling code. | |
6441 | ||
6442 | This event is implemented under Windows only. | |
6443 | """ | |
0085ce49 RD |
6444 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6445 | __repr__ = _swig_repr | |
6446 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6447 | """ |
6448 | __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent | |
6449 | ||
6450 | Constructor | |
6451 | """ | |
0085ce49 | 6452 | _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs)) |
e811c8ce | 6453 | def GetCapturedWindow(*args, **kwargs): |
5ba5649b RD |
6454 | """ |
6455 | GetCapturedWindow(self) -> Window | |
6456 | ||
6457 | Returns the window that gained the capture, or ``None`` if it was a | |
6458 | non-wxWidgets window. | |
6459 | """ | |
54f9ee45 | 6460 | return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs) |
e811c8ce | 6461 | |
57332a5a | 6462 | CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`") |
2131d850 | 6463 | _core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent) |
d14a1e28 RD |
6464 | |
6465 | #--------------------------------------------------------------------------- | |
6466 | ||
34e0a3bb RD |
6467 | class MouseCaptureLostEvent(Event): |
6468 | """ | |
6469 | A mouse capture lost event is sent to a window that obtained mouse | |
6470 | capture, which was subsequently loss due to "external" event, for | |
6471 | example when a dialog box is shown or if another application captures | |
6472 | the mouse. | |
6473 | ||
6474 | If this happens, this event is sent to all windows that are on the | |
6475 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
6476 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
6477 | if the capture changes because of a call to CaptureMouse or | |
6478 | ReleaseMouse. | |
6479 | ||
6480 | This event is currently emitted under Windows only. | |
6481 | ||
6482 | """ | |
6483 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6484 | __repr__ = _swig_repr | |
6485 | def __init__(self, *args, **kwargs): | |
6486 | """ | |
6487 | __init__(self, int winid=0) -> MouseCaptureLostEvent | |
6488 | ||
6489 | A mouse capture lost event is sent to a window that obtained mouse | |
6490 | capture, which was subsequently loss due to "external" event, for | |
6491 | example when a dialog box is shown or if another application captures | |
6492 | the mouse. | |
6493 | ||
6494 | If this happens, this event is sent to all windows that are on the | |
6495 | capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but | |
6496 | didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent | |
6497 | if the capture changes because of a call to CaptureMouse or | |
6498 | ReleaseMouse. | |
6499 | ||
6500 | This event is currently emitted under Windows only. | |
6501 | ||
6502 | """ | |
6503 | _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs)) | |
6504 | _core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent) | |
6505 | ||
6506 | #--------------------------------------------------------------------------- | |
6507 | ||
d14a1e28 | 6508 | class DisplayChangedEvent(Event): |
5ba5649b RD |
6509 | """ |
6510 | An EVT_DISPLAY_CHANGED event is sent to all windows when the display | |
6511 | resolution has changed. | |
6512 | ||
6513 | This event is implemented under Windows only. | |
6514 | """ | |
0085ce49 RD |
6515 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6516 | __repr__ = _swig_repr | |
6517 | def __init__(self, *args, **kwargs): | |
a95a7133 | 6518 | """__init__(self) -> DisplayChangedEvent""" |
0085ce49 | 6519 | _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs)) |
2131d850 | 6520 | _core_.DisplayChangedEvent_swigregister(DisplayChangedEvent) |
d14a1e28 RD |
6521 | |
6522 | #--------------------------------------------------------------------------- | |
6523 | ||
6524 | class PaletteChangedEvent(Event): | |
5ba5649b RD |
6525 | """ |
6526 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6527 | changed, thereby giving each window a chance to redo their own to | |
6528 | match. | |
6529 | ||
6530 | This event is implemented under Windows only. | |
6531 | """ | |
0085ce49 RD |
6532 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6533 | __repr__ = _swig_repr | |
6534 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6535 | """ |
6536 | __init__(self, int id=0) -> PaletteChangedEvent | |
6537 | ||
6538 | An EVT_PALETTE_CHANGED event is sent when the system palette has | |
6539 | changed, thereby giving each window a chance to redo their own to | |
6540 | match. | |
6541 | ||
6542 | This event is implemented under Windows only. | |
6543 | """ | |
0085ce49 | 6544 | _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs)) |
e811c8ce | 6545 | def SetChangedWindow(*args, **kwargs): |
a95a7133 | 6546 | """SetChangedWindow(self, Window win)""" |
54f9ee45 | 6547 | return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs) |
e811c8ce RD |
6548 | |
6549 | def GetChangedWindow(*args, **kwargs): | |
a95a7133 | 6550 | """GetChangedWindow(self) -> Window""" |
54f9ee45 | 6551 | return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs) |
e811c8ce | 6552 | |
33d6fd3b | 6553 | ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`") |
2131d850 | 6554 | _core_.PaletteChangedEvent_swigregister(PaletteChangedEvent) |
d14a1e28 RD |
6555 | |
6556 | #--------------------------------------------------------------------------- | |
6557 | ||
6558 | class QueryNewPaletteEvent(Event): | |
5ba5649b RD |
6559 | """ |
6560 | An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard | |
6561 | focus and should re-do its palette. | |
6562 | ||
6563 | This event is implemented under Windows only. | |
6564 | """ | |
0085ce49 RD |
6565 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6566 | __repr__ = _swig_repr | |
6567 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6568 | """ |
6569 | __init__(self, int winid=0) -> QueryNewPaletteEvent | |
6570 | ||
6571 | Constructor. | |
6572 | """ | |
0085ce49 | 6573 | _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs)) |
e811c8ce | 6574 | def SetPaletteRealized(*args, **kwargs): |
5ba5649b RD |
6575 | """ |
6576 | SetPaletteRealized(self, bool realized) | |
6577 | ||
6578 | App should set this if it changes the palette. | |
6579 | """ | |
54f9ee45 | 6580 | return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs) |
e811c8ce RD |
6581 | |
6582 | def GetPaletteRealized(*args, **kwargs): | |
a95a7133 | 6583 | """GetPaletteRealized(self) -> bool""" |
54f9ee45 | 6584 | return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs) |
e811c8ce | 6585 | |
33d6fd3b | 6586 | PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`") |
2131d850 | 6587 | _core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent) |
d14a1e28 RD |
6588 | |
6589 | #--------------------------------------------------------------------------- | |
6590 | ||
6591 | class NavigationKeyEvent(Event): | |
5ba5649b RD |
6592 | """ |
6593 | EVT_NAVIGATION_KEY events are used to control moving the focus between | |
6594 | widgets, otherwise known as tab-traversal. You woudl normally not | |
6595 | catch navigation events in applications as there are already | |
6596 | appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find | |
6597 | it useful to send navigation events in certain situations to change | |
6598 | the focus in certain ways, although it's probably easier to just call | |
6599 | `wx.Window.Navigate`. | |
6600 | """ | |
0085ce49 RD |
6601 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6602 | __repr__ = _swig_repr | |
6603 | def __init__(self, *args, **kwargs): | |
a95a7133 | 6604 | """__init__(self) -> NavigationKeyEvent""" |
0085ce49 | 6605 | _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs)) |
e811c8ce | 6606 | def GetDirection(*args, **kwargs): |
5ba5649b RD |
6607 | """ |
6608 | GetDirection(self) -> bool | |
6609 | ||
6610 | Returns ``True`` if the direction is forward, ``False`` otherwise. | |
6611 | """ | |
54f9ee45 | 6612 | return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs) |
e811c8ce RD |
6613 | |
6614 | def SetDirection(*args, **kwargs): | |
5ba5649b RD |
6615 | """ |
6616 | SetDirection(self, bool forward) | |
6617 | ||
6618 | Specify the direction that the navigation should take. Usually the | |
6619 | difference between using Tab and Shift-Tab. | |
6620 | """ | |
54f9ee45 | 6621 | return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs) |
e811c8ce RD |
6622 | |
6623 | def IsWindowChange(*args, **kwargs): | |
5ba5649b RD |
6624 | """ |
6625 | IsWindowChange(self) -> bool | |
6626 | ||
6627 | Returns ``True`` if window change is allowed. | |
6628 | """ | |
54f9ee45 | 6629 | return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs) |
e811c8ce RD |
6630 | |
6631 | def SetWindowChange(*args, **kwargs): | |
5ba5649b RD |
6632 | """ |
6633 | SetWindowChange(self, bool ischange) | |
6634 | ||
6635 | Specify if the navigation should be able to change parent windows. | |
6636 | For example, changing notebook pages, etc. This is usually implemented | |
6637 | by using Control-Tab. | |
6638 | """ | |
54f9ee45 | 6639 | return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs) |
e811c8ce | 6640 | |
68350608 | 6641 | def IsFromTab(*args, **kwargs): |
5ba5649b RD |
6642 | """ |
6643 | IsFromTab(self) -> bool | |
6644 | ||
6645 | Returns ``True`` if the navigation event is originated from the Tab | |
6646 | key. | |
6647 | """ | |
68350608 RD |
6648 | return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs) |
6649 | ||
6650 | def SetFromTab(*args, **kwargs): | |
5ba5649b RD |
6651 | """ |
6652 | SetFromTab(self, bool bIs) | |
6653 | ||
6654 | Set to true under MSW if the event was generated using the tab key. | |
6655 | This is required for proper navogation over radio buttons. | |
6656 | """ | |
68350608 RD |
6657 | return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs) |
6658 | ||
908b74cd | 6659 | def SetFlags(*args, **kwargs): |
5ba5649b RD |
6660 | """ |
6661 | SetFlags(self, long flags) | |
6662 | ||
6663 | Set the navigation flags to a combination of the following: | |
6664 | ||
6665 | * wx.NavigationKeyEvent.IsBackward | |
6666 | * wx.NavigationKeyEvent.IsForward | |
6667 | * wx.NavigationKeyEvent.WinChange | |
6668 | * wx.NavigationKeyEvent.FromTab | |
6669 | ||
6670 | """ | |
908b74cd RD |
6671 | return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs) |
6672 | ||
e811c8ce | 6673 | def GetCurrentFocus(*args, **kwargs): |
5ba5649b RD |
6674 | """ |
6675 | GetCurrentFocus(self) -> Window | |
6676 | ||
6677 | Returns the child window which currenty has the focus. May be | |
6678 | ``None``. | |
6679 | """ | |
54f9ee45 | 6680 | return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs) |
e811c8ce RD |
6681 | |
6682 | def SetCurrentFocus(*args, **kwargs): | |
5ba5649b RD |
6683 | """ |
6684 | SetCurrentFocus(self, Window win) | |
6685 | ||
6686 | Set the window that has the focus. | |
6687 | """ | |
54f9ee45 | 6688 | return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs) |
e811c8ce | 6689 | |
b0f7404b | 6690 | IsBackward = _core_.NavigationKeyEvent_IsBackward |
908b74cd RD |
6691 | IsForward = _core_.NavigationKeyEvent_IsForward |
6692 | WinChange = _core_.NavigationKeyEvent_WinChange | |
68350608 | 6693 | FromTab = _core_.NavigationKeyEvent_FromTab |
57332a5a RD |
6694 | CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`") |
6695 | Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`") | |
2131d850 | 6696 | _core_.NavigationKeyEvent_swigregister(NavigationKeyEvent) |
d14a1e28 RD |
6697 | |
6698 | #--------------------------------------------------------------------------- | |
6699 | ||
6700 | class WindowCreateEvent(CommandEvent): | |
5ba5649b RD |
6701 | """ |
6702 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6703 | underlying GUI object) exists. | |
6704 | """ | |
0085ce49 RD |
6705 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6706 | __repr__ = _swig_repr | |
6707 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6708 | """ |
6709 | __init__(self, Window win=None) -> WindowCreateEvent | |
6710 | ||
6711 | The EVT_WINDOW_CREATE event is sent as soon as the window object (the | |
6712 | underlying GUI object) exists. | |
6713 | """ | |
0085ce49 | 6714 | _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs)) |
e811c8ce | 6715 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6716 | """ |
6717 | GetWindow(self) -> Window | |
6718 | ||
6719 | Returns the window that this event refers to. | |
6720 | """ | |
54f9ee45 | 6721 | return _core_.WindowCreateEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6722 | |
dba7934c | 6723 | Window = property(GetWindow,doc="See `GetWindow`") |
2131d850 | 6724 | _core_.WindowCreateEvent_swigregister(WindowCreateEvent) |
d14a1e28 RD |
6725 | |
6726 | class WindowDestroyEvent(CommandEvent): | |
5ba5649b | 6727 | """ |
943e8dfd RD |
6728 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6729 | when the GUI window is destroyed. | |
6730 | ||
6731 | When a class derived from `wx.Window` is destroyed its destructor will | |
6732 | have already run by the time this event is sent. Therefore this event | |
6733 | will not usually be received at all by the window itself. Since it is | |
6734 | received after the destructor has run, an object should not try to | |
6735 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6736 | notification of the destruction of another window. | |
5ba5649b | 6737 | """ |
0085ce49 RD |
6738 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6739 | __repr__ = _swig_repr | |
6740 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6741 | """ |
6742 | __init__(self, Window win=None) -> WindowDestroyEvent | |
6743 | ||
943e8dfd RD |
6744 | The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor |
6745 | when the GUI window is destroyed. | |
6746 | ||
6747 | When a class derived from `wx.Window` is destroyed its destructor will | |
6748 | have already run by the time this event is sent. Therefore this event | |
6749 | will not usually be received at all by the window itself. Since it is | |
6750 | received after the destructor has run, an object should not try to | |
6751 | handle its own wx.WindowDestroyEvent, but it can be used to get | |
6752 | notification of the destruction of another window. | |
5ba5649b | 6753 | """ |
0085ce49 | 6754 | _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs)) |
e811c8ce | 6755 | def GetWindow(*args, **kwargs): |
5ba5649b RD |
6756 | """ |
6757 | GetWindow(self) -> Window | |
6758 | ||
6759 | Returns the window that this event refers to. | |
6760 | """ | |
54f9ee45 | 6761 | return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs) |
e811c8ce | 6762 | |
dba7934c | 6763 | Window = property(GetWindow,doc="See `GetWindow`") |
2131d850 | 6764 | _core_.WindowDestroyEvent_swigregister(WindowDestroyEvent) |
d14a1e28 RD |
6765 | |
6766 | #--------------------------------------------------------------------------- | |
6767 | ||
6768 | class ContextMenuEvent(CommandEvent): | |
5ba5649b RD |
6769 | """ |
6770 | This class is used for context menu events (EVT_CONTECT_MENU,) sent to | |
6771 | give the application a chance to show a context (popup) menu. | |
6772 | """ | |
0085ce49 RD |
6773 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6774 | __repr__ = _swig_repr | |
6775 | def __init__(self, *args, **kwargs): | |
5ba5649b | 6776 | """ |
2131d850 | 6777 | __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent |
5ba5649b RD |
6778 | |
6779 | Constructor. | |
6780 | """ | |
0085ce49 | 6781 | _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs)) |
e811c8ce | 6782 | def GetPosition(*args, **kwargs): |
5ba5649b RD |
6783 | """ |
6784 | GetPosition(self) -> Point | |
6785 | ||
6786 | Returns the position (in screen coordinants) at which the menu should | |
6787 | be shown. | |
6788 | """ | |
54f9ee45 | 6789 | return _core_.ContextMenuEvent_GetPosition(*args, **kwargs) |
e811c8ce RD |
6790 | |
6791 | def SetPosition(*args, **kwargs): | |
5ba5649b RD |
6792 | """ |
6793 | SetPosition(self, Point pos) | |
6794 | ||
6795 | Sets the position at which the menu should be shown. | |
6796 | """ | |
54f9ee45 | 6797 | return _core_.ContextMenuEvent_SetPosition(*args, **kwargs) |
e811c8ce | 6798 | |
2bf58437 | 6799 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") |
2131d850 | 6800 | _core_.ContextMenuEvent_swigregister(ContextMenuEvent) |
d14a1e28 RD |
6801 | |
6802 | #--------------------------------------------------------------------------- | |
6803 | ||
54f9ee45 RD |
6804 | IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL |
6805 | IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED | |
d14a1e28 | 6806 | class IdleEvent(Event): |
5ba5649b RD |
6807 | """ |
6808 | This class is used for EVT_IDLE events, which are generated and sent | |
6809 | when the application *becomes* idle. In other words, the when the | |
6810 | event queue becomes empty then idle events are sent to all windows (by | |
6811 | default) and as long as none of them call `RequestMore` then there are | |
6812 | no more idle events until after the system event queue has some normal | |
6813 | events and then becomes empty again. | |
6814 | ||
6815 | By default, idle events are sent to all windows. If this is causing a | |
6816 | significant overhead in your application, you can call | |
6817 | `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and | |
6818 | set the wx.WS_EX_PROCESS_IDLE extra window style for every window | |
6819 | which should receive idle events. Then idle events will only be sent | |
6820 | to those windows and not to any others. | |
6821 | """ | |
0085ce49 RD |
6822 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6823 | __repr__ = _swig_repr | |
6824 | def __init__(self, *args, **kwargs): | |
5ba5649b RD |
6825 | """ |
6826 | __init__(self) -> IdleEvent | |
6827 | ||
6828 | Constructor | |
6829 | """ | |
0085ce49 | 6830 | _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs)) |
e811c8ce | 6831 | def RequestMore(*args, **kwargs): |
5ba5649b RD |
6832 | """ |
6833 | RequestMore(self, bool needMore=True) | |
6834 | ||
6835 | Tells wxWidgets that more processing is required. This function can be | |
6836 | called by an EVT_IDLE handler for a window to indicate that the | |
6837 | application should forward the EVT_IDLE event once more to the | |
6838 | application windows. If no window calls this function during its | |
6839 | EVT_IDLE handler, then the application will remain in a passive event | |
6840 | loop until a new event is posted to the application by the windowing | |
6841 | system. | |
6842 | """ | |
54f9ee45 | 6843 | return _core_.IdleEvent_RequestMore(*args, **kwargs) |
e811c8ce RD |
6844 | |
6845 | def MoreRequested(*args, **kwargs): | |
5ba5649b RD |
6846 | """ |
6847 | MoreRequested(self) -> bool | |
6848 | ||
6849 | Returns ``True`` if the OnIdle function processing this event | |
6850 | requested more processing time. | |
6851 | """ | |
54f9ee45 | 6852 | return _core_.IdleEvent_MoreRequested(*args, **kwargs) |
e811c8ce RD |
6853 | |
6854 | def SetMode(*args, **kwargs): | |
5ba5649b RD |
6855 | """ |
6856 | SetMode(int mode) | |
6857 | ||
6858 | Static method for specifying how wxWidgets will send idle events: to | |
6859 | all windows, or only to those which specify that they will process the | |
6860 | events. | |
6861 | ||
6862 | The mode can be one of the following values: | |
6863 | ||
6864 | ========================= ======================================== | |
6865 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6866 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6867 | the wx.WS_EX_PROCESS_IDLE extra style | |
6868 | flag set. | |
6869 | ========================= ======================================== | |
6870 | ||
6871 | """ | |
54f9ee45 | 6872 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
e811c8ce RD |
6873 | |
6874 | SetMode = staticmethod(SetMode) | |
6875 | def GetMode(*args, **kwargs): | |
5ba5649b RD |
6876 | """ |
6877 | GetMode() -> int | |
6878 | ||
6879 | Static method returning a value specifying how wxWidgets will send | |
6880 | idle events: to all windows, or only to those which specify that they | |
6881 | will process the events. | |
6882 | """ | |
54f9ee45 | 6883 | return _core_.IdleEvent_GetMode(*args, **kwargs) |
e811c8ce RD |
6884 | |
6885 | GetMode = staticmethod(GetMode) | |
6886 | def CanSend(*args, **kwargs): | |
5ba5649b RD |
6887 | """ |
6888 | CanSend(Window win) -> bool | |
6889 | ||
6890 | Returns ``True`` if it is appropriate to send idle events to this | |
6891 | window. | |
6892 | ||
6893 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6894 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6895 | events should be sent to this window now. By default this will always | |
6896 | return ``True`` because the update mode is initially | |
6897 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6898 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6899 | """ | |
54f9ee45 | 6900 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
e811c8ce RD |
6901 | |
6902 | CanSend = staticmethod(CanSend) | |
2131d850 | 6903 | _core_.IdleEvent_swigregister(IdleEvent) |
d14a1e28 | 6904 | |
e811c8ce | 6905 | def IdleEvent_SetMode(*args, **kwargs): |
0085ce49 | 6906 | """ |
5ba5649b RD |
6907 | IdleEvent_SetMode(int mode) |
6908 | ||
6909 | Static method for specifying how wxWidgets will send idle events: to | |
6910 | all windows, or only to those which specify that they will process the | |
6911 | events. | |
6912 | ||
6913 | The mode can be one of the following values: | |
6914 | ||
6915 | ========================= ======================================== | |
6916 | wx.IDLE_PROCESS_ALL Send idle events to all windows | |
6917 | wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have | |
6918 | the wx.WS_EX_PROCESS_IDLE extra style | |
6919 | flag set. | |
6920 | ========================= ======================================== | |
6921 | ||
6922 | """ | |
0085ce49 | 6923 | return _core_.IdleEvent_SetMode(*args, **kwargs) |
d14a1e28 | 6924 | |
0085ce49 RD |
6925 | def IdleEvent_GetMode(*args): |
6926 | """ | |
5ba5649b RD |
6927 | IdleEvent_GetMode() -> int |
6928 | ||
6929 | Static method returning a value specifying how wxWidgets will send | |
6930 | idle events: to all windows, or only to those which specify that they | |
6931 | will process the events. | |
6932 | """ | |
0085ce49 | 6933 | return _core_.IdleEvent_GetMode(*args) |
d14a1e28 | 6934 | |
e811c8ce | 6935 | def IdleEvent_CanSend(*args, **kwargs): |
0085ce49 | 6936 | """ |
5ba5649b RD |
6937 | IdleEvent_CanSend(Window win) -> bool |
6938 | ||
6939 | Returns ``True`` if it is appropriate to send idle events to this | |
6940 | window. | |
6941 | ||
6942 | This function looks at the mode used (see `wx.IdleEvent.SetMode`), and | |
6943 | the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle | |
6944 | events should be sent to this window now. By default this will always | |
6945 | return ``True`` because the update mode is initially | |
6946 | wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events | |
6947 | to windows with the wx.WS_EX_PROCESS_IDLE extra window style set. | |
6948 | """ | |
0085ce49 | 6949 | return _core_.IdleEvent_CanSend(*args, **kwargs) |
d14a1e28 RD |
6950 | |
6951 | #--------------------------------------------------------------------------- | |
6952 | ||
2131d850 RD |
6953 | class ClipboardTextEvent(CommandEvent): |
6954 | """ | |
6955 | A Clipboard Text event is sent when a window intercepts a text | |
6956 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6957 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6958 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6959 | generated automatically for a Rich Edit text control. | |
6960 | """ | |
6961 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
6962 | __repr__ = _swig_repr | |
6963 | def __init__(self, *args, **kwargs): | |
6964 | """ | |
6965 | __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent | |
6966 | ||
6967 | A Clipboard Text event is sent when a window intercepts a text | |
6968 | copy/cut/paste message, i.e. the user has cut/copied/pasted data | |
6969 | from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a | |
6970 | popup menu command, etc. NOTE : under windows these events are *NOT* | |
6971 | generated automatically for a Rich Edit text control. | |
6972 | """ | |
6973 | _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs)) | |
6974 | _core_.ClipboardTextEvent_swigregister(ClipboardTextEvent) | |
6975 | ||
6976 | #--------------------------------------------------------------------------- | |
6977 | ||
d14a1e28 | 6978 | class PyEvent(Event): |
5ba5649b RD |
6979 | """ |
6980 | wx.PyEvent can be used as a base class for implementing custom event | |
6981 | types in Python. You should derived from this class instead of | |
6982 | `wx.Event` because this class is Python-aware and is able to transport | |
6983 | its Python bits safely through the wxWidgets event system and have | |
6984 | them still be there when the event handler is invoked. | |
6985 | ||
6986 | :see: `wx.PyCommandEvent` | |
6987 | ||
6988 | """ | |
0085ce49 RD |
6989 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
6990 | __repr__ = _swig_repr | |
6991 | def __init__(self, *args, **kwargs): | |
2131d850 | 6992 | """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent""" |
0085ce49 | 6993 | _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs)) |
5ba5649b | 6994 | self._SetSelf(self) |
e811c8ce | 6995 | |
0085ce49 RD |
6996 | __swig_destroy__ = _core_.delete_PyEvent |
6997 | __del__ = lambda self : None; | |
5ba5649b RD |
6998 | def _SetSelf(*args, **kwargs): |
6999 | """_SetSelf(self, PyObject self)""" | |
7000 | return _core_.PyEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 7001 | |
5ba5649b RD |
7002 | def _GetSelf(*args, **kwargs): |
7003 | """_GetSelf(self) -> PyObject""" | |
7004 | return _core_.PyEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 7005 | |
2131d850 | 7006 | _core_.PyEvent_swigregister(PyEvent) |
d14a1e28 RD |
7007 | |
7008 | class PyCommandEvent(CommandEvent): | |
5ba5649b RD |
7009 | """ |
7010 | wx.PyCommandEvent can be used as a base class for implementing custom | |
7011 | event types in Python, where the event shoudl travel up to parent | |
7012 | windows looking for a handler. You should derived from this class | |
7013 | instead of `wx.CommandEvent` because this class is Python-aware and is | |
7014 | able to transport its Python bits safely through the wxWidgets event | |
7015 | system and have them still be there when the event handler is invoked. | |
7016 | ||
7017 | :see: `wx.PyEvent` | |
7018 | ||
7019 | """ | |
0085ce49 RD |
7020 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7021 | __repr__ = _swig_repr | |
7022 | def __init__(self, *args, **kwargs): | |
2131d850 | 7023 | """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent""" |
0085ce49 | 7024 | _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs)) |
5ba5649b | 7025 | self._SetSelf(self) |
e811c8ce | 7026 | |
0085ce49 RD |
7027 | __swig_destroy__ = _core_.delete_PyCommandEvent |
7028 | __del__ = lambda self : None; | |
5ba5649b RD |
7029 | def _SetSelf(*args, **kwargs): |
7030 | """_SetSelf(self, PyObject self)""" | |
7031 | return _core_.PyCommandEvent__SetSelf(*args, **kwargs) | |
e811c8ce | 7032 | |
5ba5649b RD |
7033 | def _GetSelf(*args, **kwargs): |
7034 | """_GetSelf(self) -> PyObject""" | |
7035 | return _core_.PyCommandEvent__GetSelf(*args, **kwargs) | |
e811c8ce | 7036 | |
2131d850 | 7037 | _core_.PyCommandEvent_swigregister(PyCommandEvent) |
d14a1e28 | 7038 | |
53aa7709 | 7039 | class DateEvent(CommandEvent): |
5ba5649b RD |
7040 | """ |
7041 | This event class holds information about a date change event and is | |
7042 | used together with `wx.DatePickerCtrl`. It also serves as a base class | |
7043 | for `wx.calendar.CalendarEvent`. Bind these event types with | |
7044 | EVT_DATE_CHANGED. | |
7045 | """ | |
0085ce49 RD |
7046 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7047 | __repr__ = _swig_repr | |
7048 | def __init__(self, *args, **kwargs): | |
2131d850 | 7049 | """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent""" |
0085ce49 | 7050 | _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs)) |
53aa7709 | 7051 | def GetDate(*args, **kwargs): |
5ba5649b RD |
7052 | """ |
7053 | GetDate(self) -> DateTime | |
7054 | ||
7055 | Returns the date. | |
7056 | """ | |
53aa7709 RD |
7057 | return _core_.DateEvent_GetDate(*args, **kwargs) |
7058 | ||
7059 | def SetDate(*args, **kwargs): | |
5ba5649b RD |
7060 | """ |
7061 | SetDate(self, DateTime date) | |
7062 | ||
7063 | Sets the date carried by the event, normally only used by the library | |
7064 | internally. | |
7065 | """ | |
53aa7709 RD |
7066 | return _core_.DateEvent_SetDate(*args, **kwargs) |
7067 | ||
2bf58437 | 7068 | Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`") |
2131d850 | 7069 | _core_.DateEvent_swigregister(DateEvent) |
53aa7709 RD |
7070 | |
7071 | wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED | |
7072 | EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 ) | |
7073 | ||
4976f996 RD |
7074 | class EventBlocker(EvtHandler): |
7075 | """Helper class to temporarily disable event handling for a window.""" | |
7076 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
7077 | __repr__ = _swig_repr | |
7078 | def __init__(self, *args, **kwargs): | |
7079 | """ | |
7080 | __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker | |
7081 | ||
7082 | Helper class to temporarily disable event handling for a window. | |
7083 | """ | |
7084 | _core_.EventBlocker_swiginit(self,_core_.new_EventBlocker(*args, **kwargs)) | |
7085 | __swig_destroy__ = _core_.delete_EventBlocker | |
7086 | __del__ = lambda self : None; | |
7087 | def Block(*args, **kwargs): | |
7088 | """Block(self, EventType type)""" | |
7089 | return _core_.EventBlocker_Block(*args, **kwargs) | |
7090 | ||
7091 | _core_.EventBlocker_swigregister(EventBlocker) | |
7092 | ||
d14a1e28 RD |
7093 | #--------------------------------------------------------------------------- |
7094 | ||
54f9ee45 RD |
7095 | PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS |
7096 | PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION | |
7097 | PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG | |
7098 | PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG | |
7099 | PRINT_WINDOWS = _core_.PRINT_WINDOWS | |
7100 | PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT | |
d14a1e28 | 7101 | class PyApp(EvtHandler): |
66c033b4 RD |
7102 | """ |
7103 | The ``wx.PyApp`` class is an *implementation detail*, please use the | |
7104 | `wx.App` class (or some other derived class) instead. | |
7105 | """ | |
0085ce49 RD |
7106 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
7107 | __repr__ = _swig_repr | |
7108 | def __init__(self, *args, **kwargs): | |
98e665d3 | 7109 | """ |
a95a7133 | 7110 | __init__(self) -> PyApp |
98e665d3 RD |
7111 | |
7112 | Create a new application object, starting the bootstrap process. | |
7113 | """ | |
0085ce49 | 7114 | _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs)) |
c25f90f6 | 7115 | self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp) |
e811c8ce | 7116 | |
0085ce49 RD |
7117 | __swig_destroy__ = _core_.delete_PyApp |
7118 | __del__ = lambda self : None; | |
e811c8ce | 7119 | def _setCallbackInfo(*args, **kwargs): |
c25f90f6 | 7120 | """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)""" |
54f9ee45 | 7121 | return _core_.PyApp__setCallbackInfo(*args, **kwargs) |
e811c8ce RD |
7122 | |
7123 | def GetAppName(*args, **kwargs): | |
0df68c9f | 7124 | """ |
a95a7133 | 7125 | GetAppName(self) -> String |
6c3b4aae | 7126 | |
0df68c9f RD |
7127 | Get the application name. |
7128 | """ | |
54f9ee45 | 7129 | return _core_.PyApp_GetAppName(*args, **kwargs) |
e811c8ce RD |
7130 | |
7131 | def SetAppName(*args, **kwargs): | |
0df68c9f | 7132 | """ |
a95a7133 | 7133 | SetAppName(self, String name) |
6c3b4aae | 7134 | |
66c033b4 RD |
7135 | Set the application name. This value may be used automatically by |
7136 | `wx.Config` and such. | |
0df68c9f | 7137 | """ |
54f9ee45 | 7138 | return _core_.PyApp_SetAppName(*args, **kwargs) |
e811c8ce RD |
7139 | |
7140 | def GetClassName(*args, **kwargs): | |
0df68c9f | 7141 | """ |
a95a7133 | 7142 | GetClassName(self) -> String |
e811c8ce | 7143 | |
0df68c9f RD |
7144 | Get the application's class name. |
7145 | """ | |
54f9ee45 | 7146 | return _core_.PyApp_GetClassName(*args, **kwargs) |
e811c8ce RD |
7147 | |
7148 | def SetClassName(*args, **kwargs): | |
0df68c9f | 7149 | """ |
a95a7133 | 7150 | SetClassName(self, String name) |
6c3b4aae | 7151 | |
66c033b4 RD |
7152 | Set the application's class name. This value may be used for |
7153 | X-resources if applicable for the platform | |
0df68c9f | 7154 | """ |
54f9ee45 | 7155 | return _core_.PyApp_SetClassName(*args, **kwargs) |
e811c8ce RD |
7156 | |
7157 | def GetVendorName(*args, **kwargs): | |
0df68c9f | 7158 | """ |
a95a7133 | 7159 | GetVendorName(self) -> String |
6c3b4aae | 7160 | |
0df68c9f RD |
7161 | Get the application's vendor name. |
7162 | """ | |
54f9ee45 | 7163 | return _core_.PyApp_GetVendorName(*args, **kwargs) |
e811c8ce RD |
7164 | |
7165 | def SetVendorName(*args, **kwargs): | |
0df68c9f | 7166 | """ |
a95a7133 | 7167 | SetVendorName(self, String name) |
6c3b4aae | 7168 | |
66c033b4 RD |
7169 | Set the application's vendor name. This value may be used |
7170 | automatically by `wx.Config` and such. | |
0df68c9f | 7171 | """ |
54f9ee45 | 7172 | return _core_.PyApp_SetVendorName(*args, **kwargs) |
e811c8ce RD |
7173 | |
7174 | def GetTraits(*args, **kwargs): | |
0df68c9f | 7175 | """ |
a95a7133 | 7176 | GetTraits(self) -> wxAppTraits |
6c3b4aae | 7177 | |
66c033b4 RD |
7178 | Return (and create if necessary) the app traits object to which we |
7179 | delegate for everything which either should be configurable by the | |
7180 | user (then he can change the default behaviour simply by overriding | |
7181 | CreateTraits() and returning his own traits object) or which is | |
7182 | GUI/console dependent as then wx.AppTraits allows us to abstract the | |
7183 | differences behind the common facade. | |
7184 | ||
7185 | :todo: Add support for overriding CreateAppTraits in wxPython. | |
0df68c9f | 7186 | """ |
54f9ee45 | 7187 | return _core_.PyApp_GetTraits(*args, **kwargs) |
e811c8ce RD |
7188 | |
7189 | def ProcessPendingEvents(*args, **kwargs): | |
0df68c9f | 7190 | """ |
a95a7133 | 7191 | ProcessPendingEvents(self) |
6c3b4aae | 7192 | |
66c033b4 RD |
7193 | Process all events in the Pending Events list -- it is necessary to |
7194 | call this function to process posted events. This normally happens | |
7195 | during each event loop iteration. | |
0df68c9f | 7196 | """ |
54f9ee45 | 7197 | return _core_.PyApp_ProcessPendingEvents(*args, **kwargs) |
e811c8ce RD |
7198 | |
7199 | def Yield(*args, **kwargs): | |
0df68c9f | 7200 | """ |
a95a7133 | 7201 | Yield(self, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 7202 | |
66c033b4 RD |
7203 | Process all currently pending events right now, instead of waiting |
7204 | until return to the event loop. It is an error to call ``Yield`` | |
7205 | recursively unless the value of ``onlyIfNeeded`` is True. | |
6c3b4aae | 7206 | |
66c033b4 | 7207 | :warning: This function is dangerous as it can lead to unexpected |
41e2b43e RD |
7208 | reentrancies (i.e. when called from an event handler it may |
7209 | result in calling the same event handler again), use with | |
7210 | extreme care or, better, don't use at all! | |
0df68c9f | 7211 | |
66c033b4 | 7212 | :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield` |
41e2b43e | 7213 | |
0df68c9f | 7214 | """ |
54f9ee45 | 7215 | return _core_.PyApp_Yield(*args, **kwargs) |
e811c8ce RD |
7216 | |
7217 | def WakeUpIdle(*args, **kwargs): | |
0df68c9f | 7218 | """ |
a95a7133 | 7219 | WakeUpIdle(self) |
6c3b4aae | 7220 | |
66c033b4 RD |
7221 | Make sure that idle events are sent again. |
7222 | :see: `wx.WakeUpIdle` | |
0df68c9f | 7223 | """ |
54f9ee45 | 7224 | return _core_.PyApp_WakeUpIdle(*args, **kwargs) |
e811c8ce | 7225 | |
1fc3b23a RD |
7226 | def IsMainLoopRunning(*args, **kwargs): |
7227 | """ | |
7228 | IsMainLoopRunning() -> bool | |
7229 | ||
7230 | Returns True if we're running the main loop, i.e. if the events can | |
7231 | currently be dispatched. | |
7232 | """ | |
7233 | return _core_.PyApp_IsMainLoopRunning(*args, **kwargs) | |
7234 | ||
7235 | IsMainLoopRunning = staticmethod(IsMainLoopRunning) | |
e811c8ce | 7236 | def MainLoop(*args, **kwargs): |
0df68c9f | 7237 | """ |
a95a7133 | 7238 | MainLoop(self) -> int |
6c3b4aae | 7239 | |
66c033b4 RD |
7240 | Execute the main GUI loop, the function doesn't normally return until |
7241 | all top level windows have been closed and destroyed. | |
0df68c9f | 7242 | """ |
54f9ee45 | 7243 | return _core_.PyApp_MainLoop(*args, **kwargs) |
e811c8ce RD |
7244 | |
7245 | def Exit(*args, **kwargs): | |
0df68c9f | 7246 | """ |
a95a7133 | 7247 | Exit(self) |
6c3b4aae | 7248 | |
0df68c9f | 7249 | Exit the main loop thus terminating the application. |
66c033b4 | 7250 | :see: `wx.Exit` |
0df68c9f | 7251 | """ |
54f9ee45 | 7252 | return _core_.PyApp_Exit(*args, **kwargs) |
e811c8ce | 7253 | |
97ab0f6a RD |
7254 | def GetLayoutDirection(*args, **kwargs): |
7255 | """ | |
994453b8 | 7256 | GetLayoutDirection(self) -> int |
97ab0f6a RD |
7257 | |
7258 | Return the layout direction for the current locale. | |
7259 | """ | |
7260 | return _core_.PyApp_GetLayoutDirection(*args, **kwargs) | |
7261 | ||
e811c8ce | 7262 | def ExitMainLoop(*args, **kwargs): |
0df68c9f | 7263 | """ |
a95a7133 | 7264 | ExitMainLoop(self) |
6c3b4aae | 7265 | |
66c033b4 RD |
7266 | Exit the main GUI loop during the next iteration of the main |
7267 | loop, (i.e. it does not stop the program immediately!) | |
0df68c9f | 7268 | """ |
54f9ee45 | 7269 | return _core_.PyApp_ExitMainLoop(*args, **kwargs) |
e811c8ce RD |
7270 | |
7271 | def Pending(*args, **kwargs): | |
0df68c9f | 7272 | """ |
a95a7133 | 7273 | Pending(self) -> bool |
6c3b4aae | 7274 | |
0df68c9f RD |
7275 | Returns True if there are unprocessed events in the event queue. |
7276 | """ | |
54f9ee45 | 7277 | return _core_.PyApp_Pending(*args, **kwargs) |
e811c8ce RD |
7278 | |
7279 | def Dispatch(*args, **kwargs): | |
0df68c9f | 7280 | """ |
a95a7133 | 7281 | Dispatch(self) -> bool |
6c3b4aae | 7282 | |
0df68c9f RD |
7283 | Process the first event in the event queue (blocks until an event |
7284 | appears if there are none currently) | |
7285 | """ | |
54f9ee45 | 7286 | return _core_.PyApp_Dispatch(*args, **kwargs) |
e811c8ce RD |
7287 | |
7288 | def ProcessIdle(*args, **kwargs): | |
0df68c9f | 7289 | """ |
a95a7133 | 7290 | ProcessIdle(self) -> bool |
6c3b4aae | 7291 | |
66c033b4 RD |
7292 | Called from the MainLoop when the application becomes idle (there are |
7293 | no pending events) and sends a `wx.IdleEvent` to all interested | |
7294 | parties. Returns True if more idle events are needed, False if not. | |
0df68c9f | 7295 | """ |
54f9ee45 | 7296 | return _core_.PyApp_ProcessIdle(*args, **kwargs) |
e811c8ce RD |
7297 | |
7298 | def SendIdleEvents(*args, **kwargs): | |
0df68c9f | 7299 | """ |
a95a7133 | 7300 | SendIdleEvents(self, Window win, IdleEvent event) -> bool |
e811c8ce | 7301 | |
66c033b4 RD |
7302 | Send idle event to window and all subwindows. Returns True if more |
7303 | idle time is requested. | |
0df68c9f | 7304 | """ |
54f9ee45 | 7305 | return _core_.PyApp_SendIdleEvents(*args, **kwargs) |
e811c8ce RD |
7306 | |
7307 | def IsActive(*args, **kwargs): | |
0df68c9f | 7308 | """ |
a95a7133 | 7309 | IsActive(self) -> bool |
6c3b4aae | 7310 | |
0df68c9f RD |
7311 | Return True if our app has focus. |
7312 | """ | |
54f9ee45 | 7313 | return _core_.PyApp_IsActive(*args, **kwargs) |
e811c8ce RD |
7314 | |
7315 | def SetTopWindow(*args, **kwargs): | |
0df68c9f | 7316 | """ |
a95a7133 | 7317 | SetTopWindow(self, Window win) |
6c3b4aae | 7318 | |
66c033b4 | 7319 | Set the *main* top level window |
0df68c9f | 7320 | """ |
54f9ee45 | 7321 | return _core_.PyApp_SetTopWindow(*args, **kwargs) |
e811c8ce RD |
7322 | |
7323 | def GetTopWindow(*args, **kwargs): | |
0df68c9f | 7324 | """ |
a95a7133 | 7325 | GetTopWindow(self) -> Window |
6c3b4aae | 7326 | |
66c033b4 RD |
7327 | Return the *main* top level window (if it hadn't been set previously |
7328 | with SetTopWindow(), will return just some top level window and, if | |
7329 | there not any, will return None) | |
0df68c9f | 7330 | """ |
54f9ee45 | 7331 | return _core_.PyApp_GetTopWindow(*args, **kwargs) |
e811c8ce RD |
7332 | |
7333 | def SetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 7334 | """ |
a95a7133 | 7335 | SetExitOnFrameDelete(self, bool flag) |
0df68c9f | 7336 | |
66c033b4 RD |
7337 | Control the exit behaviour: by default, the program will exit the main |
7338 | loop (and so, usually, terminate) when the last top-level program | |
7339 | window is deleted. Beware that if you disable this behaviour (with | |
7340 | SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop() | |
7341 | explicitly from somewhere. | |
0df68c9f | 7342 | """ |
54f9ee45 | 7343 | return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
7344 | |
7345 | def GetExitOnFrameDelete(*args, **kwargs): | |
0df68c9f | 7346 | """ |
a95a7133 | 7347 | GetExitOnFrameDelete(self) -> bool |
6c3b4aae | 7348 | |
0df68c9f RD |
7349 | Get the current exit behaviour setting. |
7350 | """ | |
54f9ee45 | 7351 | return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs) |
e811c8ce RD |
7352 | |
7353 | def SetUseBestVisual(*args, **kwargs): | |
0df68c9f | 7354 | """ |
eccab1a7 | 7355 | SetUseBestVisual(self, bool flag, bool forceTrueColour=False) |
6c3b4aae | 7356 | |
66c033b4 RD |
7357 | Set whether the app should try to use the best available visual on |
7358 | systems where more than one is available, (Sun, SGI, XFree86 4, etc.) | |
0df68c9f | 7359 | """ |
54f9ee45 | 7360 | return _core_.PyApp_SetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
7361 | |
7362 | def GetUseBestVisual(*args, **kwargs): | |
0df68c9f | 7363 | """ |
a95a7133 | 7364 | GetUseBestVisual(self) -> bool |
6c3b4aae | 7365 | |
0df68c9f RD |
7366 | Get current UseBestVisual setting. |
7367 | """ | |
54f9ee45 | 7368 | return _core_.PyApp_GetUseBestVisual(*args, **kwargs) |
e811c8ce RD |
7369 | |
7370 | def SetPrintMode(*args, **kwargs): | |
a95a7133 | 7371 | """SetPrintMode(self, int mode)""" |
54f9ee45 | 7372 | return _core_.PyApp_SetPrintMode(*args, **kwargs) |
e811c8ce RD |
7373 | |
7374 | def GetPrintMode(*args, **kwargs): | |
a95a7133 | 7375 | """GetPrintMode(self) -> int""" |
54f9ee45 | 7376 | return _core_.PyApp_GetPrintMode(*args, **kwargs) |
e811c8ce | 7377 | |
e811c8ce | 7378 | def SetAssertMode(*args, **kwargs): |
0df68c9f | 7379 | """ |
a95a7133 | 7380 | SetAssertMode(self, int mode) |
6c3b4aae | 7381 | |
41e2b43e | 7382 | Set the OnAssert behaviour for debug and hybrid builds. |
0df68c9f | 7383 | """ |
54f9ee45 | 7384 | return _core_.PyApp_SetAssertMode(*args, **kwargs) |
e811c8ce | 7385 | |
6c3b4aae | 7386 | def GetAssertMode(*args, **kwargs): |
0df68c9f | 7387 | """ |
a95a7133 | 7388 | GetAssertMode(self) -> int |
6c3b4aae | 7389 | |
0df68c9f RD |
7390 | Get the current OnAssert behaviour setting. |
7391 | """ | |
54f9ee45 | 7392 | return _core_.PyApp_GetAssertMode(*args, **kwargs) |
6c3b4aae | 7393 | |
e811c8ce | 7394 | def GetMacSupportPCMenuShortcuts(*args, **kwargs): |
66c033b4 | 7395 | """GetMacSupportPCMenuShortcuts() -> bool""" |
54f9ee45 | 7396 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
7397 | |
7398 | GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts) | |
7399 | def GetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 7400 | """GetMacAboutMenuItemId() -> long""" |
54f9ee45 | 7401 | return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
7402 | |
7403 | GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId) | |
7404 | def GetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 7405 | """GetMacPreferencesMenuItemId() -> long""" |
54f9ee45 | 7406 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
7407 | |
7408 | GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId) | |
7409 | def GetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 7410 | """GetMacExitMenuItemId() -> long""" |
54f9ee45 | 7411 | return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
7412 | |
7413 | GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId) | |
7414 | def GetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 7415 | """GetMacHelpMenuTitleName() -> String""" |
54f9ee45 | 7416 | return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
7417 | |
7418 | GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName) | |
7419 | def SetMacSupportPCMenuShortcuts(*args, **kwargs): | |
66c033b4 | 7420 | """SetMacSupportPCMenuShortcuts(bool val)""" |
54f9ee45 | 7421 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) |
e811c8ce RD |
7422 | |
7423 | SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts) | |
7424 | def SetMacAboutMenuItemId(*args, **kwargs): | |
66c033b4 | 7425 | """SetMacAboutMenuItemId(long val)""" |
54f9ee45 | 7426 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) |
e811c8ce RD |
7427 | |
7428 | SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId) | |
7429 | def SetMacPreferencesMenuItemId(*args, **kwargs): | |
66c033b4 | 7430 | """SetMacPreferencesMenuItemId(long val)""" |
54f9ee45 | 7431 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) |
e811c8ce RD |
7432 | |
7433 | SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId) | |
7434 | def SetMacExitMenuItemId(*args, **kwargs): | |
66c033b4 | 7435 | """SetMacExitMenuItemId(long val)""" |
54f9ee45 | 7436 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) |
e811c8ce RD |
7437 | |
7438 | SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId) | |
7439 | def SetMacHelpMenuTitleName(*args, **kwargs): | |
66c033b4 | 7440 | """SetMacHelpMenuTitleName(String val)""" |
54f9ee45 | 7441 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) |
e811c8ce RD |
7442 | |
7443 | SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName) | |
7444 | def _BootstrapApp(*args, **kwargs): | |
0df68c9f | 7445 | """ |
a95a7133 | 7446 | _BootstrapApp(self) |
6c3b4aae | 7447 | |
0df68c9f RD |
7448 | For internal use only |
7449 | """ | |
54f9ee45 | 7450 | return _core_.PyApp__BootstrapApp(*args, **kwargs) |
e811c8ce RD |
7451 | |
7452 | def GetComCtl32Version(*args, **kwargs): | |
0df68c9f | 7453 | """ |
66c033b4 | 7454 | GetComCtl32Version() -> int |
6c3b4aae | 7455 | |
66c033b4 RD |
7456 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7457 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 7458 | """ |
54f9ee45 | 7459 | return _core_.PyApp_GetComCtl32Version(*args, **kwargs) |
e811c8ce RD |
7460 | |
7461 | GetComCtl32Version = staticmethod(GetComCtl32Version) | |
33d6fd3b | 7462 | def IsDisplayAvailable(*args, **kwargs): |
fc46b7f3 | 7463 | """ |
33d6fd3b | 7464 | IsDisplayAvailable() -> bool |
fc46b7f3 RD |
7465 | |
7466 | Tests if it is possible to create a GUI in the current environment. | |
7467 | This will mean different things on the different platforms. | |
7468 | ||
7469 | * On X Windows systems this function will return ``False`` if it is | |
7470 | not able to open a connection to the X display, which can happen | |
7471 | if $DISPLAY is not set, or is not set correctly. | |
7472 | ||
7473 | * On Mac OS X a ``False`` return value will mean that wx is not | |
7474 | able to access the window manager, which can happen if logged in | |
7475 | remotely or if running from the normal version of python instead | |
7476 | of the framework version, (i.e., pythonw.) | |
7477 | ||
7478 | * On MS Windows... | |
7479 | ||
7480 | """ | |
33d6fd3b RD |
7481 | return _core_.PyApp_IsDisplayAvailable(*args, **kwargs) |
7482 | ||
7483 | IsDisplayAvailable = staticmethod(IsDisplayAvailable) | |
7484 | AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`") | |
7485 | AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`") | |
7486 | ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`") | |
7487 | ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`") | |
7488 | LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`") | |
7489 | PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`") | |
7490 | TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`") | |
7491 | Traits = property(GetTraits,doc="See `GetTraits`") | |
7492 | UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`") | |
7493 | VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`") | |
7494 | Active = property(IsActive) | |
2131d850 | 7495 | _core_.PyApp_swigregister(PyApp) |
d14a1e28 | 7496 | |
0085ce49 RD |
7497 | def PyApp_IsMainLoopRunning(*args): |
7498 | """ | |
1fc3b23a RD |
7499 | PyApp_IsMainLoopRunning() -> bool |
7500 | ||
7501 | Returns True if we're running the main loop, i.e. if the events can | |
7502 | currently be dispatched. | |
7503 | """ | |
0085ce49 | 7504 | return _core_.PyApp_IsMainLoopRunning(*args) |
1fc3b23a | 7505 | |
0085ce49 RD |
7506 | def PyApp_GetMacSupportPCMenuShortcuts(*args): |
7507 | """PyApp_GetMacSupportPCMenuShortcuts() -> bool""" | |
7508 | return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args) | |
d14a1e28 | 7509 | |
0085ce49 RD |
7510 | def PyApp_GetMacAboutMenuItemId(*args): |
7511 | """PyApp_GetMacAboutMenuItemId() -> long""" | |
7512 | return _core_.PyApp_GetMacAboutMenuItemId(*args) | |
d14a1e28 | 7513 | |
0085ce49 RD |
7514 | def PyApp_GetMacPreferencesMenuItemId(*args): |
7515 | """PyApp_GetMacPreferencesMenuItemId() -> long""" | |
7516 | return _core_.PyApp_GetMacPreferencesMenuItemId(*args) | |
d14a1e28 | 7517 | |
0085ce49 RD |
7518 | def PyApp_GetMacExitMenuItemId(*args): |
7519 | """PyApp_GetMacExitMenuItemId() -> long""" | |
7520 | return _core_.PyApp_GetMacExitMenuItemId(*args) | |
d14a1e28 | 7521 | |
0085ce49 RD |
7522 | def PyApp_GetMacHelpMenuTitleName(*args): |
7523 | """PyApp_GetMacHelpMenuTitleName() -> String""" | |
7524 | return _core_.PyApp_GetMacHelpMenuTitleName(*args) | |
d14a1e28 | 7525 | |
e811c8ce | 7526 | def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs): |
0085ce49 RD |
7527 | """PyApp_SetMacSupportPCMenuShortcuts(bool val)""" |
7528 | return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs) | |
d14a1e28 | 7529 | |
e811c8ce | 7530 | def PyApp_SetMacAboutMenuItemId(*args, **kwargs): |
0085ce49 RD |
7531 | """PyApp_SetMacAboutMenuItemId(long val)""" |
7532 | return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs) | |
d14a1e28 | 7533 | |
e811c8ce | 7534 | def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs): |
0085ce49 RD |
7535 | """PyApp_SetMacPreferencesMenuItemId(long val)""" |
7536 | return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs) | |
d14a1e28 | 7537 | |
e811c8ce | 7538 | def PyApp_SetMacExitMenuItemId(*args, **kwargs): |
0085ce49 RD |
7539 | """PyApp_SetMacExitMenuItemId(long val)""" |
7540 | return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs) | |
d14a1e28 | 7541 | |
e811c8ce | 7542 | def PyApp_SetMacHelpMenuTitleName(*args, **kwargs): |
0085ce49 RD |
7543 | """PyApp_SetMacHelpMenuTitleName(String val)""" |
7544 | return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs) | |
d14a1e28 | 7545 | |
0085ce49 RD |
7546 | def PyApp_GetComCtl32Version(*args): |
7547 | """ | |
0df68c9f | 7548 | PyApp_GetComCtl32Version() -> int |
6c3b4aae | 7549 | |
66c033b4 RD |
7550 | Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if |
7551 | it wasn't found at all. Raises an exception on non-Windows platforms. | |
0df68c9f | 7552 | """ |
0085ce49 | 7553 | return _core_.PyApp_GetComCtl32Version(*args) |
d14a1e28 | 7554 | |
33d6fd3b | 7555 | def PyApp_IsDisplayAvailable(*args): |
fc46b7f3 | 7556 | """ |
33d6fd3b | 7557 | PyApp_IsDisplayAvailable() -> bool |
fc46b7f3 RD |
7558 | |
7559 | Tests if it is possible to create a GUI in the current environment. | |
7560 | This will mean different things on the different platforms. | |
7561 | ||
7562 | * On X Windows systems this function will return ``False`` if it is | |
7563 | not able to open a connection to the X display, which can happen | |
7564 | if $DISPLAY is not set, or is not set correctly. | |
7565 | ||
7566 | * On Mac OS X a ``False`` return value will mean that wx is not | |
7567 | able to access the window manager, which can happen if logged in | |
7568 | remotely or if running from the normal version of python instead | |
7569 | of the framework version, (i.e., pythonw.) | |
7570 | ||
7571 | * On MS Windows... | |
7572 | ||
7573 | """ | |
33d6fd3b | 7574 | return _core_.PyApp_IsDisplayAvailable(*args) |
fc46b7f3 | 7575 | |
d14a1e28 RD |
7576 | #--------------------------------------------------------------------------- |
7577 | ||
7578 | ||
0085ce49 RD |
7579 | def Exit(*args): |
7580 | """ | |
0df68c9f | 7581 | Exit() |
6c3b4aae | 7582 | |
0df68c9f RD |
7583 | Force an exit of the application. Convenience for wx.GetApp().Exit() |
7584 | """ | |
0085ce49 | 7585 | return _core_.Exit(*args) |
d14a1e28 | 7586 | |
0085ce49 RD |
7587 | def Yield(*args): |
7588 | """ | |
0df68c9f | 7589 | Yield() -> bool |
6c3b4aae | 7590 | |
0df68c9f RD |
7591 | Yield to other apps/messages. Convenience for wx.GetApp().Yield() |
7592 | """ | |
0085ce49 | 7593 | return _core_.Yield(*args) |
d14a1e28 | 7594 | |
0085ce49 RD |
7595 | def YieldIfNeeded(*args): |
7596 | """ | |
0df68c9f | 7597 | YieldIfNeeded() -> bool |
6c3b4aae | 7598 | |
0df68c9f RD |
7599 | Yield to other apps/messages. Convenience for wx.GetApp().Yield(True) |
7600 | """ | |
0085ce49 | 7601 | return _core_.YieldIfNeeded(*args) |
d14a1e28 | 7602 | |
e811c8ce | 7603 | def SafeYield(*args, **kwargs): |
0085ce49 | 7604 | """ |
0df68c9f | 7605 | SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool |
6c3b4aae | 7606 | |
66c033b4 RD |
7607 | This function is similar to `wx.Yield`, except that it disables the |
7608 | user input to all program windows before calling `wx.Yield` and | |
7609 | re-enables it again afterwards. If ``win`` is not None, this window | |
7610 | will remain enabled, allowing the implementation of some limited user | |
7611 | interaction. | |
6c3b4aae | 7612 | |
66c033b4 | 7613 | :Returns: the result of the call to `wx.Yield`. |
0df68c9f | 7614 | """ |
0085ce49 | 7615 | return _core_.SafeYield(*args, **kwargs) |
d14a1e28 | 7616 | |
0085ce49 RD |
7617 | def WakeUpIdle(*args): |
7618 | """ | |
0df68c9f | 7619 | WakeUpIdle() |
6c3b4aae | 7620 | |
66c033b4 RD |
7621 | Cause the message queue to become empty again, so idle events will be |
7622 | sent. | |
0df68c9f | 7623 | """ |
0085ce49 | 7624 | return _core_.WakeUpIdle(*args) |
d14a1e28 | 7625 | |
e811c8ce | 7626 | def PostEvent(*args, **kwargs): |
0085ce49 | 7627 | """ |
0df68c9f | 7628 | PostEvent(EvtHandler dest, Event event) |
6c3b4aae | 7629 | |
66c033b4 RD |
7630 | Send an event to a window or other wx.EvtHandler to be processed |
7631 | later. | |
0df68c9f | 7632 | """ |
0085ce49 | 7633 | return _core_.PostEvent(*args, **kwargs) |
d14a1e28 | 7634 | |
0085ce49 RD |
7635 | def App_CleanUp(*args): |
7636 | """ | |
0df68c9f | 7637 | App_CleanUp() |
6c3b4aae | 7638 | |
41e2b43e | 7639 | For internal use only, it is used to cleanup after wxWidgets when |
66c033b4 | 7640 | Python shuts down. |
0df68c9f | 7641 | """ |
0085ce49 | 7642 | return _core_.App_CleanUp(*args) |
d14a1e28 | 7643 | |
0085ce49 RD |
7644 | def GetApp(*args): |
7645 | """ | |
0df68c9f | 7646 | GetApp() -> PyApp |
6c3b4aae | 7647 | |
196addbf | 7648 | Return a reference to the current wx.App object. |
0df68c9f | 7649 | """ |
0085ce49 | 7650 | return _core_.GetApp(*args) |
5cbf236d RD |
7651 | |
7652 | def SetDefaultPyEncoding(*args, **kwargs): | |
0085ce49 | 7653 | """ |
5cbf236d RD |
7654 | SetDefaultPyEncoding(string encoding) |
7655 | ||
7656 | Sets the encoding that wxPython will use when it needs to convert a | |
7657 | Python string or unicode object to or from a wxString. | |
e505d15e RD |
7658 | |
7659 | The default encoding is the value of ``locale.getdefaultlocale()[1]`` | |
7660 | but please be aware that the default encoding within the same locale | |
7661 | may be slightly different on different platforms. For example, please | |
7662 | see http://www.alanwood.net/demos/charsetdiffs.html for differences | |
7663 | between the common latin/roman encodings. | |
5cbf236d | 7664 | """ |
0085ce49 | 7665 | return _core_.SetDefaultPyEncoding(*args, **kwargs) |
5cbf236d | 7666 | |
0085ce49 RD |
7667 | def GetDefaultPyEncoding(*args): |
7668 | """ | |
5cbf236d RD |
7669 | GetDefaultPyEncoding() -> string |
7670 | ||
7671 | Gets the current encoding that wxPython will use when it needs to | |
7672 | convert a Python string or unicode object to or from a wxString. | |
7673 | """ | |
0085ce49 | 7674 | return _core_.GetDefaultPyEncoding(*args) |
d14a1e28 RD |
7675 | #---------------------------------------------------------------------- |
7676 | ||
7677 | class PyOnDemandOutputWindow: | |
6c3b4aae RD |
7678 | """ |
7679 | A class that can be used for redirecting Python's stdout and | |
7680 | stderr streams. It will do nothing until something is wrriten to | |
7681 | the stream at which point it will create a Frame with a text area | |
7682 | and write the text there. | |
7683 | """ | |
d14a1e28 RD |
7684 | def __init__(self, title = "wxPython: stdout/stderr"): |
7685 | self.frame = None | |
7686 | self.title = title | |
412d302d RD |
7687 | self.pos = wx.DefaultPosition |
7688 | self.size = (450, 300) | |
d14a1e28 RD |
7689 | self.parent = None |
7690 | ||
7691 | def SetParent(self, parent): | |
6c3b4aae | 7692 | """Set the window to be used as the popup Frame's parent.""" |
d14a1e28 RD |
7693 | self.parent = parent |
7694 | ||
6c3b4aae RD |
7695 | |
7696 | def CreateOutputWindow(self, st): | |
412d302d RD |
7697 | self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size, |
7698 | style=wx.DEFAULT_FRAME_STYLE) | |
196addbf | 7699 | self.text = wx.TextCtrl(self.frame, -1, "", |
412d302d | 7700 | style=wx.TE_MULTILINE|wx.TE_READONLY) |
d1e20054 | 7701 | self.text.AppendText(st) |
6c3b4aae | 7702 | self.frame.Show(True) |
2131d850 | 7703 | self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow) |
6c3b4aae | 7704 | |
d14a1e28 | 7705 | |
7409c0c6 RD |
7706 | def OnCloseWindow(self, event): |
7707 | if self.frame is not None: | |
7708 | self.frame.Destroy() | |
7709 | self.frame = None | |
7710 | self.text = None | |
7711 | ||
7712 | ||
d14a1e28 | 7713 | # These methods provide the file-like output behaviour. |
6c3b4aae RD |
7714 | def write(self, text): |
7715 | """ | |
7716 | Create the output window if needed and write the string to it. | |
7717 | If not called in the context of the gui thread then uses | |
7718 | CallAfter to do the work there. | |
7719 | """ | |
7720 | if self.frame is None: | |
7721 | if not wx.Thread_IsMain(): | |
7722 | wx.CallAfter(self.CreateOutputWindow, text) | |
7723 | else: | |
7724 | self.CreateOutputWindow(text) | |
7725 | else: | |
7726 | if not wx.Thread_IsMain(): | |
7727 | wx.CallAfter(self.text.AppendText, text) | |
7728 | else: | |
7729 | self.text.AppendText(text) | |
7730 | ||
d14a1e28 RD |
7731 | |
7732 | def close(self): | |
6c3b4aae RD |
7733 | if self.frame is not None: |
7734 | wx.CallAfter(self.frame.Close) | |
7735 | ||
d14a1e28 | 7736 | |
19272049 RD |
7737 | def flush(self): |
7738 | pass | |
7739 | ||
7740 | ||
d14a1e28 RD |
7741 | |
7742 | #---------------------------------------------------------------------- | |
d14a1e28 RD |
7743 | |
7744 | _defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__') | |
fc46b7f3 | 7745 | |
d14a1e28 | 7746 | class App(wx.PyApp): |
6c3b4aae | 7747 | """ |
66c033b4 RD |
7748 | The ``wx.App`` class represents the application and is used to: |
7749 | ||
7750 | * bootstrap the wxPython system and initialize the underlying | |
7751 | gui toolkit | |
7752 | * set and get application-wide properties | |
7753 | * implement the windowing system main message or event loop, | |
7754 | and to dispatch events to window instances | |
7755 | * etc. | |
7756 | ||
7757 | Every application must have a ``wx.App`` instance, and all | |
7758 | creation of UI objects should be delayed until after the | |
03e37cd5 RD |
7759 | ``wx.App`` object has been created in order to ensure that the gui |
7760 | platform and wxWidgets have been fully initialized. | |
66c033b4 RD |
7761 | |
7762 | Normally you would derive from this class and implement an | |
7763 | ``OnInit`` method that creates a frame and then calls | |
7764 | ``self.SetTopWindow(frame)``. | |
7765 | ||
03e37cd5 | 7766 | :see: `wx.PySimpleApp` for a simpler app class that can be used |
1c0f361b | 7767 | directly. |
6c3b4aae | 7768 | """ |
66c033b4 | 7769 | |
d14a1e28 RD |
7770 | outputWindowClass = PyOnDemandOutputWindow |
7771 | ||
03e37cd5 RD |
7772 | def __init__(self, redirect=_defRedirect, filename=None, |
7773 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7774 | """ |
7775 | Construct a ``wx.App`` object. | |
7776 | ||
03e37cd5 RD |
7777 | :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be |
7778 | redirected? Defaults to True on Windows and Mac, False | |
da9714b5 | 7779 | otherwise. If ``filename`` is None then output will be |
03e37cd5 RD |
7780 | redirected to a window that pops up as needed. (You can |
7781 | control what kind of window is created for the output by | |
7782 | resetting the class variable ``outputWindowClass`` to a | |
7783 | class of your choosing.) | |
66c033b4 | 7784 | |
03e37cd5 RD |
7785 | :param filename: The name of a file to redirect output to, if |
7786 | redirect is True. | |
66c033b4 RD |
7787 | |
7788 | :param useBestVisual: Should the app try to use the best | |
03e37cd5 RD |
7789 | available visual provided by the system (only relevant on |
7790 | systems that have more than one visual.) This parameter | |
7791 | must be used instead of calling `SetUseBestVisual` later | |
7792 | on because it must be set before the underlying GUI | |
7793 | toolkit is initialized. | |
7794 | ||
7795 | :param clearSigInt: Should SIGINT be cleared? This allows the | |
7796 | app to terminate upon a Ctrl-C in the console like other | |
7797 | GUI apps will. | |
66c033b4 RD |
7798 | |
7799 | :note: You should override OnInit to do applicaition | |
7800 | initialization to ensure that the system, toolkit and | |
7801 | wxWidgets are fully initialized. | |
7802 | """ | |
fc46b7f3 | 7803 | |
d14a1e28 RD |
7804 | wx.PyApp.__init__(self) |
7805 | ||
fc46b7f3 | 7806 | # make sure we can create a GUI |
33d6fd3b | 7807 | if not self.IsDisplayAvailable(): |
fc46b7f3 RD |
7808 | |
7809 | if wx.Platform == "__WXMAC__": | |
7810 | msg = """This program needs access to the screen. | |
7811 | Please run with 'pythonw', not 'python', and only when you are logged | |
7812 | in on the main display of your Mac.""" | |
7813 | ||
7814 | elif wx.Platform == "__WXGTK__": | |
7815 | msg ="Unable to access the X Display, is $DISPLAY set properly?" | |
d14a1e28 | 7816 | |
fc46b7f3 RD |
7817 | else: |
7818 | msg = "Unable to create GUI" | |
7819 | # TODO: more description is needed for wxMSW... | |
7820 | ||
7821 | raise SystemExit(msg) | |
7822 | ||
d14a1e28 RD |
7823 | # This has to be done before OnInit |
7824 | self.SetUseBestVisual(useBestVisual) | |
7825 | ||
7826 | # Set the default handler for SIGINT. This fixes a problem | |
7827 | # where if Ctrl-C is pressed in the console that started this | |
7828 | # app then it will not appear to do anything, (not even send | |
7829 | # KeyboardInterrupt???) but will later segfault on exit. By | |
7830 | # setting the default handler then the app will exit, as | |
7831 | # expected (depending on platform.) | |
03e37cd5 RD |
7832 | if clearSigInt: |
7833 | try: | |
7834 | import signal | |
7835 | signal.signal(signal.SIGINT, signal.SIG_DFL) | |
7836 | except: | |
7837 | pass | |
d14a1e28 RD |
7838 | |
7839 | # Save and redirect the stdio to a window? | |
7840 | self.stdioWin = None | |
7841 | self.saveStdio = (_sys.stdout, _sys.stderr) | |
7842 | if redirect: | |
7843 | self.RedirectStdio(filename) | |
7844 | ||
8fb0e70a RD |
7845 | # Use Python's install prefix as the default |
7846 | wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix) | |
7847 | ||
48a0c021 RD |
7848 | # Until the new native control for wxMac is up to par, still use the generic one. |
7849 | wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1) | |
7850 | ||
d14a1e28 RD |
7851 | # This finishes the initialization of wxWindows and then calls |
7852 | # the OnInit that should be present in the derived class | |
7853 | self._BootstrapApp() | |
7854 | ||
7855 | ||
01f6b6d3 RD |
7856 | def OnPreInit(self): |
7857 | """ | |
7858 | Things that must be done after _BootstrapApp has done its | |
7859 | thing, but would be nice if they were already done by the time | |
7860 | that OnInit is called. | |
7861 | """ | |
7862 | wx.StockGDI._initStockObjects() | |
7863 | ||
7864 | ||
02b455f2 RD |
7865 | def __del__(self, destroy=wx.PyApp.__del__): |
7866 | self.RestoreStdio() # Just in case the MainLoop was overridden | |
7867 | destroy(self) | |
d14a1e28 | 7868 | |
70b7a5fe | 7869 | def Destroy(self): |
b39fe951 | 7870 | self.this.own(False) |
70b7a5fe | 7871 | wx.PyApp.Destroy(self) |
d14a1e28 RD |
7872 | |
7873 | def SetTopWindow(self, frame): | |
1e0c8722 | 7874 | """Set the \"main\" top level window""" |
d14a1e28 RD |
7875 | if self.stdioWin: |
7876 | self.stdioWin.SetParent(frame) | |
7877 | wx.PyApp.SetTopWindow(self, frame) | |
7878 | ||
7879 | ||
7880 | def MainLoop(self): | |
1e0c8722 | 7881 | """Execute the main GUI event loop""" |
d14a1e28 RD |
7882 | wx.PyApp.MainLoop(self) |
7883 | self.RestoreStdio() | |
7884 | ||
7885 | ||
7409c0c6 | 7886 | def RedirectStdio(self, filename=None): |
1e0c8722 | 7887 | """Redirect sys.stdout and sys.stderr to a file or a popup window.""" |
d14a1e28 RD |
7888 | if filename: |
7889 | _sys.stdout = _sys.stderr = open(filename, 'a') | |
7890 | else: | |
7891 | self.stdioWin = self.outputWindowClass() | |
7892 | _sys.stdout = _sys.stderr = self.stdioWin | |
7893 | ||
7894 | ||
7895 | def RestoreStdio(self): | |
02b455f2 RD |
7896 | try: |
7897 | _sys.stdout, _sys.stderr = self.saveStdio | |
7898 | except: | |
7899 | pass | |
d14a1e28 RD |
7900 | |
7901 | ||
412d302d RD |
7902 | def SetOutputWindowAttributes(self, title=None, pos=None, size=None): |
7903 | """ | |
7904 | Set the title, position and/or size of the output window if | |
f5b96ee1 RD |
7905 | the stdio has been redirected. This should be called before |
7906 | any output would cause the output window to be created. | |
412d302d RD |
7907 | """ |
7908 | if self.stdioWin: | |
7909 | if title is not None: | |
7910 | self.stdioWin.title = title | |
7911 | if pos is not None: | |
7912 | self.stdioWin.pos = pos | |
7913 | if size is not None: | |
7914 | self.stdioWin.size = size | |
7915 | ||
7916 | ||
7917 | ||
d14a1e28 | 7918 | |
66c033b4 | 7919 | # change from wx.PyApp_XX to wx.App_XX |
54f9ee45 RD |
7920 | App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts |
7921 | App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId | |
7922 | App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId | |
7923 | App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId | |
7924 | App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName | |
7925 | App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts | |
7926 | App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId | |
7927 | App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId | |
7928 | App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId | |
7929 | App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName | |
7930 | App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version | |
d14a1e28 RD |
7931 | |
7932 | #---------------------------------------------------------------------------- | |
7933 | ||
7934 | class PySimpleApp(wx.App): | |
6c3b4aae RD |
7935 | """ |
7936 | A simple application class. You can just create one of these and | |
7937 | then then make your top level windows later, and not have to worry | |
66c033b4 RD |
7938 | about OnInit. For example:: |
7939 | ||
7940 | app = wx.PySimpleApp() | |
7941 | frame = wx.Frame(None, title='Hello World') | |
7942 | frame.Show() | |
7943 | app.MainLoop() | |
7944 | ||
7945 | :see: `wx.App` | |
7946 | """ | |
6c3b4aae | 7947 | |
03e37cd5 RD |
7948 | def __init__(self, redirect=False, filename=None, |
7949 | useBestVisual=False, clearSigInt=True): | |
66c033b4 RD |
7950 | """ |
7951 | :see: `wx.App.__init__` | |
7952 | """ | |
03e37cd5 | 7953 | wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt) |
6c3b4aae | 7954 | |
d14a1e28 | 7955 | def OnInit(self): |
d14a1e28 RD |
7956 | return True |
7957 | ||
7958 | ||
66c033b4 | 7959 | |
6c3b4aae | 7960 | # Is anybody using this one? |
d14a1e28 RD |
7961 | class PyWidgetTester(wx.App): |
7962 | def __init__(self, size = (250, 100)): | |
7963 | self.size = size | |
7964 | wx.App.__init__(self, 0) | |
7965 | ||
7966 | def OnInit(self): | |
196addbf | 7967 | self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size) |
d14a1e28 RD |
7968 | self.SetTopWindow(self.frame) |
7969 | return True | |
7970 | ||
66c033b4 RD |
7971 | def SetWidget(self, widgetClass, *args, **kwargs): |
7972 | w = widgetClass(self.frame, *args, **kwargs) | |
d14a1e28 RD |
7973 | self.frame.Show(True) |
7974 | ||
7975 | #---------------------------------------------------------------------------- | |
7976 | # DO NOT hold any other references to this object. This is how we | |
66c033b4 | 7977 | # know when to cleanup system resources that wxWidgets is holding. When |
d14a1e28 | 7978 | # the sys module is unloaded, the refcount on sys.__wxPythonCleanup |
66c033b4 | 7979 | # goes to zero and it calls the wx.App_CleanUp function. |
d14a1e28 RD |
7980 | |
7981 | class __wxPyCleanup: | |
7982 | def __init__(self): | |
54f9ee45 | 7983 | self.cleanup = _core_.App_CleanUp |
d14a1e28 RD |
7984 | def __del__(self): |
7985 | self.cleanup() | |
7986 | ||
7987 | _sys.__wxPythonCleanup = __wxPyCleanup() | |
7988 | ||
7989 | ## # another possible solution, but it gets called too early... | |
66c033b4 RD |
7990 | ## import atexit |
7991 | ## atexit.register(_core_.wxApp_CleanUp) | |
d14a1e28 RD |
7992 | |
7993 | ||
7994 | #---------------------------------------------------------------------------- | |
7995 | ||
7996 | #--------------------------------------------------------------------------- | |
2ef75293 RD |
7997 | |
7998 | class EventLoop(object): | |
093d3ff1 | 7999 | """Proxy of C++ EventLoop class""" |
0085ce49 RD |
8000 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
8001 | __repr__ = _swig_repr | |
8002 | def __init__(self, *args, **kwargs): | |
2ef75293 | 8003 | """__init__(self) -> EventLoop""" |
0085ce49 RD |
8004 | _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs)) |
8005 | __swig_destroy__ = _core_.delete_EventLoop | |
8006 | __del__ = lambda self : None; | |
2ef75293 RD |
8007 | def Run(*args, **kwargs): |
8008 | """Run(self) -> int""" | |
8009 | return _core_.EventLoop_Run(*args, **kwargs) | |
8010 | ||
8011 | def Exit(*args, **kwargs): | |
8012 | """Exit(self, int rc=0)""" | |
8013 | return _core_.EventLoop_Exit(*args, **kwargs) | |
8014 | ||
8015 | def Pending(*args, **kwargs): | |
8016 | """Pending(self) -> bool""" | |
8017 | return _core_.EventLoop_Pending(*args, **kwargs) | |
8018 | ||
8019 | def Dispatch(*args, **kwargs): | |
8020 | """Dispatch(self) -> bool""" | |
8021 | return _core_.EventLoop_Dispatch(*args, **kwargs) | |
8022 | ||
8023 | def IsRunning(*args, **kwargs): | |
8024 | """IsRunning(self) -> bool""" | |
8025 | return _core_.EventLoop_IsRunning(*args, **kwargs) | |
8026 | ||
8027 | def GetActive(*args, **kwargs): | |
8028 | """GetActive() -> EventLoop""" | |
8029 | return _core_.EventLoop_GetActive(*args, **kwargs) | |
8030 | ||
8031 | GetActive = staticmethod(GetActive) | |
8032 | def SetActive(*args, **kwargs): | |
8033 | """SetActive(EventLoop loop)""" | |
8034 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
8035 | ||
8036 | SetActive = staticmethod(SetActive) | |
2131d850 | 8037 | _core_.EventLoop_swigregister(EventLoop) |
2ef75293 | 8038 | |
0085ce49 RD |
8039 | def EventLoop_GetActive(*args): |
8040 | """EventLoop_GetActive() -> EventLoop""" | |
8041 | return _core_.EventLoop_GetActive(*args) | |
2ef75293 RD |
8042 | |
8043 | def EventLoop_SetActive(*args, **kwargs): | |
0085ce49 RD |
8044 | """EventLoop_SetActive(EventLoop loop)""" |
8045 | return _core_.EventLoop_SetActive(*args, **kwargs) | |
2ef75293 | 8046 | |
091f5bed RD |
8047 | class EventLoopActivator(object): |
8048 | """Proxy of C++ EventLoopActivator class""" | |
0085ce49 RD |
8049 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
8050 | __repr__ = _swig_repr | |
8051 | def __init__(self, *args, **kwargs): | |
091f5bed | 8052 | """__init__(self, EventLoop evtLoop) -> EventLoopActivator""" |
0085ce49 RD |
8053 | _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs)) |
8054 | __swig_destroy__ = _core_.delete_EventLoopActivator | |
8055 | __del__ = lambda self : None; | |
2131d850 | 8056 | _core_.EventLoopActivator_swigregister(EventLoopActivator) |
091f5bed | 8057 | |
2ef75293 | 8058 | #--------------------------------------------------------------------------- |
d14a1e28 | 8059 | |
eec1c382 RD |
8060 | ACCEL_ALT = _core_.ACCEL_ALT |
8061 | ACCEL_CTRL = _core_.ACCEL_CTRL | |
8062 | ACCEL_SHIFT = _core_.ACCEL_SHIFT | |
8063 | ACCEL_NORMAL = _core_.ACCEL_NORMAL | |
8064 | ACCEL_CMD = _core_.ACCEL_CMD | |
1e0c8722 | 8065 | class AcceleratorEntry(object): |
66c033b4 RD |
8066 | """ |
8067 | A class used to define items in an `wx.AcceleratorTable`. wxPython | |
8068 | programs can choose to use wx.AcceleratorEntry objects, but using a | |
8069 | list of 3-tuple of integers (flags, keyCode, cmdID) usually works just | |
41e2b43e | 8070 | as well. See `__init__` for of the tuple values. |
66c033b4 RD |
8071 | |
8072 | :see: `wx.AcceleratorTable` | |
8073 | """ | |
0085ce49 RD |
8074 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
8075 | __repr__ = _swig_repr | |
8076 | def __init__(self, *args, **kwargs): | |
66c033b4 RD |
8077 | """ |
8078 | __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry | |
8079 | ||
8080 | Construct a wx.AcceleratorEntry. | |
66c033b4 | 8081 | """ |
0085ce49 RD |
8082 | _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs)) |
8083 | __swig_destroy__ = _core_.delete_AcceleratorEntry | |
8084 | __del__ = lambda self : None; | |
1e0c8722 | 8085 | def Set(*args, **kwargs): |
66c033b4 RD |
8086 | """ |
8087 | Set(self, int flags, int keyCode, int cmd) | |
1e0c8722 | 8088 | |
66c033b4 RD |
8089 | (Re)set the attributes of a wx.AcceleratorEntry. |
8090 | :see `__init__` | |
8091 | """ | |
8092 | return _core_.AcceleratorEntry_Set(*args, **kwargs) | |
1e0c8722 | 8093 | |
97ab0f6a RD |
8094 | def Create(*args, **kwargs): |
8095 | """ | |
8096 | Create(String str) -> AcceleratorEntry | |
8097 | ||
8098 | Create accelerator corresponding to the specified string, or None if | |
8099 | it coulnd't be parsed. | |
8100 | """ | |
8101 | return _core_.AcceleratorEntry_Create(*args, **kwargs) | |
8102 | ||
8103 | Create = staticmethod(Create) | |
1e0c8722 | 8104 | def GetFlags(*args, **kwargs): |
66c033b4 RD |
8105 | """ |
8106 | GetFlags(self) -> int | |
8107 | ||
8108 | Get the AcceleratorEntry's flags. | |
8109 | """ | |
54f9ee45 | 8110 | return _core_.AcceleratorEntry_GetFlags(*args, **kwargs) |
1e0c8722 RD |
8111 | |
8112 | def GetKeyCode(*args, **kwargs): | |
66c033b4 RD |
8113 | """ |
8114 | GetKeyCode(self) -> int | |
8115 | ||
8116 | Get the AcceleratorEntry's keycode. | |
8117 | """ | |
54f9ee45 | 8118 | return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs) |
1e0c8722 RD |
8119 | |
8120 | def GetCommand(*args, **kwargs): | |
66c033b4 RD |
8121 | """ |
8122 | GetCommand(self) -> int | |
8123 | ||
8124 | Get the AcceleratorEntry's command ID. | |
8125 | """ | |
54f9ee45 | 8126 | return _core_.AcceleratorEntry_GetCommand(*args, **kwargs) |
1e0c8722 | 8127 | |
97ab0f6a RD |
8128 | def IsOk(*args, **kwargs): |
8129 | """IsOk(self) -> bool""" | |
8130 | return _core_.AcceleratorEntry_IsOk(*args, **kwargs) | |
8131 | ||
8132 | def ToString(*args, **kwargs): | |
8133 | """ | |
8134 | ToString(self) -> String | |
8135 | ||
8136 | Returns a string representation for the this accelerator. The string | |
8137 | is formatted using the <flags>-<keycode> format where <flags> maybe a | |
8138 | hyphen-separed list of "shift|alt|ctrl" | |
8139 | ||
8140 | """ | |
8141 | return _core_.AcceleratorEntry_ToString(*args, **kwargs) | |
8142 | ||
8143 | def FromString(*args, **kwargs): | |
8144 | """ | |
8145 | FromString(self, String str) -> bool | |
8146 | ||
8147 | Returns true if the given string correctly initialized this object. | |
8148 | """ | |
8149 | return _core_.AcceleratorEntry_FromString(*args, **kwargs) | |
8150 | ||
2bf58437 RD |
8151 | Command = property(GetCommand,doc="See `GetCommand`") |
8152 | Flags = property(GetFlags,doc="See `GetFlags`") | |
8153 | KeyCode = property(GetKeyCode,doc="See `GetKeyCode`") | |
2131d850 | 8154 | _core_.AcceleratorEntry_swigregister(AcceleratorEntry) |
1e0c8722 | 8155 | |
97ab0f6a RD |
8156 | def AcceleratorEntry_Create(*args, **kwargs): |
8157 | """ | |
8158 | AcceleratorEntry_Create(String str) -> AcceleratorEntry | |
8159 | ||
8160 | Create accelerator corresponding to the specified string, or None if | |
8161 | it coulnd't be parsed. | |
8162 | """ | |
8163 | return _core_.AcceleratorEntry_Create(*args, **kwargs) | |
8164 | ||
1e0c8722 | 8165 | class AcceleratorTable(Object): |
66c033b4 RD |
8166 | """ |
8167 | An accelerator table allows the application to specify a table of | |
8168 | keyboard shortcuts for menus or other commands. On Windows, menu or | |
8169 | button commands are supported; on GTK, only menu commands are | |
8170 | supported. | |
66c033b4 | 8171 | """ |
0085ce49 RD |
8172 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
8173 | __repr__ = _swig_repr | |
8174 | def __init__(self, *args, **kwargs): | |
0df68c9f RD |
8175 | """ |
8176 | __init__(entries) -> AcceleratorTable | |
1e0c8722 | 8177 | |
66c033b4 RD |
8178 | Construct an AcceleratorTable from a list of `wx.AcceleratorEntry` |
8179 | items or or of 3-tuples (flags, keyCode, cmdID) | |
8180 | ||
8181 | :see: `wx.AcceleratorEntry` | |
0df68c9f | 8182 | """ |
0085ce49 RD |
8183 | _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs)) |
8184 | __swig_destroy__ = _core_.delete_AcceleratorTable | |
8185 | __del__ = lambda self : None; | |
b39fe951 RD |
8186 | def IsOk(*args, **kwargs): |
8187 | """IsOk(self) -> bool""" | |
8188 | return _core_.AcceleratorTable_IsOk(*args, **kwargs) | |
1e0c8722 | 8189 | |
b39fe951 | 8190 | Ok = IsOk |
2131d850 | 8191 | _core_.AcceleratorTable_swigregister(AcceleratorTable) |
1e0c8722 | 8192 | |
cbfc9df6 RD |
8193 | def GetAccelFromString(label): |
8194 | entry = AcceleratorEntry() | |
8195 | entry.FromString(label) | |
8196 | return entry | |
1e0c8722 | 8197 | |
1e0c8722 RD |
8198 | #--------------------------------------------------------------------------- |
8199 | ||
74a57fcd RD |
8200 | class VisualAttributes(object): |
8201 | """struct containing all the visual attributes of a control""" | |
0085ce49 RD |
8202 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
8203 | __repr__ = _swig_repr | |
8204 | def __init__(self, *args, **kwargs): | |
74a57fcd | 8205 | """ |
a95a7133 | 8206 | __init__(self) -> VisualAttributes |
74a57fcd RD |
8207 | |
8208 | struct containing all the visual attributes of a control | |
8209 | """ | |
0085ce49 RD |
8210 | _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs)) |
8211 | __swig_destroy__ = _core_.delete_VisualAttributes | |
8212 | __del__ = lambda self : None; | |
8c3a7183 RD |
8213 | def _get_font(*args, **kwargs): |
8214 | """_get_font(self) -> Font""" | |
8215 | return _core_.VisualAttributes__get_font(*args, **kwargs) | |
8216 | ||
8217 | def _get_colFg(*args, **kwargs): | |
8218 | """_get_colFg(self) -> Colour""" | |
8219 | return _core_.VisualAttributes__get_colFg(*args, **kwargs) | |
8220 | ||
8221 | def _get_colBg(*args, **kwargs): | |
8222 | """_get_colBg(self) -> Colour""" | |
8223 | return _core_.VisualAttributes__get_colBg(*args, **kwargs) | |
8224 | ||
8225 | font = property(_get_font) | |
8226 | colFg = property(_get_colFg) | |
8227 | colBg = property(_get_colBg) | |
2131d850 | 8228 | _core_.VisualAttributes_swigregister(VisualAttributes) |
74a57fcd RD |
8229 | NullAcceleratorTable = cvar.NullAcceleratorTable |
8230 | PanelNameStr = cvar.PanelNameStr | |
8231 | ||
54f9ee45 RD |
8232 | WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL |
8233 | WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL | |
8234 | WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI | |
8235 | WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE | |
8236 | WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX | |
d14a1e28 | 8237 | class Window(EvtHandler): |
15afbcd0 RD |
8238 | """ |
8239 | wx.Window is the base class for all windows and represents any visible | |
8240 | object on the screen. All controls, top level windows and so on are | |
8241 | wx.Windows. Sizers and device contexts are not however, as they don't | |
8242 | appear on screen themselves. | |
8243 | ||
8244 | """ | |
0085ce49 RD |
8245 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
8246 | __repr__ = _swig_repr | |
8247 | def __init__(self, *args, **kwargs): | |
0df68c9f | 8248 | """ |
a95a7133 | 8249 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 8250 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window |
15afbcd0 RD |
8251 | |
8252 | Construct and show a generic Window. | |
0df68c9f | 8253 | """ |
0085ce49 | 8254 | _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs)) |
d14a1e28 | 8255 | self._setOORInfo(self) |
d14a1e28 | 8256 | |
e811c8ce | 8257 | def Create(*args, **kwargs): |
0df68c9f | 8258 | """ |
a95a7133 | 8259 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
74a57fcd | 8260 | Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool |
15afbcd0 RD |
8261 | |
8262 | Create the GUI part of the Window for 2-phase creation mode. | |
0df68c9f | 8263 | """ |
54f9ee45 | 8264 | return _core_.Window_Create(*args, **kwargs) |
d14a1e28 | 8265 | |
e811c8ce | 8266 | def Close(*args, **kwargs): |
15afbcd0 | 8267 | """ |
a95a7133 | 8268 | Close(self, bool force=False) -> bool |
15afbcd0 RD |
8269 | |
8270 | This function simply generates a EVT_CLOSE event whose handler usually | |
8271 | tries to close the window. It doesn't close the window itself, | |
8272 | however. If force is False (the default) then the window's close | |
8273 | handler will be allowed to veto the destruction of the window. | |
15afbcd0 | 8274 | """ |
54f9ee45 | 8275 | return _core_.Window_Close(*args, **kwargs) |
d14a1e28 | 8276 | |
e811c8ce | 8277 | def Destroy(*args, **kwargs): |
0df68c9f | 8278 | """ |
a95a7133 | 8279 | Destroy(self) -> bool |
d14a1e28 | 8280 | |
15afbcd0 RD |
8281 | Destroys the window safely. Frames and dialogs are not destroyed |
8282 | immediately when this function is called -- they are added to a list | |
8283 | of windows to be deleted on idle time, when all the window's events | |
8284 | have been processed. This prevents problems with events being sent to | |
8285 | non-existent windows. | |
8286 | ||
8287 | Returns True if the window has either been successfully deleted, or it | |
8288 | has been added to the list of windows pending real deletion. | |
0df68c9f | 8289 | """ |
b39fe951 RD |
8290 | args[0].this.own(False) |
8291 | return _core_.Window_Destroy(*args, **kwargs) | |
d14a1e28 | 8292 | |
e811c8ce | 8293 | def DestroyChildren(*args, **kwargs): |
15afbcd0 | 8294 | """ |
a95a7133 | 8295 | DestroyChildren(self) -> bool |
15afbcd0 | 8296 | |
41e2b43e RD |
8297 | Destroys all children of a window. Called automatically by the |
8298 | destructor. | |
15afbcd0 | 8299 | """ |
54f9ee45 | 8300 | return _core_.Window_DestroyChildren(*args, **kwargs) |
d14a1e28 | 8301 | |
e811c8ce | 8302 | def IsBeingDeleted(*args, **kwargs): |
15afbcd0 | 8303 | """ |
a95a7133 | 8304 | IsBeingDeleted(self) -> bool |
15afbcd0 RD |
8305 | |
8306 | Is the window in the process of being deleted? | |
8307 | """ | |
54f9ee45 | 8308 | return _core_.Window_IsBeingDeleted(*args, **kwargs) |
d14a1e28 | 8309 | |
e811c8ce | 8310 | def SetLabel(*args, **kwargs): |
15afbcd0 | 8311 | """ |
a95a7133 | 8312 | SetLabel(self, String label) |
15afbcd0 RD |
8313 | |
8314 | Set the text which the window shows in its label if applicable. | |
8315 | """ | |
54f9ee45 | 8316 | return _core_.Window_SetLabel(*args, **kwargs) |
d14a1e28 | 8317 | |
e811c8ce | 8318 | def GetLabel(*args, **kwargs): |
15afbcd0 | 8319 | """ |
a95a7133 | 8320 | GetLabel(self) -> String |
15afbcd0 | 8321 | |
41e2b43e RD |
8322 | Generic way of getting a label from any window, for identification |
8323 | purposes. The interpretation of this function differs from class to | |
8324 | class. For frames and dialogs, the value returned is the title. For | |
8325 | buttons or static text controls, it is the button text. This function | |
8326 | can be useful for meta-programs such as testing tools or special-needs | |
8327 | access programs)which need to identify windows by name. | |
15afbcd0 | 8328 | """ |
54f9ee45 | 8329 | return _core_.Window_GetLabel(*args, **kwargs) |
d14a1e28 | 8330 | |
e811c8ce | 8331 | def SetName(*args, **kwargs): |
15afbcd0 | 8332 | """ |
a95a7133 | 8333 | SetName(self, String name) |
15afbcd0 | 8334 | |
41e2b43e RD |
8335 | Sets the window's name. The window name is used for ressource setting |
8336 | in X, it is not the same as the window title/label | |
15afbcd0 | 8337 | """ |
54f9ee45 | 8338 | return _core_.Window_SetName(*args, **kwargs) |
d14a1e28 | 8339 | |
e811c8ce | 8340 | def GetName(*args, **kwargs): |
15afbcd0 | 8341 | """ |
a95a7133 | 8342 | GetName(self) -> String |
15afbcd0 | 8343 | |
41e2b43e RD |
8344 | Returns the windows name. This name is not guaranteed to be unique; |
8345 | it is up to the programmer to supply an appropriate name in the window | |
8346 | constructor or via wx.Window.SetName. | |
15afbcd0 | 8347 | """ |
54f9ee45 | 8348 | return _core_.Window_GetName(*args, **kwargs) |
d14a1e28 | 8349 | |
4276dc52 RD |
8350 | def SetWindowVariant(*args, **kwargs): |
8351 | """ | |
a95a7133 | 8352 | SetWindowVariant(self, int variant) |
4276dc52 | 8353 | |
41e2b43e RD |
8354 | Sets the variant of the window/font size to use for this window, if |
8355 | the platform supports variants, for example, wxMac. | |
4276dc52 | 8356 | """ |
54f9ee45 | 8357 | return _core_.Window_SetWindowVariant(*args, **kwargs) |
4276dc52 RD |
8358 | |
8359 | def GetWindowVariant(*args, **kwargs): | |
a95a7133 | 8360 | """GetWindowVariant(self) -> int""" |
54f9ee45 | 8361 | return _core_.Window_GetWindowVariant(*args, **kwargs) |
4276dc52 | 8362 | |
e811c8ce | 8363 | def SetId(*args, **kwargs): |
15afbcd0 | 8364 | """ |
a95a7133 | 8365 | SetId(self, int winid) |
15afbcd0 RD |
8366 | |
8367 | Sets the identifier of the window. Each window has an integer | |
8368 | identifier. If the application has not provided one, an identifier | |
8369 | will be generated. Normally, the identifier should be provided on | |
8370 | creation and should not be modified subsequently. | |
8371 | """ | |
54f9ee45 | 8372 | return _core_.Window_SetId(*args, **kwargs) |
d14a1e28 | 8373 | |
e811c8ce | 8374 | def GetId(*args, **kwargs): |
15afbcd0 | 8375 | """ |
a95a7133 | 8376 | GetId(self) -> int |
15afbcd0 RD |
8377 | |
8378 | Returns the identifier of the window. Each window has an integer | |
8379 | identifier. If the application has not provided one (or the default Id | |
8380 | -1 is used) then an unique identifier with a negative value will be | |
8381 | generated. | |
8382 | """ | |
54f9ee45 | 8383 | return _core_.Window_GetId(*args, **kwargs) |
d14a1e28 | 8384 | |
e811c8ce | 8385 | def NewControlId(*args, **kwargs): |
15afbcd0 | 8386 | """ |
66c033b4 | 8387 | NewControlId() -> int |
15afbcd0 RD |
8388 | |
8389 | Generate a control id for the controls which were not given one. | |
8390 | """ | |
54f9ee45 | 8391 | return _core_.Window_NewControlId(*args, **kwargs) |
d14a1e28 | 8392 | |
e811c8ce RD |
8393 | NewControlId = staticmethod(NewControlId) |
8394 | def NextControlId(*args, **kwargs): | |
15afbcd0 | 8395 | """ |
66c033b4 | 8396 | NextControlId(int winid) -> int |
15afbcd0 RD |
8397 | |
8398 | Get the id of the control following the one with the given | |
41e2b43e | 8399 | autogenerated) id |
15afbcd0 | 8400 | """ |
54f9ee45 | 8401 | return _core_.Window_NextControlId(*args, **kwargs) |
d14a1e28 | 8402 | |
e811c8ce RD |
8403 | NextControlId = staticmethod(NextControlId) |
8404 | def PrevControlId(*args, **kwargs): | |
15afbcd0 | 8405 | """ |
66c033b4 | 8406 | PrevControlId(int winid) -> int |
15afbcd0 RD |
8407 | |
8408 | Get the id of the control preceding the one with the given | |
41e2b43e | 8409 | autogenerated) id |
15afbcd0 | 8410 | """ |
54f9ee45 | 8411 | return _core_.Window_PrevControlId(*args, **kwargs) |
d14a1e28 | 8412 | |
e811c8ce | 8413 | PrevControlId = staticmethod(PrevControlId) |
97ab0f6a RD |
8414 | def GetLayoutDirection(*args, **kwargs): |
8415 | """ | |
994453b8 | 8416 | GetLayoutDirection(self) -> int |
97ab0f6a RD |
8417 | |
8418 | Get the layout direction (LTR or RTL) for this window. Returns | |
8419 | ``wx.Layout_Default`` if layout direction is not supported. | |
8420 | """ | |
8421 | return _core_.Window_GetLayoutDirection(*args, **kwargs) | |
8422 | ||
8423 | def SetLayoutDirection(*args, **kwargs): | |
8424 | """ | |
994453b8 | 8425 | SetLayoutDirection(self, int dir) |
97ab0f6a RD |
8426 | |
8427 | Set the layout direction (LTR or RTL) for this window. | |
8428 | """ | |
8429 | return _core_.Window_SetLayoutDirection(*args, **kwargs) | |
8430 | ||
8431 | def AdjustForLayoutDirection(*args, **kwargs): | |
8432 | """ | |
8433 | AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int | |
8434 | ||
8435 | Mirror coordinates for RTL layout if this window uses it and if the | |
8436 | mirroring is not done automatically like Win32. | |
8437 | """ | |
8438 | return _core_.Window_AdjustForLayoutDirection(*args, **kwargs) | |
8439 | ||
e811c8ce | 8440 | def SetSize(*args, **kwargs): |
15afbcd0 | 8441 | """ |
a95a7133 | 8442 | SetSize(self, Size size) |
15afbcd0 RD |
8443 | |
8444 | Sets the size of the window in pixels. | |
8445 | """ | |
54f9ee45 | 8446 | return _core_.Window_SetSize(*args, **kwargs) |
d14a1e28 | 8447 | |
e811c8ce | 8448 | def SetDimensions(*args, **kwargs): |
15afbcd0 | 8449 | """ |
a95a7133 | 8450 | SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
8451 | |
8452 | Sets the position and size of the window in pixels. The sizeFlags | |
8453 | parameter indicates the interpretation of the other params if they are | |
e505d15e RD |
8454 | equal to -1. |
8455 | ||
8456 | ======================== ====================================== | |
8457 | wx.SIZE_AUTO A -1 indicates that a class-specific | |
8458 | default should be used. | |
8459 | wx.SIZE_USE_EXISTING Axisting dimensions should be used if | |
8460 | -1 values are supplied. | |
8461 | wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be | |
8462 | interpreted as real dimensions, not | |
8463 | default values. | |
8464 | ======================== ====================================== | |
8465 | ||
15afbcd0 | 8466 | """ |
54f9ee45 | 8467 | return _core_.Window_SetDimensions(*args, **kwargs) |
d14a1e28 | 8468 | |
e811c8ce | 8469 | def SetRect(*args, **kwargs): |
15afbcd0 | 8470 | """ |
a95a7133 | 8471 | SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) |
15afbcd0 RD |
8472 | |
8473 | Sets the position and size of the window in pixels using a wx.Rect. | |
8474 | """ | |
54f9ee45 | 8475 | return _core_.Window_SetRect(*args, **kwargs) |
d14a1e28 | 8476 | |
e811c8ce | 8477 | def SetSizeWH(*args, **kwargs): |
15afbcd0 | 8478 | """ |
a95a7133 | 8479 | SetSizeWH(self, int width, int height) |
15afbcd0 RD |
8480 | |
8481 | Sets the size of the window in pixels. | |
8482 | """ | |
54f9ee45 | 8483 | return _core_.Window_SetSizeWH(*args, **kwargs) |
d14a1e28 | 8484 | |
e811c8ce | 8485 | def Move(*args, **kwargs): |
15afbcd0 | 8486 | """ |
a95a7133 | 8487 | Move(self, Point pt, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
8488 | |
8489 | Moves the window to the given position. | |
8490 | """ | |
54f9ee45 | 8491 | return _core_.Window_Move(*args, **kwargs) |
d14a1e28 | 8492 | |
e811c8ce RD |
8493 | SetPosition = Move |
8494 | def MoveXY(*args, **kwargs): | |
15afbcd0 | 8495 | """ |
a95a7133 | 8496 | MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) |
15afbcd0 RD |
8497 | |
8498 | Moves the window to the given position. | |
8499 | """ | |
54f9ee45 | 8500 | return _core_.Window_MoveXY(*args, **kwargs) |
e811c8ce | 8501 | |
580080c5 | 8502 | def SetInitialSize(*args, **kwargs): |
f8167d6e | 8503 | """ |
580080c5 | 8504 | SetInitialSize(self, Size size=DefaultSize) |
f8167d6e RD |
8505 | |
8506 | A 'Smart' SetSize that will fill in default size components with the | |
8507 | window's *best size* values. Also set's the minsize for use with sizers. | |
8508 | """ | |
580080c5 | 8509 | return _core_.Window_SetInitialSize(*args, **kwargs) |
f8167d6e | 8510 | |
580080c5 | 8511 | SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`') |
e811c8ce | 8512 | def Raise(*args, **kwargs): |
15afbcd0 | 8513 | """ |
a95a7133 | 8514 | Raise(self) |
15afbcd0 | 8515 | |
943e8dfd | 8516 | Raises the window to the top of the window hierarchy. In current |
70b63a99 | 8517 | version of wxWidgets this works both for managed and child windows. |
15afbcd0 | 8518 | """ |
54f9ee45 | 8519 | return _core_.Window_Raise(*args, **kwargs) |
e811c8ce RD |
8520 | |
8521 | def Lower(*args, **kwargs): | |
15afbcd0 | 8522 | """ |
a95a7133 | 8523 | Lower(self) |
15afbcd0 | 8524 | |
943e8dfd | 8525 | Lowers the window to the bottom of the window hierarchy. In current |
70b63a99 | 8526 | version of wxWidgets this works both for managed and child windows. |
15afbcd0 | 8527 | """ |
54f9ee45 | 8528 | return _core_.Window_Lower(*args, **kwargs) |
e811c8ce RD |
8529 | |
8530 | def SetClientSize(*args, **kwargs): | |
15afbcd0 | 8531 | """ |
a95a7133 | 8532 | SetClientSize(self, Size size) |
15afbcd0 RD |
8533 | |
8534 | This sets the size of the window client area in pixels. Using this | |
8535 | function to size a window tends to be more device-independent than | |
8536 | wx.Window.SetSize, since the application need not worry about what | |
8537 | dimensions the border or title bar have when trying to fit the window | |
8538 | around panel items, for example. | |
8539 | """ | |
54f9ee45 | 8540 | return _core_.Window_SetClientSize(*args, **kwargs) |
e811c8ce RD |
8541 | |
8542 | def SetClientSizeWH(*args, **kwargs): | |
15afbcd0 | 8543 | """ |
a95a7133 | 8544 | SetClientSizeWH(self, int width, int height) |
15afbcd0 RD |
8545 | |
8546 | This sets the size of the window client area in pixels. Using this | |
8547 | function to size a window tends to be more device-independent than | |
8548 | wx.Window.SetSize, since the application need not worry about what | |
8549 | dimensions the border or title bar have when trying to fit the window | |
8550 | around panel items, for example. | |
8551 | """ | |
54f9ee45 | 8552 | return _core_.Window_SetClientSizeWH(*args, **kwargs) |
e811c8ce RD |
8553 | |
8554 | def SetClientRect(*args, **kwargs): | |
15afbcd0 | 8555 | """ |
a95a7133 | 8556 | SetClientRect(self, Rect rect) |
15afbcd0 RD |
8557 | |
8558 | This sets the size of the window client area in pixels. Using this | |
8559 | function to size a window tends to be more device-independent than | |
8560 | wx.Window.SetSize, since the application need not worry about what | |
8561 | dimensions the border or title bar have when trying to fit the window | |
8562 | around panel items, for example. | |
8563 | """ | |
54f9ee45 | 8564 | return _core_.Window_SetClientRect(*args, **kwargs) |
e811c8ce RD |
8565 | |
8566 | def GetPosition(*args, **kwargs): | |
0df68c9f | 8567 | """ |
a95a7133 | 8568 | GetPosition(self) -> Point |
e811c8ce | 8569 | |
75219dcb RD |
8570 | Get the window's position. Notice that the position is in client |
8571 | coordinates for child windows and screen coordinates for the top level | |
8572 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
8573 | kinds of windows. | |
0df68c9f | 8574 | """ |
54f9ee45 | 8575 | return _core_.Window_GetPosition(*args, **kwargs) |
e811c8ce RD |
8576 | |
8577 | def GetPositionTuple(*args, **kwargs): | |
0df68c9f RD |
8578 | """ |
8579 | GetPositionTuple() -> (x,y) | |
e811c8ce | 8580 | |
75219dcb RD |
8581 | Get the window's position. Notice that the position is in client |
8582 | coordinates for child windows and screen coordinates for the top level | |
8583 | ones, use `GetScreenPosition` if you need screen coordinates for all | |
8584 | kinds of windows. | |
0df68c9f | 8585 | """ |
54f9ee45 | 8586 | return _core_.Window_GetPositionTuple(*args, **kwargs) |
e811c8ce | 8587 | |
75219dcb RD |
8588 | def GetScreenPosition(*args, **kwargs): |
8589 | """ | |
8590 | GetScreenPosition(self) -> Point | |
8591 | ||
8592 | Get the position of the window in screen coordinantes. | |
8593 | """ | |
8594 | return _core_.Window_GetScreenPosition(*args, **kwargs) | |
8595 | ||
8596 | def GetScreenPositionTuple(*args, **kwargs): | |
8597 | """ | |
8598 | GetScreenPositionTuple() -> (x,y) | |
8599 | ||
8600 | Get the position of the window in screen coordinantes. | |
8601 | """ | |
8602 | return _core_.Window_GetScreenPositionTuple(*args, **kwargs) | |
8603 | ||
8604 | def GetScreenRect(*args, **kwargs): | |
8605 | """ | |
8606 | GetScreenRect(self) -> Rect | |
8607 | ||
8608 | Returns the size and position of the window in screen coordinantes as | |
8609 | a `wx.Rect` object. | |
8610 | """ | |
8611 | return _core_.Window_GetScreenRect(*args, **kwargs) | |
8612 | ||
e811c8ce | 8613 | def GetSize(*args, **kwargs): |
0df68c9f | 8614 | """ |
a95a7133 | 8615 | GetSize(self) -> Size |
e811c8ce | 8616 | |
0df68c9f RD |
8617 | Get the window size. |
8618 | """ | |
54f9ee45 | 8619 | return _core_.Window_GetSize(*args, **kwargs) |
e811c8ce RD |
8620 | |
8621 | def GetSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8622 | """ |
8623 | GetSizeTuple() -> (width, height) | |
e811c8ce | 8624 | |
0df68c9f RD |
8625 | Get the window size. |
8626 | """ | |
54f9ee45 | 8627 | return _core_.Window_GetSizeTuple(*args, **kwargs) |
e811c8ce RD |
8628 | |
8629 | def GetRect(*args, **kwargs): | |
15afbcd0 | 8630 | """ |
a95a7133 | 8631 | GetRect(self) -> Rect |
15afbcd0 | 8632 | |
75219dcb | 8633 | Returns the size and position of the window as a `wx.Rect` object. |
15afbcd0 | 8634 | """ |
54f9ee45 | 8635 | return _core_.Window_GetRect(*args, **kwargs) |
e811c8ce RD |
8636 | |
8637 | def GetClientSize(*args, **kwargs): | |
0df68c9f | 8638 | """ |
a95a7133 | 8639 | GetClientSize(self) -> Size |
e811c8ce | 8640 | |
15afbcd0 RD |
8641 | This gets the size of the window's 'client area' in pixels. The client |
8642 | area is the area which may be drawn on by the programmer, excluding | |
8643 | title bar, border, scrollbars, etc. | |
0df68c9f | 8644 | """ |
54f9ee45 | 8645 | return _core_.Window_GetClientSize(*args, **kwargs) |
e811c8ce RD |
8646 | |
8647 | def GetClientSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8648 | """ |
8649 | GetClientSizeTuple() -> (width, height) | |
e811c8ce | 8650 | |
15afbcd0 RD |
8651 | This gets the size of the window's 'client area' in pixels. The client |
8652 | area is the area which may be drawn on by the programmer, excluding | |
8653 | title bar, border, scrollbars, etc. | |
0df68c9f | 8654 | """ |
54f9ee45 | 8655 | return _core_.Window_GetClientSizeTuple(*args, **kwargs) |
e811c8ce RD |
8656 | |
8657 | def GetClientAreaOrigin(*args, **kwargs): | |
15afbcd0 | 8658 | """ |
a95a7133 | 8659 | GetClientAreaOrigin(self) -> Point |
15afbcd0 RD |
8660 | |
8661 | Get the origin of the client area of the window relative to the | |
8662 | window's top left corner (the client area may be shifted because of | |
8663 | the borders, scrollbars, other decorations...) | |
8664 | """ | |
54f9ee45 | 8665 | return _core_.Window_GetClientAreaOrigin(*args, **kwargs) |
e811c8ce RD |
8666 | |
8667 | def GetClientRect(*args, **kwargs): | |
15afbcd0 | 8668 | """ |
a95a7133 | 8669 | GetClientRect(self) -> Rect |
15afbcd0 | 8670 | |
61863841 | 8671 | Get the client area position and size as a `wx.Rect` object. |
15afbcd0 | 8672 | """ |
54f9ee45 | 8673 | return _core_.Window_GetClientRect(*args, **kwargs) |
e811c8ce RD |
8674 | |
8675 | def GetBestSize(*args, **kwargs): | |
0df68c9f | 8676 | """ |
a95a7133 | 8677 | GetBestSize(self) -> Size |
e811c8ce | 8678 | |
248ed943 | 8679 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8680 | window, if applicable. For example, for a static text control, it will |
8681 | be the minimal size such that the control label is not truncated. For | |
8682 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8683 | this function will be the same as the size the window would have had | |
8684 | after calling Fit. | |
0df68c9f | 8685 | """ |
54f9ee45 | 8686 | return _core_.Window_GetBestSize(*args, **kwargs) |
e811c8ce RD |
8687 | |
8688 | def GetBestSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8689 | """ |
8690 | GetBestSizeTuple() -> (width, height) | |
e811c8ce | 8691 | |
248ed943 | 8692 | This function returns the best acceptable minimal size for the |
41e2b43e RD |
8693 | window, if applicable. For example, for a static text control, it will |
8694 | be the minimal size such that the control label is not truncated. For | |
8695 | windows containing subwindows (suzh aswx.Panel), the size returned by | |
8696 | this function will be the same as the size the window would have had | |
8697 | after calling Fit. | |
0df68c9f | 8698 | """ |
54f9ee45 | 8699 | return _core_.Window_GetBestSizeTuple(*args, **kwargs) |
e811c8ce | 8700 | |
dfbb5885 RD |
8701 | def InvalidateBestSize(*args, **kwargs): |
8702 | """ | |
8703 | InvalidateBestSize(self) | |
8704 | ||
8705 | Reset the cached best size value so it will be recalculated the next | |
8706 | time it is needed. | |
8707 | """ | |
8708 | return _core_.Window_InvalidateBestSize(*args, **kwargs) | |
8709 | ||
e2813725 RD |
8710 | def CacheBestSize(*args, **kwargs): |
8711 | """ | |
8712 | CacheBestSize(self, Size size) | |
8713 | ||
8714 | Cache the best size so it doesn't need to be calculated again, (at least until | |
8715 | some properties of the window change.) | |
8716 | """ | |
8717 | return _core_.Window_CacheBestSize(*args, **kwargs) | |
8718 | ||
580080c5 | 8719 | def GetEffectiveMinSize(*args, **kwargs): |
dfbb5885 | 8720 | """ |
580080c5 | 8721 | GetEffectiveMinSize(self) -> Size |
dfbb5885 RD |
8722 | |
8723 | This function will merge the window's best size into the window's | |
8724 | minimum size, giving priority to the min size components, and returns | |
8725 | the results. | |
8726 | ||
8727 | """ | |
580080c5 | 8728 | return _core_.Window_GetEffectiveMinSize(*args, **kwargs) |
dfbb5885 | 8729 | |
0d82d64e | 8730 | GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.') |
8f514ab4 RD |
8731 | def GetAdjustedBestSize(self): |
8732 | s = self.GetBestSize() | |
8733 | return wx.Size(max(s.width, self.GetMinWidth()), | |
8734 | max(s.height, self.GetMinHeight())) | |
580080c5 | 8735 | GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.') |
e811c8ce RD |
8736 | |
8737 | def Center(*args, **kwargs): | |
15afbcd0 | 8738 | """ |
a95a7133 | 8739 | Center(self, int direction=BOTH) |
15afbcd0 RD |
8740 | |
8741 | Centers the window. The parameter specifies the direction for | |
8742 | cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may | |
8743 | also include wx.CENTER_ON_SCREEN flag if you want to center the window | |
8744 | on the entire screen and not on its parent window. If it is a | |
8745 | top-level window and has no parent then it will always be centered | |
8746 | relative to the screen. | |
8747 | """ | |
54f9ee45 | 8748 | return _core_.Window_Center(*args, **kwargs) |
e811c8ce RD |
8749 | |
8750 | Centre = Center | |
e811c8ce | 8751 | def CenterOnParent(*args, **kwargs): |
15afbcd0 | 8752 | """ |
a95a7133 | 8753 | CenterOnParent(self, int dir=BOTH) |
15afbcd0 RD |
8754 | |
8755 | Center with respect to the the parent window | |
8756 | """ | |
54f9ee45 | 8757 | return _core_.Window_CenterOnParent(*args, **kwargs) |
e811c8ce RD |
8758 | |
8759 | CentreOnParent = CenterOnParent | |
8760 | def Fit(*args, **kwargs): | |
15afbcd0 | 8761 | """ |
a95a7133 | 8762 | Fit(self) |
15afbcd0 RD |
8763 | |
8764 | Sizes the window so that it fits around its subwindows. This function | |
8765 | won't do anything if there are no subwindows and will only really work | |
8766 | correctly if sizers are used for the subwindows layout. Also, if the | |
8767 | window has exactly one subwindow it is better (faster and the result | |
8768 | is more precise as Fit adds some margin to account for fuzziness of | |
8769 | its calculations) to call window.SetClientSize(child.GetSize()) | |
8770 | instead of calling Fit. | |
8771 | """ | |
54f9ee45 | 8772 | return _core_.Window_Fit(*args, **kwargs) |
e811c8ce RD |
8773 | |
8774 | def FitInside(*args, **kwargs): | |
15afbcd0 | 8775 | """ |
a95a7133 | 8776 | FitInside(self) |
15afbcd0 RD |
8777 | |
8778 | Similar to Fit, but sizes the interior (virtual) size of a | |
8779 | window. Mainly useful with scrolled windows to reset scrollbars after | |
8780 | sizing changes that do not trigger a size event, and/or scrolled | |
8781 | windows without an interior sizer. This function similarly won't do | |
8782 | anything if there are no subwindows. | |
8783 | """ | |
54f9ee45 | 8784 | return _core_.Window_FitInside(*args, **kwargs) |
e811c8ce | 8785 | |
f16ab95d | 8786 | def SetSizeHints(*args, **kwargs): |
0df68c9f | 8787 | """ |
a95a7133 | 8788 | SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, |
0df68c9f | 8789 | int incH=-1) |
15afbcd0 RD |
8790 | |
8791 | Allows specification of minimum and maximum window sizes, and window | |
8792 | size increments. If a pair of values is not set (or set to -1), the | |
8793 | default values will be used. If this function is called, the user | |
908b74cd RD |
8794 | will not be able to size the window outside the given bounds (if it is |
8795 | a top-level window.) Sizers will also inspect the minimum window size | |
8796 | and will use that value if set when calculating layout. | |
8797 | ||
8798 | The resizing increments are only significant under Motif or Xt. | |
0df68c9f | 8799 | """ |
f16ab95d | 8800 | return _core_.Window_SetSizeHints(*args, **kwargs) |
e811c8ce | 8801 | |
f16ab95d RD |
8802 | def SetSizeHintsSz(*args, **kwargs): |
8803 | """ | |
8804 | SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) | |
8805 | ||
8806 | Allows specification of minimum and maximum window sizes, and window | |
8807 | size increments. If a pair of values is not set (or set to -1), the | |
8808 | default values will be used. If this function is called, the user | |
8809 | will not be able to size the window outside the given bounds (if it is | |
8810 | a top-level window.) Sizers will also inspect the minimum window size | |
8811 | and will use that value if set when calculating layout. | |
8812 | ||
8813 | The resizing increments are only significant under Motif or Xt. | |
8814 | """ | |
8815 | return _core_.Window_SetSizeHintsSz(*args, **kwargs) | |
8816 | ||
8817 | def SetVirtualSizeHints(*args, **kwargs): | |
15afbcd0 | 8818 | """ |
908b74cd | 8819 | SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1) |
15afbcd0 RD |
8820 | |
8821 | Allows specification of minimum and maximum virtual window sizes. If a | |
8822 | pair of values is not set (or set to -1), the default values will be | |
8823 | used. If this function is called, the user will not be able to size | |
8824 | the virtual area of the window outside the given bounds. | |
8825 | """ | |
f16ab95d RD |
8826 | return _core_.Window_SetVirtualSizeHints(*args, **kwargs) |
8827 | ||
8828 | def SetVirtualSizeHintsSz(*args, **kwargs): | |
8829 | """ | |
8830 | SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize) | |
8831 | ||
8832 | Allows specification of minimum and maximum virtual window sizes. If a | |
8833 | pair of values is not set (or set to -1), the default values will be | |
8834 | used. If this function is called, the user will not be able to size | |
8835 | the virtual area of the window outside the given bounds. | |
8836 | """ | |
8837 | return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs) | |
e811c8ce | 8838 | |
908b74cd RD |
8839 | def GetMaxSize(*args, **kwargs): |
8840 | """GetMaxSize(self) -> Size""" | |
8841 | return _core_.Window_GetMaxSize(*args, **kwargs) | |
8842 | ||
8843 | def GetMinSize(*args, **kwargs): | |
8844 | """GetMinSize(self) -> Size""" | |
8845 | return _core_.Window_GetMinSize(*args, **kwargs) | |
8846 | ||
8847 | def SetMinSize(*args, **kwargs): | |
8848 | """ | |
8849 | SetMinSize(self, Size minSize) | |
8850 | ||
8851 | A more convenient method than `SetSizeHints` for setting just the | |
8852 | min size. | |
8853 | """ | |
8854 | return _core_.Window_SetMinSize(*args, **kwargs) | |
8855 | ||
8856 | def SetMaxSize(*args, **kwargs): | |
8857 | """ | |
8858 | SetMaxSize(self, Size maxSize) | |
8859 | ||
8860 | A more convenient method than `SetSizeHints` for setting just the | |
8861 | max size. | |
8862 | """ | |
8863 | return _core_.Window_SetMaxSize(*args, **kwargs) | |
8864 | ||
e811c8ce | 8865 | def GetMinWidth(*args, **kwargs): |
a95a7133 | 8866 | """GetMinWidth(self) -> int""" |
54f9ee45 | 8867 | return _core_.Window_GetMinWidth(*args, **kwargs) |
e811c8ce RD |
8868 | |
8869 | def GetMinHeight(*args, **kwargs): | |
a95a7133 | 8870 | """GetMinHeight(self) -> int""" |
54f9ee45 | 8871 | return _core_.Window_GetMinHeight(*args, **kwargs) |
e811c8ce RD |
8872 | |
8873 | def GetMaxWidth(*args, **kwargs): | |
a95a7133 | 8874 | """GetMaxWidth(self) -> int""" |
54f9ee45 | 8875 | return _core_.Window_GetMaxWidth(*args, **kwargs) |
e811c8ce RD |
8876 | |
8877 | def GetMaxHeight(*args, **kwargs): | |
a95a7133 | 8878 | """GetMaxHeight(self) -> int""" |
54f9ee45 | 8879 | return _core_.Window_GetMaxHeight(*args, **kwargs) |
e811c8ce | 8880 | |
e811c8ce | 8881 | def SetVirtualSize(*args, **kwargs): |
0df68c9f | 8882 | """ |
a95a7133 | 8883 | SetVirtualSize(self, Size size) |
e811c8ce | 8884 | |
15afbcd0 RD |
8885 | Set the the virtual size of a window in pixels. For most windows this |
8886 | is just the client area of the window, but for some like scrolled | |
8887 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8888 | """ |
54f9ee45 | 8889 | return _core_.Window_SetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8890 | |
8891 | def SetVirtualSizeWH(*args, **kwargs): | |
0df68c9f | 8892 | """ |
a95a7133 | 8893 | SetVirtualSizeWH(self, int w, int h) |
e811c8ce | 8894 | |
15afbcd0 RD |
8895 | Set the the virtual size of a window in pixels. For most windows this |
8896 | is just the client area of the window, but for some like scrolled | |
8897 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8898 | """ |
54f9ee45 | 8899 | return _core_.Window_SetVirtualSizeWH(*args, **kwargs) |
e811c8ce RD |
8900 | |
8901 | def GetVirtualSize(*args, **kwargs): | |
0df68c9f | 8902 | """ |
a95a7133 | 8903 | GetVirtualSize(self) -> Size |
e811c8ce | 8904 | |
15afbcd0 RD |
8905 | Get the the virtual size of the window in pixels. For most windows |
8906 | this is just the client area of the window, but for some like scrolled | |
8907 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8908 | """ |
54f9ee45 | 8909 | return _core_.Window_GetVirtualSize(*args, **kwargs) |
e811c8ce RD |
8910 | |
8911 | def GetVirtualSizeTuple(*args, **kwargs): | |
0df68c9f RD |
8912 | """ |
8913 | GetVirtualSizeTuple() -> (width, height) | |
e811c8ce | 8914 | |
15afbcd0 RD |
8915 | Get the the virtual size of the window in pixels. For most windows |
8916 | this is just the client area of the window, but for some like scrolled | |
8917 | windows it is more or less independent of the screen window size. | |
0df68c9f | 8918 | """ |
54f9ee45 | 8919 | return _core_.Window_GetVirtualSizeTuple(*args, **kwargs) |
e811c8ce | 8920 | |
cbdf0fb0 RD |
8921 | def GetWindowBorderSize(*args, **kwargs): |
8922 | """ | |
8923 | GetWindowBorderSize(self) -> Size | |
8924 | ||
8925 | Return the size of the left/right and top/bottom borders. | |
8926 | """ | |
8927 | return _core_.Window_GetWindowBorderSize(*args, **kwargs) | |
8928 | ||
e811c8ce | 8929 | def GetBestVirtualSize(*args, **kwargs): |
15afbcd0 | 8930 | """ |
a95a7133 | 8931 | GetBestVirtualSize(self) -> Size |
15afbcd0 RD |
8932 | |
8933 | Return the largest of ClientSize and BestSize (as determined by a | |
8934 | sizer, interior children, or other means) | |
8935 | """ | |
54f9ee45 | 8936 | return _core_.Window_GetBestVirtualSize(*args, **kwargs) |
e811c8ce RD |
8937 | |
8938 | def Show(*args, **kwargs): | |
15afbcd0 | 8939 | """ |
a95a7133 | 8940 | Show(self, bool show=True) -> bool |
15afbcd0 RD |
8941 | |
8942 | Shows or hides the window. You may need to call Raise for a top level | |
8943 | window if you want to bring it to top, although this is not needed if | |
8944 | Show is called immediately after the frame creation. Returns True if | |
8945 | the window has been shown or hidden or False if nothing was done | |
8946 | because it already was in the requested state. | |
8947 | """ | |
54f9ee45 | 8948 | return _core_.Window_Show(*args, **kwargs) |
e811c8ce RD |
8949 | |
8950 | def Hide(*args, **kwargs): | |
15afbcd0 | 8951 | """ |
a95a7133 | 8952 | Hide(self) -> bool |
15afbcd0 RD |
8953 | |
8954 | Equivalent to calling Show(False). | |
8955 | """ | |
54f9ee45 | 8956 | return _core_.Window_Hide(*args, **kwargs) |
e811c8ce RD |
8957 | |
8958 | def Enable(*args, **kwargs): | |
15afbcd0 | 8959 | """ |
a95a7133 | 8960 | Enable(self, bool enable=True) -> bool |
15afbcd0 RD |
8961 | |
8962 | Enable or disable the window for user input. Note that when a parent | |
8963 | window is disabled, all of its children are disabled as well and they | |
8964 | are reenabled again when the parent is. Returns true if the window | |
8965 | has been enabled or disabled, false if nothing was done, i.e. if the | |
8966 | window had already been in the specified state. | |
8967 | """ | |
54f9ee45 | 8968 | return _core_.Window_Enable(*args, **kwargs) |
e811c8ce RD |
8969 | |
8970 | def Disable(*args, **kwargs): | |
15afbcd0 | 8971 | """ |
a95a7133 | 8972 | Disable(self) -> bool |
15afbcd0 RD |
8973 | |
8974 | Disables the window, same as Enable(false). | |
8975 | """ | |
54f9ee45 | 8976 | return _core_.Window_Disable(*args, **kwargs) |
e811c8ce RD |
8977 | |
8978 | def IsShown(*args, **kwargs): | |
15afbcd0 | 8979 | """ |
a95a7133 | 8980 | IsShown(self) -> bool |
15afbcd0 RD |
8981 | |
8982 | Returns true if the window is shown, false if it has been hidden. | |
8983 | """ | |
54f9ee45 | 8984 | return _core_.Window_IsShown(*args, **kwargs) |
e811c8ce RD |
8985 | |
8986 | def IsEnabled(*args, **kwargs): | |
15afbcd0 | 8987 | """ |
a95a7133 | 8988 | IsEnabled(self) -> bool |
15afbcd0 RD |
8989 | |
8990 | Returns true if the window is enabled for input, false otherwise. | |
cbfc9df6 RD |
8991 | This method takes into account the enabled state of parent windows up |
8992 | to the top-level window. | |
15afbcd0 | 8993 | """ |
54f9ee45 | 8994 | return _core_.Window_IsEnabled(*args, **kwargs) |
e811c8ce | 8995 | |
cbfc9df6 RD |
8996 | def IsThisEnabled(*args, **kwargs): |
8997 | """ | |
8998 | IsThisEnabled(self) -> bool | |
8999 | ||
9000 | Returns the internal enabled state independent of the parent(s) state, | |
9001 | i.e. the state in which the window would be if all of its parents are | |
9002 | enabled. Use `IsEnabled` to get the effective window state. | |
9003 | """ | |
9004 | return _core_.Window_IsThisEnabled(*args, **kwargs) | |
9005 | ||
33d6fd3b RD |
9006 | def IsShownOnScreen(*args, **kwargs): |
9007 | """ | |
9008 | IsShownOnScreen(self) -> bool | |
9009 | ||
9010 | Returns ``True`` if the window is physically visible on the screen, | |
9011 | i.e. it is shown and all its parents up to the toplevel window are | |
9012 | shown as well. | |
9013 | """ | |
9014 | return _core_.Window_IsShownOnScreen(*args, **kwargs) | |
9015 | ||
e811c8ce | 9016 | def SetWindowStyleFlag(*args, **kwargs): |
15afbcd0 | 9017 | """ |
a95a7133 | 9018 | SetWindowStyleFlag(self, long style) |
15afbcd0 | 9019 | |
41e2b43e RD |
9020 | Sets the style of the window. Please note that some styles cannot be |
9021 | changed after the window creation and that Refresh() might need to be | |
9022 | called after changing the others for the change to take place | |
9023 | immediately. | |
15afbcd0 | 9024 | """ |
54f9ee45 | 9025 | return _core_.Window_SetWindowStyleFlag(*args, **kwargs) |
e811c8ce RD |
9026 | |
9027 | def GetWindowStyleFlag(*args, **kwargs): | |
15afbcd0 | 9028 | """ |
a95a7133 | 9029 | GetWindowStyleFlag(self) -> long |
e811c8ce | 9030 | |
15afbcd0 RD |
9031 | Gets the window style that was passed to the constructor or Create |
9032 | method. | |
9033 | """ | |
54f9ee45 | 9034 | return _core_.Window_GetWindowStyleFlag(*args, **kwargs) |
e811c8ce | 9035 | |
15afbcd0 | 9036 | SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag |
e811c8ce | 9037 | def HasFlag(*args, **kwargs): |
15afbcd0 | 9038 | """ |
a95a7133 | 9039 | HasFlag(self, int flag) -> bool |
15afbcd0 RD |
9040 | |
9041 | Test if the given style is set for this window. | |
9042 | """ | |
54f9ee45 | 9043 | return _core_.Window_HasFlag(*args, **kwargs) |
e811c8ce RD |
9044 | |
9045 | def IsRetained(*args, **kwargs): | |
15afbcd0 | 9046 | """ |
a95a7133 | 9047 | IsRetained(self) -> bool |
15afbcd0 RD |
9048 | |
9049 | Returns true if the window is retained, false otherwise. Retained | |
9050 | windows are only available on X platforms. | |
9051 | """ | |
54f9ee45 | 9052 | return _core_.Window_IsRetained(*args, **kwargs) |
e811c8ce | 9053 | |
5917d041 RD |
9054 | def ToggleWindowStyle(*args, **kwargs): |
9055 | """ | |
9056 | ToggleWindowStyle(self, int flag) -> bool | |
9057 | ||
9058 | Turn the flag on if it had been turned off before and vice versa, | |
9059 | returns True if the flag is turned on by this function call. | |
9060 | """ | |
9061 | return _core_.Window_ToggleWindowStyle(*args, **kwargs) | |
9062 | ||
e811c8ce | 9063 | def SetExtraStyle(*args, **kwargs): |
15afbcd0 | 9064 | """ |
a95a7133 | 9065 | SetExtraStyle(self, long exStyle) |
15afbcd0 RD |
9066 | |
9067 | Sets the extra style bits for the window. Extra styles are the less | |
9068 | often used style bits which can't be set with the constructor or with | |
9069 | SetWindowStyleFlag() | |
9070 | """ | |
54f9ee45 | 9071 | return _core_.Window_SetExtraStyle(*args, **kwargs) |
e811c8ce RD |
9072 | |
9073 | def GetExtraStyle(*args, **kwargs): | |
15afbcd0 | 9074 | """ |
a95a7133 | 9075 | GetExtraStyle(self) -> long |
15afbcd0 RD |
9076 | |
9077 | Returns the extra style bits for the window. | |
9078 | """ | |
54f9ee45 | 9079 | return _core_.Window_GetExtraStyle(*args, **kwargs) |
e811c8ce | 9080 | |
da9714b5 RD |
9081 | def HasExtraStyle(*args, **kwargs): |
9082 | """ | |
9083 | HasExtraStyle(self, int exFlag) -> bool | |
9084 | ||
9085 | Returns ``True`` if the given extra flag is set. | |
9086 | """ | |
9087 | return _core_.Window_HasExtraStyle(*args, **kwargs) | |
9088 | ||
e811c8ce | 9089 | def MakeModal(*args, **kwargs): |
15afbcd0 | 9090 | """ |
a95a7133 | 9091 | MakeModal(self, bool modal=True) |
15afbcd0 RD |
9092 | |
9093 | Disables all other windows in the application so that the user can | |
9094 | only interact with this window. Passing False will reverse this | |
9095 | effect. | |
9096 | """ | |
54f9ee45 | 9097 | return _core_.Window_MakeModal(*args, **kwargs) |
e811c8ce RD |
9098 | |
9099 | def SetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 9100 | """ |
a95a7133 | 9101 | SetThemeEnabled(self, bool enableTheme) |
15afbcd0 RD |
9102 | |
9103 | This function tells a window if it should use the system's "theme" | |
9104 | code to draw the windows' background instead if its own background | |
9105 | drawing code. This will only have an effect on platforms that support | |
9106 | the notion of themes in user defined windows. One such platform is | |
9107 | GTK+ where windows can have (very colourful) backgrounds defined by a | |
9108 | user's selected theme. | |
9109 | ||
9110 | Dialogs, notebook pages and the status bar have this flag set to true | |
9111 | by default so that the default look and feel is simulated best. | |
9112 | """ | |
54f9ee45 | 9113 | return _core_.Window_SetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
9114 | |
9115 | def GetThemeEnabled(*args, **kwargs): | |
15afbcd0 | 9116 | """ |
a95a7133 | 9117 | GetThemeEnabled(self) -> bool |
e811c8ce | 9118 | |
15afbcd0 RD |
9119 | Return the themeEnabled flag. |
9120 | """ | |
54f9ee45 | 9121 | return _core_.Window_GetThemeEnabled(*args, **kwargs) |
e811c8ce RD |
9122 | |
9123 | def SetFocus(*args, **kwargs): | |
15afbcd0 | 9124 | """ |
a95a7133 | 9125 | SetFocus(self) |
15afbcd0 RD |
9126 | |
9127 | Set's the focus to this window, allowing it to receive keyboard input. | |
9128 | """ | |
54f9ee45 | 9129 | return _core_.Window_SetFocus(*args, **kwargs) |
e811c8ce RD |
9130 | |
9131 | def SetFocusFromKbd(*args, **kwargs): | |
15afbcd0 | 9132 | """ |
a95a7133 | 9133 | SetFocusFromKbd(self) |
15afbcd0 RD |
9134 | |
9135 | Set focus to this window as the result of a keyboard action. Normally | |
9136 | only called internally. | |
9137 | """ | |
54f9ee45 | 9138 | return _core_.Window_SetFocusFromKbd(*args, **kwargs) |
e811c8ce RD |
9139 | |
9140 | def FindFocus(*args, **kwargs): | |
15afbcd0 | 9141 | """ |
66c033b4 | 9142 | FindFocus() -> Window |
15afbcd0 RD |
9143 | |
9144 | Returns the window or control that currently has the keyboard focus, | |
9145 | or None. | |
9146 | """ | |
54f9ee45 | 9147 | return _core_.Window_FindFocus(*args, **kwargs) |
e811c8ce RD |
9148 | |
9149 | FindFocus = staticmethod(FindFocus) | |
9150 | def AcceptsFocus(*args, **kwargs): | |
15afbcd0 | 9151 | """ |
a95a7133 | 9152 | AcceptsFocus(self) -> bool |
15afbcd0 RD |
9153 | |
9154 | Can this window have focus? | |
9155 | """ | |
54f9ee45 | 9156 | return _core_.Window_AcceptsFocus(*args, **kwargs) |
e811c8ce | 9157 | |
cbfc9df6 RD |
9158 | def CanAcceptFocus(*args, **kwargs): |
9159 | """ | |
9160 | CanAcceptFocus(self) -> bool | |
9161 | ||
9162 | Can this window have focus right now? | |
9163 | """ | |
9164 | return _core_.Window_CanAcceptFocus(*args, **kwargs) | |
9165 | ||
e811c8ce | 9166 | def AcceptsFocusFromKeyboard(*args, **kwargs): |
15afbcd0 | 9167 | """ |
a95a7133 | 9168 | AcceptsFocusFromKeyboard(self) -> bool |
15afbcd0 RD |
9169 | |
9170 | Can this window be given focus by keyboard navigation? if not, the | |
9171 | only way to give it focus (provided it accepts it at all) is to click | |
9172 | it. | |
9173 | """ | |
54f9ee45 | 9174 | return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs) |
e811c8ce | 9175 | |
cbfc9df6 RD |
9176 | def CanAcceptFocusFromKeyboard(*args, **kwargs): |
9177 | """ | |
9178 | CanAcceptFocusFromKeyboard(self) -> bool | |
9179 | ||
9180 | Can this window be assigned focus from keyboard right now? | |
9181 | """ | |
9182 | return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs) | |
9183 | ||
8c3a7183 RD |
9184 | def SetCanFocus(*args, **kwargs): |
9185 | """SetCanFocus(self, bool canFocus)""" | |
9186 | return _core_.Window_SetCanFocus(*args, **kwargs) | |
9187 | ||
ddeca22c RD |
9188 | def NavigateIn(*args, **kwargs): |
9189 | """ | |
9190 | NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
9191 | ||
9192 | Navigates inside this window. | |
9193 | """ | |
9194 | return _core_.Window_NavigateIn(*args, **kwargs) | |
9195 | ||
908b74cd RD |
9196 | def Navigate(*args, **kwargs): |
9197 | """ | |
9198 | Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool | |
9199 | ||
ddeca22c RD |
9200 | Does keyboard navigation starting from this window to another. This is |
9201 | equivalient to self.GetParent().NavigateIn(). | |
908b74cd RD |
9202 | """ |
9203 | return _core_.Window_Navigate(*args, **kwargs) | |
9204 | ||
7f98d120 RD |
9205 | def MoveAfterInTabOrder(*args, **kwargs): |
9206 | """ | |
9207 | MoveAfterInTabOrder(self, Window win) | |
9208 | ||
9209 | Moves this window in the tab navigation order after the specified | |
9210 | sibling window. This means that when the user presses the TAB key on | |
9211 | that other window, the focus switches to this window. | |
9212 | ||
9213 | The default tab order is the same as creation order. This function | |
9214 | and `MoveBeforeInTabOrder` allow to change it after creating all the | |
9215 | windows. | |
9216 | ||
9217 | """ | |
9218 | return _core_.Window_MoveAfterInTabOrder(*args, **kwargs) | |
9219 | ||
9220 | def MoveBeforeInTabOrder(*args, **kwargs): | |
9221 | """ | |
9222 | MoveBeforeInTabOrder(self, Window win) | |
9223 | ||
9224 | Same as `MoveAfterInTabOrder` except that it inserts this window just | |
9225 | before win instead of putting it right after it. | |
9226 | """ | |
9227 | return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs) | |
9228 | ||
e811c8ce | 9229 | def GetChildren(*args, **kwargs): |
15afbcd0 | 9230 | """ |
a95a7133 | 9231 | GetChildren(self) -> PyObject |
15afbcd0 RD |
9232 | |
9233 | Returns a list of the window's children. NOTE: Currently this is a | |
9234 | copy of the child window list maintained by the window, so the return | |
9235 | value of this function is only valid as long as the window's children | |
9236 | do not change. | |
9237 | """ | |
54f9ee45 | 9238 | return _core_.Window_GetChildren(*args, **kwargs) |
e811c8ce RD |
9239 | |
9240 | def GetParent(*args, **kwargs): | |
15afbcd0 | 9241 | """ |
a95a7133 | 9242 | GetParent(self) -> Window |
15afbcd0 RD |
9243 | |
9244 | Returns the parent window of this window, or None if there isn't one. | |
9245 | """ | |
54f9ee45 | 9246 | return _core_.Window_GetParent(*args, **kwargs) |
e811c8ce RD |
9247 | |
9248 | def GetGrandParent(*args, **kwargs): | |
15afbcd0 | 9249 | """ |
a95a7133 | 9250 | GetGrandParent(self) -> Window |
15afbcd0 | 9251 | |
41e2b43e RD |
9252 | Returns the parent of the parent of this window, or None if there |
9253 | isn't one. | |
15afbcd0 | 9254 | """ |
54f9ee45 | 9255 | return _core_.Window_GetGrandParent(*args, **kwargs) |
e811c8ce | 9256 | |
cbfc9df6 RD |
9257 | def GetTopLevelParent(*args, **kwargs): |
9258 | """ | |
9259 | GetTopLevelParent(self) -> Window | |
9260 | ||
9261 | Returns the first frame or dialog in this window's parental hierarchy. | |
9262 | """ | |
9263 | return _core_.Window_GetTopLevelParent(*args, **kwargs) | |
9264 | ||
e811c8ce | 9265 | def IsTopLevel(*args, **kwargs): |
15afbcd0 | 9266 | """ |
a95a7133 | 9267 | IsTopLevel(self) -> bool |
15afbcd0 RD |
9268 | |
9269 | Returns true if the given window is a top-level one. Currently all | |
9270 | frames and dialogs are always considered to be top-level windows (even | |
9271 | if they have a parent window). | |
9272 | """ | |
54f9ee45 | 9273 | return _core_.Window_IsTopLevel(*args, **kwargs) |
e811c8ce RD |
9274 | |
9275 | def Reparent(*args, **kwargs): | |
15afbcd0 | 9276 | """ |
a95a7133 | 9277 | Reparent(self, Window newParent) -> bool |
15afbcd0 RD |
9278 | |
9279 | Reparents the window, i.e the window will be removed from its current | |
9280 | parent window (e.g. a non-standard toolbar in a wxFrame) and then | |
9281 | re-inserted into another. Available on Windows and GTK. Returns True | |
9282 | if the parent was changed, False otherwise (error or newParent == | |
9283 | oldParent) | |
9284 | """ | |
54f9ee45 | 9285 | return _core_.Window_Reparent(*args, **kwargs) |
e811c8ce RD |
9286 | |
9287 | def AddChild(*args, **kwargs): | |
15afbcd0 | 9288 | """ |
a95a7133 | 9289 | AddChild(self, Window child) |
15afbcd0 RD |
9290 | |
9291 | Adds a child window. This is called automatically by window creation | |
9292 | functions so should not be required by the application programmer. | |
9293 | """ | |
54f9ee45 | 9294 | return _core_.Window_AddChild(*args, **kwargs) |
e811c8ce RD |
9295 | |
9296 | def RemoveChild(*args, **kwargs): | |
15afbcd0 | 9297 | """ |
a95a7133 | 9298 | RemoveChild(self, Window child) |
15afbcd0 RD |
9299 | |
9300 | Removes a child window. This is called automatically by window | |
9301 | deletion functions so should not be required by the application | |
9302 | programmer. | |
9303 | """ | |
54f9ee45 | 9304 | return _core_.Window_RemoveChild(*args, **kwargs) |
e811c8ce | 9305 | |
704eda0c RD |
9306 | def SetDoubleBuffered(*args, **kwargs): |
9307 | """ | |
9308 | SetDoubleBuffered(self, bool on) | |
9309 | ||
9310 | Currently wxGTK2 only. | |
9311 | """ | |
9312 | return _core_.Window_SetDoubleBuffered(*args, **kwargs) | |
9313 | ||
e811c8ce | 9314 | def FindWindowById(*args, **kwargs): |
15afbcd0 | 9315 | """ |
a95a7133 | 9316 | FindWindowById(self, long winid) -> Window |
15afbcd0 RD |
9317 | |
9318 | Find a chld of this window by window ID | |
9319 | """ | |
54f9ee45 | 9320 | return _core_.Window_FindWindowById(*args, **kwargs) |
e811c8ce RD |
9321 | |
9322 | def FindWindowByName(*args, **kwargs): | |
15afbcd0 | 9323 | """ |
a95a7133 | 9324 | FindWindowByName(self, String name) -> Window |
15afbcd0 RD |
9325 | |
9326 | Find a child of this window by name | |
9327 | """ | |
54f9ee45 | 9328 | return _core_.Window_FindWindowByName(*args, **kwargs) |
e811c8ce RD |
9329 | |
9330 | def GetEventHandler(*args, **kwargs): | |
15afbcd0 | 9331 | """ |
a95a7133 | 9332 | GetEventHandler(self) -> EvtHandler |
15afbcd0 RD |
9333 | |
9334 | Returns the event handler for this window. By default, the window is | |
9335 | its own event handler. | |
9336 | """ | |
54f9ee45 | 9337 | return _core_.Window_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
9338 | |
9339 | def SetEventHandler(*args, **kwargs): | |
15afbcd0 | 9340 | """ |
a95a7133 | 9341 | SetEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
9342 | |
9343 | Sets the event handler for this window. An event handler is an object | |
d49bdf34 RD |
9344 | that is capable of processing the events sent to a window. (In other |
9345 | words, is able to dispatch the events to handler function.) By | |
9346 | default, the window is its own event handler, but an application may | |
9347 | wish to substitute another, for example to allow central | |
9348 | implementation of event-handling for a variety of different window | |
9349 | classes. | |
15afbcd0 | 9350 | |
41e2b43e | 9351 | It is usually better to use `wx.Window.PushEventHandler` since this sets |
15afbcd0 | 9352 | up a chain of event handlers, where an event not handled by one event |
d49bdf34 | 9353 | handler is handed off to the next one in the chain. |
15afbcd0 | 9354 | """ |
54f9ee45 | 9355 | return _core_.Window_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
9356 | |
9357 | def PushEventHandler(*args, **kwargs): | |
15afbcd0 | 9358 | """ |
a95a7133 | 9359 | PushEventHandler(self, EvtHandler handler) |
15afbcd0 RD |
9360 | |
9361 | Pushes this event handler onto the event handler stack for the window. | |
9362 | An event handler is an object that is capable of processing the events | |
0b0849b5 | 9363 | sent to a window. (In other words, is able to dispatch the events to a |
d49bdf34 RD |
9364 | handler function.) By default, the window is its own event handler, |
9365 | but an application may wish to substitute another, for example to | |
9366 | allow central implementation of event-handling for a variety of | |
9367 | different window classes. | |
15afbcd0 RD |
9368 | |
9369 | wx.Window.PushEventHandler allows an application to set up a chain of | |
9370 | event handlers, where an event not handled by one event handler is | |
d49bdf34 RD |
9371 | handed to the next one in the chain. Use `wx.Window.PopEventHandler` |
9372 | to remove the event handler. Ownership of the handler is *not* given | |
9373 | to the window, so you should be sure to pop the handler before the | |
9374 | window is destroyed and either let PopEventHandler destroy it, or call | |
9375 | its Destroy method yourself. | |
15afbcd0 | 9376 | """ |
54f9ee45 | 9377 | return _core_.Window_PushEventHandler(*args, **kwargs) |
e811c8ce RD |
9378 | |
9379 | def PopEventHandler(*args, **kwargs): | |
15afbcd0 | 9380 | """ |
a95a7133 | 9381 | PopEventHandler(self, bool deleteHandler=False) -> EvtHandler |
15afbcd0 RD |
9382 | |
9383 | Removes and returns the top-most event handler on the event handler | |
9384 | stack. If deleteHandler is True then the wx.EvtHandler object will be | |
d49bdf34 | 9385 | destroyed after it is popped, and ``None`` will be returned instead. |
15afbcd0 | 9386 | """ |
54f9ee45 | 9387 | return _core_.Window_PopEventHandler(*args, **kwargs) |
e811c8ce RD |
9388 | |
9389 | def RemoveEventHandler(*args, **kwargs): | |
15afbcd0 | 9390 | """ |
a95a7133 | 9391 | RemoveEventHandler(self, EvtHandler handler) -> bool |
15afbcd0 | 9392 | |
41e2b43e | 9393 | Find the given handler in the event handler chain and remove (but not |
d49bdf34 | 9394 | delete) it from the event handler chain, returns True if it was found |
41e2b43e RD |
9395 | and False otherwise (this also results in an assert failure so this |
9396 | function should only be called when the handler is supposed to be | |
9397 | there.) | |
15afbcd0 | 9398 | """ |
54f9ee45 | 9399 | return _core_.Window_RemoveEventHandler(*args, **kwargs) |
e811c8ce RD |
9400 | |
9401 | def SetValidator(*args, **kwargs): | |
15afbcd0 | 9402 | """ |
a95a7133 | 9403 | SetValidator(self, Validator validator) |
15afbcd0 RD |
9404 | |
9405 | Deletes the current validator (if any) and sets the window validator, | |
9406 | having called wx.Validator.Clone to create a new validator of this | |
9407 | type. | |
9408 | """ | |
54f9ee45 | 9409 | return _core_.Window_SetValidator(*args, **kwargs) |
e811c8ce RD |
9410 | |
9411 | def GetValidator(*args, **kwargs): | |
15afbcd0 | 9412 | """ |
a95a7133 | 9413 | GetValidator(self) -> Validator |
15afbcd0 RD |
9414 | |
9415 | Returns a pointer to the current validator for the window, or None if | |
9416 | there is none. | |
9417 | """ | |
54f9ee45 | 9418 | return _core_.Window_GetValidator(*args, **kwargs) |
e811c8ce | 9419 | |
74a57fcd RD |
9420 | def Validate(*args, **kwargs): |
9421 | """ | |
a95a7133 | 9422 | Validate(self) -> bool |
74a57fcd RD |
9423 | |
9424 | Validates the current values of the child controls using their | |
41e2b43e RD |
9425 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra |
9426 | style flag set, the method will also call Validate() of all child | |
9427 | windows. Returns false if any of the validations failed. | |
74a57fcd | 9428 | """ |
54f9ee45 | 9429 | return _core_.Window_Validate(*args, **kwargs) |
74a57fcd RD |
9430 | |
9431 | def TransferDataToWindow(*args, **kwargs): | |
9432 | """ | |
a95a7133 | 9433 | TransferDataToWindow(self) -> bool |
74a57fcd | 9434 | |
41e2b43e RD |
9435 | Transfers values to child controls from data areas specified by their |
9436 | validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra | |
9437 | style flag set, the method will also call TransferDataToWindow() of | |
9438 | all child windows. | |
74a57fcd | 9439 | """ |
54f9ee45 | 9440 | return _core_.Window_TransferDataToWindow(*args, **kwargs) |
74a57fcd RD |
9441 | |
9442 | def TransferDataFromWindow(*args, **kwargs): | |
9443 | """ | |
a95a7133 | 9444 | TransferDataFromWindow(self) -> bool |
74a57fcd | 9445 | |
41e2b43e RD |
9446 | Transfers values from child controls to data areas specified by their |
9447 | validators. Returns false if a transfer failed. If the window has | |
9448 | wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will | |
9449 | also call TransferDataFromWindow() of all child windows. | |
74a57fcd | 9450 | """ |
54f9ee45 | 9451 | return _core_.Window_TransferDataFromWindow(*args, **kwargs) |
74a57fcd RD |
9452 | |
9453 | def InitDialog(*args, **kwargs): | |
9454 | """ | |
a95a7133 | 9455 | InitDialog(self) |
74a57fcd | 9456 | |
41e2b43e RD |
9457 | Sends an EVT_INIT_DIALOG event, whose handler usually transfers data |
9458 | to the dialog via validators. | |
74a57fcd | 9459 | """ |
54f9ee45 | 9460 | return _core_.Window_InitDialog(*args, **kwargs) |
74a57fcd | 9461 | |
e811c8ce | 9462 | def SetAcceleratorTable(*args, **kwargs): |
15afbcd0 | 9463 | """ |
a95a7133 | 9464 | SetAcceleratorTable(self, AcceleratorTable accel) |
15afbcd0 RD |
9465 | |
9466 | Sets the accelerator table for this window. | |
9467 | """ | |
54f9ee45 | 9468 | return _core_.Window_SetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
9469 | |
9470 | def GetAcceleratorTable(*args, **kwargs): | |
15afbcd0 | 9471 | """ |
a95a7133 | 9472 | GetAcceleratorTable(self) -> AcceleratorTable |
15afbcd0 RD |
9473 | |
9474 | Gets the accelerator table for this window. | |
9475 | """ | |
54f9ee45 | 9476 | return _core_.Window_GetAcceleratorTable(*args, **kwargs) |
e811c8ce RD |
9477 | |
9478 | def RegisterHotKey(*args, **kwargs): | |
15afbcd0 | 9479 | """ |
a95a7133 | 9480 | RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool |
15afbcd0 RD |
9481 | |
9482 | Registers a system wide hotkey. Every time the user presses the hotkey | |
9483 | registered here, this window will receive a hotkey event. It will | |
9484 | receive the event even if the application is in the background and | |
9485 | does not have the input focus because the user is working with some | |
9486 | other application. To bind an event handler function to this hotkey | |
9487 | use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the | |
9488 | hotkey was registered successfully. | |
9489 | """ | |
54f9ee45 | 9490 | return _core_.Window_RegisterHotKey(*args, **kwargs) |
e811c8ce RD |
9491 | |
9492 | def UnregisterHotKey(*args, **kwargs): | |
15afbcd0 | 9493 | """ |
a95a7133 | 9494 | UnregisterHotKey(self, int hotkeyId) -> bool |
15afbcd0 RD |
9495 | |
9496 | Unregisters a system wide hotkey. | |
9497 | """ | |
54f9ee45 | 9498 | return _core_.Window_UnregisterHotKey(*args, **kwargs) |
e811c8ce RD |
9499 | |
9500 | def ConvertDialogPointToPixels(*args, **kwargs): | |
15afbcd0 | 9501 | """ |
a95a7133 | 9502 | ConvertDialogPointToPixels(self, Point pt) -> Point |
15afbcd0 RD |
9503 | |
9504 | Converts a point or size from dialog units to pixels. Dialog units | |
9505 | are used for maintaining a dialog's proportions even if the font | |
9506 | changes. For the x dimension, the dialog units are multiplied by the | |
9507 | average character width and then divided by 4. For the y dimension, | |
9508 | the dialog units are multiplied by the average character height and | |
9509 | then divided by 8. | |
9510 | """ | |
54f9ee45 | 9511 | return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs) |
e811c8ce RD |
9512 | |
9513 | def ConvertDialogSizeToPixels(*args, **kwargs): | |
15afbcd0 | 9514 | """ |
a95a7133 | 9515 | ConvertDialogSizeToPixels(self, Size sz) -> Size |
15afbcd0 RD |
9516 | |
9517 | Converts a point or size from dialog units to pixels. Dialog units | |
9518 | are used for maintaining a dialog's proportions even if the font | |
9519 | changes. For the x dimension, the dialog units are multiplied by the | |
9520 | average character width and then divided by 4. For the y dimension, | |
9521 | the dialog units are multiplied by the average character height and | |
9522 | then divided by 8. | |
9523 | """ | |
54f9ee45 | 9524 | return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs) |
e811c8ce RD |
9525 | |
9526 | def DLG_PNT(*args, **kwargs): | |
15afbcd0 | 9527 | """ |
a95a7133 | 9528 | DLG_PNT(self, Point pt) -> Point |
15afbcd0 RD |
9529 | |
9530 | Converts a point or size from dialog units to pixels. Dialog units | |
9531 | are used for maintaining a dialog's proportions even if the font | |
9532 | changes. For the x dimension, the dialog units are multiplied by the | |
9533 | average character width and then divided by 4. For the y dimension, | |
9534 | the dialog units are multiplied by the average character height and | |
9535 | then divided by 8. | |
9536 | """ | |
54f9ee45 | 9537 | return _core_.Window_DLG_PNT(*args, **kwargs) |
e811c8ce RD |
9538 | |
9539 | def DLG_SZE(*args, **kwargs): | |
15afbcd0 | 9540 | """ |
a95a7133 | 9541 | DLG_SZE(self, Size sz) -> Size |
15afbcd0 RD |
9542 | |
9543 | Converts a point or size from dialog units to pixels. Dialog units | |
9544 | are used for maintaining a dialog's proportions even if the font | |
9545 | changes. For the x dimension, the dialog units are multiplied by the | |
9546 | average character width and then divided by 4. For the y dimension, | |
9547 | the dialog units are multiplied by the average character height and | |
9548 | then divided by 8. | |
9549 | """ | |
54f9ee45 | 9550 | return _core_.Window_DLG_SZE(*args, **kwargs) |
e811c8ce RD |
9551 | |
9552 | def ConvertPixelPointToDialog(*args, **kwargs): | |
a95a7133 | 9553 | """ConvertPixelPointToDialog(self, Point pt) -> Point""" |
54f9ee45 | 9554 | return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs) |
e811c8ce RD |
9555 | |
9556 | def ConvertPixelSizeToDialog(*args, **kwargs): | |
a95a7133 | 9557 | """ConvertPixelSizeToDialog(self, Size sz) -> Size""" |
54f9ee45 | 9558 | return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs) |
e811c8ce RD |
9559 | |
9560 | def WarpPointer(*args, **kwargs): | |
15afbcd0 | 9561 | """ |
a95a7133 | 9562 | WarpPointer(self, int x, int y) |
15afbcd0 RD |
9563 | |
9564 | Moves the pointer to the given position on the window. | |
9565 | ||
9566 | NOTE: This function is not supported under Mac because Apple Human | |
9567 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
9568 | """ | |
54f9ee45 | 9569 | return _core_.Window_WarpPointer(*args, **kwargs) |
e811c8ce RD |
9570 | |
9571 | def CaptureMouse(*args, **kwargs): | |
15afbcd0 | 9572 | """ |
a95a7133 | 9573 | CaptureMouse(self) |
15afbcd0 RD |
9574 | |
9575 | Directs all mouse input to this window. Call wx.Window.ReleaseMouse to | |
9576 | release the capture. | |
9577 | ||
9578 | Note that wxWindows maintains the stack of windows having captured the | |
9579 | mouse and when the mouse is released the capture returns to the window | |
9580 | which had had captured it previously and it is only really released if | |
9581 | there were no previous window. In particular, this means that you must | |
34e0a3bb RD |
9582 | release the mouse as many times as you capture it, unless the window |
9583 | receives the `wx.MouseCaptureLostEvent` event. | |
9584 | ||
9585 | Any application which captures the mouse in the beginning of some | |
9586 | operation *must* handle `wx.MouseCaptureLostEvent` and cancel this | |
9587 | operation when it receives the event. The event handler must not | |
9588 | recapture mouse. | |
15afbcd0 | 9589 | """ |
54f9ee45 | 9590 | return _core_.Window_CaptureMouse(*args, **kwargs) |
e811c8ce RD |
9591 | |
9592 | def ReleaseMouse(*args, **kwargs): | |
15afbcd0 | 9593 | """ |
a95a7133 | 9594 | ReleaseMouse(self) |
15afbcd0 RD |
9595 | |
9596 | Releases mouse input captured with wx.Window.CaptureMouse. | |
9597 | """ | |
54f9ee45 | 9598 | return _core_.Window_ReleaseMouse(*args, **kwargs) |
e811c8ce RD |
9599 | |
9600 | def GetCapture(*args, **kwargs): | |
15afbcd0 | 9601 | """ |
66c033b4 | 9602 | GetCapture() -> Window |
15afbcd0 RD |
9603 | |
9604 | Returns the window which currently captures the mouse or None | |
9605 | """ | |
54f9ee45 | 9606 | return _core_.Window_GetCapture(*args, **kwargs) |
e811c8ce RD |
9607 | |
9608 | GetCapture = staticmethod(GetCapture) | |
9609 | def HasCapture(*args, **kwargs): | |
15afbcd0 | 9610 | """ |
a95a7133 | 9611 | HasCapture(self) -> bool |
15afbcd0 RD |
9612 | |
9613 | Returns true if this window has the current mouse capture. | |
9614 | """ | |
54f9ee45 | 9615 | return _core_.Window_HasCapture(*args, **kwargs) |
e811c8ce RD |
9616 | |
9617 | def Refresh(*args, **kwargs): | |
15afbcd0 | 9618 | """ |
a95a7133 | 9619 | Refresh(self, bool eraseBackground=True, Rect rect=None) |
15afbcd0 RD |
9620 | |
9621 | Mark the specified rectangle (or the whole window) as "dirty" so it | |
9622 | will be repainted. Causes an EVT_PAINT event to be generated and sent | |
9623 | to the window. | |
9624 | """ | |
54f9ee45 | 9625 | return _core_.Window_Refresh(*args, **kwargs) |
e811c8ce RD |
9626 | |
9627 | def RefreshRect(*args, **kwargs): | |
15afbcd0 | 9628 | """ |
fef4c27a | 9629 | RefreshRect(self, Rect rect, bool eraseBackground=True) |
15afbcd0 RD |
9630 | |
9631 | Redraws the contents of the given rectangle: the area inside it will | |
9632 | be repainted. This is the same as Refresh but has a nicer syntax. | |
9633 | """ | |
54f9ee45 | 9634 | return _core_.Window_RefreshRect(*args, **kwargs) |
e811c8ce RD |
9635 | |
9636 | def Update(*args, **kwargs): | |
15afbcd0 | 9637 | """ |
a95a7133 | 9638 | Update(self) |
15afbcd0 RD |
9639 | |
9640 | Calling this method immediately repaints the invalidated area of the | |
9641 | window instead of waiting for the EVT_PAINT event to happen, (normally | |
9642 | this would usually only happen when the flow of control returns to the | |
9643 | event loop.) Notice that this function doesn't refresh the window and | |
9b940138 | 9644 | does nothing if the window has been already repainted. Use `Refresh` |
15afbcd0 RD |
9645 | first if you want to immediately redraw the window (or some portion of |
9646 | it) unconditionally. | |
9647 | """ | |
54f9ee45 | 9648 | return _core_.Window_Update(*args, **kwargs) |
e811c8ce RD |
9649 | |
9650 | def ClearBackground(*args, **kwargs): | |
15afbcd0 | 9651 | """ |
a95a7133 | 9652 | ClearBackground(self) |
15afbcd0 RD |
9653 | |
9654 | Clears the window by filling it with the current background | |
9655 | colour. Does not cause an erase background event to be generated. | |
9656 | """ | |
54f9ee45 | 9657 | return _core_.Window_ClearBackground(*args, **kwargs) |
e811c8ce RD |
9658 | |
9659 | def Freeze(*args, **kwargs): | |
15afbcd0 | 9660 | """ |
a95a7133 | 9661 | Freeze(self) |
15afbcd0 | 9662 | |
41e2b43e RD |
9663 | Freezes the window or, in other words, prevents any updates from |
9664 | taking place on screen, the window is not redrawn at all. Thaw must be | |
9665 | called to reenable window redrawing. Calls to Freeze/Thaw may be | |
9666 | nested, with the actual Thaw being delayed until all the nesting has | |
9667 | been undone. | |
15afbcd0 RD |
9668 | |
9669 | This method is useful for visual appearance optimization (for example, | |
9670 | it is a good idea to use it before inserting large amount of text into | |
9671 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor | |
9672 | for all controls so it is mostly just a hint to wxWindows and not a | |
9673 | mandatory directive. | |
9674 | """ | |
54f9ee45 | 9675 | return _core_.Window_Freeze(*args, **kwargs) |
e811c8ce | 9676 | |
33d6fd3b RD |
9677 | def IsFrozen(*args, **kwargs): |
9678 | """ | |
9679 | IsFrozen(self) -> bool | |
9680 | ||
9681 | Returns ``True`` if the window has been frozen and not thawed yet. | |
9682 | ||
9683 | :see: `Freeze` and `Thaw` | |
9684 | """ | |
9685 | return _core_.Window_IsFrozen(*args, **kwargs) | |
9686 | ||
e811c8ce | 9687 | def Thaw(*args, **kwargs): |
15afbcd0 | 9688 | """ |
a95a7133 | 9689 | Thaw(self) |
15afbcd0 | 9690 | |
4276dc52 | 9691 | Reenables window updating after a previous call to Freeze. Calls to |
41e2b43e RD |
9692 | Freeze/Thaw may be nested, so Thaw must be called the same number of |
9693 | times that Freeze was before the window will be updated. | |
15afbcd0 | 9694 | """ |
54f9ee45 | 9695 | return _core_.Window_Thaw(*args, **kwargs) |
e811c8ce RD |
9696 | |
9697 | def PrepareDC(*args, **kwargs): | |
15afbcd0 | 9698 | """ |
a95a7133 | 9699 | PrepareDC(self, DC dc) |
15afbcd0 RD |
9700 | |
9701 | Call this function to prepare the device context for drawing a | |
9702 | scrolled image. It sets the device origin according to the current | |
9703 | scroll position. | |
9704 | """ | |
54f9ee45 | 9705 | return _core_.Window_PrepareDC(*args, **kwargs) |
e811c8ce | 9706 | |
b39fe951 RD |
9707 | def IsDoubleBuffered(*args, **kwargs): |
9708 | """ | |
9709 | IsDoubleBuffered(self) -> bool | |
9710 | ||
9711 | Returns ``True`` if the window contents is double-buffered by the | |
9712 | system, i.e. if any drawing done on the window is really done on a | |
9713 | temporary backing surface and transferred to the screen all at once | |
9714 | later. | |
9715 | """ | |
9716 | return _core_.Window_IsDoubleBuffered(*args, **kwargs) | |
9717 | ||
e811c8ce | 9718 | def GetUpdateRegion(*args, **kwargs): |
15afbcd0 | 9719 | """ |
a95a7133 | 9720 | GetUpdateRegion(self) -> Region |
15afbcd0 RD |
9721 | |
9722 | Returns the region specifying which parts of the window have been | |
9723 | damaged. Should only be called within an EVT_PAINT handler. | |
9724 | """ | |
54f9ee45 | 9725 | return _core_.Window_GetUpdateRegion(*args, **kwargs) |
e811c8ce RD |
9726 | |
9727 | def GetUpdateClientRect(*args, **kwargs): | |
15afbcd0 | 9728 | """ |
a95a7133 | 9729 | GetUpdateClientRect(self) -> Rect |
15afbcd0 RD |
9730 | |
9731 | Get the update rectangle region bounding box in client coords. | |
9732 | """ | |
54f9ee45 | 9733 | return _core_.Window_GetUpdateClientRect(*args, **kwargs) |
e811c8ce RD |
9734 | |
9735 | def IsExposed(*args, **kwargs): | |
15afbcd0 | 9736 | """ |
a95a7133 | 9737 | IsExposed(self, int x, int y, int w=1, int h=1) -> bool |
15afbcd0 RD |
9738 | |
9739 | Returns true if the given point or rectangle area has been exposed | |
9740 | since the last repaint. Call this in an paint event handler to | |
9741 | optimize redrawing by only redrawing those areas, which have been | |
9742 | exposed. | |
9743 | """ | |
54f9ee45 | 9744 | return _core_.Window_IsExposed(*args, **kwargs) |
e811c8ce RD |
9745 | |
9746 | def IsExposedPoint(*args, **kwargs): | |
15afbcd0 | 9747 | """ |
a95a7133 | 9748 | IsExposedPoint(self, Point pt) -> bool |
15afbcd0 RD |
9749 | |
9750 | Returns true if the given point or rectangle area has been exposed | |
9751 | since the last repaint. Call this in an paint event handler to | |
9752 | optimize redrawing by only redrawing those areas, which have been | |
9753 | exposed. | |
9754 | """ | |
54f9ee45 | 9755 | return _core_.Window_IsExposedPoint(*args, **kwargs) |
e811c8ce | 9756 | |
4276dc52 | 9757 | def IsExposedRect(*args, **kwargs): |
15afbcd0 | 9758 | """ |
a95a7133 | 9759 | IsExposedRect(self, Rect rect) -> bool |
15afbcd0 RD |
9760 | |
9761 | Returns true if the given point or rectangle area has been exposed | |
9762 | since the last repaint. Call this in an paint event handler to | |
9763 | optimize redrawing by only redrawing those areas, which have been | |
9764 | exposed. | |
9765 | """ | |
54f9ee45 | 9766 | return _core_.Window_IsExposedRect(*args, **kwargs) |
e811c8ce | 9767 | |
74a57fcd RD |
9768 | def GetDefaultAttributes(*args, **kwargs): |
9769 | """ | |
a95a7133 | 9770 | GetDefaultAttributes(self) -> VisualAttributes |
74a57fcd | 9771 | |
41e2b43e RD |
9772 | Get the default attributes for an instance of this class. This is |
9773 | useful if you want to use the same font or colour in your own control | |
9774 | as in a standard control -- which is a much better idea than hard | |
9775 | coding specific colours or fonts which might look completely out of | |
db3e571a | 9776 | place on the user's system, especially if it uses themes. |
74a57fcd | 9777 | """ |
54f9ee45 | 9778 | return _core_.Window_GetDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9779 | |
9780 | def GetClassDefaultAttributes(*args, **kwargs): | |
9781 | """ | |
66c033b4 | 9782 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
74a57fcd | 9783 | |
41e2b43e RD |
9784 | Get the default attributes for this class. This is useful if you want |
9785 | to use the same font or colour in your own control as in a standard | |
9786 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
9787 | colours or fonts which might look completely out of place on the |
9788 | user's system, especially if it uses themes. | |
74a57fcd RD |
9789 | |
9790 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 9791 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
9792 | the returned font. See `wx.Window.SetWindowVariant` for more about |
9793 | this. | |
74a57fcd | 9794 | """ |
54f9ee45 | 9795 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
9796 | |
9797 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
e811c8ce | 9798 | def SetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9799 | """ |
a95a7133 | 9800 | SetBackgroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9801 | |
9802 | Sets the background colour of the window. Returns True if the colour | |
9803 | was changed. The background colour is usually painted by the default | |
9804 | EVT_ERASE_BACKGROUND event handler function under Windows and | |
f8167d6e RD |
9805 | automatically under GTK. Using `wx.NullColour` will reset the window |
9806 | to the default background colour. | |
15afbcd0 | 9807 | |
db3e571a | 9808 | Note that setting the background colour may not cause an immediate |
f8167d6e | 9809 | refresh, so you may wish to call `ClearBackground` or `Refresh` after |
15afbcd0 RD |
9810 | calling this function. |
9811 | ||
f8167d6e RD |
9812 | Using this function will disable attempts to use themes for this |
9813 | window, if the system supports them. Use with care since usually the | |
9814 | themes represent the appearance chosen by the user to be used for all | |
9815 | applications on the system. | |
15afbcd0 | 9816 | """ |
54f9ee45 | 9817 | return _core_.Window_SetBackgroundColour(*args, **kwargs) |
e811c8ce | 9818 | |
412d302d RD |
9819 | def SetOwnBackgroundColour(*args, **kwargs): |
9820 | """SetOwnBackgroundColour(self, Colour colour)""" | |
9821 | return _core_.Window_SetOwnBackgroundColour(*args, **kwargs) | |
b2df227b | 9822 | |
e811c8ce | 9823 | def SetForegroundColour(*args, **kwargs): |
15afbcd0 | 9824 | """ |
a95a7133 | 9825 | SetForegroundColour(self, Colour colour) -> bool |
15afbcd0 RD |
9826 | |
9827 | Sets the foreground colour of the window. Returns True is the colour | |
9828 | was changed. The interpretation of foreground colour is dependent on | |
9829 | the window class; it may be the text colour or other colour, or it may | |
9830 | not be used at all. | |
9831 | """ | |
54f9ee45 | 9832 | return _core_.Window_SetForegroundColour(*args, **kwargs) |
e811c8ce | 9833 | |
fa47d7a7 VS |
9834 | def SetOwnForegroundColour(*args, **kwargs): |
9835 | """SetOwnForegroundColour(self, Colour colour)""" | |
9836 | return _core_.Window_SetOwnForegroundColour(*args, **kwargs) | |
b2df227b | 9837 | |
e811c8ce | 9838 | def GetBackgroundColour(*args, **kwargs): |
15afbcd0 | 9839 | """ |
a95a7133 | 9840 | GetBackgroundColour(self) -> Colour |
15afbcd0 RD |
9841 | |
9842 | Returns the background colour of the window. | |
9843 | """ | |
54f9ee45 | 9844 | return _core_.Window_GetBackgroundColour(*args, **kwargs) |
e811c8ce RD |
9845 | |
9846 | def GetForegroundColour(*args, **kwargs): | |
15afbcd0 | 9847 | """ |
a95a7133 | 9848 | GetForegroundColour(self) -> Colour |
15afbcd0 RD |
9849 | |
9850 | Returns the foreground colour of the window. The interpretation of | |
9851 | foreground colour is dependent on the window class; it may be the text | |
9852 | colour or other colour, or it may not be used at all. | |
9853 | """ | |
54f9ee45 | 9854 | return _core_.Window_GetForegroundColour(*args, **kwargs) |
e811c8ce | 9855 | |
562ecc31 RD |
9856 | def InheritsBackgroundColour(*args, **kwargs): |
9857 | """InheritsBackgroundColour(self) -> bool""" | |
9858 | return _core_.Window_InheritsBackgroundColour(*args, **kwargs) | |
9859 | ||
9860 | def UseBgCol(*args, **kwargs): | |
9861 | """UseBgCol(self) -> bool""" | |
9862 | return _core_.Window_UseBgCol(*args, **kwargs) | |
9863 | ||
7bc1e663 RD |
9864 | def SetBackgroundStyle(*args, **kwargs): |
9865 | """ | |
9866 | SetBackgroundStyle(self, int style) -> bool | |
9867 | ||
9868 | Returns the background style of the window. The background style | |
9869 | indicates how the background of the window is drawn. | |
9870 | ||
9871 | ====================== ======================================== | |
9872 | wx.BG_STYLE_SYSTEM The background colour or pattern should | |
9873 | be determined by the system | |
9874 | wx.BG_STYLE_COLOUR The background should be a solid colour | |
9875 | wx.BG_STYLE_CUSTOM The background will be implemented by the | |
9876 | application. | |
9877 | ====================== ======================================== | |
9878 | ||
9879 | On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of | |
9880 | a custom background, such as a tiled bitmap. Currently the style has | |
9881 | no effect on other platforms. | |
9882 | ||
9883 | :see: `GetBackgroundStyle`, `SetBackgroundColour` | |
9884 | """ | |
9885 | return _core_.Window_SetBackgroundStyle(*args, **kwargs) | |
9886 | ||
9887 | def GetBackgroundStyle(*args, **kwargs): | |
9888 | """ | |
9889 | GetBackgroundStyle(self) -> int | |
9890 | ||
9891 | Returns the background style of the window. | |
9892 | ||
9893 | :see: `SetBackgroundStyle` | |
9894 | """ | |
9895 | return _core_.Window_GetBackgroundStyle(*args, **kwargs) | |
9896 | ||
51b83b37 RD |
9897 | def HasTransparentBackground(*args, **kwargs): |
9898 | """ | |
9899 | HasTransparentBackground(self) -> bool | |
9900 | ||
9901 | Returns True if this window's background is transparent (as, for | |
9902 | example, for `wx.StaticText`) and should show the parent window's | |
9903 | background. | |
9904 | ||
9905 | This method is mostly used internally by the library itself and you | |
9906 | normally shouldn't have to call it. You may, however, have to override | |
9907 | it in your custom control classes to ensure that background is painted | |
9908 | correctly. | |
9909 | """ | |
9910 | return _core_.Window_HasTransparentBackground(*args, **kwargs) | |
9911 | ||
e811c8ce | 9912 | def SetCursor(*args, **kwargs): |
15afbcd0 | 9913 | """ |
a95a7133 | 9914 | SetCursor(self, Cursor cursor) -> bool |
15afbcd0 RD |
9915 | |
9916 | Sets the window's cursor. Notice that the window cursor also sets it | |
9917 | for the children of the window implicitly. | |
9918 | ||
9919 | The cursor may be wx.NullCursor in which case the window cursor will | |
9920 | be reset back to default. | |
9921 | """ | |
54f9ee45 | 9922 | return _core_.Window_SetCursor(*args, **kwargs) |
e811c8ce RD |
9923 | |
9924 | def GetCursor(*args, **kwargs): | |
15afbcd0 | 9925 | """ |
a95a7133 | 9926 | GetCursor(self) -> Cursor |
15afbcd0 RD |
9927 | |
9928 | Return the cursor associated with this window. | |
9929 | """ | |
54f9ee45 | 9930 | return _core_.Window_GetCursor(*args, **kwargs) |
e811c8ce RD |
9931 | |
9932 | def SetFont(*args, **kwargs): | |
15afbcd0 | 9933 | """ |
a95a7133 | 9934 | SetFont(self, Font font) -> bool |
15afbcd0 RD |
9935 | |
9936 | Sets the font for this window. | |
9937 | """ | |
54f9ee45 | 9938 | return _core_.Window_SetFont(*args, **kwargs) |
e811c8ce | 9939 | |
fa47d7a7 VS |
9940 | def SetOwnFont(*args, **kwargs): |
9941 | """SetOwnFont(self, Font font)""" | |
9942 | return _core_.Window_SetOwnFont(*args, **kwargs) | |
b2df227b | 9943 | |
e811c8ce | 9944 | def GetFont(*args, **kwargs): |
15afbcd0 | 9945 | """ |
a95a7133 | 9946 | GetFont(self) -> Font |
15afbcd0 | 9947 | |
4276dc52 | 9948 | Returns the default font used for this window. |
15afbcd0 | 9949 | """ |
54f9ee45 | 9950 | return _core_.Window_GetFont(*args, **kwargs) |
e811c8ce RD |
9951 | |
9952 | def SetCaret(*args, **kwargs): | |
15afbcd0 | 9953 | """ |
a95a7133 | 9954 | SetCaret(self, Caret caret) |
15afbcd0 RD |
9955 | |
9956 | Sets the caret associated with the window. | |
9957 | """ | |
54f9ee45 | 9958 | return _core_.Window_SetCaret(*args, **kwargs) |
e811c8ce RD |
9959 | |
9960 | def GetCaret(*args, **kwargs): | |
15afbcd0 | 9961 | """ |
a95a7133 | 9962 | GetCaret(self) -> Caret |
15afbcd0 RD |
9963 | |
9964 | Returns the caret associated with the window. | |
9965 | """ | |
54f9ee45 | 9966 | return _core_.Window_GetCaret(*args, **kwargs) |
e811c8ce RD |
9967 | |
9968 | def GetCharHeight(*args, **kwargs): | |
15afbcd0 | 9969 | """ |
a95a7133 | 9970 | GetCharHeight(self) -> int |
15afbcd0 RD |
9971 | |
9972 | Get the (average) character size for the current font. | |
9973 | """ | |
54f9ee45 | 9974 | return _core_.Window_GetCharHeight(*args, **kwargs) |
e811c8ce RD |
9975 | |
9976 | def GetCharWidth(*args, **kwargs): | |
15afbcd0 | 9977 | """ |
a95a7133 | 9978 | GetCharWidth(self) -> int |
15afbcd0 RD |
9979 | |
9980 | Get the (average) character size for the current font. | |
9981 | """ | |
54f9ee45 | 9982 | return _core_.Window_GetCharWidth(*args, **kwargs) |
e811c8ce RD |
9983 | |
9984 | def GetTextExtent(*args, **kwargs): | |
fd2dc343 RD |
9985 | """ |
9986 | GetTextExtent(String string) -> (width, height) | |
9987 | ||
9988 | Get the width and height of the text using the current font. | |
9989 | """ | |
54f9ee45 | 9990 | return _core_.Window_GetTextExtent(*args, **kwargs) |
e811c8ce RD |
9991 | |
9992 | def GetFullTextExtent(*args, **kwargs): | |
0df68c9f | 9993 | """ |
196addbf | 9994 | GetFullTextExtent(String string, Font font=None) -> |
0df68c9f | 9995 | (width, height, descent, externalLeading) |
e811c8ce | 9996 | |
15afbcd0 RD |
9997 | Get the width, height, decent and leading of the text using the |
9998 | current or specified font. | |
0df68c9f | 9999 | """ |
54f9ee45 | 10000 | return _core_.Window_GetFullTextExtent(*args, **kwargs) |
e811c8ce RD |
10001 | |
10002 | def ClientToScreenXY(*args, **kwargs): | |
15afbcd0 RD |
10003 | """ |
10004 | ClientToScreenXY(int x, int y) -> (x,y) | |
10005 | ||
10006 | Converts to screen coordinates from coordinates relative to this window. | |
10007 | """ | |
54f9ee45 | 10008 | return _core_.Window_ClientToScreenXY(*args, **kwargs) |
e811c8ce RD |
10009 | |
10010 | def ScreenToClientXY(*args, **kwargs): | |
15afbcd0 RD |
10011 | """ |
10012 | ScreenToClientXY(int x, int y) -> (x,y) | |
10013 | ||
10014 | Converts from screen to client window coordinates. | |
10015 | """ | |
54f9ee45 | 10016 | return _core_.Window_ScreenToClientXY(*args, **kwargs) |
e811c8ce RD |
10017 | |
10018 | def ClientToScreen(*args, **kwargs): | |
15afbcd0 | 10019 | """ |
a95a7133 | 10020 | ClientToScreen(self, Point pt) -> Point |
15afbcd0 RD |
10021 | |
10022 | Converts to screen coordinates from coordinates relative to this window. | |
10023 | """ | |
54f9ee45 | 10024 | return _core_.Window_ClientToScreen(*args, **kwargs) |
e811c8ce RD |
10025 | |
10026 | def ScreenToClient(*args, **kwargs): | |
15afbcd0 | 10027 | """ |
a95a7133 | 10028 | ScreenToClient(self, Point pt) -> Point |
15afbcd0 RD |
10029 | |
10030 | Converts from screen to client window coordinates. | |
10031 | """ | |
54f9ee45 | 10032 | return _core_.Window_ScreenToClient(*args, **kwargs) |
e811c8ce RD |
10033 | |
10034 | def HitTestXY(*args, **kwargs): | |
15afbcd0 | 10035 | """ |
a95a7133 | 10036 | HitTestXY(self, int x, int y) -> int |
15afbcd0 RD |
10037 | |
10038 | Test where the given (in client coords) point lies | |
10039 | """ | |
54f9ee45 | 10040 | return _core_.Window_HitTestXY(*args, **kwargs) |
e811c8ce RD |
10041 | |
10042 | def HitTest(*args, **kwargs): | |
15afbcd0 | 10043 | """ |
a95a7133 | 10044 | HitTest(self, Point pt) -> int |
15afbcd0 RD |
10045 | |
10046 | Test where the given (in client coords) point lies | |
10047 | """ | |
54f9ee45 | 10048 | return _core_.Window_HitTest(*args, **kwargs) |
e811c8ce | 10049 | |
15afbcd0 RD |
10050 | def GetBorder(*args): |
10051 | """ | |
a95a7133 RD |
10052 | GetBorder(self, long flags) -> int |
10053 | GetBorder(self) -> int | |
e811c8ce | 10054 | |
15afbcd0 RD |
10055 | Get border for the flags of this window |
10056 | """ | |
54f9ee45 | 10057 | return _core_.Window_GetBorder(*args) |
e811c8ce RD |
10058 | |
10059 | def UpdateWindowUI(*args, **kwargs): | |
15afbcd0 | 10060 | """ |
a95a7133 | 10061 | UpdateWindowUI(self, long flags=UPDATE_UI_NONE) |
15afbcd0 RD |
10062 | |
10063 | This function sends EVT_UPDATE_UI events to the window. The particular | |
10064 | implementation depends on the window; for example a wx.ToolBar will | |
10065 | send an update UI event for each toolbar button, and a wx.Frame will | |
10066 | send an update UI event for each menubar menu item. You can call this | |
10067 | function from your application to ensure that your UI is up-to-date at | |
10068 | a particular point in time (as far as your EVT_UPDATE_UI handlers are | |
10069 | concerned). This may be necessary if you have called | |
5ba5649b | 10070 | `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to |
15afbcd0 RD |
10071 | limit the overhead that wxWindows incurs by sending update UI events |
10072 | in idle time. | |
15afbcd0 | 10073 | """ |
54f9ee45 | 10074 | return _core_.Window_UpdateWindowUI(*args, **kwargs) |
e811c8ce RD |
10075 | |
10076 | def PopupMenuXY(*args, **kwargs): | |
15afbcd0 | 10077 | """ |
b0503257 | 10078 | PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool |
15afbcd0 | 10079 | |
b0503257 RD |
10080 | Pops up the given menu at the specified coordinates, relative to this window, |
10081 | and returns control when the user has dismissed the menu. If a menu item is | |
10082 | selected, the corresponding menu event is generated and will be processed as | |
10083 | usual. If the default position is given then the current position of the | |
10084 | mouse cursor will be used. | |
15afbcd0 | 10085 | """ |
54f9ee45 | 10086 | return _core_.Window_PopupMenuXY(*args, **kwargs) |
e811c8ce | 10087 | |
15afbcd0 RD |
10088 | def PopupMenu(*args, **kwargs): |
10089 | """ | |
b0503257 | 10090 | PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool |
15afbcd0 | 10091 | |
b0503257 RD |
10092 | Pops up the given menu at the specified coordinates, relative to this window, |
10093 | and returns control when the user has dismissed the menu. If a menu item is | |
10094 | selected, the corresponding menu event is generated and will be processed as | |
10095 | usual. If the default position is given then the current position of the | |
10096 | mouse cursor will be used. | |
15afbcd0 | 10097 | """ |
54f9ee45 | 10098 | return _core_.Window_PopupMenu(*args, **kwargs) |
15afbcd0 | 10099 | |
10044bf1 RD |
10100 | def HasMultiplePages(*args, **kwargs): |
10101 | """HasMultiplePages(self) -> bool""" | |
10102 | return _core_.Window_HasMultiplePages(*args, **kwargs) | |
10103 | ||
15afbcd0 RD |
10104 | def GetHandle(*args, **kwargs): |
10105 | """ | |
a95a7133 | 10106 | GetHandle(self) -> long |
15afbcd0 RD |
10107 | |
10108 | Returns the platform-specific handle (as a long integer) of the | |
10109 | physical window. Currently on wxMac it returns the handle of the | |
10110 | toplevel parent of the window. | |
10111 | """ | |
54f9ee45 | 10112 | return _core_.Window_GetHandle(*args, **kwargs) |
15afbcd0 | 10113 | |
7e63a440 RD |
10114 | def AssociateHandle(*args, **kwargs): |
10115 | """ | |
10116 | AssociateHandle(self, long handle) | |
10117 | ||
10118 | Associate the window with a new native handle | |
10119 | """ | |
10120 | return _core_.Window_AssociateHandle(*args, **kwargs) | |
10121 | ||
10122 | def DissociateHandle(*args, **kwargs): | |
10123 | """ | |
10124 | DissociateHandle(self) | |
10125 | ||
10126 | Dissociate the current native handle from the window | |
10127 | """ | |
10128 | return _core_.Window_DissociateHandle(*args, **kwargs) | |
10129 | ||
15afbcd0 RD |
10130 | def HasScrollbar(*args, **kwargs): |
10131 | """ | |
a95a7133 | 10132 | HasScrollbar(self, int orient) -> bool |
15afbcd0 RD |
10133 | |
10134 | Does the window have the scrollbar for this orientation? | |
10135 | """ | |
54f9ee45 | 10136 | return _core_.Window_HasScrollbar(*args, **kwargs) |
15afbcd0 RD |
10137 | |
10138 | def SetScrollbar(*args, **kwargs): | |
10139 | """ | |
41e2b43e | 10140 | SetScrollbar(self, int orientation, int position, int thumbSize, int range, |
15afbcd0 RD |
10141 | bool refresh=True) |
10142 | ||
10143 | Sets the scrollbar properties of a built-in scrollbar. | |
15afbcd0 | 10144 | """ |
54f9ee45 | 10145 | return _core_.Window_SetScrollbar(*args, **kwargs) |
e811c8ce RD |
10146 | |
10147 | def SetScrollPos(*args, **kwargs): | |
15afbcd0 | 10148 | """ |
a95a7133 | 10149 | SetScrollPos(self, int orientation, int pos, bool refresh=True) |
15afbcd0 RD |
10150 | |
10151 | Sets the position of one of the built-in scrollbars. | |
10152 | """ | |
54f9ee45 | 10153 | return _core_.Window_SetScrollPos(*args, **kwargs) |
e811c8ce RD |
10154 | |
10155 | def GetScrollPos(*args, **kwargs): | |
15afbcd0 | 10156 | """ |
a95a7133 | 10157 | GetScrollPos(self, int orientation) -> int |
15afbcd0 RD |
10158 | |
10159 | Returns the built-in scrollbar position. | |
10160 | """ | |
54f9ee45 | 10161 | return _core_.Window_GetScrollPos(*args, **kwargs) |
e811c8ce RD |
10162 | |
10163 | def GetScrollThumb(*args, **kwargs): | |
15afbcd0 | 10164 | """ |
a95a7133 | 10165 | GetScrollThumb(self, int orientation) -> int |
15afbcd0 RD |
10166 | |
10167 | Returns the built-in scrollbar thumb size. | |
10168 | """ | |
54f9ee45 | 10169 | return _core_.Window_GetScrollThumb(*args, **kwargs) |
e811c8ce RD |
10170 | |
10171 | def GetScrollRange(*args, **kwargs): | |
15afbcd0 | 10172 | """ |
a95a7133 | 10173 | GetScrollRange(self, int orientation) -> int |
15afbcd0 RD |
10174 | |
10175 | Returns the built-in scrollbar range. | |
10176 | """ | |
54f9ee45 | 10177 | return _core_.Window_GetScrollRange(*args, **kwargs) |
e811c8ce RD |
10178 | |
10179 | def ScrollWindow(*args, **kwargs): | |
15afbcd0 | 10180 | """ |
a95a7133 | 10181 | ScrollWindow(self, int dx, int dy, Rect rect=None) |
15afbcd0 RD |
10182 | |
10183 | Physically scrolls the pixels in the window and move child windows | |
10184 | accordingly. Use this function to optimise your scrolling | |
10185 | implementations, to minimise the area that must be redrawn. Note that | |
10186 | it is rarely required to call this function from a user program. | |
15afbcd0 | 10187 | """ |
54f9ee45 | 10188 | return _core_.Window_ScrollWindow(*args, **kwargs) |
e811c8ce RD |
10189 | |
10190 | def ScrollLines(*args, **kwargs): | |
15afbcd0 | 10191 | """ |
a95a7133 | 10192 | ScrollLines(self, int lines) -> bool |
15afbcd0 RD |
10193 | |
10194 | If the platform and window class supports it, scrolls the window by | |
10195 | the given number of lines down, if lines is positive, or up if lines | |
10196 | is negative. Returns True if the window was scrolled, False if it was | |
10197 | already on top/bottom and nothing was done. | |
10198 | """ | |
54f9ee45 | 10199 | return _core_.Window_ScrollLines(*args, **kwargs) |
e811c8ce RD |
10200 | |
10201 | def ScrollPages(*args, **kwargs): | |
15afbcd0 | 10202 | """ |
a95a7133 | 10203 | ScrollPages(self, int pages) -> bool |
15afbcd0 | 10204 | |
41e2b43e | 10205 | If the platform and window class supports it, scrolls the window by |
15afbcd0 RD |
10206 | the given number of pages down, if pages is positive, or up if pages |
10207 | is negative. Returns True if the window was scrolled, False if it was | |
10208 | already on top/bottom and nothing was done. | |
10209 | """ | |
54f9ee45 | 10210 | return _core_.Window_ScrollPages(*args, **kwargs) |
e811c8ce RD |
10211 | |
10212 | def LineUp(*args, **kwargs): | |
15afbcd0 | 10213 | """ |
a95a7133 | 10214 | LineUp(self) -> bool |
15afbcd0 RD |
10215 | |
10216 | This is just a wrapper for ScrollLines(-1). | |
10217 | """ | |
54f9ee45 | 10218 | return _core_.Window_LineUp(*args, **kwargs) |
e811c8ce RD |
10219 | |
10220 | def LineDown(*args, **kwargs): | |
15afbcd0 | 10221 | """ |
a95a7133 | 10222 | LineDown(self) -> bool |
15afbcd0 RD |
10223 | |
10224 | This is just a wrapper for ScrollLines(1). | |
10225 | """ | |
54f9ee45 | 10226 | return _core_.Window_LineDown(*args, **kwargs) |
e811c8ce RD |
10227 | |
10228 | def PageUp(*args, **kwargs): | |
15afbcd0 | 10229 | """ |
a95a7133 | 10230 | PageUp(self) -> bool |
15afbcd0 RD |
10231 | |
10232 | This is just a wrapper for ScrollPages(-1). | |
10233 | """ | |
54f9ee45 | 10234 | return _core_.Window_PageUp(*args, **kwargs) |
e811c8ce RD |
10235 | |
10236 | def PageDown(*args, **kwargs): | |
15afbcd0 | 10237 | """ |
a95a7133 | 10238 | PageDown(self) -> bool |
15afbcd0 RD |
10239 | |
10240 | This is just a wrapper for ScrollPages(1). | |
10241 | """ | |
54f9ee45 | 10242 | return _core_.Window_PageDown(*args, **kwargs) |
e811c8ce RD |
10243 | |
10244 | def SetHelpText(*args, **kwargs): | |
15afbcd0 | 10245 | """ |
a95a7133 | 10246 | SetHelpText(self, String text) |
15afbcd0 RD |
10247 | |
10248 | Sets the help text to be used as context-sensitive help for this | |
10249 | window. Note that the text is actually stored by the current | |
f52cbe90 | 10250 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 10251 | """ |
54f9ee45 | 10252 | return _core_.Window_SetHelpText(*args, **kwargs) |
e811c8ce RD |
10253 | |
10254 | def SetHelpTextForId(*args, **kwargs): | |
15afbcd0 | 10255 | """ |
a95a7133 | 10256 | SetHelpTextForId(self, String text) |
15afbcd0 RD |
10257 | |
10258 | Associate this help text with all windows with the same id as this | |
10259 | one. | |
10260 | """ | |
54f9ee45 | 10261 | return _core_.Window_SetHelpTextForId(*args, **kwargs) |
e811c8ce | 10262 | |
b850e7f3 RD |
10263 | def GetHelpTextAtPoint(*args, **kwargs): |
10264 | """ | |
10265 | GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String | |
10266 | ||
10267 | Get the help string associated with the given position in this window. | |
10268 | ||
10269 | Notice that pt may be invalid if event origin is keyboard or unknown | |
10270 | and this method should return the global window help text then | |
10271 | ||
10272 | """ | |
10273 | return _core_.Window_GetHelpTextAtPoint(*args, **kwargs) | |
10274 | ||
e811c8ce | 10275 | def GetHelpText(*args, **kwargs): |
15afbcd0 | 10276 | """ |
a95a7133 | 10277 | GetHelpText(self) -> String |
15afbcd0 RD |
10278 | |
10279 | Gets the help text to be used as context-sensitive help for this | |
10280 | window. Note that the text is actually stored by the current | |
f52cbe90 | 10281 | `wx.HelpProvider` implementation, and not in the window object itself. |
15afbcd0 | 10282 | """ |
54f9ee45 | 10283 | return _core_.Window_GetHelpText(*args, **kwargs) |
e811c8ce RD |
10284 | |
10285 | def SetToolTipString(*args, **kwargs): | |
15afbcd0 | 10286 | """ |
a95a7133 | 10287 | SetToolTipString(self, String tip) |
15afbcd0 RD |
10288 | |
10289 | Attach a tooltip to the window. | |
10290 | """ | |
54f9ee45 | 10291 | return _core_.Window_SetToolTipString(*args, **kwargs) |
e811c8ce RD |
10292 | |
10293 | def SetToolTip(*args, **kwargs): | |
15afbcd0 | 10294 | """ |
a95a7133 | 10295 | SetToolTip(self, ToolTip tip) |
15afbcd0 RD |
10296 | |
10297 | Attach a tooltip to the window. | |
10298 | """ | |
54f9ee45 | 10299 | return _core_.Window_SetToolTip(*args, **kwargs) |
e811c8ce RD |
10300 | |
10301 | def GetToolTip(*args, **kwargs): | |
15afbcd0 | 10302 | """ |
a95a7133 | 10303 | GetToolTip(self) -> ToolTip |
15afbcd0 RD |
10304 | |
10305 | get the associated tooltip or None if none | |
10306 | """ | |
54f9ee45 | 10307 | return _core_.Window_GetToolTip(*args, **kwargs) |
e811c8ce RD |
10308 | |
10309 | def SetDropTarget(*args, **kwargs): | |
15afbcd0 | 10310 | """ |
a95a7133 | 10311 | SetDropTarget(self, DropTarget dropTarget) |
15afbcd0 RD |
10312 | |
10313 | Associates a drop target with this window. If the window already has | |
10314 | a drop target, it is deleted. | |
10315 | """ | |
54f9ee45 | 10316 | return _core_.Window_SetDropTarget(*args, **kwargs) |
e811c8ce RD |
10317 | |
10318 | def GetDropTarget(*args, **kwargs): | |
15afbcd0 | 10319 | """ |
a95a7133 | 10320 | GetDropTarget(self) -> DropTarget |
15afbcd0 RD |
10321 | |
10322 | Returns the associated drop target, which may be None. | |
10323 | """ | |
54f9ee45 | 10324 | return _core_.Window_GetDropTarget(*args, **kwargs) |
e811c8ce | 10325 | |
5ba5649b RD |
10326 | def DragAcceptFiles(*args, **kwargs): |
10327 | """ | |
10328 | DragAcceptFiles(self, bool accept) | |
10329 | ||
10330 | Enables or disables eligibility for drop file events, EVT_DROP_FILES. | |
10331 | Only functional on Windows. | |
10332 | """ | |
10333 | return _core_.Window_DragAcceptFiles(*args, **kwargs) | |
10334 | ||
e811c8ce | 10335 | def SetConstraints(*args, **kwargs): |
15afbcd0 | 10336 | """ |
a95a7133 | 10337 | SetConstraints(self, LayoutConstraints constraints) |
15afbcd0 RD |
10338 | |
10339 | Sets the window to have the given layout constraints. If an existing | |
10340 | layout constraints object is already owned by the window, it will be | |
10341 | deleted. Pass None to disassociate and delete the window's current | |
10342 | constraints. | |
10343 | ||
10344 | You must call SetAutoLayout to tell a window to use the constraints | |
10345 | automatically in its default EVT_SIZE handler; otherwise, you must | |
10346 | handle EVT_SIZE yourself and call Layout() explicitly. When setting | |
10347 | both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have | |
10348 | effect. | |
10349 | """ | |
54f9ee45 | 10350 | return _core_.Window_SetConstraints(*args, **kwargs) |
e811c8ce RD |
10351 | |
10352 | def GetConstraints(*args, **kwargs): | |
15afbcd0 | 10353 | """ |
a95a7133 | 10354 | GetConstraints(self) -> LayoutConstraints |
15afbcd0 RD |
10355 | |
10356 | Returns a pointer to the window's layout constraints, or None if there | |
10357 | are none. | |
10358 | """ | |
54f9ee45 | 10359 | return _core_.Window_GetConstraints(*args, **kwargs) |
e811c8ce RD |
10360 | |
10361 | def SetAutoLayout(*args, **kwargs): | |
15afbcd0 | 10362 | """ |
a95a7133 | 10363 | SetAutoLayout(self, bool autoLayout) |
15afbcd0 RD |
10364 | |
10365 | Determines whether the Layout function will be called automatically | |
b1fcee84 RD |
10366 | when the window is resized. lease note that this only happens for the |
10367 | windows usually used to contain children, namely `wx.Panel` and | |
10368 | `wx.TopLevelWindow` (and the classes deriving from them). | |
10369 | ||
10370 | This method is called implicitly by `SetSizer` but if you use | |
10371 | `SetConstraints` you should call it manually or otherwise the window | |
10372 | layout won't be correctly updated when its size changes. | |
15afbcd0 | 10373 | """ |
54f9ee45 | 10374 | return _core_.Window_SetAutoLayout(*args, **kwargs) |
e811c8ce RD |
10375 | |
10376 | def GetAutoLayout(*args, **kwargs): | |
15afbcd0 | 10377 | """ |
a95a7133 | 10378 | GetAutoLayout(self) -> bool |
15afbcd0 RD |
10379 | |
10380 | Returns the current autoLayout setting | |
10381 | """ | |
54f9ee45 | 10382 | return _core_.Window_GetAutoLayout(*args, **kwargs) |
e811c8ce RD |
10383 | |
10384 | def Layout(*args, **kwargs): | |
15afbcd0 | 10385 | """ |
a95a7133 | 10386 | Layout(self) -> bool |
15afbcd0 RD |
10387 | |
10388 | Invokes the constraint-based layout algorithm or the sizer-based | |
10389 | algorithm for this window. See SetAutoLayout: when auto layout is on, | |
10390 | this function gets called automatically by the default EVT_SIZE | |
10391 | handler when the window is resized. | |
10392 | """ | |
54f9ee45 | 10393 | return _core_.Window_Layout(*args, **kwargs) |
e811c8ce RD |
10394 | |
10395 | def SetSizer(*args, **kwargs): | |
15afbcd0 | 10396 | """ |
a95a7133 | 10397 | SetSizer(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
10398 | |
10399 | Sets the window to have the given layout sizer. The window will then | |
10400 | own the object, and will take care of its deletion. If an existing | |
10401 | layout sizer object is already owned by the window, it will be deleted | |
10402 | if the deleteOld parameter is true. Note that this function will also | |
10403 | call SetAutoLayout implicitly with a True parameter if the sizer is | |
ae8162c8 | 10404 | non-None, and False otherwise. |
15afbcd0 | 10405 | """ |
54f9ee45 | 10406 | return _core_.Window_SetSizer(*args, **kwargs) |
e811c8ce RD |
10407 | |
10408 | def SetSizerAndFit(*args, **kwargs): | |
15afbcd0 | 10409 | """ |
a95a7133 | 10410 | SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) |
15afbcd0 RD |
10411 | |
10412 | The same as SetSizer, except it also sets the size hints for the | |
10413 | window based on the sizer's minimum size. | |
10414 | """ | |
54f9ee45 | 10415 | return _core_.Window_SetSizerAndFit(*args, **kwargs) |
e811c8ce RD |
10416 | |
10417 | def GetSizer(*args, **kwargs): | |
15afbcd0 | 10418 | """ |
a95a7133 | 10419 | GetSizer(self) -> Sizer |
15afbcd0 RD |
10420 | |
10421 | Return the sizer associated with the window by a previous call to | |
10422 | SetSizer or None if there isn't one. | |
10423 | """ | |
54f9ee45 | 10424 | return _core_.Window_GetSizer(*args, **kwargs) |
e811c8ce RD |
10425 | |
10426 | def SetContainingSizer(*args, **kwargs): | |
15afbcd0 | 10427 | """ |
a95a7133 | 10428 | SetContainingSizer(self, Sizer sizer) |
15afbcd0 RD |
10429 | |
10430 | This normally does not need to be called by application code. It is | |
10431 | called internally when a window is added to a sizer, and is used so | |
10432 | the window can remove itself from the sizer when it is destroyed. | |
10433 | """ | |
54f9ee45 | 10434 | return _core_.Window_SetContainingSizer(*args, **kwargs) |
e811c8ce RD |
10435 | |
10436 | def GetContainingSizer(*args, **kwargs): | |
15afbcd0 | 10437 | """ |
a95a7133 | 10438 | GetContainingSizer(self) -> Sizer |
15afbcd0 RD |
10439 | |
10440 | Return the sizer that this window is a member of, if any, otherwise None. | |
10441 | """ | |
54f9ee45 | 10442 | return _core_.Window_GetContainingSizer(*args, **kwargs) |
e811c8ce | 10443 | |
a95a7133 RD |
10444 | def InheritAttributes(*args, **kwargs): |
10445 | """ | |
10446 | InheritAttributes(self) | |
10447 | ||
41e2b43e RD |
10448 | This function is (or should be, in case of custom controls) called |
10449 | during window creation to intelligently set up the window visual | |
10450 | attributes, that is the font and the foreground and background | |
10451 | colours. | |
10452 | ||
10453 | By 'intelligently' the following is meant: by default, all windows use | |
10454 | their own default attributes. However if some of the parent's | |
10455 | attributes are explicitly changed (that is, using SetFont and not | |
fa47d7a7 | 10456 | SetOwnFont) and if the corresponding attribute hadn't been |
41e2b43e RD |
10457 | explicitly set for this window itself, then this window takes the same |
10458 | value as used by the parent. In addition, if the window overrides | |
10459 | ShouldInheritColours to return false, the colours will not be changed | |
10460 | no matter what and only the font might. | |
10461 | ||
34621cc5 | 10462 | This rather complicated logic is necessary in order to accommodate the |
ec9b55ca | 10463 | different usage scenarios. The most common one is when all default |
41e2b43e RD |
10464 | attributes are used and in this case, nothing should be inherited as |
10465 | in modern GUIs different controls use different fonts (and colours) | |
10466 | than their siblings so they can't inherit the same value from the | |
10467 | parent. However it was also deemed desirable to allow to simply change | |
10468 | the attributes of all children at once by just changing the font or | |
10469 | colour of their common parent, hence in this case we do inherit the | |
10470 | parents attributes. | |
10471 | ||
a95a7133 | 10472 | """ |
54f9ee45 | 10473 | return _core_.Window_InheritAttributes(*args, **kwargs) |
a95a7133 RD |
10474 | |
10475 | def ShouldInheritColours(*args, **kwargs): | |
10476 | """ | |
10477 | ShouldInheritColours(self) -> bool | |
10478 | ||
10479 | Return true from here to allow the colours of this window to be | |
41e2b43e RD |
10480 | changed by InheritAttributes, returning false forbids inheriting them |
10481 | from the parent window. | |
a95a7133 | 10482 | |
41e2b43e RD |
10483 | The base class version returns false, but this method is overridden in |
10484 | wxControl where it returns true. | |
a95a7133 | 10485 | """ |
54f9ee45 | 10486 | return _core_.Window_ShouldInheritColours(*args, **kwargs) |
a95a7133 | 10487 | |
fc46b7f3 RD |
10488 | def CanSetTransparent(*args, **kwargs): |
10489 | """ | |
10490 | CanSetTransparent(self) -> bool | |
10491 | ||
10492 | Returns ``True`` if the platform supports setting the transparency for | |
10493 | this window. Note that this method will err on the side of caution, | |
10494 | so it is possible that this will return ``False`` when it is in fact | |
10495 | possible to set the transparency. | |
10496 | ||
10497 | NOTE: On X-windows systems the X server must have the composite | |
10498 | extension loaded, and there must be a composite manager program (such | |
10499 | as xcompmgr) running. | |
10500 | """ | |
10501 | return _core_.Window_CanSetTransparent(*args, **kwargs) | |
10502 | ||
10503 | def SetTransparent(*args, **kwargs): | |
10504 | """ | |
10505 | SetTransparent(self, byte alpha) -> bool | |
10506 | ||
10507 | Attempt to set the transparency of this window to the ``alpha`` value, | |
10508 | returns True on success. The ``alpha`` value is an integer in the | |
10509 | range of 0 to 255, where 0 is fully transparent and 255 is fully | |
10510 | opaque. | |
10511 | """ | |
10512 | return _core_.Window_SetTransparent(*args, **kwargs) | |
10513 | ||
e811c8ce | 10514 | def PostCreate(self, pre): |
15afbcd0 RD |
10515 | """ |
10516 | Phase 3 of the 2-phase create <wink!> | |
10517 | Call this method after precreating the window with the 2-phase create method. | |
10518 | """ | |
e811c8ce RD |
10519 | self.this = pre.this |
10520 | self.thisown = pre.thisown | |
10521 | pre.thisown = 0 | |
10522 | if hasattr(self, '_setOORInfo'): | |
4976f996 RD |
10523 | try: |
10524 | self._setOORInfo(self) | |
10525 | except TypeError: | |
10526 | pass | |
e811c8ce | 10527 | if hasattr(self, '_setCallbackInfo'): |
4976f996 RD |
10528 | try: |
10529 | self._setCallbackInfo(self, pre.__class__) | |
10530 | except TypeError: | |
10531 | pass | |
e811c8ce | 10532 | |
7e08d4ef | 10533 | def SendSizeEvent(self): |
453fb36b | 10534 | self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1))) |
7e08d4ef | 10535 | |
2bf58437 | 10536 | AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`") |
2bf58437 RD |
10537 | AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`") |
10538 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
10539 | BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`") | |
580080c5 | 10540 | EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`") |
2bf58437 RD |
10541 | BestSize = property(GetBestSize,doc="See `GetBestSize`") |
10542 | BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`") | |
10543 | Border = property(GetBorder,doc="See `GetBorder`") | |
10544 | Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`") | |
10545 | CharHeight = property(GetCharHeight,doc="See `GetCharHeight`") | |
10546 | CharWidth = property(GetCharWidth,doc="See `GetCharWidth`") | |
10547 | Children = property(GetChildren,doc="See `GetChildren`") | |
10548 | ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`") | |
10549 | ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`") | |
10550 | ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`") | |
10551 | Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`") | |
10552 | ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`") | |
10553 | Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`") | |
10554 | DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`") | |
10555 | DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`") | |
10556 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") | |
10557 | ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`") | |
10558 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
10559 | ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`") | |
2bf58437 | 10560 | GrandParent = property(GetGrandParent,doc="See `GetGrandParent`") |
cbfc9df6 | 10561 | TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`") |
2bf58437 RD |
10562 | Handle = property(GetHandle,doc="See `GetHandle`") |
10563 | HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`") | |
2bf58437 RD |
10564 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") |
10565 | Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`") | |
994453b8 | 10566 | LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`") |
2bf58437 RD |
10567 | MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`") |
10568 | MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`") | |
10569 | MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`") | |
10570 | MinHeight = property(GetMinHeight,doc="See `GetMinHeight`") | |
10571 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
10572 | MinWidth = property(GetMinWidth,doc="See `GetMinWidth`") | |
10573 | Name = property(GetName,SetName,doc="See `GetName` and `SetName`") | |
10574 | Parent = property(GetParent,doc="See `GetParent`") | |
10575 | Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`") | |
10576 | Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`") | |
10577 | ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`") | |
10578 | ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`") | |
2bf58437 RD |
10579 | Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`") |
10580 | Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`") | |
2bf58437 RD |
10581 | ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`") |
10582 | ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`") | |
10583 | UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`") | |
10584 | UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`") | |
10585 | Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`") | |
10586 | VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`") | |
10587 | WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`") | |
10588 | WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`") | |
10589 | WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`") | |
97ab0f6a RD |
10590 | Shown = property(IsShown,Show,doc="See `IsShown` and `Show`") |
10591 | Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`") | |
10592 | TopLevel = property(IsTopLevel,doc="See `IsTopLevel`") | |
2131d850 | 10593 | _core_.Window_swigregister(Window) |
e811c8ce RD |
10594 | |
10595 | def PreWindow(*args, **kwargs): | |
15afbcd0 RD |
10596 | """ |
10597 | PreWindow() -> Window | |
10598 | ||
10599 | Precreate a Window for 2-phase creation. | |
10600 | """ | |
54f9ee45 | 10601 | val = _core_.new_PreWindow(*args, **kwargs) |
e811c8ce RD |
10602 | return val |
10603 | ||
0085ce49 RD |
10604 | def Window_NewControlId(*args): |
10605 | """ | |
15afbcd0 RD |
10606 | Window_NewControlId() -> int |
10607 | ||
10608 | Generate a control id for the controls which were not given one. | |
10609 | """ | |
0085ce49 | 10610 | return _core_.Window_NewControlId(*args) |
e811c8ce RD |
10611 | |
10612 | def Window_NextControlId(*args, **kwargs): | |
0085ce49 | 10613 | """ |
15afbcd0 RD |
10614 | Window_NextControlId(int winid) -> int |
10615 | ||
10616 | Get the id of the control following the one with the given | |
41e2b43e | 10617 | autogenerated) id |
15afbcd0 | 10618 | """ |
0085ce49 | 10619 | return _core_.Window_NextControlId(*args, **kwargs) |
e811c8ce RD |
10620 | |
10621 | def Window_PrevControlId(*args, **kwargs): | |
0085ce49 | 10622 | """ |
15afbcd0 RD |
10623 | Window_PrevControlId(int winid) -> int |
10624 | ||
10625 | Get the id of the control preceding the one with the given | |
41e2b43e | 10626 | autogenerated) id |
15afbcd0 | 10627 | """ |
0085ce49 | 10628 | return _core_.Window_PrevControlId(*args, **kwargs) |
e811c8ce | 10629 | |
0085ce49 RD |
10630 | def Window_FindFocus(*args): |
10631 | """ | |
15afbcd0 RD |
10632 | Window_FindFocus() -> Window |
10633 | ||
10634 | Returns the window or control that currently has the keyboard focus, | |
10635 | or None. | |
10636 | """ | |
0085ce49 | 10637 | return _core_.Window_FindFocus(*args) |
e811c8ce | 10638 | |
0085ce49 RD |
10639 | def Window_GetCapture(*args): |
10640 | """ | |
15afbcd0 RD |
10641 | Window_GetCapture() -> Window |
10642 | ||
10643 | Returns the window which currently captures the mouse or None | |
10644 | """ | |
0085ce49 | 10645 | return _core_.Window_GetCapture(*args) |
e811c8ce | 10646 | |
74a57fcd | 10647 | def Window_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 10648 | """ |
74a57fcd RD |
10649 | Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
10650 | ||
41e2b43e RD |
10651 | Get the default attributes for this class. This is useful if you want |
10652 | to use the same font or colour in your own control as in a standard | |
10653 | control -- which is a much better idea than hard coding specific | |
db3e571a RD |
10654 | colours or fonts which might look completely out of place on the |
10655 | user's system, especially if it uses themes. | |
74a57fcd RD |
10656 | |
10657 | The variant parameter is only relevant under Mac currently and is | |
41e2b43e | 10658 | ignore under other platforms. Under Mac, it will change the size of |
db3e571a RD |
10659 | the returned font. See `wx.Window.SetWindowVariant` for more about |
10660 | this. | |
74a57fcd | 10661 | """ |
0085ce49 | 10662 | return _core_.Window_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 10663 | |
e811c8ce | 10664 | def DLG_PNT(win, point_or_x, y=None): |
15afbcd0 RD |
10665 | """ |
10666 | Convenience function for converting a Point or (x,y) in | |
10667 | dialog units to pixel units. | |
10668 | """ | |
e811c8ce RD |
10669 | if y is None: |
10670 | return win.ConvertDialogPointToPixels(point_or_x) | |
10671 | else: | |
fd3f2efe | 10672 | return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y)) |
e811c8ce RD |
10673 | |
10674 | def DLG_SZE(win, size_width, height=None): | |
15afbcd0 RD |
10675 | """ |
10676 | Convenience function for converting a Size or (w,h) in | |
10677 | dialog units to pixel units. | |
10678 | """ | |
e811c8ce RD |
10679 | if height is None: |
10680 | return win.ConvertDialogSizeToPixels(size_width) | |
10681 | else: | |
fd3f2efe | 10682 | return win.ConvertDialogSizeToPixels(wx.Size(size_width, height)) |
e811c8ce RD |
10683 | |
10684 | ||
10685 | def FindWindowById(*args, **kwargs): | |
0085ce49 | 10686 | """ |
15afbcd0 RD |
10687 | FindWindowById(long id, Window parent=None) -> Window |
10688 | ||
10689 | Find the first window in the application with the given id. If parent | |
10690 | is None, the search will start from all top-level frames and dialog | |
10691 | boxes; if non-None, the search will be limited to the given window | |
10692 | hierarchy. The search is recursive in both cases. | |
10693 | """ | |
0085ce49 | 10694 | return _core_.FindWindowById(*args, **kwargs) |
e811c8ce RD |
10695 | |
10696 | def FindWindowByName(*args, **kwargs): | |
0085ce49 | 10697 | """ |
15afbcd0 RD |
10698 | FindWindowByName(String name, Window parent=None) -> Window |
10699 | ||
10700 | Find a window by its name (as given in a window constructor or Create | |
10701 | function call). If parent is None, the search will start from all | |
10702 | top-level frames and dialog boxes; if non-None, the search will be | |
10703 | limited to the given window hierarchy. The search is recursive in both | |
10704 | cases. | |
10705 | ||
10706 | If no window with such name is found, wx.FindWindowByLabel is called. | |
10707 | """ | |
0085ce49 | 10708 | return _core_.FindWindowByName(*args, **kwargs) |
e811c8ce RD |
10709 | |
10710 | def FindWindowByLabel(*args, **kwargs): | |
0085ce49 | 10711 | """ |
15afbcd0 RD |
10712 | FindWindowByLabel(String label, Window parent=None) -> Window |
10713 | ||
10714 | Find a window by its label. Depending on the type of window, the label | |
10715 | may be a window title or panel item label. If parent is None, the | |
10716 | search will start from all top-level frames and dialog boxes; if | |
10717 | non-None, the search will be limited to the given window | |
10718 | hierarchy. The search is recursive in both cases. | |
10719 | """ | |
0085ce49 | 10720 | return _core_.FindWindowByLabel(*args, **kwargs) |
e811c8ce RD |
10721 | |
10722 | def Window_FromHWND(*args, **kwargs): | |
0085ce49 RD |
10723 | """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" |
10724 | return _core_.Window_FromHWND(*args, **kwargs) | |
b6b0383e | 10725 | |
0085ce49 RD |
10726 | def GetTopLevelWindows(*args): |
10727 | """ | |
b6b0383e RD |
10728 | GetTopLevelWindows() -> PyObject |
10729 | ||
10730 | Returns a list of the the application's top-level windows, (frames, | |
10731 | dialogs, etc.) NOTE: Currently this is a copy of the list maintained | |
10732 | by wxWidgets, and so it is only valid as long as no top-level windows | |
10733 | are closed or new top-level windows are created. | |
10734 | ||
10735 | """ | |
0085ce49 | 10736 | return _core_.GetTopLevelWindows(*args) |
e811c8ce RD |
10737 | #--------------------------------------------------------------------------- |
10738 | ||
10739 | class Validator(EvtHandler): | |
093d3ff1 | 10740 | """Proxy of C++ Validator class""" |
0085ce49 RD |
10741 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10742 | __repr__ = _swig_repr | |
10743 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10744 | """__init__(self) -> Validator""" |
0085ce49 | 10745 | _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs)) |
d14a1e28 | 10746 | self._setOORInfo(self) |
e811c8ce RD |
10747 | |
10748 | def Clone(*args, **kwargs): | |
a95a7133 | 10749 | """Clone(self) -> Validator""" |
54f9ee45 | 10750 | return _core_.Validator_Clone(*args, **kwargs) |
e811c8ce RD |
10751 | |
10752 | def Validate(*args, **kwargs): | |
a95a7133 | 10753 | """Validate(self, Window parent) -> bool""" |
54f9ee45 | 10754 | return _core_.Validator_Validate(*args, **kwargs) |
e811c8ce RD |
10755 | |
10756 | def TransferToWindow(*args, **kwargs): | |
a95a7133 | 10757 | """TransferToWindow(self) -> bool""" |
54f9ee45 | 10758 | return _core_.Validator_TransferToWindow(*args, **kwargs) |
e811c8ce RD |
10759 | |
10760 | def TransferFromWindow(*args, **kwargs): | |
a95a7133 | 10761 | """TransferFromWindow(self) -> bool""" |
54f9ee45 | 10762 | return _core_.Validator_TransferFromWindow(*args, **kwargs) |
e811c8ce RD |
10763 | |
10764 | def GetWindow(*args, **kwargs): | |
a95a7133 | 10765 | """GetWindow(self) -> Window""" |
54f9ee45 | 10766 | return _core_.Validator_GetWindow(*args, **kwargs) |
e811c8ce RD |
10767 | |
10768 | def SetWindow(*args, **kwargs): | |
a95a7133 | 10769 | """SetWindow(self, Window window)""" |
54f9ee45 | 10770 | return _core_.Validator_SetWindow(*args, **kwargs) |
e811c8ce RD |
10771 | |
10772 | def IsSilent(*args, **kwargs): | |
66c033b4 | 10773 | """IsSilent() -> bool""" |
54f9ee45 | 10774 | return _core_.Validator_IsSilent(*args, **kwargs) |
e811c8ce RD |
10775 | |
10776 | IsSilent = staticmethod(IsSilent) | |
10777 | def SetBellOnError(*args, **kwargs): | |
66c033b4 | 10778 | """SetBellOnError(int doIt=True)""" |
54f9ee45 | 10779 | return _core_.Validator_SetBellOnError(*args, **kwargs) |
e811c8ce RD |
10780 | |
10781 | SetBellOnError = staticmethod(SetBellOnError) | |
dba7934c | 10782 | Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`") |
2131d850 | 10783 | _core_.Validator_swigregister(Validator) |
e811c8ce | 10784 | |
0085ce49 RD |
10785 | def Validator_IsSilent(*args): |
10786 | """Validator_IsSilent() -> bool""" | |
10787 | return _core_.Validator_IsSilent(*args) | |
e811c8ce RD |
10788 | |
10789 | def Validator_SetBellOnError(*args, **kwargs): | |
0085ce49 RD |
10790 | """Validator_SetBellOnError(int doIt=True)""" |
10791 | return _core_.Validator_SetBellOnError(*args, **kwargs) | |
e811c8ce RD |
10792 | |
10793 | class PyValidator(Validator): | |
093d3ff1 | 10794 | """Proxy of C++ PyValidator class""" |
0085ce49 RD |
10795 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10796 | __repr__ = _swig_repr | |
10797 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10798 | """__init__(self) -> PyValidator""" |
0085ce49 | 10799 | _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs)) |
c25f90f6 | 10800 | self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator) |
e811c8ce RD |
10801 | |
10802 | def _setCallbackInfo(*args, **kwargs): | |
c25f90f6 | 10803 | """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)""" |
54f9ee45 | 10804 | return _core_.PyValidator__setCallbackInfo(*args, **kwargs) |
e811c8ce | 10805 | |
2131d850 | 10806 | _core_.PyValidator_swigregister(PyValidator) |
e811c8ce RD |
10807 | |
10808 | #--------------------------------------------------------------------------- | |
10809 | ||
10810 | class Menu(EvtHandler): | |
093d3ff1 | 10811 | """Proxy of C++ Menu class""" |
0085ce49 RD |
10812 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
10813 | __repr__ = _swig_repr | |
10814 | def __init__(self, *args, **kwargs): | |
a95a7133 | 10815 | """__init__(self, String title=EmptyString, long style=0) -> Menu""" |
0085ce49 | 10816 | _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs)) |
e811c8ce RD |
10817 | self._setOORInfo(self) |
10818 | ||
10819 | def Append(*args, **kwargs): | |
97ab0f6a RD |
10820 | """ |
10821 | Append(self, int id, String text=EmptyString, String help=EmptyString, | |
10822 | int kind=ITEM_NORMAL) -> MenuItem | |
10823 | """ | |
54f9ee45 | 10824 | return _core_.Menu_Append(*args, **kwargs) |
e811c8ce RD |
10825 | |
10826 | def AppendSeparator(*args, **kwargs): | |
a95a7133 | 10827 | """AppendSeparator(self) -> MenuItem""" |
54f9ee45 | 10828 | return _core_.Menu_AppendSeparator(*args, **kwargs) |
e811c8ce RD |
10829 | |
10830 | def AppendCheckItem(*args, **kwargs): | |
a95a7133 | 10831 | """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10832 | return _core_.Menu_AppendCheckItem(*args, **kwargs) |
e811c8ce RD |
10833 | |
10834 | def AppendRadioItem(*args, **kwargs): | |
a95a7133 | 10835 | """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10836 | return _core_.Menu_AppendRadioItem(*args, **kwargs) |
e811c8ce RD |
10837 | |
10838 | def AppendMenu(*args, **kwargs): | |
a95a7133 | 10839 | """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10840 | return _core_.Menu_AppendMenu(*args, **kwargs) |
e811c8ce | 10841 | |
50efceee RD |
10842 | def AppendSubMenu(*args, **kwargs): |
10843 | """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem""" | |
10844 | return _core_.Menu_AppendSubMenu(*args, **kwargs) | |
10845 | ||
e811c8ce | 10846 | def AppendItem(*args, **kwargs): |
a95a7133 | 10847 | """AppendItem(self, MenuItem item) -> MenuItem""" |
54f9ee45 | 10848 | return _core_.Menu_AppendItem(*args, **kwargs) |
e811c8ce | 10849 | |
e811c8ce | 10850 | def InsertItem(*args, **kwargs): |
a95a7133 | 10851 | """InsertItem(self, size_t pos, MenuItem item) -> MenuItem""" |
54f9ee45 | 10852 | return _core_.Menu_InsertItem(*args, **kwargs) |
e811c8ce | 10853 | |
0085ce49 RD |
10854 | def PrependItem(*args, **kwargs): |
10855 | """PrependItem(self, MenuItem item) -> MenuItem""" | |
10856 | return _core_.Menu_PrependItem(*args, **kwargs) | |
10857 | ||
10858 | def Break(*args, **kwargs): | |
10859 | """Break(self)""" | |
10860 | return _core_.Menu_Break(*args, **kwargs) | |
10861 | ||
e811c8ce | 10862 | def Insert(*args, **kwargs): |
0df68c9f | 10863 | """ |
97ab0f6a | 10864 | Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString, |
a41e16b6 | 10865 | int kind=ITEM_NORMAL) -> MenuItem |
0df68c9f | 10866 | """ |
54f9ee45 | 10867 | return _core_.Menu_Insert(*args, **kwargs) |
e811c8ce RD |
10868 | |
10869 | def InsertSeparator(*args, **kwargs): | |
a95a7133 | 10870 | """InsertSeparator(self, size_t pos) -> MenuItem""" |
54f9ee45 | 10871 | return _core_.Menu_InsertSeparator(*args, **kwargs) |
e811c8ce RD |
10872 | |
10873 | def InsertCheckItem(*args, **kwargs): | |
a95a7133 | 10874 | """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10875 | return _core_.Menu_InsertCheckItem(*args, **kwargs) |
e811c8ce RD |
10876 | |
10877 | def InsertRadioItem(*args, **kwargs): | |
a95a7133 | 10878 | """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10879 | return _core_.Menu_InsertRadioItem(*args, **kwargs) |
e811c8ce RD |
10880 | |
10881 | def InsertMenu(*args, **kwargs): | |
a95a7133 | 10882 | """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10883 | return _core_.Menu_InsertMenu(*args, **kwargs) |
e811c8ce | 10884 | |
e811c8ce | 10885 | def Prepend(*args, **kwargs): |
97ab0f6a RD |
10886 | """ |
10887 | Prepend(self, int id, String text=EmptyString, String help=EmptyString, | |
10888 | int kind=ITEM_NORMAL) -> MenuItem | |
10889 | """ | |
54f9ee45 | 10890 | return _core_.Menu_Prepend(*args, **kwargs) |
e811c8ce RD |
10891 | |
10892 | def PrependSeparator(*args, **kwargs): | |
a95a7133 | 10893 | """PrependSeparator(self) -> MenuItem""" |
54f9ee45 | 10894 | return _core_.Menu_PrependSeparator(*args, **kwargs) |
e811c8ce RD |
10895 | |
10896 | def PrependCheckItem(*args, **kwargs): | |
a95a7133 | 10897 | """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10898 | return _core_.Menu_PrependCheckItem(*args, **kwargs) |
e811c8ce RD |
10899 | |
10900 | def PrependRadioItem(*args, **kwargs): | |
a95a7133 | 10901 | """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10902 | return _core_.Menu_PrependRadioItem(*args, **kwargs) |
e811c8ce RD |
10903 | |
10904 | def PrependMenu(*args, **kwargs): | |
a95a7133 | 10905 | """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem""" |
54f9ee45 | 10906 | return _core_.Menu_PrependMenu(*args, **kwargs) |
e811c8ce RD |
10907 | |
10908 | def Remove(*args, **kwargs): | |
a95a7133 | 10909 | """Remove(self, int id) -> MenuItem""" |
54f9ee45 | 10910 | return _core_.Menu_Remove(*args, **kwargs) |
e811c8ce | 10911 | |
59ccbf7f | 10912 | def RemoveItem(self, item): |
a95a7133 | 10913 | """RemoveItem(self, MenuItem item) -> MenuItem""" |
59ccbf7f RD |
10914 | #// The return object is always the parameter, so return that |
10915 | #// proxy instead of the new one | |
10916 | val = _core_.Menu_RemoveItem(self, item) | |
10917 | item.this.own(val.this.own()) | |
10918 | val.this.disown() | |
10919 | return item | |
10920 | ||
e811c8ce RD |
10921 | |
10922 | def Delete(*args, **kwargs): | |
a95a7133 | 10923 | """Delete(self, int id) -> bool""" |
54f9ee45 | 10924 | return _core_.Menu_Delete(*args, **kwargs) |
e811c8ce RD |
10925 | |
10926 | def DeleteItem(*args, **kwargs): | |
a95a7133 | 10927 | """DeleteItem(self, MenuItem item) -> bool""" |
54f9ee45 | 10928 | return _core_.Menu_DeleteItem(*args, **kwargs) |
e811c8ce RD |
10929 | |
10930 | def Destroy(*args, **kwargs): | |
0df68c9f | 10931 | """ |
a95a7133 | 10932 | Destroy(self) |
e811c8ce | 10933 | |
0df68c9f RD |
10934 | Deletes the C++ object this Python object is a proxy for. |
10935 | """ | |
b39fe951 RD |
10936 | args[0].this.own(False) |
10937 | return _core_.Menu_Destroy(*args, **kwargs) | |
e811c8ce RD |
10938 | |
10939 | def DestroyId(*args, **kwargs): | |
b39fe951 RD |
10940 | """DestroyId(self, int id) -> bool""" |
10941 | return _core_.Menu_DestroyId(*args, **kwargs) | |
e811c8ce RD |
10942 | |
10943 | def DestroyItem(*args, **kwargs): | |
b39fe951 RD |
10944 | """DestroyItem(self, MenuItem item) -> bool""" |
10945 | return _core_.Menu_DestroyItem(*args, **kwargs) | |
e811c8ce RD |
10946 | |
10947 | def GetMenuItemCount(*args, **kwargs): | |
a95a7133 | 10948 | """GetMenuItemCount(self) -> size_t""" |
54f9ee45 | 10949 | return _core_.Menu_GetMenuItemCount(*args, **kwargs) |
e811c8ce RD |
10950 | |
10951 | def GetMenuItems(*args, **kwargs): | |
a95a7133 | 10952 | """GetMenuItems(self) -> PyObject""" |
54f9ee45 | 10953 | return _core_.Menu_GetMenuItems(*args, **kwargs) |
e811c8ce RD |
10954 | |
10955 | def FindItem(*args, **kwargs): | |
a95a7133 | 10956 | """FindItem(self, String item) -> int""" |
54f9ee45 | 10957 | return _core_.Menu_FindItem(*args, **kwargs) |
e811c8ce RD |
10958 | |
10959 | def FindItemById(*args, **kwargs): | |
a95a7133 | 10960 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 10961 | return _core_.Menu_FindItemById(*args, **kwargs) |
e811c8ce RD |
10962 | |
10963 | def FindItemByPosition(*args, **kwargs): | |
a95a7133 | 10964 | """FindItemByPosition(self, size_t position) -> MenuItem""" |
54f9ee45 | 10965 | return _core_.Menu_FindItemByPosition(*args, **kwargs) |
e811c8ce RD |
10966 | |
10967 | def Enable(*args, **kwargs): | |
a95a7133 | 10968 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 10969 | return _core_.Menu_Enable(*args, **kwargs) |
e811c8ce RD |
10970 | |
10971 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 10972 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 10973 | return _core_.Menu_IsEnabled(*args, **kwargs) |
e811c8ce RD |
10974 | |
10975 | def Check(*args, **kwargs): | |
a95a7133 | 10976 | """Check(self, int id, bool check)""" |
54f9ee45 | 10977 | return _core_.Menu_Check(*args, **kwargs) |
e811c8ce RD |
10978 | |
10979 | def IsChecked(*args, **kwargs): | |
a95a7133 | 10980 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 10981 | return _core_.Menu_IsChecked(*args, **kwargs) |
e811c8ce RD |
10982 | |
10983 | def SetLabel(*args, **kwargs): | |
a95a7133 | 10984 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 10985 | return _core_.Menu_SetLabel(*args, **kwargs) |
e811c8ce RD |
10986 | |
10987 | def GetLabel(*args, **kwargs): | |
a95a7133 | 10988 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 10989 | return _core_.Menu_GetLabel(*args, **kwargs) |
e811c8ce RD |
10990 | |
10991 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 10992 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 10993 | return _core_.Menu_SetHelpString(*args, **kwargs) |
e811c8ce RD |
10994 | |
10995 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 10996 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 10997 | return _core_.Menu_GetHelpString(*args, **kwargs) |
e811c8ce RD |
10998 | |
10999 | def SetTitle(*args, **kwargs): | |
a95a7133 | 11000 | """SetTitle(self, String title)""" |
54f9ee45 | 11001 | return _core_.Menu_SetTitle(*args, **kwargs) |
e811c8ce RD |
11002 | |
11003 | def GetTitle(*args, **kwargs): | |
a95a7133 | 11004 | """GetTitle(self) -> String""" |
54f9ee45 | 11005 | return _core_.Menu_GetTitle(*args, **kwargs) |
e811c8ce RD |
11006 | |
11007 | def SetEventHandler(*args, **kwargs): | |
a95a7133 | 11008 | """SetEventHandler(self, EvtHandler handler)""" |
54f9ee45 | 11009 | return _core_.Menu_SetEventHandler(*args, **kwargs) |
e811c8ce RD |
11010 | |
11011 | def GetEventHandler(*args, **kwargs): | |
a95a7133 | 11012 | """GetEventHandler(self) -> EvtHandler""" |
54f9ee45 | 11013 | return _core_.Menu_GetEventHandler(*args, **kwargs) |
e811c8ce RD |
11014 | |
11015 | def SetInvokingWindow(*args, **kwargs): | |
a95a7133 | 11016 | """SetInvokingWindow(self, Window win)""" |
54f9ee45 | 11017 | return _core_.Menu_SetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
11018 | |
11019 | def GetInvokingWindow(*args, **kwargs): | |
a95a7133 | 11020 | """GetInvokingWindow(self) -> Window""" |
54f9ee45 | 11021 | return _core_.Menu_GetInvokingWindow(*args, **kwargs) |
e811c8ce RD |
11022 | |
11023 | def GetStyle(*args, **kwargs): | |
a95a7133 | 11024 | """GetStyle(self) -> long""" |
54f9ee45 | 11025 | return _core_.Menu_GetStyle(*args, **kwargs) |
e811c8ce RD |
11026 | |
11027 | def UpdateUI(*args, **kwargs): | |
a95a7133 | 11028 | """UpdateUI(self, EvtHandler source=None)""" |
54f9ee45 | 11029 | return _core_.Menu_UpdateUI(*args, **kwargs) |
e811c8ce RD |
11030 | |
11031 | def GetMenuBar(*args, **kwargs): | |
a95a7133 | 11032 | """GetMenuBar(self) -> MenuBar""" |
54f9ee45 | 11033 | return _core_.Menu_GetMenuBar(*args, **kwargs) |
e811c8ce RD |
11034 | |
11035 | def Attach(*args, **kwargs): | |
a95a7133 | 11036 | """Attach(self, wxMenuBarBase menubar)""" |
54f9ee45 | 11037 | return _core_.Menu_Attach(*args, **kwargs) |
e811c8ce RD |
11038 | |
11039 | def Detach(*args, **kwargs): | |
a95a7133 | 11040 | """Detach(self)""" |
54f9ee45 | 11041 | return _core_.Menu_Detach(*args, **kwargs) |
e811c8ce RD |
11042 | |
11043 | def IsAttached(*args, **kwargs): | |
a95a7133 | 11044 | """IsAttached(self) -> bool""" |
54f9ee45 | 11045 | return _core_.Menu_IsAttached(*args, **kwargs) |
e811c8ce RD |
11046 | |
11047 | def SetParent(*args, **kwargs): | |
a95a7133 | 11048 | """SetParent(self, Menu parent)""" |
54f9ee45 | 11049 | return _core_.Menu_SetParent(*args, **kwargs) |
e811c8ce RD |
11050 | |
11051 | def GetParent(*args, **kwargs): | |
a95a7133 | 11052 | """GetParent(self) -> Menu""" |
54f9ee45 | 11053 | return _core_.Menu_GetParent(*args, **kwargs) |
e811c8ce | 11054 | |
57332a5a RD |
11055 | EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`") |
11056 | HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`") | |
11057 | InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`") | |
11058 | MenuBar = property(GetMenuBar,doc="See `GetMenuBar`") | |
11059 | MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`") | |
11060 | MenuItems = property(GetMenuItems,doc="See `GetMenuItems`") | |
11061 | Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`") | |
11062 | Style = property(GetStyle,doc="See `GetStyle`") | |
11063 | Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`") | |
2131d850 | 11064 | _core_.Menu_swigregister(Menu) |
d14a1e28 RD |
11065 | DefaultValidator = cvar.DefaultValidator |
11066 | ||
11067 | #--------------------------------------------------------------------------- | |
11068 | ||
11069 | class MenuBar(Window): | |
093d3ff1 | 11070 | """Proxy of C++ MenuBar class""" |
0085ce49 RD |
11071 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11072 | __repr__ = _swig_repr | |
11073 | def __init__(self, *args, **kwargs): | |
a95a7133 | 11074 | """__init__(self, long style=0) -> MenuBar""" |
0085ce49 | 11075 | _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs)) |
d14a1e28 | 11076 | self._setOORInfo(self) |
e811c8ce RD |
11077 | |
11078 | def Append(*args, **kwargs): | |
a95a7133 | 11079 | """Append(self, Menu menu, String title) -> bool""" |
54f9ee45 | 11080 | return _core_.MenuBar_Append(*args, **kwargs) |
e811c8ce RD |
11081 | |
11082 | def Insert(*args, **kwargs): | |
a95a7133 | 11083 | """Insert(self, size_t pos, Menu menu, String title) -> bool""" |
54f9ee45 | 11084 | return _core_.MenuBar_Insert(*args, **kwargs) |
e811c8ce RD |
11085 | |
11086 | def GetMenuCount(*args, **kwargs): | |
a95a7133 | 11087 | """GetMenuCount(self) -> size_t""" |
54f9ee45 | 11088 | return _core_.MenuBar_GetMenuCount(*args, **kwargs) |
e811c8ce RD |
11089 | |
11090 | def GetMenu(*args, **kwargs): | |
a95a7133 | 11091 | """GetMenu(self, size_t pos) -> Menu""" |
54f9ee45 | 11092 | return _core_.MenuBar_GetMenu(*args, **kwargs) |
e811c8ce RD |
11093 | |
11094 | def Replace(*args, **kwargs): | |
a95a7133 | 11095 | """Replace(self, size_t pos, Menu menu, String title) -> Menu""" |
54f9ee45 | 11096 | return _core_.MenuBar_Replace(*args, **kwargs) |
e811c8ce RD |
11097 | |
11098 | def Remove(*args, **kwargs): | |
a95a7133 | 11099 | """Remove(self, size_t pos) -> Menu""" |
54f9ee45 | 11100 | return _core_.MenuBar_Remove(*args, **kwargs) |
e811c8ce RD |
11101 | |
11102 | def EnableTop(*args, **kwargs): | |
a95a7133 | 11103 | """EnableTop(self, size_t pos, bool enable)""" |
54f9ee45 | 11104 | return _core_.MenuBar_EnableTop(*args, **kwargs) |
e811c8ce RD |
11105 | |
11106 | def IsEnabledTop(*args, **kwargs): | |
a95a7133 | 11107 | """IsEnabledTop(self, size_t pos) -> bool""" |
54f9ee45 | 11108 | return _core_.MenuBar_IsEnabledTop(*args, **kwargs) |
e811c8ce RD |
11109 | |
11110 | def SetLabelTop(*args, **kwargs): | |
a95a7133 | 11111 | """SetLabelTop(self, size_t pos, String label)""" |
54f9ee45 | 11112 | return _core_.MenuBar_SetLabelTop(*args, **kwargs) |
e811c8ce RD |
11113 | |
11114 | def GetLabelTop(*args, **kwargs): | |
a95a7133 | 11115 | """GetLabelTop(self, size_t pos) -> String""" |
54f9ee45 | 11116 | return _core_.MenuBar_GetLabelTop(*args, **kwargs) |
e811c8ce RD |
11117 | |
11118 | def FindMenuItem(*args, **kwargs): | |
a95a7133 | 11119 | """FindMenuItem(self, String menu, String item) -> int""" |
54f9ee45 | 11120 | return _core_.MenuBar_FindMenuItem(*args, **kwargs) |
e811c8ce RD |
11121 | |
11122 | def FindItemById(*args, **kwargs): | |
a95a7133 | 11123 | """FindItemById(self, int id) -> MenuItem""" |
54f9ee45 | 11124 | return _core_.MenuBar_FindItemById(*args, **kwargs) |
e811c8ce RD |
11125 | |
11126 | def FindMenu(*args, **kwargs): | |
a95a7133 | 11127 | """FindMenu(self, String title) -> int""" |
54f9ee45 | 11128 | return _core_.MenuBar_FindMenu(*args, **kwargs) |
e811c8ce RD |
11129 | |
11130 | def Enable(*args, **kwargs): | |
a95a7133 | 11131 | """Enable(self, int id, bool enable)""" |
54f9ee45 | 11132 | return _core_.MenuBar_Enable(*args, **kwargs) |
e811c8ce RD |
11133 | |
11134 | def Check(*args, **kwargs): | |
a95a7133 | 11135 | """Check(self, int id, bool check)""" |
54f9ee45 | 11136 | return _core_.MenuBar_Check(*args, **kwargs) |
e811c8ce RD |
11137 | |
11138 | def IsChecked(*args, **kwargs): | |
a95a7133 | 11139 | """IsChecked(self, int id) -> bool""" |
54f9ee45 | 11140 | return _core_.MenuBar_IsChecked(*args, **kwargs) |
e811c8ce RD |
11141 | |
11142 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 11143 | """IsEnabled(self, int id) -> bool""" |
54f9ee45 | 11144 | return _core_.MenuBar_IsEnabled(*args, **kwargs) |
e811c8ce RD |
11145 | |
11146 | def SetLabel(*args, **kwargs): | |
a95a7133 | 11147 | """SetLabel(self, int id, String label)""" |
54f9ee45 | 11148 | return _core_.MenuBar_SetLabel(*args, **kwargs) |
e811c8ce RD |
11149 | |
11150 | def GetLabel(*args, **kwargs): | |
a95a7133 | 11151 | """GetLabel(self, int id) -> String""" |
54f9ee45 | 11152 | return _core_.MenuBar_GetLabel(*args, **kwargs) |
e811c8ce RD |
11153 | |
11154 | def SetHelpString(*args, **kwargs): | |
a95a7133 | 11155 | """SetHelpString(self, int id, String helpString)""" |
54f9ee45 | 11156 | return _core_.MenuBar_SetHelpString(*args, **kwargs) |
e811c8ce RD |
11157 | |
11158 | def GetHelpString(*args, **kwargs): | |
a95a7133 | 11159 | """GetHelpString(self, int id) -> String""" |
54f9ee45 | 11160 | return _core_.MenuBar_GetHelpString(*args, **kwargs) |
e811c8ce RD |
11161 | |
11162 | def GetFrame(*args, **kwargs): | |
a95a7133 | 11163 | """GetFrame(self) -> wxFrame""" |
54f9ee45 | 11164 | return _core_.MenuBar_GetFrame(*args, **kwargs) |
e811c8ce RD |
11165 | |
11166 | def IsAttached(*args, **kwargs): | |
a95a7133 | 11167 | """IsAttached(self) -> bool""" |
54f9ee45 | 11168 | return _core_.MenuBar_IsAttached(*args, **kwargs) |
e811c8ce RD |
11169 | |
11170 | def Attach(*args, **kwargs): | |
a95a7133 | 11171 | """Attach(self, wxFrame frame)""" |
54f9ee45 | 11172 | return _core_.MenuBar_Attach(*args, **kwargs) |
e811c8ce RD |
11173 | |
11174 | def Detach(*args, **kwargs): | |
a95a7133 | 11175 | """Detach(self)""" |
54f9ee45 | 11176 | return _core_.MenuBar_Detach(*args, **kwargs) |
e811c8ce | 11177 | |
587d0f36 RD |
11178 | def UpdateMenus(*args, **kwargs): |
11179 | """UpdateMenus(self)""" | |
11180 | return _core_.MenuBar_UpdateMenus(*args, **kwargs) | |
11181 | ||
4f433fef RD |
11182 | def SetAutoWindowMenu(*args, **kwargs): |
11183 | """SetAutoWindowMenu(bool enable)""" | |
11184 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
11185 | ||
11186 | SetAutoWindowMenu = staticmethod(SetAutoWindowMenu) | |
11187 | def GetAutoWindowMenu(*args, **kwargs): | |
11188 | """GetAutoWindowMenu() -> bool""" | |
11189 | return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs) | |
11190 | ||
11191 | GetAutoWindowMenu = staticmethod(GetAutoWindowMenu) | |
97ab0f6a RD |
11192 | def GetMenus(self): |
11193 | """Return a list of (menu, label) items for the menus in the MenuBar. """ | |
11194 | return [(self.GetMenu(i), self.GetLabelTop(i)) | |
11195 | for i in range(self.GetMenuCount())] | |
11196 | ||
11197 | def SetMenus(self, items): | |
11198 | """Clear and add new menus to the MenuBar from a list of (menu, label) items. """ | |
11199 | for i in range(self.GetMenuCount()-1, -1, -1): | |
11200 | self.Remove(i) | |
11201 | for m, l in items: | |
11202 | self.Append(m, l) | |
11203 | ||
57332a5a | 11204 | Frame = property(GetFrame,doc="See `GetFrame`") |
57332a5a RD |
11205 | MenuCount = property(GetMenuCount,doc="See `GetMenuCount`") |
11206 | Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`") | |
2131d850 | 11207 | _core_.MenuBar_swigregister(MenuBar) |
d14a1e28 | 11208 | |
4f433fef | 11209 | def MenuBar_SetAutoWindowMenu(*args, **kwargs): |
0085ce49 RD |
11210 | """MenuBar_SetAutoWindowMenu(bool enable)""" |
11211 | return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs) | |
4f433fef | 11212 | |
0085ce49 RD |
11213 | def MenuBar_GetAutoWindowMenu(*args): |
11214 | """MenuBar_GetAutoWindowMenu() -> bool""" | |
11215 | return _core_.MenuBar_GetAutoWindowMenu(*args) | |
4f433fef | 11216 | |
d14a1e28 RD |
11217 | #--------------------------------------------------------------------------- |
11218 | ||
11219 | class MenuItem(Object): | |
093d3ff1 | 11220 | """Proxy of C++ MenuItem class""" |
0085ce49 RD |
11221 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11222 | __repr__ = _swig_repr | |
11223 | def __init__(self, *args, **kwargs): | |
0df68c9f | 11224 | """ |
89d1e2ee | 11225 | __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString, |
196addbf RD |
11226 | String help=EmptyString, int kind=ITEM_NORMAL, |
11227 | Menu subMenu=None) -> MenuItem | |
0df68c9f | 11228 | """ |
0085ce49 RD |
11229 | _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs)) |
11230 | __swig_destroy__ = _core_.delete_MenuItem | |
11231 | __del__ = lambda self : None; | |
89d1e2ee | 11232 | def Destroy(self): pass |
e811c8ce | 11233 | def GetMenu(*args, **kwargs): |
a95a7133 | 11234 | """GetMenu(self) -> Menu""" |
54f9ee45 | 11235 | return _core_.MenuItem_GetMenu(*args, **kwargs) |
e811c8ce RD |
11236 | |
11237 | def SetMenu(*args, **kwargs): | |
a95a7133 | 11238 | """SetMenu(self, Menu menu)""" |
54f9ee45 | 11239 | return _core_.MenuItem_SetMenu(*args, **kwargs) |
e811c8ce RD |
11240 | |
11241 | def SetId(*args, **kwargs): | |
a95a7133 | 11242 | """SetId(self, int id)""" |
54f9ee45 | 11243 | return _core_.MenuItem_SetId(*args, **kwargs) |
e811c8ce RD |
11244 | |
11245 | def GetId(*args, **kwargs): | |
a95a7133 | 11246 | """GetId(self) -> int""" |
54f9ee45 | 11247 | return _core_.MenuItem_GetId(*args, **kwargs) |
e811c8ce RD |
11248 | |
11249 | def IsSeparator(*args, **kwargs): | |
a95a7133 | 11250 | """IsSeparator(self) -> bool""" |
54f9ee45 | 11251 | return _core_.MenuItem_IsSeparator(*args, **kwargs) |
e811c8ce RD |
11252 | |
11253 | def SetText(*args, **kwargs): | |
a95a7133 | 11254 | """SetText(self, String str)""" |
54f9ee45 | 11255 | return _core_.MenuItem_SetText(*args, **kwargs) |
e811c8ce RD |
11256 | |
11257 | def GetLabel(*args, **kwargs): | |
a95a7133 | 11258 | """GetLabel(self) -> String""" |
54f9ee45 | 11259 | return _core_.MenuItem_GetLabel(*args, **kwargs) |
e811c8ce RD |
11260 | |
11261 | def GetText(*args, **kwargs): | |
a95a7133 | 11262 | """GetText(self) -> String""" |
54f9ee45 | 11263 | return _core_.MenuItem_GetText(*args, **kwargs) |
e811c8ce RD |
11264 | |
11265 | def GetLabelFromText(*args, **kwargs): | |
66c033b4 | 11266 | """GetLabelFromText(String text) -> String""" |
54f9ee45 | 11267 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) |
e811c8ce RD |
11268 | |
11269 | GetLabelFromText = staticmethod(GetLabelFromText) | |
11270 | def GetKind(*args, **kwargs): | |
a95a7133 | 11271 | """GetKind(self) -> int""" |
54f9ee45 | 11272 | return _core_.MenuItem_GetKind(*args, **kwargs) |
e811c8ce | 11273 | |
a95a7133 RD |
11274 | def SetKind(*args, **kwargs): |
11275 | """SetKind(self, int kind)""" | |
54f9ee45 | 11276 | return _core_.MenuItem_SetKind(*args, **kwargs) |
a95a7133 | 11277 | |
e811c8ce | 11278 | def SetCheckable(*args, **kwargs): |
a95a7133 | 11279 | """SetCheckable(self, bool checkable)""" |
54f9ee45 | 11280 | return _core_.MenuItem_SetCheckable(*args, **kwargs) |
e811c8ce RD |
11281 | |
11282 | def IsCheckable(*args, **kwargs): | |
a95a7133 | 11283 | """IsCheckable(self) -> bool""" |
54f9ee45 | 11284 | return _core_.MenuItem_IsCheckable(*args, **kwargs) |
e811c8ce RD |
11285 | |
11286 | def IsSubMenu(*args, **kwargs): | |
a95a7133 | 11287 | """IsSubMenu(self) -> bool""" |
54f9ee45 | 11288 | return _core_.MenuItem_IsSubMenu(*args, **kwargs) |
e811c8ce RD |
11289 | |
11290 | def SetSubMenu(*args, **kwargs): | |
a95a7133 | 11291 | """SetSubMenu(self, Menu menu)""" |
54f9ee45 | 11292 | return _core_.MenuItem_SetSubMenu(*args, **kwargs) |
e811c8ce RD |
11293 | |
11294 | def GetSubMenu(*args, **kwargs): | |
a95a7133 | 11295 | """GetSubMenu(self) -> Menu""" |
54f9ee45 | 11296 | return _core_.MenuItem_GetSubMenu(*args, **kwargs) |
e811c8ce RD |
11297 | |
11298 | def Enable(*args, **kwargs): | |
a95a7133 | 11299 | """Enable(self, bool enable=True)""" |
54f9ee45 | 11300 | return _core_.MenuItem_Enable(*args, **kwargs) |
e811c8ce RD |
11301 | |
11302 | def IsEnabled(*args, **kwargs): | |
a95a7133 | 11303 | """IsEnabled(self) -> bool""" |
54f9ee45 | 11304 | return _core_.MenuItem_IsEnabled(*args, **kwargs) |
e811c8ce RD |
11305 | |
11306 | def Check(*args, **kwargs): | |
a95a7133 | 11307 | """Check(self, bool check=True)""" |
54f9ee45 | 11308 | return _core_.MenuItem_Check(*args, **kwargs) |
e811c8ce RD |
11309 | |
11310 | def IsChecked(*args, **kwargs): | |
a95a7133 | 11311 | """IsChecked(self) -> bool""" |
54f9ee45 | 11312 | return _core_.MenuItem_IsChecked(*args, **kwargs) |
e811c8ce RD |
11313 | |
11314 | def Toggle(*args, **kwargs): | |
a95a7133 | 11315 | """Toggle(self)""" |
54f9ee45 | 11316 | return _core_.MenuItem_Toggle(*args, **kwargs) |
e811c8ce RD |
11317 | |
11318 | def SetHelp(*args, **kwargs): | |
a95a7133 | 11319 | """SetHelp(self, String str)""" |
54f9ee45 | 11320 | return _core_.MenuItem_SetHelp(*args, **kwargs) |
e811c8ce RD |
11321 | |
11322 | def GetHelp(*args, **kwargs): | |
a95a7133 | 11323 | """GetHelp(self) -> String""" |
54f9ee45 | 11324 | return _core_.MenuItem_GetHelp(*args, **kwargs) |
e811c8ce RD |
11325 | |
11326 | def GetAccel(*args, **kwargs): | |
a95a7133 | 11327 | """GetAccel(self) -> AcceleratorEntry""" |
54f9ee45 | 11328 | return _core_.MenuItem_GetAccel(*args, **kwargs) |
e811c8ce RD |
11329 | |
11330 | def SetAccel(*args, **kwargs): | |
a95a7133 | 11331 | """SetAccel(self, AcceleratorEntry accel)""" |
54f9ee45 | 11332 | return _core_.MenuItem_SetAccel(*args, **kwargs) |
e811c8ce | 11333 | |
091f5bed RD |
11334 | def SetBitmap(*args, **kwargs): |
11335 | """SetBitmap(self, Bitmap bitmap)""" | |
11336 | return _core_.MenuItem_SetBitmap(*args, **kwargs) | |
11337 | ||
11338 | def GetBitmap(*args, **kwargs): | |
11339 | """GetBitmap(self) -> Bitmap""" | |
11340 | return _core_.MenuItem_GetBitmap(*args, **kwargs) | |
11341 | ||
c1280d1e RD |
11342 | def SetFont(*args, **kwargs): |
11343 | """SetFont(self, Font font)""" | |
11344 | return _core_.MenuItem_SetFont(*args, **kwargs) | |
11345 | ||
11346 | def GetFont(*args, **kwargs): | |
11347 | """GetFont(self) -> Font""" | |
11348 | return _core_.MenuItem_GetFont(*args, **kwargs) | |
11349 | ||
11350 | def SetTextColour(*args, **kwargs): | |
11351 | """SetTextColour(self, Colour colText)""" | |
11352 | return _core_.MenuItem_SetTextColour(*args, **kwargs) | |
11353 | ||
11354 | def GetTextColour(*args, **kwargs): | |
11355 | """GetTextColour(self) -> Colour""" | |
11356 | return _core_.MenuItem_GetTextColour(*args, **kwargs) | |
11357 | ||
11358 | def SetBackgroundColour(*args, **kwargs): | |
11359 | """SetBackgroundColour(self, Colour colBack)""" | |
11360 | return _core_.MenuItem_SetBackgroundColour(*args, **kwargs) | |
11361 | ||
11362 | def GetBackgroundColour(*args, **kwargs): | |
11363 | """GetBackgroundColour(self) -> Colour""" | |
11364 | return _core_.MenuItem_GetBackgroundColour(*args, **kwargs) | |
11365 | ||
11366 | def SetBitmaps(*args, **kwargs): | |
11367 | """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)""" | |
11368 | return _core_.MenuItem_SetBitmaps(*args, **kwargs) | |
11369 | ||
11370 | def SetDisabledBitmap(*args, **kwargs): | |
11371 | """SetDisabledBitmap(self, Bitmap bmpDisabled)""" | |
11372 | return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs) | |
11373 | ||
11374 | def GetDisabledBitmap(*args, **kwargs): | |
11375 | """GetDisabledBitmap(self) -> Bitmap""" | |
11376 | return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs) | |
11377 | ||
11378 | def SetMarginWidth(*args, **kwargs): | |
11379 | """SetMarginWidth(self, int nWidth)""" | |
11380 | return _core_.MenuItem_SetMarginWidth(*args, **kwargs) | |
11381 | ||
11382 | def GetMarginWidth(*args, **kwargs): | |
11383 | """GetMarginWidth(self) -> int""" | |
11384 | return _core_.MenuItem_GetMarginWidth(*args, **kwargs) | |
11385 | ||
e811c8ce | 11386 | def GetDefaultMarginWidth(*args, **kwargs): |
66c033b4 | 11387 | """GetDefaultMarginWidth() -> int""" |
54f9ee45 | 11388 | return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs) |
e811c8ce RD |
11389 | |
11390 | GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth) | |
c1280d1e RD |
11391 | def IsOwnerDrawn(*args, **kwargs): |
11392 | """IsOwnerDrawn(self) -> bool""" | |
11393 | return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs) | |
11394 | ||
11395 | def SetOwnerDrawn(*args, **kwargs): | |
11396 | """SetOwnerDrawn(self, bool ownerDrawn=True)""" | |
11397 | return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs) | |
11398 | ||
11399 | def ResetOwnerDrawn(*args, **kwargs): | |
11400 | """ResetOwnerDrawn(self)""" | |
11401 | return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs) | |
11402 | ||
57332a5a RD |
11403 | Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`") |
11404 | BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`") | |
11405 | Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`") | |
11406 | DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`") | |
11407 | Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`") | |
11408 | Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`") | |
11409 | Id = property(GetId,SetId,doc="See `GetId` and `SetId`") | |
11410 | Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`") | |
11411 | Label = property(GetLabel,doc="See `GetLabel`") | |
11412 | MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`") | |
11413 | Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`") | |
11414 | SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`") | |
11415 | Text = property(GetText,SetText,doc="See `GetText` and `SetText`") | |
11416 | TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`") | |
2131d850 | 11417 | _core_.MenuItem_swigregister(MenuItem) |
d14a1e28 | 11418 | |
e811c8ce | 11419 | def MenuItem_GetLabelFromText(*args, **kwargs): |
0085ce49 RD |
11420 | """MenuItem_GetLabelFromText(String text) -> String""" |
11421 | return _core_.MenuItem_GetLabelFromText(*args, **kwargs) | |
d14a1e28 | 11422 | |
0085ce49 RD |
11423 | def MenuItem_GetDefaultMarginWidth(*args): |
11424 | """MenuItem_GetDefaultMarginWidth() -> int""" | |
11425 | return _core_.MenuItem_GetDefaultMarginWidth(*args) | |
d14a1e28 RD |
11426 | |
11427 | #--------------------------------------------------------------------------- | |
11428 | ||
11429 | class Control(Window): | |
15afbcd0 RD |
11430 | """ |
11431 | This is the base class for a control or 'widget'. | |
11432 | ||
41e2b43e RD |
11433 | A control is generally a small window which processes user input |
11434 | and/or displays one or more item of data. | |
15afbcd0 | 11435 | """ |
0085ce49 RD |
11436 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11437 | __repr__ = _swig_repr | |
11438 | def __init__(self, *args, **kwargs): | |
0df68c9f | 11439 | """ |
248ed943 RD |
11440 | __init__(self, Window parent, int id=-1, Point pos=DefaultPosition, |
11441 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 11442 | String name=ControlNameStr) -> Control |
15afbcd0 | 11443 | |
41e2b43e RD |
11444 | Create a Control. Normally you should only call this from a subclass' |
11445 | __init__ as a plain old wx.Control is not very useful. | |
0df68c9f | 11446 | """ |
0085ce49 | 11447 | _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs)) |
d14a1e28 | 11448 | self._setOORInfo(self) |
e811c8ce RD |
11449 | |
11450 | def Create(*args, **kwargs): | |
0df68c9f | 11451 | """ |
248ed943 RD |
11452 | Create(self, Window parent, int id=-1, Point pos=DefaultPosition, |
11453 | Size size=DefaultSize, long style=0, Validator validator=DefaultValidator, | |
b2dc1044 | 11454 | String name=ControlNameStr) -> bool |
15afbcd0 RD |
11455 | |
11456 | Do the 2nd phase and create the GUI control. | |
0df68c9f | 11457 | """ |
54f9ee45 | 11458 | return _core_.Control_Create(*args, **kwargs) |
e811c8ce | 11459 | |
10044bf1 RD |
11460 | def GetAlignment(*args, **kwargs): |
11461 | """ | |
11462 | GetAlignment(self) -> int | |
11463 | ||
11464 | Get the control alignment (left/right/centre, top/bottom/centre) | |
11465 | """ | |
11466 | return _core_.Control_GetAlignment(*args, **kwargs) | |
11467 | ||
34e0a3bb | 11468 | def GetLabelText(*args, **kwargs): |
10044bf1 | 11469 | """ |
10044bf1 RD |
11470 | GetLabelText(self) -> String |
11471 | ||
11472 | Get just the text of the label, without mnemonic characters ('&') | |
11473 | """ | |
34e0a3bb | 11474 | return _core_.Control_GetLabelText(*args, **kwargs) |
10044bf1 | 11475 | |
e811c8ce | 11476 | def Command(*args, **kwargs): |
15afbcd0 | 11477 | """ |
a95a7133 | 11478 | Command(self, CommandEvent event) |
15afbcd0 | 11479 | |
41e2b43e RD |
11480 | Simulates the effect of the user issuing a command to the item. |
11481 | ||
11482 | :see: `wx.CommandEvent` | |
11483 | ||
15afbcd0 | 11484 | """ |
54f9ee45 | 11485 | return _core_.Control_Command(*args, **kwargs) |
e811c8ce | 11486 | |
ddeca22c RD |
11487 | def RemoveMnemonics(*args, **kwargs): |
11488 | """ | |
11489 | RemoveMnemonics(String str) -> String | |
11490 | ||
11491 | removes the mnemonics characters | |
11492 | """ | |
11493 | return _core_.Control_RemoveMnemonics(*args, **kwargs) | |
11494 | ||
11495 | RemoveMnemonics = staticmethod(RemoveMnemonics) | |
74a57fcd | 11496 | def GetClassDefaultAttributes(*args, **kwargs): |
110da5b0 RD |
11497 | """ |
11498 | GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes | |
11499 | ||
11500 | Get the default attributes for this class. This is useful if you want | |
11501 | to use the same font or colour in your own control as in a standard | |
11502 | control -- which is a much better idea than hard coding specific | |
11503 | colours or fonts which might look completely out of place on the | |
11504 | user's system, especially if it uses themes. | |
11505 | ||
11506 | The variant parameter is only relevant under Mac currently and is | |
11507 | ignore under other platforms. Under Mac, it will change the size of | |
11508 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11509 | this. | |
11510 | """ | |
54f9ee45 | 11511 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd RD |
11512 | |
11513 | GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes) | |
2bf58437 | 11514 | Alignment = property(GetAlignment,doc="See `GetAlignment`") |
2bf58437 | 11515 | LabelText = property(GetLabelText,doc="See `GetLabelText`") |
2131d850 | 11516 | _core_.Control_swigregister(Control) |
b2dc1044 | 11517 | ControlNameStr = cvar.ControlNameStr |
d14a1e28 RD |
11518 | |
11519 | def PreControl(*args, **kwargs): | |
15afbcd0 RD |
11520 | """ |
11521 | PreControl() -> Control | |
11522 | ||
11523 | Precreate a Control control for 2-phase creation | |
11524 | """ | |
54f9ee45 | 11525 | val = _core_.new_PreControl(*args, **kwargs) |
d14a1e28 RD |
11526 | return val |
11527 | ||
ddeca22c RD |
11528 | def Control_RemoveMnemonics(*args, **kwargs): |
11529 | """ | |
11530 | Control_RemoveMnemonics(String str) -> String | |
11531 | ||
11532 | removes the mnemonics characters | |
11533 | """ | |
11534 | return _core_.Control_RemoveMnemonics(*args, **kwargs) | |
11535 | ||
74a57fcd | 11536 | def Control_GetClassDefaultAttributes(*args, **kwargs): |
0085ce49 | 11537 | """ |
110da5b0 RD |
11538 | Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes |
11539 | ||
11540 | Get the default attributes for this class. This is useful if you want | |
11541 | to use the same font or colour in your own control as in a standard | |
11542 | control -- which is a much better idea than hard coding specific | |
11543 | colours or fonts which might look completely out of place on the | |
11544 | user's system, especially if it uses themes. | |
11545 | ||
11546 | The variant parameter is only relevant under Mac currently and is | |
11547 | ignore under other platforms. Under Mac, it will change the size of | |
11548 | the returned font. See `wx.Window.SetWindowVariant` for more about | |
11549 | this. | |
11550 | """ | |
0085ce49 | 11551 | return _core_.Control_GetClassDefaultAttributes(*args, **kwargs) |
74a57fcd | 11552 | |
d14a1e28 RD |
11553 | #--------------------------------------------------------------------------- |
11554 | ||
11555 | class ItemContainer(object): | |
15afbcd0 | 11556 | """ |
53aa7709 RD |
11557 | The wx.ItemContainer class defines an interface which is implemented |
11558 | by all controls which have string subitems, each of which may be | |
11559 | selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well | |
11560 | as `wx.ComboBox` which implements an extended interface deriving from | |
41e2b43e | 11561 | this one. |
15afbcd0 | 11562 | |
41e2b43e RD |
11563 | It defines the methods for accessing the control's items and although |
11564 | each of the derived classes implements them differently, they still | |
11565 | all conform to the same interface. | |
15afbcd0 | 11566 | |
41e2b43e RD |
11567 | The items in a wx.ItemContainer have (non empty) string labels and, |
11568 | optionally, client data associated with them. | |
15afbcd0 RD |
11569 | |
11570 | """ | |
0085ce49 RD |
11571 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11572 | def __init__(self): raise AttributeError, "No constructor defined" | |
11573 | __repr__ = _swig_repr | |
e811c8ce | 11574 | def Append(*args, **kwargs): |
15afbcd0 | 11575 | """ |
a95a7133 | 11576 | Append(self, String item, PyObject clientData=None) -> int |
15afbcd0 | 11577 | |
41e2b43e RD |
11578 | Adds the item to the control, associating the given data with the item |
11579 | if not None. The return value is the index of the newly added item | |
11580 | which may be different from the last one if the control is sorted (e.g. | |
11581 | has wx.LB_SORT or wx.CB_SORT style). | |
15afbcd0 | 11582 | """ |
54f9ee45 | 11583 | return _core_.ItemContainer_Append(*args, **kwargs) |
e811c8ce RD |
11584 | |
11585 | def AppendItems(*args, **kwargs): | |
15afbcd0 | 11586 | """ |
f5b96ee1 | 11587 | AppendItems(self, List strings) |
15afbcd0 | 11588 | |
41e2b43e RD |
11589 | Apend several items at once to the control. Notice that calling this |
11590 | method may be much faster than appending the items one by one if you | |
11591 | need to add a lot of items. | |
15afbcd0 | 11592 | """ |
54f9ee45 | 11593 | return _core_.ItemContainer_AppendItems(*args, **kwargs) |
e811c8ce RD |
11594 | |
11595 | def Insert(*args, **kwargs): | |
15afbcd0 | 11596 | """ |
d359a380 | 11597 | Insert(self, String item, int pos, PyObject clientData=None) -> int |
15afbcd0 | 11598 | |
41e2b43e | 11599 | Insert an item into the control before the item at the ``pos`` index, |
15afbcd0 RD |
11600 | optionally associating some data object with the item. |
11601 | """ | |
54f9ee45 | 11602 | return _core_.ItemContainer_Insert(*args, **kwargs) |
e811c8ce RD |
11603 | |
11604 | def Clear(*args, **kwargs): | |
15afbcd0 | 11605 | """ |
a95a7133 | 11606 | Clear(self) |
15afbcd0 RD |
11607 | |
11608 | Removes all items from the control. | |
11609 | """ | |
54f9ee45 | 11610 | return _core_.ItemContainer_Clear(*args, **kwargs) |
e811c8ce RD |
11611 | |
11612 | def Delete(*args, **kwargs): | |
15afbcd0 | 11613 | """ |
d359a380 | 11614 | Delete(self, int n) |
15afbcd0 | 11615 | |
41e2b43e RD |
11616 | Deletes the item at the zero-based index 'n' from the control. Note |
11617 | that it is an error (signalled by a `wx.PyAssertionError` exception if | |
11618 | enabled) to remove an item with the index negative or greater or equal | |
11619 | than the number of items in the control. | |
15afbcd0 | 11620 | """ |
54f9ee45 | 11621 | return _core_.ItemContainer_Delete(*args, **kwargs) |
e811c8ce | 11622 | |
53aa7709 RD |
11623 | def GetClientData(*args, **kwargs): |
11624 | """ | |
d359a380 | 11625 | GetClientData(self, int n) -> PyObject |
53aa7709 RD |
11626 | |
11627 | Returns the client data associated with the given item, (if any.) | |
11628 | """ | |
11629 | return _core_.ItemContainer_GetClientData(*args, **kwargs) | |
11630 | ||
11631 | def SetClientData(*args, **kwargs): | |
11632 | """ | |
d359a380 | 11633 | SetClientData(self, int n, PyObject clientData) |
53aa7709 RD |
11634 | |
11635 | Associate the given client data with the item at position n. | |
11636 | """ | |
11637 | return _core_.ItemContainer_SetClientData(*args, **kwargs) | |
11638 | ||
e811c8ce | 11639 | def GetCount(*args, **kwargs): |
15afbcd0 | 11640 | """ |
d359a380 | 11641 | GetCount(self) -> int |
15afbcd0 RD |
11642 | |
11643 | Returns the number of items in the control. | |
11644 | """ | |
54f9ee45 | 11645 | return _core_.ItemContainer_GetCount(*args, **kwargs) |
e811c8ce RD |
11646 | |
11647 | def IsEmpty(*args, **kwargs): | |
15afbcd0 | 11648 | """ |
a95a7133 | 11649 | IsEmpty(self) -> bool |
15afbcd0 RD |
11650 | |
11651 | Returns True if the control is empty or False if it has some items. | |
11652 | """ | |
54f9ee45 | 11653 | return _core_.ItemContainer_IsEmpty(*args, **kwargs) |
e811c8ce RD |
11654 | |
11655 | def GetString(*args, **kwargs): | |
15afbcd0 | 11656 | """ |
d359a380 | 11657 | GetString(self, int n) -> String |
15afbcd0 RD |
11658 | |
11659 | Returns the label of the item with the given index. | |
11660 | """ | |
54f9ee45 | 11661 | return _core_.ItemContainer_GetString(*args, **kwargs) |
e811c8ce RD |
11662 | |
11663 | def GetStrings(*args, **kwargs): | |
a95a7133 | 11664 | """GetStrings(self) -> wxArrayString""" |
54f9ee45 | 11665 | return _core_.ItemContainer_GetStrings(*args, **kwargs) |
e811c8ce RD |
11666 | |
11667 | def SetString(*args, **kwargs): | |
15afbcd0 | 11668 | """ |
d359a380 | 11669 | SetString(self, int n, String s) |
15afbcd0 RD |
11670 | |
11671 | Sets the label for the given item. | |
11672 | """ | |
54f9ee45 | 11673 | return _core_.ItemContainer_SetString(*args, **kwargs) |
e811c8ce RD |
11674 | |
11675 | def FindString(*args, **kwargs): | |
15afbcd0 | 11676 | """ |
a95a7133 | 11677 | FindString(self, String s) -> int |
15afbcd0 RD |
11678 | |
11679 | Finds an item whose label matches the given string. Returns the | |
41e2b43e RD |
11680 | zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not |
11681 | found. | |
15afbcd0 | 11682 | """ |
54f9ee45 | 11683 | return _core_.ItemContainer_FindString(*args, **kwargs) |
e811c8ce | 11684 | |
53aa7709 | 11685 | def SetSelection(*args, **kwargs): |
15afbcd0 | 11686 | """ |
53aa7709 | 11687 | SetSelection(self, int n) |
15afbcd0 RD |
11688 | |
11689 | Sets the item at index 'n' to be the selected item. | |
11690 | """ | |
53aa7709 | 11691 | return _core_.ItemContainer_SetSelection(*args, **kwargs) |
e811c8ce RD |
11692 | |
11693 | def GetSelection(*args, **kwargs): | |
15afbcd0 | 11694 | """ |
a95a7133 | 11695 | GetSelection(self) -> int |
15afbcd0 | 11696 | |
41e2b43e RD |
11697 | Returns the index of the selected item or ``wx.NOT_FOUND`` if no item |
11698 | is selected. | |
15afbcd0 | 11699 | """ |
54f9ee45 | 11700 | return _core_.ItemContainer_GetSelection(*args, **kwargs) |
e811c8ce | 11701 | |
53aa7709 RD |
11702 | def SetStringSelection(*args, **kwargs): |
11703 | """SetStringSelection(self, String s) -> bool""" | |
11704 | return _core_.ItemContainer_SetStringSelection(*args, **kwargs) | |
11705 | ||
e811c8ce | 11706 | def GetStringSelection(*args, **kwargs): |
15afbcd0 | 11707 | """ |
a95a7133 | 11708 | GetStringSelection(self) -> String |
15afbcd0 | 11709 | |
41e2b43e RD |
11710 | Returns the label of the selected item or an empty string if no item |
11711 | is selected. | |
15afbcd0 | 11712 | """ |
54f9ee45 | 11713 | return _core_.ItemContainer_GetStringSelection(*args, **kwargs) |
e811c8ce | 11714 | |
53aa7709 | 11715 | def Select(*args, **kwargs): |
15afbcd0 | 11716 | """ |
53aa7709 | 11717 | Select(self, int n) |
15afbcd0 | 11718 | |
53aa7709 RD |
11719 | This is the same as `SetSelection` and exists only because it is |
11720 | slightly more natural for controls which support multiple selection. | |
15afbcd0 | 11721 | """ |
53aa7709 | 11722 | return _core_.ItemContainer_Select(*args, **kwargs) |
e811c8ce | 11723 | |
97ab0f6a RD |
11724 | def GetItems(self): |
11725 | """Return a list of the strings in the control""" | |
11726 | return [self.GetString(i) for i in xrange(self.GetCount())] | |
11727 | ||
11728 | def SetItems(self, items): | |
11729 | """Clear and set the strings in the control from a list""" | |
11730 | self.Clear() | |
11731 | for i in items: | |
11732 | self.Append(i) | |
11733 | ||
11734 | Count = property(GetCount,doc="See `GetCount`") | |
11735 | Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`") | |
11736 | Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`") | |
11737 | StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`") | |
11738 | Strings = property(GetStrings,doc="See `GetStrings`") | |
2131d850 | 11739 | _core_.ItemContainer_swigregister(ItemContainer) |
d14a1e28 RD |
11740 | |
11741 | #--------------------------------------------------------------------------- | |
11742 | ||
11743 | class ControlWithItems(Control,ItemContainer): | |
15afbcd0 | 11744 | """ |
41e2b43e RD |
11745 | wx.ControlWithItems combines the ``wx.ItemContainer`` class with the |
11746 | wx.Control class, and is used for the base class of various controls | |
11747 | that have items. | |
15afbcd0 | 11748 | """ |
0085ce49 RD |
11749 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11750 | def __init__(self): raise AttributeError, "No constructor defined" | |
11751 | __repr__ = _swig_repr | |
2131d850 | 11752 | _core_.ControlWithItems_swigregister(ControlWithItems) |
d14a1e28 RD |
11753 | |
11754 | #--------------------------------------------------------------------------- | |
11755 | ||
cbfc9df6 RD |
11756 | class SizerFlags(object): |
11757 | """ | |
11758 | Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have | |
11759 | to specify a lot of flags and parameters which can be unwieldy. This | |
11760 | is where wx.SizerFlags comes in: it allows you to specify all | |
11761 | parameters using the named methods instead. For example, instead of:: | |
11762 | ||
11763 | sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10) | |
11764 | ||
11765 | you can now write:: | |
11766 | ||
11767 | sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10)) | |
11768 | ||
11769 | This is more readable and also allows you to create wx.SizerFlags | |
11770 | objects which can be reused for several sizer items.:: | |
11771 | ||
11772 | flagsExpand = wx.SizerFlags(1) | |
11773 | flagsExpand.Expand().Border(wx.ALL, 10) | |
11774 | sizer.AddF(ctrl1, flagsExpand) | |
11775 | sizer.AddF(ctrl2, flagsExpand) | |
11776 | ||
11777 | Note that by specification, all methods of wx.SizerFlags return the | |
11778 | wx.SizerFlags object itself allowing chaining multiple method calls | |
11779 | like in the examples above. | |
11780 | """ | |
11781 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') | |
11782 | __repr__ = _swig_repr | |
11783 | def __init__(self, *args, **kwargs): | |
11784 | """ | |
11785 | __init__(self, int proportion=0) -> SizerFlags | |
11786 | ||
11787 | Constructs the flags object with the specified proportion. | |
11788 | """ | |
11789 | _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs)) | |
11790 | __swig_destroy__ = _core_.delete_SizerFlags | |
11791 | __del__ = lambda self : None; | |
11792 | def Proportion(*args, **kwargs): | |
11793 | """ | |
11794 | Proportion(self, int proportion) -> SizerFlags | |
11795 | ||
11796 | Sets the item's proportion value. | |
11797 | """ | |
11798 | return _core_.SizerFlags_Proportion(*args, **kwargs) | |
11799 | ||
11800 | def Align(*args, **kwargs): | |
11801 | """ | |
11802 | Align(self, int alignment) -> SizerFlags | |
11803 | ||
11804 | Sets the item's alignment | |
11805 | """ | |
11806 | return _core_.SizerFlags_Align(*args, **kwargs) | |
11807 | ||
11808 | def Expand(*args, **kwargs): | |
11809 | """ | |
11810 | Expand(self) -> SizerFlags | |
11811 | ||
11812 | Sets the wx.EXPAND flag, which will cause the item to be expanded to | |
11813 | fill as much space as it is given by the sizer. | |
11814 | """ | |
11815 | return _core_.SizerFlags_Expand(*args, **kwargs) | |
11816 | ||
11817 | def Centre(*args, **kwargs): | |
11818 | """ | |
11819 | Centre(self) -> SizerFlags | |
11820 | ||
11821 | Same as `Center` for those with an alternate dialect of English. | |
11822 | """ | |
11823 | return _core_.SizerFlags_Centre(*args, **kwargs) | |
11824 | ||
11825 | def Center(*args, **kwargs): | |
11826 | """ | |
11827 | Center(self) -> SizerFlags | |
11828 | ||
11829 | Sets the centering alignment flags. | |
11830 | """ | |
11831 | return _core_.SizerFlags_Center(*args, **kwargs) | |
11832 | ||
11833 | def Left(*args, **kwargs): | |
11834 | """ | |
11835 | Left(self) -> SizerFlags | |
11836 | ||
11837 | Aligns the object to the left, a shortcut for calling | |
11838 | Align(wx.ALIGN_LEFT) | |
11839 | """ | |
11840 | return _core_.SizerFlags_Left(*args, **kwargs) | |
11841 | ||
11842 | def Right(*args, **kwargs): | |
11843 | """ | |
11844 | Right(self) -> SizerFlags | |
11845 | ||
11846 | Aligns the object to the right, a shortcut for calling | |
11847 | Align(wx.ALIGN_RIGHT) | |
11848 | """ | |
11849 | return _core_.SizerFlags_Right(*args, **kwargs) | |
11850 | ||
11851 | def Top(*args, **kwargs): | |
11852 | """ | |
11853 | Top(self) -> SizerFlags | |
11854 | ||
11855 | Aligns the object to the top of the available space, a shortcut for | |
11856 | calling Align(wx.ALIGN_TOP) | |
11857 | """ | |
11858 | return _core_.SizerFlags_Top(*args, **kwargs) | |
11859 | ||
11860 | def Bottom(*args, **kwargs): | |
11861 | """ | |
11862 | Bottom(self) -> SizerFlags | |
11863 | ||
11864 | Aligns the object to the bottom of the available space, a shortcut for | |
11865 | calling Align(wx.ALIGN_BOTTOM) | |
11866 | """ | |
11867 | return _core_.SizerFlags_Bottom(*args, **kwargs) | |
11868 | ||
11869 | def Shaped(*args, **kwargs): | |
11870 | """ | |
11871 | Shaped(self) -> SizerFlags | |
11872 | ||
11873 | Sets the wx.SHAPED flag. | |
11874 | """ | |
11875 | return _core_.SizerFlags_Shaped(*args, **kwargs) | |
11876 | ||
11877 | def FixedMinSize(*args, **kwargs): | |
11878 | """ | |
11879 | FixedMinSize(self) -> SizerFlags | |
11880 | ||
11881 | Sets the wx.FIXED_MINSIZE flag. | |
11882 | """ | |
11883 | return _core_.SizerFlags_FixedMinSize(*args, **kwargs) | |
11884 | ||
11885 | def Border(*args, **kwargs): | |
11886 | """ | |
11887 | Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags | |
11888 | ||
11889 | Sets the border of the item in the direction(s) or sides given by the | |
11890 | direction parameter. If the borderInPixels value is not given then | |
11891 | the default border size (see `GetDefaultBorder`) will be used. | |
11892 | """ | |
11893 | return _core_.SizerFlags_Border(*args, **kwargs) | |
11894 | ||
11895 | def DoubleBorder(*args, **kwargs): | |
11896 | """ | |
11897 | DoubleBorder(self, int direction=ALL) -> SizerFlags | |
11898 | ||
11899 | Sets the border in the given direction to twice the default border | |
11900 | size. | |
11901 | """ | |
11902 | return _core_.SizerFlags_DoubleBorder(*args, **kwargs) | |
11903 | ||
11904 | def TripleBorder(*args, **kwargs): | |
11905 | """ | |
11906 | TripleBorder(self, int direction=ALL) -> SizerFlags | |
11907 | ||
11908 | Sets the border in the given direction to three times the default | |
11909 | border size. | |
11910 | """ | |
11911 | return _core_.SizerFlags_TripleBorder(*args, **kwargs) | |
11912 | ||
11913 | def HorzBorder(*args, **kwargs): | |
11914 | """ | |
11915 | HorzBorder(self) -> SizerFlags | |
11916 | ||
11917 | Sets the left and right borders to the default border size. | |
11918 | """ | |
11919 | return _core_.SizerFlags_HorzBorder(*args, **kwargs) | |
11920 | ||
11921 | def DoubleHorzBorder(*args, **kwargs): | |
11922 | """ | |
11923 | DoubleHorzBorder(self) -> SizerFlags | |
11924 | ||
11925 | Sets the left and right borders to twice the default border size. | |
11926 | """ | |
11927 | return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs) | |
11928 | ||
11929 | def GetDefaultBorder(*args, **kwargs): | |
11930 | """ | |
11931 | GetDefaultBorder() -> int | |
11932 | ||
11933 | Returns the default border size used by the other border methods | |
11934 | """ | |
11935 | return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs) | |
11936 | ||
11937 | GetDefaultBorder = staticmethod(GetDefaultBorder) | |
11938 | def GetProportion(*args, **kwargs): | |
11939 | """ | |
11940 | GetProportion(self) -> int | |
11941 | ||
11942 | Returns the proportion value to be used in the sizer item. | |
11943 | """ | |
11944 | return _core_.SizerFlags_GetProportion(*args, **kwargs) | |
11945 | ||
11946 | def GetFlags(*args, **kwargs): | |
11947 | """ | |
11948 | GetFlags(self) -> int | |
11949 | ||
11950 | Returns the flags value to be used in the sizer item. | |
11951 | """ | |
11952 | return _core_.SizerFlags_GetFlags(*args, **kwargs) | |
11953 | ||
11954 | def GetBorderInPixels(*args, **kwargs): | |
11955 | """ | |
11956 | GetBorderInPixels(self) -> int | |
11957 | ||
11958 | Returns the border value in pixels to be used in the sizer item. | |
11959 | """ | |
11960 | return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs) | |
11961 | ||
11962 | _core_.SizerFlags_swigregister(SizerFlags) | |
11963 | ||
11964 | def SizerFlags_GetDefaultBorder(*args): | |
11965 | """ | |
11966 | SizerFlags_GetDefaultBorder() -> int | |
11967 | ||
11968 | Returns the default border size used by the other border methods | |
11969 | """ | |
11970 | return _core_.SizerFlags_GetDefaultBorder(*args) | |
11971 | ||
d14a1e28 | 11972 | class SizerItem(Object): |
248ed943 RD |
11973 | """ |
11974 | The wx.SizerItem class is used to track the position, size and other | |
01f6b6d3 RD |
11975 | attributes of each item managed by a `wx.Sizer`. It is not usually |
11976 | necessary to use this class because the sizer elements can also be | |
11977 | identified by their positions or window or sizer references but | |
11978 | sometimes it may be more convenient to use wx.SizerItem directly. | |
11979 | Also, custom classes derived from `wx.PySizer` will probably need to | |
11980 | use the collection of wx.SizerItems held by wx.Sizer when calculating | |
11981 | layout. | |
248ed943 RD |
11982 | |
11983 | :see: `wx.Sizer`, `wx.GBSizerItem` | |
11984 | """ | |
0085ce49 RD |
11985 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
11986 | __repr__ = _swig_repr | |
11987 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
11988 | """ |
11989 | __init__(self) -> SizerItem | |
11990 | ||
11991 | Constructs an empty wx.SizerItem. Either a window, sizer or spacer | |
11992 | size will need to be set before this item can be used in a Sizer. | |
11993 | ||
11994 | You will probably never need to create a wx.SizerItem directly as they | |
11995 | are created automatically when the sizer's Add, Insert or Prepend | |
11996 | methods are called. | |
11997 | ||
11998 | :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer` | |
11999 | """ | |
0085ce49 RD |
12000 | _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs)) |
12001 | __swig_destroy__ = _core_.delete_SizerItem | |
12002 | __del__ = lambda self : None; | |
e811c8ce | 12003 | def DeleteWindows(*args, **kwargs): |
248ed943 RD |
12004 | """ |
12005 | DeleteWindows(self) | |
12006 | ||
12007 | Destroy the window or the windows in a subsizer, depending on the type | |
12008 | of item. | |
12009 | """ | |
54f9ee45 | 12010 | return _core_.SizerItem_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
12011 | |
12012 | def DetachSizer(*args, **kwargs): | |
248ed943 RD |
12013 | """ |
12014 | DetachSizer(self) | |
12015 | ||
12016 | Enable deleting the SizerItem without destroying the contained sizer. | |
12017 | """ | |
54f9ee45 | 12018 | return _core_.SizerItem_DetachSizer(*args, **kwargs) |
e811c8ce RD |
12019 | |
12020 | def GetSize(*args, **kwargs): | |
248ed943 RD |
12021 | """ |
12022 | GetSize(self) -> Size | |
12023 | ||
12024 | Get the current size of the item, as set in the last Layout. | |
12025 | """ | |
54f9ee45 | 12026 | return _core_.SizerItem_GetSize(*args, **kwargs) |
e811c8ce RD |
12027 | |
12028 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
12029 | """ |
12030 | CalcMin(self) -> Size | |
12031 | ||
12032 | Calculates the minimum desired size for the item, including any space | |
12033 | needed by borders. | |
12034 | """ | |
54f9ee45 | 12035 | return _core_.SizerItem_CalcMin(*args, **kwargs) |
e811c8ce RD |
12036 | |
12037 | def SetDimension(*args, **kwargs): | |
248ed943 RD |
12038 | """ |
12039 | SetDimension(self, Point pos, Size size) | |
12040 | ||
12041 | Set the position and size of the space allocated for this item by the | |
12042 | sizer, and adjust the position and size of the item (window or | |
12043 | subsizer) to be within that space taking alignment and borders into | |
12044 | account. | |
12045 | """ | |
54f9ee45 | 12046 | return _core_.SizerItem_SetDimension(*args, **kwargs) |
e811c8ce RD |
12047 | |
12048 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
12049 | """ |
12050 | GetMinSize(self) -> Size | |
12051 | ||
12052 | Get the minimum size needed for the item. | |
12053 | """ | |
54f9ee45 | 12054 | return _core_.SizerItem_GetMinSize(*args, **kwargs) |
e811c8ce | 12055 | |
dfbb5885 RD |
12056 | def GetMinSizeWithBorder(*args, **kwargs): |
12057 | """ | |
12058 | GetMinSizeWithBorder(self) -> Size | |
12059 | ||
12060 | Get the minimum size needed for the item with space for the borders | |
12061 | added, if needed. | |
12062 | """ | |
12063 | return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs) | |
12064 | ||
e811c8ce | 12065 | def SetInitSize(*args, **kwargs): |
a95a7133 | 12066 | """SetInitSize(self, int x, int y)""" |
54f9ee45 | 12067 | return _core_.SizerItem_SetInitSize(*args, **kwargs) |
e811c8ce RD |
12068 | |
12069 | def SetRatioWH(*args, **kwargs): | |
248ed943 RD |
12070 | """ |
12071 | SetRatioWH(self, int width, int height) | |
12072 | ||
12073 | Set the ratio item attribute. | |
12074 | """ | |
54f9ee45 | 12075 | return _core_.SizerItem_SetRatioWH(*args, **kwargs) |
e811c8ce RD |
12076 | |
12077 | def SetRatioSize(*args, **kwargs): | |
248ed943 RD |
12078 | """ |
12079 | SetRatioSize(self, Size size) | |
12080 | ||
12081 | Set the ratio item attribute. | |
12082 | """ | |
54f9ee45 | 12083 | return _core_.SizerItem_SetRatioSize(*args, **kwargs) |
e811c8ce RD |
12084 | |
12085 | def SetRatio(*args, **kwargs): | |
248ed943 RD |
12086 | """ |
12087 | SetRatio(self, float ratio) | |
12088 | ||
12089 | Set the ratio item attribute. | |
12090 | """ | |
54f9ee45 | 12091 | return _core_.SizerItem_SetRatio(*args, **kwargs) |
e811c8ce RD |
12092 | |
12093 | def GetRatio(*args, **kwargs): | |
248ed943 RD |
12094 | """ |
12095 | GetRatio(self) -> float | |
12096 | ||
12097 | Set the ratio item attribute. | |
12098 | """ | |
54f9ee45 | 12099 | return _core_.SizerItem_GetRatio(*args, **kwargs) |
e811c8ce | 12100 | |
d3b6e4ff RD |
12101 | def GetRect(*args, **kwargs): |
12102 | """ | |
12103 | GetRect(self) -> Rect | |
12104 | ||
12105 | Returns the rectangle that the sizer item should occupy | |
12106 | """ | |
12107 | return _core_.SizerItem_GetRect(*args, **kwargs) | |
12108 | ||
e811c8ce | 12109 | def IsWindow(*args, **kwargs): |
248ed943 RD |
12110 | """ |
12111 | IsWindow(self) -> bool | |
12112 | ||
12113 | Is this sizer item a window? | |
12114 | """ | |
54f9ee45 | 12115 | return _core_.SizerItem_IsWindow(*args, **kwargs) |
e811c8ce RD |
12116 | |
12117 | def IsSizer(*args, **kwargs): | |
248ed943 RD |
12118 | """ |
12119 | IsSizer(self) -> bool | |
12120 | ||
12121 | Is this sizer item a subsizer? | |
12122 | """ | |
54f9ee45 | 12123 | return _core_.SizerItem_IsSizer(*args, **kwargs) |
e811c8ce RD |
12124 | |
12125 | def IsSpacer(*args, **kwargs): | |
248ed943 RD |
12126 | """ |
12127 | IsSpacer(self) -> bool | |
12128 | ||
12129 | Is this sizer item a spacer? | |
12130 | """ | |
54f9ee45 | 12131 | return _core_.SizerItem_IsSpacer(*args, **kwargs) |
e811c8ce RD |
12132 | |
12133 | def SetProportion(*args, **kwargs): | |
248ed943 RD |
12134 | """ |
12135 | SetProportion(self, int proportion) | |
12136 | ||
12137 | Set the proportion value for this item. | |
12138 | """ | |
54f9ee45 | 12139 | return _core_.SizerItem_SetProportion(*args, **kwargs) |
e811c8ce RD |
12140 | |
12141 | def GetProportion(*args, **kwargs): | |
248ed943 RD |
12142 | """ |
12143 | GetProportion(self) -> int | |
12144 | ||
12145 | Get the proportion value for this item. | |
12146 | """ | |
54f9ee45 | 12147 | return _core_.SizerItem_GetProportion(*args, **kwargs) |
e811c8ce | 12148 | |
248ed943 RD |
12149 | SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.") |
12150 | GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.") | |
e811c8ce | 12151 | def SetFlag(*args, **kwargs): |
248ed943 RD |
12152 | """ |
12153 | SetFlag(self, int flag) | |
12154 | ||
12155 | Set the flag value for this item. | |
12156 | """ | |
54f9ee45 | 12157 | return _core_.SizerItem_SetFlag(*args, **kwargs) |
e811c8ce RD |
12158 | |
12159 | def GetFlag(*args, **kwargs): | |
248ed943 RD |
12160 | """ |
12161 | GetFlag(self) -> int | |
12162 | ||
12163 | Get the flag value for this item. | |
12164 | """ | |
54f9ee45 | 12165 | return _core_.SizerItem_GetFlag(*args, **kwargs) |
e811c8ce RD |
12166 | |
12167 | def SetBorder(*args, **kwargs): | |
248ed943 RD |
12168 | """ |
12169 | SetBorder(self, int border) | |
12170 | ||
12171 | Set the border value for this item. | |
12172 | """ | |
54f9ee45 | 12173 | return _core_.SizerItem_SetBorder(*args, **kwargs) |
e811c8ce RD |
12174 | |
12175 | def GetBorder(*args, **kwargs): | |
248ed943 RD |
12176 | """ |
12177 | GetBorder(self) -> int | |
12178 | ||
12179 | Get the border value for this item. | |
12180 | """ | |
54f9ee45 | 12181 | return _core_.SizerItem_GetBorder(*args, **kwargs) |
e811c8ce RD |
12182 | |
12183 | def GetWindow(*args, **kwargs): | |
248ed943 RD |
12184 | """ |
12185 | GetWindow(self) -> Window | |
12186 | ||
12187 | Get the window (if any) that is managed by this sizer item. | |
12188 | """ | |
54f9ee45 | 12189 | return _core_.SizerItem_GetWindow(*args, **kwargs) |
e811c8ce | 12190 | |
e811c8ce | 12191 | def GetSizer(*args, **kwargs): |
248ed943 RD |
12192 | """ |
12193 | GetSizer(self) -> Sizer | |
12194 | ||
12195 | Get the subsizer (if any) that is managed by this sizer item. | |
12196 | """ | |
54f9ee45 | 12197 | return _core_.SizerItem_GetSizer(*args, **kwargs) |
e811c8ce | 12198 | |
ddeca22c RD |
12199 | def GetSpacer(*args, **kwargs): |
12200 | """ | |
12201 | GetSpacer(self) -> Size | |
12202 | ||
12203 | Get the size of the spacer managed by this sizer item. | |
12204 | """ | |
12205 | return _core_.SizerItem_GetSpacer(*args, **kwargs) | |
12206 | ||
12207 | def SetWindow(*args, **kwargs): | |
12208 | """ | |
12209 | SetWindow(self, Window window) | |
12210 | ||
12211 | Set the window to be managed by this sizer item. | |
12212 | """ | |
12213 | return _core_.SizerItem_SetWindow(*args, **kwargs) | |
12214 | ||
e811c8ce | 12215 | def SetSizer(*args, **kwargs): |
248ed943 RD |
12216 | """ |
12217 | SetSizer(self, Sizer sizer) | |
12218 | ||
12219 | Set the subsizer to be managed by this sizer item. | |
12220 | """ | |
54f9ee45 | 12221 | return _core_.SizerItem_SetSizer(*args, **kwargs) |
e811c8ce | 12222 | |
ddeca22c | 12223 | def SetSpacer(*args, **kwargs): |
248ed943 | 12224 | """ |
ddeca22c | 12225 | SetSpacer(self, Size size) |
248ed943 | 12226 | |
ddeca22c | 12227 | Set the size of the spacer to be managed by this sizer item. |
248ed943 | 12228 | """ |
ddeca22c | 12229 | return _core_.SizerItem_SetSpacer(*args, **kwargs) |
e811c8ce | 12230 | |
ddeca22c RD |
12231 | SetWindow = wx._deprecated(SetWindow, "Use `AssignWindow` instead.") |
12232 | SetSizer = wx._deprecated(SetSizer, "Use `AssignSizer` instead.") | |
12233 | SetSpacer = wx._deprecated(SetSpacer, "Use `AssignSpacer` instead.") | |
12234 | ||
12235 | def AssignWindow(*args, **kwargs): | |
248ed943 | 12236 | """ |
ddeca22c RD |
12237 | AssignWindow(self, Window window) |
12238 | ||
12239 | Set the window to be managed by this sizer item. | |
12240 | """ | |
12241 | return _core_.SizerItem_AssignWindow(*args, **kwargs) | |
12242 | ||
12243 | def AssignSizer(*args, **kwargs): | |
12244 | """ | |
12245 | AssignSizer(self, Sizer sizer) | |
12246 | ||
12247 | Set the subsizer to be managed by this sizer item. | |
12248 | """ | |
12249 | return _core_.SizerItem_AssignSizer(*args, **kwargs) | |
12250 | ||
12251 | def AssignSpacer(*args, **kwargs): | |
12252 | """ | |
12253 | AssignSpacer(self, Size size) | |
248ed943 RD |
12254 | |
12255 | Set the size of the spacer to be managed by this sizer item. | |
12256 | """ | |
ddeca22c | 12257 | return _core_.SizerItem_AssignSpacer(*args, **kwargs) |
e811c8ce RD |
12258 | |
12259 | def Show(*args, **kwargs): | |
248ed943 RD |
12260 | """ |
12261 | Show(self, bool show) | |
12262 | ||
12263 | Set the show item attribute, which sizers use to determine if the item | |
12264 | is to be made part of the layout or not. If the item is tracking a | |
12265 | window then it is shown or hidden as needed. | |
12266 | """ | |
54f9ee45 | 12267 | return _core_.SizerItem_Show(*args, **kwargs) |
e811c8ce RD |
12268 | |
12269 | def IsShown(*args, **kwargs): | |
248ed943 RD |
12270 | """ |
12271 | IsShown(self) -> bool | |
12272 | ||
12273 | Is the item to be shown in the layout? | |
12274 | """ | |
54f9ee45 | 12275 | return _core_.SizerItem_IsShown(*args, **kwargs) |
e811c8ce RD |
12276 | |
12277 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
12278 | """ |
12279 | GetPosition(self) -> Point | |
12280 | ||
12281 | Returns the current position of the item, as set in the last Layout. | |
12282 | """ | |
54f9ee45 | 12283 | return _core_.SizerItem_GetPosition(*args, **kwargs) |
e811c8ce RD |
12284 | |
12285 | def GetUserData(*args, **kwargs): | |
248ed943 RD |
12286 | """ |
12287 | GetUserData(self) -> PyObject | |
12288 | ||
12289 | Returns the userData associated with this sizer item, or None if there | |
12290 | isn't any. | |
12291 | """ | |
54f9ee45 | 12292 | return _core_.SizerItem_GetUserData(*args, **kwargs) |
e811c8ce | 12293 | |
091f5bed RD |
12294 | def SetUserData(*args, **kwargs): |
12295 | """ | |
12296 | SetUserData(self, PyObject userData) | |
12297 | ||
12298 | Associate a Python object with this sizer item. | |
12299 | """ | |
12300 | return _core_.SizerItem_SetUserData(*args, **kwargs) | |
12301 | ||
33d6fd3b RD |
12302 | Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`") |
12303 | Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`") | |
12304 | MinSize = property(GetMinSize,doc="See `GetMinSize`") | |
12305 | MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`") | |
12306 | Position = property(GetPosition,doc="See `GetPosition`") | |
12307 | Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`") | |
12308 | Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`") | |
12309 | Rect = property(GetRect,doc="See `GetRect`") | |
12310 | Size = property(GetSize,doc="See `GetSize`") | |
ddeca22c RD |
12311 | Sizer = property(GetSizer,AssignSizer,doc="See `GetSizer` and `AssignSizer`") |
12312 | Spacer = property(GetSpacer,AssignSpacer,doc="See `GetSpacer` and `AssignSpacer`") | |
33d6fd3b | 12313 | UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`") |
ddeca22c | 12314 | Window = property(GetWindow,AssignWindow,doc="See `GetWindow` and `AssignWindow`") |
2131d850 | 12315 | _core_.SizerItem_swigregister(SizerItem) |
d14a1e28 | 12316 | |
248ed943 | 12317 | def SizerItemWindow(*args, **kwargs): |
0df68c9f | 12318 | """ |
248ed943 RD |
12319 | SizerItemWindow(Window window, int proportion, int flag, int border, |
12320 | PyObject userData=None) -> SizerItem | |
12321 | ||
12322 | Constructs a `wx.SizerItem` for tracking a window. | |
0df68c9f | 12323 | """ |
248ed943 | 12324 | val = _core_.new_SizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
12325 | return val |
12326 | ||
248ed943 | 12327 | def SizerItemSpacer(*args, **kwargs): |
0df68c9f | 12328 | """ |
248ed943 RD |
12329 | SizerItemSpacer(int width, int height, int proportion, int flag, int border, |
12330 | PyObject userData=None) -> SizerItem | |
12331 | ||
12332 | Constructs a `wx.SizerItem` for tracking a spacer. | |
0df68c9f | 12333 | """ |
248ed943 | 12334 | val = _core_.new_SizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
12335 | return val |
12336 | ||
12337 | def SizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
12338 | """ |
12339 | SizerItemSizer(Sizer sizer, int proportion, int flag, int border, | |
248ed943 RD |
12340 | PyObject userData=None) -> SizerItem |
12341 | ||
12342 | Constructs a `wx.SizerItem` for tracking a subsizer | |
0df68c9f | 12343 | """ |
54f9ee45 | 12344 | val = _core_.new_SizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
12345 | return val |
12346 | ||
12347 | class Sizer(Object): | |
248ed943 RD |
12348 | """ |
12349 | wx.Sizer is the abstract base class used for laying out subwindows in | |
12350 | a window. You cannot use wx.Sizer directly; instead, you will have to | |
12351 | use one of the sizer classes derived from it such as `wx.BoxSizer`, | |
1d5ee749 RD |
12352 | `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and |
12353 | `wx.GridBagSizer`. | |
248ed943 RD |
12354 | |
12355 | The concept implemented by sizers in wxWidgets is closely related to | |
12356 | layout tools in other GUI toolkits, such as Java's AWT, the GTK | |
12357 | toolkit or the Qt toolkit. It is based upon the idea of the individual | |
12358 | subwindows reporting their minimal required size and their ability to | |
12359 | get stretched if the size of the parent window has changed. This will | |
12360 | most often mean that the programmer does not set the original size of | |
12361 | a dialog in the beginning, rather the dialog will assigned a sizer and | |
12362 | this sizer will be queried about the recommended size. The sizer in | |
12363 | turn will query its children, which can be normal windows or contorls, | |
12364 | empty space or other sizers, so that a hierarchy of sizers can be | |
12365 | constructed. Note that wxSizer does not derive from wxWindow and thus | |
12366 | do not interfere with tab ordering and requires very little resources | |
12367 | compared to a real window on screen. | |
12368 | ||
12369 | What makes sizers so well fitted for use in wxWidgets is the fact that | |
12370 | every control reports its own minimal size and the algorithm can | |
12371 | handle differences in font sizes or different window (dialog item) | |
12372 | sizes on different platforms without problems. If for example the | |
12373 | standard font as well as the overall design of Mac widgets requires | |
12374 | more space than on Windows, then the initial size of a dialog using a | |
12375 | sizer will automatically be bigger on Mac than on Windows. | |
12376 | """ | |
0085ce49 RD |
12377 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12378 | def __init__(self): raise AttributeError, "No constructor defined" | |
12379 | __repr__ = _swig_repr | |
12380 | __swig_destroy__ = _core_.delete_Sizer | |
12381 | __del__ = lambda self : None; | |
e811c8ce | 12382 | def _setOORInfo(*args, **kwargs): |
a95a7133 | 12383 | """_setOORInfo(self, PyObject _self)""" |
54f9ee45 | 12384 | return _core_.Sizer__setOORInfo(*args, **kwargs) |
e811c8ce RD |
12385 | |
12386 | def Add(*args, **kwargs): | |
0df68c9f | 12387 | """ |
248ed943 | 12388 | Add(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 12389 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
12390 | |
12391 | Appends a child item to the sizer. | |
0df68c9f | 12392 | """ |
54f9ee45 | 12393 | return _core_.Sizer_Add(*args, **kwargs) |
e811c8ce | 12394 | |
cbfc9df6 RD |
12395 | def AddF(*args, **kwargs): |
12396 | """ | |
12397 | AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem | |
12398 | ||
12399 | Similar to `Add` but uses the `wx.SizerFlags` convenience class for | |
12400 | setting the various flags, options and borders. | |
12401 | """ | |
12402 | return _core_.Sizer_AddF(*args, **kwargs) | |
12403 | ||
e811c8ce | 12404 | def Insert(*args, **kwargs): |
0df68c9f | 12405 | """ |
248ed943 | 12406 | Insert(self, int before, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 12407 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
12408 | |
12409 | Inserts a new item into the list of items managed by this sizer before | |
12410 | the item at index *before*. See `Add` for a description of the parameters. | |
0df68c9f | 12411 | """ |
54f9ee45 | 12412 | return _core_.Sizer_Insert(*args, **kwargs) |
e811c8ce | 12413 | |
cbfc9df6 RD |
12414 | def InsertF(*args, **kwargs): |
12415 | """ | |
12416 | InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem | |
12417 | ||
12418 | Similar to `Insert`, but uses the `wx.SizerFlags` convenience class | |
12419 | for setting the various flags, options and borders. | |
12420 | """ | |
12421 | return _core_.Sizer_InsertF(*args, **kwargs) | |
12422 | ||
e811c8ce | 12423 | def Prepend(*args, **kwargs): |
0df68c9f | 12424 | """ |
248ed943 | 12425 | Prepend(self, item, int proportion=0, int flag=0, int border=0, |
d3b6e4ff | 12426 | PyObject userData=None) -> wx.SizerItem |
248ed943 RD |
12427 | |
12428 | Adds a new item to the begining of the list of sizer items managed by | |
12429 | this sizer. See `Add` for a description of the parameters. | |
0df68c9f | 12430 | """ |
54f9ee45 | 12431 | return _core_.Sizer_Prepend(*args, **kwargs) |
e811c8ce | 12432 | |
cbfc9df6 RD |
12433 | def PrependF(*args, **kwargs): |
12434 | """ | |
12435 | PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem | |
12436 | ||
12437 | Similar to `Prepend` but uses the `wx.SizerFlags` convenience class | |
12438 | for setting the various flags, options and borders. | |
12439 | """ | |
12440 | return _core_.Sizer_PrependF(*args, **kwargs) | |
12441 | ||
e811c8ce | 12442 | def Remove(*args, **kwargs): |
248ed943 RD |
12443 | """ |
12444 | Remove(self, item) -> bool | |
12445 | ||
12446 | Removes an item from the sizer and destroys it. This method does not | |
12447 | cause any layout or resizing to take place, call `Layout` to update | |
12448 | the layout on screen after removing a child from the sizer. The | |
12449 | *item* parameter can be either a window, a sizer, or the zero-based | |
12450 | index of an item to remove. Returns True if the child item was found | |
12451 | and removed. | |
12452 | """ | |
54f9ee45 | 12453 | return _core_.Sizer_Remove(*args, **kwargs) |
e811c8ce | 12454 | |
1c0f361b | 12455 | def Detach(*args, **kwargs): |
248ed943 RD |
12456 | """ |
12457 | Detach(self, item) -> bool | |
12458 | ||
12459 | Detaches an item from the sizer without destroying it. This method | |
12460 | does not cause any layout or resizing to take place, call `Layout` to | |
12461 | do so. The *item* parameter can be either a window, a sizer, or the | |
12462 | zero-based index of the item to be detached. Returns True if the child item | |
12463 | was found and detached. | |
12464 | """ | |
1c0f361b RD |
12465 | return _core_.Sizer_Detach(*args, **kwargs) |
12466 | ||
d3b6e4ff RD |
12467 | def GetItem(*args, **kwargs): |
12468 | """ | |
cbfc9df6 | 12469 | GetItem(self, item, recursive=False) -> wx.SizerItem |
d3b6e4ff RD |
12470 | |
12471 | Returns the `wx.SizerItem` which holds the *item* given. The *item* | |
12472 | parameter can be either a window, a sizer, or the zero-based index of | |
4d170c95 | 12473 | the item to be found. |
d3b6e4ff RD |
12474 | """ |
12475 | return _core_.Sizer_GetItem(*args, **kwargs) | |
12476 | ||
e811c8ce | 12477 | def _SetItemMinSize(*args, **kwargs): |
a95a7133 | 12478 | """_SetItemMinSize(self, PyObject item, Size size)""" |
54f9ee45 | 12479 | return _core_.Sizer__SetItemMinSize(*args, **kwargs) |
e811c8ce | 12480 | |
97ab0f6a RD |
12481 | def _ReplaceWin(*args, **kwargs): |
12482 | """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool""" | |
12483 | return _core_.Sizer__ReplaceWin(*args, **kwargs) | |
12484 | ||
12485 | def _ReplaceSizer(*args, **kwargs): | |
12486 | """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool""" | |
12487 | return _core_.Sizer__ReplaceSizer(*args, **kwargs) | |
12488 | ||
12489 | def _ReplaceItem(*args, **kwargs): | |
12490 | """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool""" | |
12491 | return _core_.Sizer__ReplaceItem(*args, **kwargs) | |
12492 | ||
12493 | def Replace(self, olditem, item, recursive=False): | |
12494 | """ | |
12495 | Detaches the given ``olditem`` from the sizer and replaces it with | |
12496 | ``item`` which can be a window, sizer, or `wx.SizerItem`. The | |
12497 | detached child is destroyed only if it is not a window, (because | |
12498 | windows are owned by their parent, not the sizer.) The | |
12499 | ``recursive`` parameter can be used to search for the given | |
12500 | element recursivly in subsizers. | |
12501 | ||
12502 | This method does not cause any layout or resizing to take place, | |
12503 | call `Layout` to do so. | |
12504 | ||
12505 | Returns ``True`` if the child item was found and removed. | |
12506 | """ | |
12507 | if isinstance(olditem, wx.Window): | |
12508 | return self._ReplaceWin(olditem, item, recursive) | |
cbfc9df6 | 12509 | elif isinstance(olditem, wx.Sizer): |
97ab0f6a | 12510 | return self._ReplaceSizer(olditem, item, recursive) |
cbfc9df6 | 12511 | elif isinstance(olditem, int): |
97ab0f6a RD |
12512 | return self._ReplaceItem(olditem, item) |
12513 | else: | |
12514 | raise TypeError("Expected Window, Sizer, or integer for first parameter.") | |
12515 | ||
12516 | def SetContainingWindow(*args, **kwargs): | |
12517 | """ | |
12518 | SetContainingWindow(self, Window window) | |
12519 | ||
12520 | Set (or unset) the window this sizer is used in. | |
12521 | """ | |
12522 | return _core_.Sizer_SetContainingWindow(*args, **kwargs) | |
12523 | ||
12524 | def GetContainingWindow(*args, **kwargs): | |
12525 | """ | |
12526 | GetContainingWindow(self) -> Window | |
12527 | ||
12528 | Get the window this sizer is used in. | |
12529 | """ | |
12530 | return _core_.Sizer_GetContainingWindow(*args, **kwargs) | |
12531 | ||
248ed943 RD |
12532 | def SetItemMinSize(self, item, *args): |
12533 | """ | |
12534 | SetItemMinSize(self, item, Size size) | |
12535 | ||
12536 | Sets the minimum size that will be allocated for an item in the sizer. | |
12537 | The *item* parameter can be either a window, a sizer, or the | |
12538 | zero-based index of the item. If a window or sizer is given then it | |
12539 | will be searched for recursivly in subsizers if neccessary. | |
12540 | """ | |
12541 | if len(args) == 2: | |
12542 | # for backward compatibility accept separate width,height args too | |
12543 | return self._SetItemMinSize(item, args) | |
12544 | else: | |
12545 | return self._SetItemMinSize(item, args[0]) | |
12546 | ||
e811c8ce | 12547 | def AddItem(*args, **kwargs): |
248ed943 RD |
12548 | """ |
12549 | AddItem(self, SizerItem item) | |
12550 | ||
12551 | Adds a `wx.SizerItem` to the sizer. | |
12552 | """ | |
54f9ee45 | 12553 | return _core_.Sizer_AddItem(*args, **kwargs) |
e811c8ce RD |
12554 | |
12555 | def InsertItem(*args, **kwargs): | |
248ed943 RD |
12556 | """ |
12557 | InsertItem(self, int index, SizerItem item) | |
12558 | ||
12559 | Inserts a `wx.SizerItem` to the sizer at the position given by *index*. | |
12560 | """ | |
54f9ee45 | 12561 | return _core_.Sizer_InsertItem(*args, **kwargs) |
e811c8ce RD |
12562 | |
12563 | def PrependItem(*args, **kwargs): | |
248ed943 RD |
12564 | """ |
12565 | PrependItem(self, SizerItem item) | |
12566 | ||
12567 | Prepends a `wx.SizerItem` to the sizer. | |
12568 | """ | |
54f9ee45 | 12569 | return _core_.Sizer_PrependItem(*args, **kwargs) |
e811c8ce | 12570 | |
248ed943 | 12571 | def AddMany(self, items): |
66c033b4 RD |
12572 | """ |
12573 | AddMany is a convenience method for adding several items | |
12574 | to a sizer at one time. Simply pass it a list of tuples, | |
12575 | where each tuple consists of the parameters that you | |
12576 | would normally pass to the `Add` method. | |
12577 | """ | |
248ed943 RD |
12578 | for item in items: |
12579 | if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)): | |
12580 | item = (item, ) | |
12581 | self.Add(*item) | |
d14a1e28 | 12582 | |
ae5bc7f3 RD |
12583 | def AddSpacer(self, *args, **kw): |
12584 | """AddSpacer(int size) --> SizerItem | |
12585 | ||
12586 | Add a spacer that is (size,size) pixels. | |
12587 | """ | |
12588 | if args and type(args[0]) == int: | |
12589 | return self.Add( (args[0],args[0] ), 0) | |
12590 | else: # otherwise stay compatible with old AddSpacer | |
12591 | return self.Add(*args, **kw) | |
12592 | def PrependSpacer(self, *args, **kw): | |
12593 | """PrependSpacer(int size) --> SizerItem | |
12594 | ||
12595 | Prepend a spacer that is (size, size) pixels.""" | |
12596 | if args and type(args[0]) == int: | |
12597 | return self.Prepend( (args[0],args[0] ), 0) | |
12598 | else: # otherwise stay compatible with old PrependSpacer | |
12599 | return self.Prepend(*args, **kw) | |
12600 | def InsertSpacer(self, index, *args, **kw): | |
12601 | """InsertSpacer(int index, int size) --> SizerItem | |
12602 | ||
12603 | Insert a spacer at position index that is (size, size) pixels.""" | |
12604 | if args and type(args[0]) == int: | |
12605 | return self.Insert( index, (args[0],args[0] ), 0) | |
12606 | else: # otherwise stay compatible with old InsertSpacer | |
12607 | return self.Insert(index, *args, **kw) | |
12608 | ||
12609 | ||
12610 | def AddStretchSpacer(self, prop=1): | |
12611 | """AddStretchSpacer(int prop=1) --> SizerItem | |
12612 | ||
12613 | Add a stretchable spacer.""" | |
12614 | return self.Add((0,0), prop) | |
12615 | def PrependStretchSpacer(self, prop=1): | |
12616 | """PrependStretchSpacer(int prop=1) --> SizerItem | |
12617 | ||
12618 | Prepend a stretchable spacer.""" | |
12619 | return self.Prepend((0,0), prop) | |
12620 | def InsertStretchSpacer(self, index, prop=1): | |
12621 | """InsertStretchSpacer(int index, int prop=1) --> SizerItem | |
12622 | ||
12623 | Insert a stretchable spacer.""" | |
12624 | return self.Insert(index, (0,0), prop) | |
12625 | ||
12626 | ||
74e96f3d | 12627 | # for backwards compatibility only, please do not use in new code |
b9d6a5f3 RD |
12628 | def AddWindow(self, *args, **kw): |
12629 | """Compatibility alias for `Add`.""" | |
12630 | return self.Add(*args, **kw) | |
12631 | def AddSizer(self, *args, **kw): | |
12632 | """Compatibility alias for `Add`.""" | |
12633 | return self.Add(*args, **kw) | |
b9d6a5f3 RD |
12634 | |
12635 | def PrependWindow(self, *args, **kw): | |
12636 | """Compatibility alias for `Prepend`.""" | |
12637 | return self.Prepend(*args, **kw) | |
12638 | def PrependSizer(self, *args, **kw): | |
12639 | """Compatibility alias for `Prepend`.""" | |
12640 | return self.Prepend(*args, **kw) | |
b9d6a5f3 RD |
12641 | |
12642 | def InsertWindow(self, *args, **kw): | |
12643 | """Compatibility alias for `Insert`.""" | |
12644 | return self.Insert(*args, **kw) | |
12645 | def InsertSizer(self, *args, **kw): | |
12646 | """Compatibility alias for `Insert`.""" | |
b9d6a5f3 RD |
12647 | return self.Insert(*args, **kw) |
12648 | ||
12649 | def RemoveWindow(self, *args, **kw): | |
12650 | """Compatibility alias for `Remove`.""" | |
12651 | return self.Remove(*args, **kw) | |
12652 | def RemoveSizer(self, *args, **kw): | |
12653 | """Compatibility alias for `Remove`.""" | |
12654 | return self.Remove(*args, **kw) | |
12655 | def RemovePos(self, *args, **kw): | |
12656 | """Compatibility alias for `Remove`.""" | |
12657 | return self.Remove(*args, **kw) | |
d14a1e28 RD |
12658 | |
12659 | ||
e811c8ce | 12660 | def SetDimension(*args, **kwargs): |
248ed943 RD |
12661 | """ |
12662 | SetDimension(self, int x, int y, int width, int height) | |
12663 | ||
12664 | Call this to force the sizer to take the given dimension and thus | |
12665 | force the items owned by the sizer to resize themselves according to | |
12666 | the rules defined by the parameter in the `Add`, `Insert` or `Prepend` | |
12667 | methods. | |
12668 | """ | |
54f9ee45 | 12669 | return _core_.Sizer_SetDimension(*args, **kwargs) |
e811c8ce RD |
12670 | |
12671 | def SetMinSize(*args, **kwargs): | |
248ed943 RD |
12672 | """ |
12673 | SetMinSize(self, Size size) | |
12674 | ||
12675 | Call this to give the sizer a minimal size. Normally, the sizer will | |
12676 | calculate its minimal size based purely on how much space its children | |
12677 | need. After calling this method `GetMinSize` will return either the | |
12678 | minimal size as requested by its children or the minimal size set | |
12679 | here, depending on which is bigger. | |
12680 | """ | |
54f9ee45 | 12681 | return _core_.Sizer_SetMinSize(*args, **kwargs) |
e811c8ce RD |
12682 | |
12683 | def GetSize(*args, **kwargs): | |
248ed943 RD |
12684 | """ |
12685 | GetSize(self) -> Size | |
12686 | ||
12687 | Returns the current size of the space managed by the sizer. | |
12688 | """ | |
54f9ee45 | 12689 | return _core_.Sizer_GetSize(*args, **kwargs) |
e811c8ce RD |
12690 | |
12691 | def GetPosition(*args, **kwargs): | |
248ed943 RD |
12692 | """ |
12693 | GetPosition(self) -> Point | |
12694 | ||
12695 | Returns the current position of the sizer's managed space. | |
12696 | """ | |
54f9ee45 | 12697 | return _core_.Sizer_GetPosition(*args, **kwargs) |
e811c8ce RD |
12698 | |
12699 | def GetMinSize(*args, **kwargs): | |
248ed943 RD |
12700 | """ |
12701 | GetMinSize(self) -> Size | |
12702 | ||
12703 | Returns the minimal size of the sizer. This is either the combined | |
12704 | minimal size of all the children and their borders or the minimal size | |
12705 | set by SetMinSize, depending on which is bigger. | |
12706 | """ | |
54f9ee45 | 12707 | return _core_.Sizer_GetMinSize(*args, **kwargs) |
e811c8ce | 12708 | |
d14a1e28 | 12709 | def GetSizeTuple(self): |
1c0f361b | 12710 | return self.GetSize().Get() |
d14a1e28 | 12711 | def GetPositionTuple(self): |
1c0f361b | 12712 | return self.GetPosition().Get() |
d14a1e28 | 12713 | def GetMinSizeTuple(self): |
1c0f361b | 12714 | return self.GetMinSize().Get() |
d14a1e28 | 12715 | |
e811c8ce | 12716 | def RecalcSizes(*args, **kwargs): |
248ed943 RD |
12717 | """ |
12718 | RecalcSizes(self) | |
12719 | ||
12720 | Using the sizes calculated by `CalcMin` reposition and resize all the | |
12721 | items managed by this sizer. You should not need to call this directly as | |
12722 | it is called by `Layout`. | |
12723 | """ | |
54f9ee45 | 12724 | return _core_.Sizer_RecalcSizes(*args, **kwargs) |
e811c8ce RD |
12725 | |
12726 | def CalcMin(*args, **kwargs): | |
248ed943 RD |
12727 | """ |
12728 | CalcMin(self) -> Size | |
12729 | ||
12730 | This method is where the sizer will do the actual calculation of its | |
12731 | children's minimal sizes. You should not need to call this directly as | |
12732 | it is called by `Layout`. | |
12733 | """ | |
54f9ee45 | 12734 | return _core_.Sizer_CalcMin(*args, **kwargs) |
e811c8ce RD |
12735 | |
12736 | def Layout(*args, **kwargs): | |
248ed943 RD |
12737 | """ |
12738 | Layout(self) | |
12739 | ||
12740 | This method will force the recalculation and layout of the items | |
12741 | controlled by the sizer using the current space allocated to the | |
12742 | sizer. Normally this is called automatically from the owning window's | |
12743 | EVT_SIZE handler, but it is also useful to call it from user code when | |
12744 | one of the items in a sizer change size, or items are added or | |
12745 | removed. | |
12746 | """ | |
54f9ee45 | 12747 | return _core_.Sizer_Layout(*args, **kwargs) |
e811c8ce RD |
12748 | |
12749 | def Fit(*args, **kwargs): | |
248ed943 RD |
12750 | """ |
12751 | Fit(self, Window window) -> Size | |
12752 | ||
12753 | Tell the sizer to resize the *window* to match the sizer's minimal | |
12754 | size. This is commonly done in the constructor of the window itself in | |
12755 | order to set its initial size to match the needs of the children as | |
12756 | determined by the sizer. Returns the new size. | |
12757 | ||
12758 | For a top level window this is the total window size, not the client size. | |
12759 | """ | |
54f9ee45 | 12760 | return _core_.Sizer_Fit(*args, **kwargs) |
e811c8ce RD |
12761 | |
12762 | def FitInside(*args, **kwargs): | |
248ed943 RD |
12763 | """ |
12764 | FitInside(self, Window window) | |
12765 | ||
12766 | Tell the sizer to resize the *virtual size* of the *window* to match the | |
12767 | sizer's minimal size. This will not alter the on screen size of the | |
12768 | window, but may cause the addition/removal/alteration of scrollbars | |
12769 | required to view the virtual area in windows which manage it. | |
12770 | ||
12771 | :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints` | |
12772 | ||
12773 | """ | |
54f9ee45 | 12774 | return _core_.Sizer_FitInside(*args, **kwargs) |
e811c8ce RD |
12775 | |
12776 | def SetSizeHints(*args, **kwargs): | |
248ed943 RD |
12777 | """ |
12778 | SetSizeHints(self, Window window) | |
12779 | ||
12780 | Tell the sizer to set (and `Fit`) the minimal size of the *window* to | |
12781 | match the sizer's minimal size. This is commonly done in the | |
12782 | constructor of the window itself if the window is resizable (as are | |
12783 | many dialogs under Unix and frames on probably all platforms) in order | |
12784 | to prevent the window from being sized smaller than the minimal size | |
12785 | required by the sizer. | |
12786 | """ | |
54f9ee45 | 12787 | return _core_.Sizer_SetSizeHints(*args, **kwargs) |
e811c8ce RD |
12788 | |
12789 | def SetVirtualSizeHints(*args, **kwargs): | |
248ed943 RD |
12790 | """ |
12791 | SetVirtualSizeHints(self, Window window) | |
12792 | ||
12793 | Tell the sizer to set the minimal size of the window virtual area to | |
12794 | match the sizer's minimal size. For windows with managed scrollbars | |
12795 | this will set them appropriately. | |
12796 | ||
12797 | :see: `wx.ScrolledWindow.SetScrollbars` | |
12798 | ||
12799 | """ | |
54f9ee45 | 12800 | return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs) |
e811c8ce RD |
12801 | |
12802 | def Clear(*args, **kwargs): | |
248ed943 RD |
12803 | """ |
12804 | Clear(self, bool deleteWindows=False) | |
12805 | ||
12806 | Clear all items from the sizer, optionally destroying the window items | |
12807 | as well. | |
12808 | """ | |
54f9ee45 | 12809 | return _core_.Sizer_Clear(*args, **kwargs) |
e811c8ce RD |
12810 | |
12811 | def DeleteWindows(*args, **kwargs): | |
248ed943 RD |
12812 | """ |
12813 | DeleteWindows(self) | |
12814 | ||
12815 | Destroy all windows managed by the sizer. | |
12816 | """ | |
54f9ee45 | 12817 | return _core_.Sizer_DeleteWindows(*args, **kwargs) |
e811c8ce RD |
12818 | |
12819 | def GetChildren(*args, **kwargs): | |
248ed943 | 12820 | """ |
51b83b37 | 12821 | GetChildren(self) -> list |
248ed943 RD |
12822 | |
12823 | Returns a list of all the `wx.SizerItem` objects managed by the sizer. | |
12824 | """ | |
54f9ee45 | 12825 | return _core_.Sizer_GetChildren(*args, **kwargs) |
e811c8ce RD |
12826 | |
12827 | def Show(*args, **kwargs): | |
248ed943 | 12828 | """ |
ae8162c8 | 12829 | Show(self, item, bool show=True, bool recursive=false) -> bool |
e811c8ce | 12830 | |
248ed943 RD |
12831 | Shows or hides an item managed by the sizer. To make a sizer item |
12832 | disappear or reappear, use Show followed by `Layout`. The *item* | |
12833 | parameter can be either a window, a sizer, or the zero-based index of | |
7e63a440 RD |
12834 | the item. Use the recursive parameter to show or hide an item in a |
12835 | subsizer. Returns True if the item was found. | |
248ed943 RD |
12836 | """ |
12837 | return _core_.Sizer_Show(*args, **kwargs) | |
e811c8ce RD |
12838 | |
12839 | def IsShown(*args, **kwargs): | |
248ed943 RD |
12840 | """ |
12841 | IsShown(self, item) | |
12842 | ||
b1fcee84 | 12843 | Determines if the item is currently shown. To make a sizer |
248ed943 RD |
12844 | item disappear or reappear, use Show followed by `Layout`. The *item* |
12845 | parameter can be either a window, a sizer, or the zero-based index of | |
12846 | the item. | |
12847 | """ | |
54f9ee45 | 12848 | return _core_.Sizer_IsShown(*args, **kwargs) |
e811c8ce | 12849 | |
7e63a440 | 12850 | def Hide(self, item, recursive=False): |
248ed943 | 12851 | """ |
27fb7603 | 12852 | A convenience method for `Show` (item, False, recursive). |
248ed943 | 12853 | """ |
06759a38 | 12854 | return self.Show(item, False, recursive) |
248ed943 | 12855 | |
e811c8ce | 12856 | def ShowItems(*args, **kwargs): |
248ed943 RD |
12857 | """ |
12858 | ShowItems(self, bool show) | |
12859 | ||
84f85550 | 12860 | Recursively call `wx.SizerItem.Show` on all sizer items. |
248ed943 | 12861 | """ |
54f9ee45 | 12862 | return _core_.Sizer_ShowItems(*args, **kwargs) |
e811c8ce | 12863 | |
33d6fd3b RD |
12864 | Children = property(GetChildren,doc="See `GetChildren`") |
12865 | ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`") | |
12866 | MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`") | |
12867 | Position = property(GetPosition,doc="See `GetPosition`") | |
12868 | Size = property(GetSize,doc="See `GetSize`") | |
2131d850 | 12869 | _core_.Sizer_swigregister(Sizer) |
d14a1e28 RD |
12870 | |
12871 | class PySizer(Sizer): | |
248ed943 RD |
12872 | """ |
12873 | wx.PySizer is a special version of `wx.Sizer` that has been | |
12874 | instrumented to allow the C++ virtual methods to be overloaded in | |
12875 | Python derived classes. You would derive from this class if you are | |
12876 | wanting to implement a custom sizer in Python code. Simply implement | |
12877 | `CalcMin` and `RecalcSizes` in the derived class and you're all set. | |
12878 | For example:: | |
12879 | ||
12880 | class MySizer(wx.PySizer): | |
12881 | def __init__(self): | |
12882 | wx.PySizer.__init__(self) | |
12883 | ||
12884 | def CalcMin(self): | |
12885 | for item in self.GetChildren(): | |
12886 | # calculate the total minimum width and height needed | |
12887 | # by all items in the sizer according to this sizer's | |
12888 | # layout algorithm. | |
12889 | ... | |
12890 | return wx.Size(width, height) | |
12891 | ||
12892 | def RecalcSizes(self): | |
12893 | # find the space allotted to this sizer | |
12894 | pos = self.GetPosition() | |
12895 | size = self.GetSize() | |
12896 | for item in self.GetChildren(): | |
12897 | # Recalculate (if necessary) the position and size of | |
12898 | # each item and then call item.SetDimension to do the | |
12899 | # actual positioning and sizing of the items within the | |
12900 | # space alloted to this sizer. | |
12901 | ... | |
12902 | item.SetDimension(itemPos, itemSize) | |
12903 | ||
12904 | ||
12905 | When `Layout` is called it first calls `CalcMin` followed by | |
12906 | `RecalcSizes` so you can optimize a bit by saving the results of | |
e505d15e | 12907 | `CalcMin` and reusing them in `RecalcSizes`. |
248ed943 RD |
12908 | |
12909 | :see: `wx.SizerItem`, `wx.Sizer.GetChildren` | |
12910 | ||
12911 | ||
12912 | """ | |
0085ce49 RD |
12913 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12914 | __repr__ = _swig_repr | |
12915 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12916 | """ |
12917 | __init__(self) -> PySizer | |
12918 | ||
12919 | Creates a wx.PySizer. Must be called from the __init__ in the derived | |
12920 | class. | |
12921 | """ | |
0085ce49 | 12922 | _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs)) |
c25f90f6 | 12923 | self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer) |
e811c8ce RD |
12924 | |
12925 | def _setCallbackInfo(*args, **kwargs): | |
a95a7133 | 12926 | """_setCallbackInfo(self, PyObject self, PyObject _class)""" |
54f9ee45 | 12927 | return _core_.PySizer__setCallbackInfo(*args, **kwargs) |
e811c8ce | 12928 | |
2131d850 | 12929 | _core_.PySizer_swigregister(PySizer) |
d14a1e28 RD |
12930 | |
12931 | #--------------------------------------------------------------------------- | |
12932 | ||
12933 | class BoxSizer(Sizer): | |
248ed943 RD |
12934 | """ |
12935 | The basic idea behind a box sizer is that windows will most often be | |
12936 | laid out in rather simple basic geometry, typically in a row or a | |
12937 | column or nested hierarchies of either. A wx.BoxSizer will lay out | |
12938 | its items in a simple row or column, depending on the orientation | |
12939 | parameter passed to the constructor. | |
12940 | """ | |
0085ce49 RD |
12941 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12942 | __repr__ = _swig_repr | |
12943 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12944 | """ |
12945 | __init__(self, int orient=HORIZONTAL) -> BoxSizer | |
12946 | ||
12947 | Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL`` | |
12948 | or ``wx.HORIZONTAL`` for creating either a column sizer or a row | |
12949 | sizer. | |
12950 | """ | |
0085ce49 | 12951 | _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs)) |
d14a1e28 | 12952 | self._setOORInfo(self) |
e811c8ce RD |
12953 | |
12954 | def GetOrientation(*args, **kwargs): | |
248ed943 RD |
12955 | """ |
12956 | GetOrientation(self) -> int | |
12957 | ||
12958 | Returns the current orientation of the sizer. | |
12959 | """ | |
54f9ee45 | 12960 | return _core_.BoxSizer_GetOrientation(*args, **kwargs) |
e811c8ce RD |
12961 | |
12962 | def SetOrientation(*args, **kwargs): | |
248ed943 RD |
12963 | """ |
12964 | SetOrientation(self, int orient) | |
e811c8ce | 12965 | |
248ed943 RD |
12966 | Resets the orientation of the sizer. |
12967 | """ | |
12968 | return _core_.BoxSizer_SetOrientation(*args, **kwargs) | |
e811c8ce | 12969 | |
da9714b5 RD |
12970 | def IsVertical(*args, **kwargs): |
12971 | """IsVertical(self) -> bool""" | |
12972 | return _core_.BoxSizer_IsVertical(*args, **kwargs) | |
12973 | ||
2bf58437 | 12974 | Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`") |
2131d850 | 12975 | _core_.BoxSizer_swigregister(BoxSizer) |
d14a1e28 RD |
12976 | |
12977 | #--------------------------------------------------------------------------- | |
12978 | ||
12979 | class StaticBoxSizer(BoxSizer): | |
248ed943 RD |
12980 | """ |
12981 | wx.StaticBoxSizer derives from and functions identically to the | |
12982 | `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer | |
12983 | manages. Note that this static box must be created separately and | |
12984 | passed to the sizer constructor. | |
12985 | """ | |
0085ce49 RD |
12986 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
12987 | __repr__ = _swig_repr | |
12988 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
12989 | """ |
12990 | __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer | |
12991 | ||
12992 | Constructor. It takes an associated static box and the orientation | |
12993 | *orient* as parameters - orient can be either of ``wx.VERTICAL`` or | |
12994 | ``wx.HORIZONTAL``. | |
12995 | """ | |
0085ce49 | 12996 | _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs)) |
d14a1e28 | 12997 | self._setOORInfo(self) |
e811c8ce RD |
12998 | |
12999 | def GetStaticBox(*args, **kwargs): | |
248ed943 RD |
13000 | """ |
13001 | GetStaticBox(self) -> StaticBox | |
e811c8ce | 13002 | |
248ed943 RD |
13003 | Returns the static box associated with this sizer. |
13004 | """ | |
13005 | return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs) | |
e811c8ce | 13006 | |
33d6fd3b | 13007 | StaticBox = property(GetStaticBox,doc="See `GetStaticBox`") |
2131d850 | 13008 | _core_.StaticBoxSizer_swigregister(StaticBoxSizer) |
d14a1e28 RD |
13009 | |
13010 | #--------------------------------------------------------------------------- | |
13011 | ||
13012 | class GridSizer(Sizer): | |
248ed943 RD |
13013 | """ |
13014 | A grid sizer is a sizer which lays out its children in a | |
13015 | two-dimensional table with all cells having the same size. In other | |
13016 | words, the width of each cell within the grid is the width of the | |
13017 | widest item added to the sizer and the height of each grid cell is the | |
13018 | height of the tallest item. An optional vertical and/or horizontal | |
13019 | gap between items can also be specified (in pixels.) | |
13020 | ||
13021 | Items are placed in the cells of the grid in the order they are added, | |
13022 | in row-major order. In other words, the first row is filled first, | |
13023 | then the second, and so on until all items have been added. (If | |
13024 | neccessary, additional rows will be added as items are added.) If you | |
13025 | need to have greater control over the cells that items are placed in | |
13026 | then use the `wx.GridBagSizer`. | |
13027 | ||
13028 | """ | |
0085ce49 RD |
13029 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13030 | __repr__ = _swig_repr | |
13031 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
13032 | """ |
13033 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer | |
13034 | ||
13035 | Constructor for a wx.GridSizer. *rows* and *cols* determine the number | |
13036 | of columns and rows in the sizer - if either of the parameters is | |
13037 | zero, it will be calculated to from the total number of children in | |
13038 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
13039 | define extra space between all children. | |
13040 | """ | |
0085ce49 | 13041 | _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs)) |
d14a1e28 | 13042 | self._setOORInfo(self) |
e811c8ce | 13043 | |
e811c8ce | 13044 | def SetCols(*args, **kwargs): |
248ed943 RD |
13045 | """ |
13046 | SetCols(self, int cols) | |
13047 | ||
13048 | Sets the number of columns in the sizer. | |
13049 | """ | |
54f9ee45 | 13050 | return _core_.GridSizer_SetCols(*args, **kwargs) |
e811c8ce RD |
13051 | |
13052 | def SetRows(*args, **kwargs): | |
248ed943 RD |
13053 | """ |
13054 | SetRows(self, int rows) | |
13055 | ||
13056 | Sets the number of rows in the sizer. | |
13057 | """ | |
54f9ee45 | 13058 | return _core_.GridSizer_SetRows(*args, **kwargs) |
e811c8ce RD |
13059 | |
13060 | def SetVGap(*args, **kwargs): | |
248ed943 RD |
13061 | """ |
13062 | SetVGap(self, int gap) | |
13063 | ||
13064 | Sets the vertical gap (in pixels) between the cells in the sizer. | |
13065 | """ | |
54f9ee45 | 13066 | return _core_.GridSizer_SetVGap(*args, **kwargs) |
e811c8ce RD |
13067 | |
13068 | def SetHGap(*args, **kwargs): | |
248ed943 RD |
13069 | """ |
13070 | SetHGap(self, int gap) | |
13071 | ||
13072 | Sets the horizontal gap (in pixels) between cells in the sizer | |
13073 | """ | |
54f9ee45 | 13074 | return _core_.GridSizer_SetHGap(*args, **kwargs) |
e811c8ce RD |
13075 | |
13076 | def GetCols(*args, **kwargs): | |
248ed943 RD |
13077 | """ |
13078 | GetCols(self) -> int | |
13079 | ||
13080 | Returns the number of columns in the sizer. | |
13081 | """ | |
54f9ee45 | 13082 | return _core_.GridSizer_GetCols(*args, **kwargs) |
e811c8ce RD |
13083 | |
13084 | def GetRows(*args, **kwargs): | |
248ed943 RD |
13085 | """ |
13086 | GetRows(self) -> int | |
13087 | ||
13088 | Returns the number of rows in the sizer. | |
13089 | """ | |
54f9ee45 | 13090 | return _core_.GridSizer_GetRows(*args, **kwargs) |
e811c8ce RD |
13091 | |
13092 | def GetVGap(*args, **kwargs): | |
248ed943 RD |
13093 | """ |
13094 | GetVGap(self) -> int | |
13095 | ||
13096 | Returns the vertical gap (in pixels) between the cells in the sizer. | |
13097 | """ | |
54f9ee45 | 13098 | return _core_.GridSizer_GetVGap(*args, **kwargs) |
e811c8ce RD |
13099 | |
13100 | def GetHGap(*args, **kwargs): | |
248ed943 RD |
13101 | """ |
13102 | GetHGap(self) -> int | |
13103 | ||
13104 | Returns the horizontal gap (in pixels) between cells in the sizer. | |
13105 | """ | |
54f9ee45 | 13106 | return _core_.GridSizer_GetHGap(*args, **kwargs) |
e811c8ce | 13107 | |
0085ce49 RD |
13108 | def CalcRowsCols(self): |
13109 | """ | |
13110 | CalcRowsCols() -> (rows, cols) | |
13111 | ||
13112 | Calculates how many rows and columns will be in the sizer based | |
13113 | on the current number of items and also the rows, cols specified | |
13114 | in the constructor. | |
13115 | """ | |
13116 | nitems = len(self.GetChildren()) | |
13117 | rows = self.GetRows() | |
13118 | cols = self.GetCols() | |
13119 | assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed" | |
13120 | if cols != 0: | |
13121 | rows = (nitems + cols - 1) / cols | |
13122 | elif rows != 0: | |
13123 | cols = (nitems + rows - 1) / rows | |
13124 | return (rows, cols) | |
d14a1e28 | 13125 | |
97ab0f6a RD |
13126 | Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`") |
13127 | HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`") | |
13128 | Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`") | |
13129 | VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`") | |
2131d850 | 13130 | _core_.GridSizer_swigregister(GridSizer) |
d14a1e28 RD |
13131 | |
13132 | #--------------------------------------------------------------------------- | |
13133 | ||
54f9ee45 RD |
13134 | FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE |
13135 | FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED | |
13136 | FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL | |
d14a1e28 | 13137 | class FlexGridSizer(GridSizer): |
248ed943 RD |
13138 | """ |
13139 | A flex grid sizer is a sizer which lays out its children in a | |
13140 | two-dimensional table with all table cells in one row having the same | |
13141 | height and all cells in one column having the same width, but all | |
13142 | rows or all columns are not necessarily the same height or width as in | |
13143 | the `wx.GridSizer`. | |
13144 | ||
13145 | wx.FlexGridSizer can also size items equally in one direction but | |
13146 | unequally ("flexibly") in the other. If the sizer is only flexible | |
13147 | in one direction (this can be changed using `SetFlexibleDirection`), it | |
13148 | needs to be decided how the sizer should grow in the other ("non | |
13149 | flexible") direction in order to fill the available space. The | |
13150 | `SetNonFlexibleGrowMode` method serves this purpose. | |
13151 | ||
13152 | ||
13153 | """ | |
0085ce49 RD |
13154 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13155 | __repr__ = _swig_repr | |
13156 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
13157 | """ |
13158 | __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer | |
13159 | ||
13160 | Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the | |
13161 | number of columns and rows in the sizer - if either of the parameters | |
13162 | is zero, it will be calculated to from the total number of children in | |
13163 | the sizer, thus making the sizer grow dynamically. *vgap* and *hgap* | |
13164 | define extra space between all children. | |
13165 | """ | |
0085ce49 | 13166 | _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs)) |
d14a1e28 | 13167 | self._setOORInfo(self) |
e811c8ce | 13168 | |
248ed943 RD |
13169 | def AddGrowableRow(*args, **kwargs): |
13170 | """ | |
13171 | AddGrowableRow(self, size_t idx, int proportion=0) | |
e811c8ce | 13172 | |
248ed943 RD |
13173 | Specifies that row *idx* (starting from zero) should be grown if there |
13174 | is extra space available to the sizer. | |
e811c8ce | 13175 | |
248ed943 RD |
13176 | The *proportion* parameter has the same meaning as the stretch factor |
13177 | for the box sizers except that if all proportions are 0, then all | |
13178 | columns are resized equally (instead of not being resized at all). | |
13179 | """ | |
54f9ee45 | 13180 | return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs) |
e811c8ce RD |
13181 | |
13182 | def RemoveGrowableRow(*args, **kwargs): | |
248ed943 RD |
13183 | """ |
13184 | RemoveGrowableRow(self, size_t idx) | |
13185 | ||
13186 | Specifies that row *idx* is no longer growable. | |
13187 | """ | |
54f9ee45 | 13188 | return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs) |
e811c8ce RD |
13189 | |
13190 | def AddGrowableCol(*args, **kwargs): | |
248ed943 RD |
13191 | """ |
13192 | AddGrowableCol(self, size_t idx, int proportion=0) | |
13193 | ||
13194 | Specifies that column *idx* (starting from zero) should be grown if | |
13195 | there is extra space available to the sizer. | |
13196 | ||
13197 | The *proportion* parameter has the same meaning as the stretch factor | |
13198 | for the box sizers except that if all proportions are 0, then all | |
13199 | columns are resized equally (instead of not being resized at all). | |
13200 | """ | |
54f9ee45 | 13201 | return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs) |
e811c8ce RD |
13202 | |
13203 | def RemoveGrowableCol(*args, **kwargs): | |
248ed943 RD |
13204 | """ |
13205 | RemoveGrowableCol(self, size_t idx) | |
13206 | ||
13207 | Specifies that column *idx* is no longer growable. | |
13208 | """ | |
54f9ee45 | 13209 | return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs) |
e811c8ce RD |
13210 | |
13211 | def SetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
13212 | """ |
13213 | SetFlexibleDirection(self, int direction) | |
13214 | ||
13215 | Specifies whether the sizer should flexibly resize its columns, rows, | |
13216 | or both. Argument *direction* can be one of the following values. Any | |
13217 | other value is ignored. | |
13218 | ||
13219 | ============== ======================================= | |
13220 | wx.VERTICAL Rows are flexibly sized. | |
13221 | wx.HORIZONTAL Columns are flexibly sized. | |
13222 | wx.BOTH Both rows and columns are flexibly sized | |
13223 | (this is the default value). | |
13224 | ============== ======================================= | |
13225 | ||
13226 | Note that this method does not trigger relayout. | |
13227 | ||
13228 | """ | |
54f9ee45 | 13229 | return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
13230 | |
13231 | def GetFlexibleDirection(*args, **kwargs): | |
248ed943 RD |
13232 | """ |
13233 | GetFlexibleDirection(self) -> int | |
13234 | ||
13235 | Returns a value that specifies whether the sizer | |
13236 | flexibly resizes its columns, rows, or both (default). | |
13237 | ||
13238 | :see: `SetFlexibleDirection` | |
13239 | """ | |
54f9ee45 | 13240 | return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs) |
e811c8ce RD |
13241 | |
13242 | def SetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
13243 | """ |
13244 | SetNonFlexibleGrowMode(self, int mode) | |
13245 | ||
13246 | Specifies how the sizer should grow in the non-flexible direction if | |
13247 | there is one (so `SetFlexibleDirection` must have been called | |
13248 | previously). Argument *mode* can be one of the following values: | |
13249 | ||
13250 | ========================== ================================================= | |
13251 | wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction. | |
13252 | wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with | |
13253 | `AddGrowableCol` and `AddGrowableRow`. In this | |
13254 | case equal sizing applies to minimum sizes of | |
13255 | columns or rows (this is the default value). | |
13256 | wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in | |
13257 | the non flexible direction, whether they are | |
13258 | growable or not in the flexbile direction. | |
13259 | ========================== ================================================= | |
13260 | ||
13261 | Note that this method does not trigger relayout. | |
248ed943 | 13262 | """ |
54f9ee45 | 13263 | return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
13264 | |
13265 | def GetNonFlexibleGrowMode(*args, **kwargs): | |
248ed943 RD |
13266 | """ |
13267 | GetNonFlexibleGrowMode(self) -> int | |
13268 | ||
13269 | Returns the value that specifies how the sizer grows in the | |
13270 | non-flexible direction if there is one. | |
13271 | ||
13272 | :see: `SetNonFlexibleGrowMode` | |
13273 | """ | |
54f9ee45 | 13274 | return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs) |
e811c8ce RD |
13275 | |
13276 | def GetRowHeights(*args, **kwargs): | |
fd2dc343 RD |
13277 | """ |
13278 | GetRowHeights(self) -> list | |
13279 | ||
13280 | Returns a list of integers representing the heights of each of the | |
13281 | rows in the sizer. | |
13282 | """ | |
54f9ee45 | 13283 | return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs) |
e811c8ce RD |
13284 | |
13285 | def GetColWidths(*args, **kwargs): | |
fd2dc343 RD |
13286 | """ |
13287 | GetColWidths(self) -> list | |
13288 | ||
13289 | Returns a list of integers representing the widths of each of the | |
13290 | columns in the sizer. | |
13291 | """ | |
54f9ee45 | 13292 | return _core_.FlexGridSizer_GetColWidths(*args, **kwargs) |
e811c8ce | 13293 | |
97ab0f6a RD |
13294 | ColWidths = property(GetColWidths,doc="See `GetColWidths`") |
13295 | FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`") | |
13296 | NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`") | |
13297 | RowHeights = property(GetRowHeights,doc="See `GetRowHeights`") | |
2131d850 | 13298 | _core_.FlexGridSizer_swigregister(FlexGridSizer) |
d14a1e28 | 13299 | |
e505d15e RD |
13300 | class StdDialogButtonSizer(BoxSizer): |
13301 | """ | |
13302 | A special sizer that knows how to order and position standard buttons | |
13303 | in order to conform to the current platform's standards. You simply | |
13304 | need to add each `wx.Button` to the sizer, and be sure to create the | |
53aa7709 | 13305 | buttons using the standard ID's. Then call `Realize` and the sizer |
e505d15e RD |
13306 | will take care of the rest. |
13307 | ||
13308 | """ | |
0085ce49 RD |
13309 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13310 | __repr__ = _swig_repr | |
13311 | def __init__(self, *args, **kwargs): | |
e505d15e | 13312 | """__init__(self) -> StdDialogButtonSizer""" |
0085ce49 | 13313 | _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs)) |
e505d15e RD |
13314 | def AddButton(*args, **kwargs): |
13315 | """ | |
13316 | AddButton(self, wxButton button) | |
13317 | ||
13318 | Use this to add the buttons to this sizer. Do not use the `Add` | |
13319 | method in the base class. | |
13320 | """ | |
13321 | return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs) | |
13322 | ||
53aa7709 | 13323 | def Realize(*args, **kwargs): |
e505d15e | 13324 | """ |
53aa7709 | 13325 | Realize(self) |
e505d15e RD |
13326 | |
13327 | This funciton needs to be called after all the buttons have been added | |
13328 | to the sizer. It will reorder them and position them in a platform | |
13329 | specifc manner. | |
13330 | """ | |
53aa7709 | 13331 | return _core_.StdDialogButtonSizer_Realize(*args, **kwargs) |
51b83b37 RD |
13332 | |
13333 | def SetAffirmativeButton(*args, **kwargs): | |
13334 | """SetAffirmativeButton(self, wxButton button)""" | |
13335 | return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs) | |
13336 | ||
13337 | def SetNegativeButton(*args, **kwargs): | |
13338 | """SetNegativeButton(self, wxButton button)""" | |
13339 | return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs) | |
13340 | ||
13341 | def SetCancelButton(*args, **kwargs): | |
13342 | """SetCancelButton(self, wxButton button)""" | |
13343 | return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs) | |
e505d15e RD |
13344 | |
13345 | def GetAffirmativeButton(*args, **kwargs): | |
13346 | """GetAffirmativeButton(self) -> wxButton""" | |
13347 | return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs) | |
13348 | ||
13349 | def GetApplyButton(*args, **kwargs): | |
13350 | """GetApplyButton(self) -> wxButton""" | |
13351 | return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs) | |
13352 | ||
13353 | def GetNegativeButton(*args, **kwargs): | |
13354 | """GetNegativeButton(self) -> wxButton""" | |
13355 | return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs) | |
13356 | ||
13357 | def GetCancelButton(*args, **kwargs): | |
13358 | """GetCancelButton(self) -> wxButton""" | |
13359 | return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs) | |
13360 | ||
13361 | def GetHelpButton(*args, **kwargs): | |
13362 | """GetHelpButton(self) -> wxButton""" | |
13363 | return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs) | |
13364 | ||
33d6fd3b RD |
13365 | AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`") |
13366 | ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`") | |
13367 | CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`") | |
13368 | HelpButton = property(GetHelpButton,doc="See `GetHelpButton`") | |
13369 | NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`") | |
2131d850 | 13370 | _core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer) |
e505d15e | 13371 | |
d14a1e28 RD |
13372 | #--------------------------------------------------------------------------- |
13373 | ||
13374 | class GBPosition(object): | |
248ed943 RD |
13375 | """ |
13376 | This class represents the position of an item in a virtual grid of | |
13377 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
13378 | typemaps that will automatically convert from a 2-element sequence of | |
13379 | integers to a wx.GBPosition, so you can use the more pythonic | |
13380 | representation of the position nearly transparently in Python code. | |
13381 | """ | |
0085ce49 RD |
13382 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13383 | __repr__ = _swig_repr | |
13384 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
13385 | """ |
13386 | __init__(self, int row=0, int col=0) -> GBPosition | |
13387 | ||
13388 | This class represents the position of an item in a virtual grid of | |
13389 | rows and columns managed by a `wx.GridBagSizer`. wxPython has | |
13390 | typemaps that will automatically convert from a 2-element sequence of | |
13391 | integers to a wx.GBPosition, so you can use the more pythonic | |
13392 | representation of the position nearly transparently in Python code. | |
13393 | """ | |
0085ce49 RD |
13394 | _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs)) |
13395 | __swig_destroy__ = _core_.delete_GBPosition | |
13396 | __del__ = lambda self : None; | |
e811c8ce | 13397 | def GetRow(*args, **kwargs): |
a95a7133 | 13398 | """GetRow(self) -> int""" |
54f9ee45 | 13399 | return _core_.GBPosition_GetRow(*args, **kwargs) |
e811c8ce RD |
13400 | |
13401 | def GetCol(*args, **kwargs): | |
a95a7133 | 13402 | """GetCol(self) -> int""" |
54f9ee45 | 13403 | return _core_.GBPosition_GetCol(*args, **kwargs) |
e811c8ce RD |
13404 | |
13405 | def SetRow(*args, **kwargs): | |
a95a7133 | 13406 | """SetRow(self, int row)""" |
54f9ee45 | 13407 | return _core_.GBPosition_SetRow(*args, **kwargs) |
e811c8ce RD |
13408 | |
13409 | def SetCol(*args, **kwargs): | |
a95a7133 | 13410 | """SetCol(self, int col)""" |
54f9ee45 | 13411 | return _core_.GBPosition_SetCol(*args, **kwargs) |
e811c8ce RD |
13412 | |
13413 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
13414 | """ |
13415 | __eq__(self, PyObject other) -> bool | |
13416 | ||
13417 | Compare GBPosition for equality. | |
13418 | """ | |
54f9ee45 | 13419 | return _core_.GBPosition___eq__(*args, **kwargs) |
e811c8ce RD |
13420 | |
13421 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
13422 | """ |
13423 | __ne__(self, PyObject other) -> bool | |
13424 | ||
13425 | Compare GBPosition for inequality. | |
13426 | """ | |
54f9ee45 | 13427 | return _core_.GBPosition___ne__(*args, **kwargs) |
e811c8ce RD |
13428 | |
13429 | def Set(*args, **kwargs): | |
a95a7133 | 13430 | """Set(self, int row=0, int col=0)""" |
54f9ee45 | 13431 | return _core_.GBPosition_Set(*args, **kwargs) |
e811c8ce RD |
13432 | |
13433 | def Get(*args, **kwargs): | |
a95a7133 | 13434 | """Get(self) -> PyObject""" |
54f9ee45 | 13435 | return _core_.GBPosition_Get(*args, **kwargs) |
e811c8ce | 13436 | |
41e2b43e | 13437 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
13438 | def __str__(self): return str(self.Get()) |
13439 | def __repr__(self): return 'wx.GBPosition'+str(self.Get()) | |
13440 | def __len__(self): return len(self.Get()) | |
13441 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
13442 | def __setitem__(self, index, val): |
13443 | if index == 0: self.SetRow(val) | |
13444 | elif index == 1: self.SetCol(val) | |
13445 | else: raise IndexError | |
e811c8ce | 13446 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
13447 | __safe_for_unpickling__ = True |
13448 | def __reduce__(self): return (wx.GBPosition, self.Get()) | |
d14a1e28 RD |
13449 | |
13450 | row = property(GetRow, SetRow) | |
13451 | col = property(GetCol, SetCol) | |
13452 | ||
2131d850 | 13453 | _core_.GBPosition_swigregister(GBPosition) |
d14a1e28 RD |
13454 | |
13455 | class GBSpan(object): | |
248ed943 RD |
13456 | """ |
13457 | This class is used to hold the row and column spanning attributes of | |
13458 | items in a `wx.GridBagSizer`. wxPython has typemaps that will | |
13459 | automatically convert from a 2-element sequence of integers to a | |
13460 | wx.GBSpan, so you can use the more pythonic representation of the span | |
13461 | nearly transparently in Python code. | |
13462 | ||
13463 | """ | |
0085ce49 RD |
13464 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13465 | __repr__ = _swig_repr | |
13466 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
13467 | """ |
13468 | __init__(self, int rowspan=1, int colspan=1) -> GBSpan | |
13469 | ||
13470 | Construct a new wxGBSpan, optionally setting the rowspan and | |
13471 | colspan. The default is (1,1). (Meaning that the item occupies one | |
13472 | cell in each direction. | |
13473 | """ | |
0085ce49 RD |
13474 | _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs)) |
13475 | __swig_destroy__ = _core_.delete_GBSpan | |
13476 | __del__ = lambda self : None; | |
e811c8ce | 13477 | def GetRowspan(*args, **kwargs): |
a95a7133 | 13478 | """GetRowspan(self) -> int""" |
54f9ee45 | 13479 | return _core_.GBSpan_GetRowspan(*args, **kwargs) |
e811c8ce RD |
13480 | |
13481 | def GetColspan(*args, **kwargs): | |
a95a7133 | 13482 | """GetColspan(self) -> int""" |
54f9ee45 | 13483 | return _core_.GBSpan_GetColspan(*args, **kwargs) |
e811c8ce RD |
13484 | |
13485 | def SetRowspan(*args, **kwargs): | |
a95a7133 | 13486 | """SetRowspan(self, int rowspan)""" |
54f9ee45 | 13487 | return _core_.GBSpan_SetRowspan(*args, **kwargs) |
e811c8ce RD |
13488 | |
13489 | def SetColspan(*args, **kwargs): | |
a95a7133 | 13490 | """SetColspan(self, int colspan)""" |
54f9ee45 | 13491 | return _core_.GBSpan_SetColspan(*args, **kwargs) |
e811c8ce RD |
13492 | |
13493 | def __eq__(*args, **kwargs): | |
e9d6f3a4 RD |
13494 | """ |
13495 | __eq__(self, PyObject other) -> bool | |
13496 | ||
13497 | Compare wxGBSpan for equality. | |
13498 | """ | |
54f9ee45 | 13499 | return _core_.GBSpan___eq__(*args, **kwargs) |
e811c8ce RD |
13500 | |
13501 | def __ne__(*args, **kwargs): | |
e9d6f3a4 RD |
13502 | """ |
13503 | __ne__(self, PyObject other) -> bool | |
13504 | ||
13505 | Compare GBSpan for inequality. | |
13506 | """ | |
54f9ee45 | 13507 | return _core_.GBSpan___ne__(*args, **kwargs) |
e811c8ce RD |
13508 | |
13509 | def Set(*args, **kwargs): | |
a95a7133 | 13510 | """Set(self, int rowspan=1, int colspan=1)""" |
54f9ee45 | 13511 | return _core_.GBSpan_Set(*args, **kwargs) |
e811c8ce RD |
13512 | |
13513 | def Get(*args, **kwargs): | |
a95a7133 | 13514 | """Get(self) -> PyObject""" |
54f9ee45 | 13515 | return _core_.GBSpan_Get(*args, **kwargs) |
e811c8ce | 13516 | |
41e2b43e | 13517 | asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead") |
e811c8ce RD |
13518 | def __str__(self): return str(self.Get()) |
13519 | def __repr__(self): return 'wx.GBSpan'+str(self.Get()) | |
13520 | def __len__(self): return len(self.Get()) | |
13521 | def __getitem__(self, index): return self.Get()[index] | |
d14a1e28 RD |
13522 | def __setitem__(self, index, val): |
13523 | if index == 0: self.SetRowspan(val) | |
13524 | elif index == 1: self.SetColspan(val) | |
13525 | else: raise IndexError | |
e811c8ce | 13526 | def __nonzero__(self): return self.Get() != (0,0) |
74e96f3d RD |
13527 | __safe_for_unpickling__ = True |
13528 | def __reduce__(self): return (wx.GBSpan, self.Get()) | |
d14a1e28 RD |
13529 | |
13530 | rowspan = property(GetRowspan, SetRowspan) | |
13531 | colspan = property(GetColspan, SetColspan) | |
13532 | ||
2131d850 | 13533 | _core_.GBSpan_swigregister(GBSpan) |
d14a1e28 RD |
13534 | |
13535 | class GBSizerItem(SizerItem): | |
248ed943 RD |
13536 | """ |
13537 | The wx.GBSizerItem class is used to track the additional data about | |
13538 | items in a `wx.GridBagSizer` such as the item's position in the grid | |
13539 | and how many rows or columns it spans. | |
13540 | ||
13541 | """ | |
0085ce49 RD |
13542 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13543 | __repr__ = _swig_repr | |
13544 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
13545 | """ |
13546 | __init__(self) -> GBSizerItem | |
13547 | ||
13548 | Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer | |
13549 | size will need to be set, as well as a position and span before this | |
13550 | item can be used in a Sizer. | |
13551 | ||
13552 | You will probably never need to create a wx.GBSizerItem directly as they | |
13553 | are created automatically when the sizer's Add method is called. | |
13554 | """ | |
0085ce49 RD |
13555 | _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs)) |
13556 | __swig_destroy__ = _core_.delete_GBSizerItem | |
13557 | __del__ = lambda self : None; | |
e811c8ce | 13558 | def GetPos(*args, **kwargs): |
248ed943 RD |
13559 | """ |
13560 | GetPos(self) -> GBPosition | |
13561 | ||
13562 | Get the grid position of the item | |
13563 | """ | |
54f9ee45 | 13564 | return _core_.GBSizerItem_GetPos(*args, **kwargs) |
e811c8ce RD |
13565 | |
13566 | def GetPosTuple(self): return self.GetPos().Get() | |
13567 | def GetSpan(*args, **kwargs): | |
248ed943 RD |
13568 | """ |
13569 | GetSpan(self) -> GBSpan | |
13570 | ||
13571 | Get the row and column spanning of the item | |
13572 | """ | |
54f9ee45 | 13573 | return _core_.GBSizerItem_GetSpan(*args, **kwargs) |
e811c8ce RD |
13574 | |
13575 | def GetSpanTuple(self): return self.GetSpan().Get() | |
13576 | def SetPos(*args, **kwargs): | |
248ed943 RD |
13577 | """ |
13578 | SetPos(self, GBPosition pos) -> bool | |
13579 | ||
13580 | If the item is already a member of a sizer then first ensure that | |
13581 | there is no other item that would intersect with this one at the new | |
13582 | position, then set the new position. Returns True if the change is | |
13583 | successful and after the next Layout() the item will be moved. | |
13584 | """ | |
54f9ee45 | 13585 | return _core_.GBSizerItem_SetPos(*args, **kwargs) |
e811c8ce RD |
13586 | |
13587 | def SetSpan(*args, **kwargs): | |
248ed943 RD |
13588 | """ |
13589 | SetSpan(self, GBSpan span) -> bool | |
13590 | ||
13591 | If the item is already a member of a sizer then first ensure that | |
13592 | there is no other item that would intersect with this one with its new | |
13593 | spanning size, then set the new spanning. Returns True if the change | |
13594 | is successful and after the next Layout() the item will be resized. | |
13595 | ||
13596 | """ | |
54f9ee45 | 13597 | return _core_.GBSizerItem_SetSpan(*args, **kwargs) |
e811c8ce | 13598 | |
248ed943 | 13599 | def Intersects(*args, **kwargs): |
0df68c9f | 13600 | """ |
a95a7133 | 13601 | Intersects(self, GBSizerItem other) -> bool |
248ed943 RD |
13602 | |
13603 | Returns True if this item and the other item instersect. | |
0df68c9f | 13604 | """ |
248ed943 RD |
13605 | return _core_.GBSizerItem_Intersects(*args, **kwargs) |
13606 | ||
13607 | def IntersectsPos(*args, **kwargs): | |
13608 | """ | |
13609 | IntersectsPos(self, GBPosition pos, GBSpan span) -> bool | |
13610 | ||
13611 | Returns True if the given pos/span would intersect with this item. | |
13612 | """ | |
13613 | return _core_.GBSizerItem_IntersectsPos(*args, **kwargs) | |
e811c8ce RD |
13614 | |
13615 | def GetEndPos(*args, **kwargs): | |
248ed943 RD |
13616 | """ |
13617 | GetEndPos(self) -> GBPosition | |
13618 | ||
13619 | Get the row and column of the endpoint of this item. | |
13620 | """ | |
54f9ee45 | 13621 | return _core_.GBSizerItem_GetEndPos(*args, **kwargs) |
e811c8ce RD |
13622 | |
13623 | def GetGBSizer(*args, **kwargs): | |
248ed943 RD |
13624 | """ |
13625 | GetGBSizer(self) -> GridBagSizer | |
13626 | ||
13627 | Get the sizer this item is a member of. | |
13628 | """ | |
54f9ee45 | 13629 | return _core_.GBSizerItem_GetGBSizer(*args, **kwargs) |
e811c8ce RD |
13630 | |
13631 | def SetGBSizer(*args, **kwargs): | |
248ed943 RD |
13632 | """ |
13633 | SetGBSizer(self, GridBagSizer sizer) | |
13634 | ||
13635 | Set the sizer this item is a member of. | |
13636 | """ | |
54f9ee45 | 13637 | return _core_.GBSizerItem_SetGBSizer(*args, **kwargs) |
e811c8ce | 13638 | |
97ab0f6a RD |
13639 | EndPos = property(GetEndPos,doc="See `GetEndPos`") |
13640 | GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`") | |
13641 | Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`") | |
13642 | Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`") | |
2131d850 | 13643 | _core_.GBSizerItem_swigregister(GBSizerItem) |
d14a1e28 RD |
13644 | DefaultSpan = cvar.DefaultSpan |
13645 | ||
13646 | def GBSizerItemWindow(*args, **kwargs): | |
0df68c9f RD |
13647 | """ |
13648 | GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
13649 | int border, PyObject userData=None) -> GBSizerItem |
13650 | ||
13651 | Construct a `wx.GBSizerItem` for a window. | |
0df68c9f | 13652 | """ |
54f9ee45 | 13653 | val = _core_.new_GBSizerItemWindow(*args, **kwargs) |
d14a1e28 RD |
13654 | return val |
13655 | ||
13656 | def GBSizerItemSizer(*args, **kwargs): | |
0df68c9f RD |
13657 | """ |
13658 | GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag, | |
248ed943 RD |
13659 | int border, PyObject userData=None) -> GBSizerItem |
13660 | ||
13661 | Construct a `wx.GBSizerItem` for a sizer | |
0df68c9f | 13662 | """ |
54f9ee45 | 13663 | val = _core_.new_GBSizerItemSizer(*args, **kwargs) |
d14a1e28 RD |
13664 | return val |
13665 | ||
13666 | def GBSizerItemSpacer(*args, **kwargs): | |
0df68c9f RD |
13667 | """ |
13668 | GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span, | |
248ed943 RD |
13669 | int flag, int border, PyObject userData=None) -> GBSizerItem |
13670 | ||
13671 | Construct a `wx.GBSizerItem` for a spacer. | |
0df68c9f | 13672 | """ |
54f9ee45 | 13673 | val = _core_.new_GBSizerItemSpacer(*args, **kwargs) |
d14a1e28 RD |
13674 | return val |
13675 | ||
13676 | class GridBagSizer(FlexGridSizer): | |
248ed943 RD |
13677 | """ |
13678 | A `wx.Sizer` that can lay out items in a virtual grid like a | |
13679 | `wx.FlexGridSizer` but in this case explicit positioning of the items | |
13680 | is allowed using `wx.GBPosition`, and items can optionally span more | |
13681 | than one row and/or column using `wx.GBSpan`. The total size of the | |
13682 | virtual grid is determined by the largest row and column that items are | |
13683 | positioned at, adjusted for spanning. | |
13684 | ||
13685 | """ | |
0085ce49 RD |
13686 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13687 | __repr__ = _swig_repr | |
13688 | def __init__(self, *args, **kwargs): | |
248ed943 RD |
13689 | """ |
13690 | __init__(self, int vgap=0, int hgap=0) -> GridBagSizer | |
13691 | ||
13692 | Constructor, with optional parameters to specify the gap between the | |
13693 | rows and columns. | |
13694 | """ | |
0085ce49 | 13695 | _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs)) |
1823fbb4 RD |
13696 | self._setOORInfo(self) |
13697 | ||
e811c8ce | 13698 | def Add(*args, **kwargs): |
0df68c9f | 13699 | """ |
248ed943 | 13700 | Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0, |
d3b6e4ff | 13701 | int border=0, userData=None) -> wx.GBSizerItem |
248ed943 RD |
13702 | |
13703 | Adds an item to the sizer at the grid cell *pos*, optionally spanning | |
13704 | more than one row or column as specified with *span*. The remaining | |
13705 | args behave similarly to `wx.Sizer.Add`. | |
13706 | ||
13707 | Returns True if the item was successfully placed at the given cell | |
13708 | position, False if something was already there. | |
13709 | ||
0df68c9f | 13710 | """ |
54f9ee45 | 13711 | return _core_.GridBagSizer_Add(*args, **kwargs) |
e811c8ce RD |
13712 | |
13713 | def AddItem(*args, **kwargs): | |
248ed943 | 13714 | """ |
d3b6e4ff | 13715 | Add(self, GBSizerItem item) -> wx.GBSizerItem |
248ed943 RD |
13716 | |
13717 | Add an item to the sizer using a `wx.GBSizerItem`. Returns True if | |
13718 | the item was successfully placed at its given cell position, False if | |
13719 | something was already there. | |
13720 | """ | |
54f9ee45 | 13721 | return _core_.GridBagSizer_AddItem(*args, **kwargs) |
e811c8ce | 13722 | |
84f85550 RD |
13723 | def GetCellSize(*args, **kwargs): |
13724 | """ | |
13725 | GetCellSize(self, int row, int col) -> Size | |
13726 | ||
13727 | Get the size of the specified cell, including hgap and | |
13728 | vgap. Only valid after a Layout. | |
13729 | """ | |
13730 | return _core_.GridBagSizer_GetCellSize(*args, **kwargs) | |
13731 | ||
e811c8ce | 13732 | def GetEmptyCellSize(*args, **kwargs): |
248ed943 RD |
13733 | """ |
13734 | GetEmptyCellSize(self) -> Size | |
13735 | ||
13736 | Get the size used for cells in the grid with no item. | |
13737 | """ | |
54f9ee45 | 13738 | return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
13739 | |
13740 | def SetEmptyCellSize(*args, **kwargs): | |
248ed943 RD |
13741 | """ |
13742 | SetEmptyCellSize(self, Size sz) | |
13743 | ||
13744 | Set the size used for cells in the grid with no item. | |
13745 | """ | |
54f9ee45 | 13746 | return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs) |
e811c8ce RD |
13747 | |
13748 | def GetItemPosition(*args): | |
0df68c9f | 13749 | """ |
248ed943 RD |
13750 | GetItemPosition(self, item) -> GBPosition |
13751 | ||
13752 | Get the grid position of the specified *item* where *item* is either a | |
13753 | window or subsizer that is a member of this sizer, or a zero-based | |
13754 | index of an item. | |
0df68c9f | 13755 | """ |
54f9ee45 | 13756 | return _core_.GridBagSizer_GetItemPosition(*args) |
e811c8ce RD |
13757 | |
13758 | def SetItemPosition(*args): | |
0df68c9f | 13759 | """ |
248ed943 RD |
13760 | SetItemPosition(self, item, GBPosition pos) -> bool |
13761 | ||
13762 | Set the grid position of the specified *item* where *item* is either a | |
13763 | window or subsizer that is a member of this sizer, or a zero-based | |
13764 | index of an item. Returns True on success. If the move is not | |
13765 | allowed (because an item is already there) then False is returned. | |
13766 | ||
0df68c9f | 13767 | """ |
54f9ee45 | 13768 | return _core_.GridBagSizer_SetItemPosition(*args) |
e811c8ce RD |
13769 | |
13770 | def GetItemSpan(*args): | |
0df68c9f | 13771 | """ |
248ed943 RD |
13772 | GetItemSpan(self, item) -> GBSpan |
13773 | ||
13774 | Get the row/col spanning of the specified *item* where *item* is | |
13775 | either a window or subsizer that is a member of this sizer, or a | |
13776 | zero-based index of an item. | |
0df68c9f | 13777 | """ |
54f9ee45 | 13778 | return _core_.GridBagSizer_GetItemSpan(*args) |
e811c8ce RD |
13779 | |
13780 | def SetItemSpan(*args): | |
0df68c9f | 13781 | """ |
248ed943 RD |
13782 | SetItemSpan(self, item, GBSpan span) -> bool |
13783 | ||
13784 | Set the row/col spanning of the specified *item* where *item* is | |
13785 | either a window or subsizer that is a member of this sizer, or a | |
13786 | zero-based index of an item. Returns True on success. If the move is | |
13787 | not allowed (because an item is already there) then False is returned. | |
0df68c9f | 13788 | """ |
54f9ee45 | 13789 | return _core_.GridBagSizer_SetItemSpan(*args) |
e811c8ce RD |
13790 | |
13791 | def FindItem(*args): | |
0df68c9f | 13792 | """ |
248ed943 RD |
13793 | FindItem(self, item) -> GBSizerItem |
13794 | ||
13795 | Find the sizer item for the given window or subsizer, returns None if | |
13796 | not found. (non-recursive) | |
0df68c9f | 13797 | """ |
54f9ee45 | 13798 | return _core_.GridBagSizer_FindItem(*args) |
e811c8ce | 13799 | |
b08d67c2 RD |
13800 | def GetItem(self, item): |
13801 | gbsi = None | |
13802 | si = wx.FlexGridSizer.GetItem(self, item) | |
13803 | if not si: | |
13804 | return None | |
13805 | if type(item) is not int: | |
13806 | gbsi = self.FindItem(item) | |
13807 | if gbsi: return gbsi | |
13808 | return si | |
13809 | ||
e811c8ce | 13810 | def FindItemAtPosition(*args, **kwargs): |
248ed943 RD |
13811 | """ |
13812 | FindItemAtPosition(self, GBPosition pos) -> GBSizerItem | |
13813 | ||
13814 | Return the sizer item for the given grid cell, or None if there is no | |
13815 | item at that position. (non-recursive) | |
13816 | """ | |
54f9ee45 | 13817 | return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs) |
e811c8ce RD |
13818 | |
13819 | def FindItemAtPoint(*args, **kwargs): | |
248ed943 RD |
13820 | """ |
13821 | FindItemAtPoint(self, Point pt) -> GBSizerItem | |
13822 | ||
13823 | Return the sizer item located at the point given in *pt*, or None if | |
13824 | there is no item at that point. The (x,y) coordinates in pt correspond | |
13825 | to the client coordinates of the window using the sizer for | |
13826 | layout. (non-recursive) | |
13827 | """ | |
54f9ee45 | 13828 | return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs) |
e811c8ce | 13829 | |
248ed943 RD |
13830 | def CheckForIntersection(*args, **kwargs): |
13831 | """ | |
13832 | CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool | |
e811c8ce | 13833 | |
248ed943 RD |
13834 | Look at all items and see if any intersect (or would overlap) the |
13835 | given *item*. Returns True if so, False if there would be no overlap. | |
13836 | If an *excludeItem* is given then it will not be checked for | |
13837 | intersection, for example it may be the item we are checking the | |
13838 | position of. | |
e811c8ce | 13839 | |
248ed943 RD |
13840 | """ |
13841 | return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs) | |
e811c8ce | 13842 | |
248ed943 | 13843 | def CheckForIntersectionPos(*args, **kwargs): |
0df68c9f | 13844 | """ |
248ed943 RD |
13845 | CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool |
13846 | ||
13847 | Look at all items and see if any intersect (or would overlap) the | |
13848 | given position and span. Returns True if so, False if there would be | |
13849 | no overlap. If an *excludeItem* is given then it will not be checked | |
13850 | for intersection, for example it may be the item we are checking the | |
13851 | position of. | |
0df68c9f | 13852 | """ |
248ed943 | 13853 | return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs) |
e811c8ce | 13854 | |
2131d850 | 13855 | _core_.GridBagSizer_swigregister(GridBagSizer) |
d14a1e28 RD |
13856 | |
13857 | #--------------------------------------------------------------------------- | |
13858 | ||
54f9ee45 RD |
13859 | Left = _core_.Left |
13860 | Top = _core_.Top | |
13861 | Right = _core_.Right | |
13862 | Bottom = _core_.Bottom | |
13863 | Width = _core_.Width | |
13864 | Height = _core_.Height | |
13865 | Centre = _core_.Centre | |
13866 | Center = _core_.Center | |
13867 | CentreX = _core_.CentreX | |
13868 | CentreY = _core_.CentreY | |
13869 | Unconstrained = _core_.Unconstrained | |
13870 | AsIs = _core_.AsIs | |
13871 | PercentOf = _core_.PercentOf | |
13872 | Above = _core_.Above | |
13873 | Below = _core_.Below | |
13874 | LeftOf = _core_.LeftOf | |
13875 | RightOf = _core_.RightOf | |
13876 | SameAs = _core_.SameAs | |
13877 | Absolute = _core_.Absolute | |
d14a1e28 | 13878 | class IndividualLayoutConstraint(Object): |
15afbcd0 | 13879 | """ |
41e2b43e RD |
13880 | Objects of this class are stored in the `wx.LayoutConstraints` class as |
13881 | one of eight possible constraints that a window can be involved in. | |
13882 | You will never need to create an instance of | |
13883 | wx.IndividualLayoutConstraint, rather you should create a | |
13884 | `wx.LayoutConstraints` instance and use the individual contstraints | |
15afbcd0 | 13885 | that it contains. |
15afbcd0 | 13886 | """ |
0085ce49 RD |
13887 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
13888 | def __init__(self): raise AttributeError, "No constructor defined" | |
13889 | __repr__ = _swig_repr | |
e811c8ce | 13890 | def Set(*args, **kwargs): |
41e2b43e RD |
13891 | """ |
13892 | Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN) | |
13893 | ||
13894 | Sets the properties of the constraint. Normally called by one of the | |
13895 | convenience functions such as Above, RightOf, SameAs. | |
13896 | """ | |
54f9ee45 | 13897 | return _core_.IndividualLayoutConstraint_Set(*args, **kwargs) |
e811c8ce RD |
13898 | |
13899 | def LeftOf(*args, **kwargs): | |
15afbcd0 | 13900 | """ |
a95a7133 | 13901 | LeftOf(self, Window sibling, int marg=0) |
15afbcd0 | 13902 | |
41e2b43e RD |
13903 | Constrains this edge to be to the left of the given window, with an |
13904 | optional margin. Implicitly, this is relative to the left edge of the | |
13905 | other window. | |
15afbcd0 | 13906 | """ |
54f9ee45 | 13907 | return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs) |
e811c8ce RD |
13908 | |
13909 | def RightOf(*args, **kwargs): | |
15afbcd0 | 13910 | """ |
a95a7133 | 13911 | RightOf(self, Window sibling, int marg=0) |
15afbcd0 | 13912 | |
41e2b43e RD |
13913 | Constrains this edge to be to the right of the given window, with an |
13914 | optional margin. Implicitly, this is relative to the right edge of the | |
13915 | other window. | |
15afbcd0 | 13916 | """ |
54f9ee45 | 13917 | return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs) |
e811c8ce RD |
13918 | |
13919 | def Above(*args, **kwargs): | |
15afbcd0 | 13920 | """ |
a95a7133 | 13921 | Above(self, Window sibling, int marg=0) |
15afbcd0 | 13922 | |
41e2b43e RD |
13923 | Constrains this edge to be above the given window, with an optional |
13924 | margin. Implicitly, this is relative to the top edge of the other | |
13925 | window. | |
15afbcd0 | 13926 | """ |
54f9ee45 | 13927 | return _core_.IndividualLayoutConstraint_Above(*args, **kwargs) |
e811c8ce RD |
13928 | |
13929 | def Below(*args, **kwargs): | |
15afbcd0 | 13930 | """ |
a95a7133 | 13931 | Below(self, Window sibling, int marg=0) |
15afbcd0 | 13932 | |
41e2b43e RD |
13933 | Constrains this edge to be below the given window, with an optional |
13934 | margin. Implicitly, this is relative to the bottom edge of the other | |
13935 | window. | |
15afbcd0 | 13936 | """ |
54f9ee45 | 13937 | return _core_.IndividualLayoutConstraint_Below(*args, **kwargs) |
e811c8ce RD |
13938 | |
13939 | def SameAs(*args, **kwargs): | |
15afbcd0 | 13940 | """ |
a95a7133 | 13941 | SameAs(self, Window otherW, int edge, int marg=0) |
15afbcd0 | 13942 | |
41e2b43e RD |
13943 | Constrains this edge or dimension to be to the same as the edge of the |
13944 | given window, with an optional margin. | |
15afbcd0 | 13945 | """ |
54f9ee45 | 13946 | return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs) |
e811c8ce RD |
13947 | |
13948 | def PercentOf(*args, **kwargs): | |
15afbcd0 | 13949 | """ |
a95a7133 | 13950 | PercentOf(self, Window otherW, int wh, int per) |
15afbcd0 | 13951 | |
41e2b43e RD |
13952 | Constrains this edge or dimension to be to a percentage of the given |
13953 | window, with an optional margin. | |
15afbcd0 | 13954 | """ |
54f9ee45 | 13955 | return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs) |
e811c8ce RD |
13956 | |
13957 | def Absolute(*args, **kwargs): | |
15afbcd0 | 13958 | """ |
a95a7133 | 13959 | Absolute(self, int val) |
15afbcd0 | 13960 | |
41e2b43e | 13961 | Constrains this edge or dimension to be the given absolute value. |
15afbcd0 | 13962 | """ |
54f9ee45 | 13963 | return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs) |
e811c8ce RD |
13964 | |
13965 | def Unconstrained(*args, **kwargs): | |
15afbcd0 | 13966 | """ |
a95a7133 | 13967 | Unconstrained(self) |
15afbcd0 | 13968 | |
41e2b43e RD |
13969 | Sets this edge or dimension to be unconstrained, that is, dependent on |
13970 | other edges and dimensions from which this value can be deduced. | |
15afbcd0 | 13971 | """ |
54f9ee45 | 13972 | return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs) |
e811c8ce RD |
13973 | |
13974 | def AsIs(*args, **kwargs): | |
15afbcd0 | 13975 | """ |
a95a7133 | 13976 | AsIs(self) |
15afbcd0 | 13977 | |
41e2b43e RD |
13978 | Sets this edge or constraint to be whatever the window's value is at |
13979 | the moment. If either of the width and height constraints are *as is*, | |
13980 | the window will not be resized, but moved instead. This is important | |
13981 | when considering panel items which are intended to have a default | |
13982 | size, such as a button, which may take its size from the size of the | |
13983 | button label. | |
15afbcd0 | 13984 | """ |
54f9ee45 | 13985 | return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs) |
e811c8ce RD |
13986 | |
13987 | def GetOtherWindow(*args, **kwargs): | |
a95a7133 | 13988 | """GetOtherWindow(self) -> Window""" |
54f9ee45 | 13989 | return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs) |
e811c8ce RD |
13990 | |
13991 | def GetMyEdge(*args, **kwargs): | |
a95a7133 | 13992 | """GetMyEdge(self) -> int""" |
54f9ee45 | 13993 | return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs) |
e811c8ce RD |
13994 | |
13995 | def SetEdge(*args, **kwargs): | |
a95a7133 | 13996 | """SetEdge(self, int which)""" |
54f9ee45 | 13997 | return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs) |
e811c8ce RD |
13998 | |
13999 | def SetValue(*args, **kwargs): | |
a95a7133 | 14000 | """SetValue(self, int v)""" |
54f9ee45 | 14001 | return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs) |
e811c8ce RD |
14002 | |
14003 | def GetMargin(*args, **kwargs): | |
a95a7133 | 14004 | """GetMargin(self) -> int""" |
54f9ee45 | 14005 | return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs) |
e811c8ce RD |
14006 | |
14007 | def SetMargin(*args, **kwargs): | |
a95a7133 | 14008 | """SetMargin(self, int m)""" |
54f9ee45 | 14009 | return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs) |
e811c8ce RD |
14010 | |
14011 | def GetValue(*args, **kwargs): | |
a95a7133 | 14012 | """GetValue(self) -> int""" |
54f9ee45 | 14013 | return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs) |
e811c8ce RD |
14014 | |
14015 | def GetPercent(*args, **kwargs): | |
a95a7133 | 14016 | """GetPercent(self) -> int""" |
54f9ee45 | 14017 | return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs) |
e811c8ce RD |
14018 | |
14019 | def GetOtherEdge(*args, **kwargs): | |
a95a7133 | 14020 | """GetOtherEdge(self) -> int""" |
54f9ee45 | 14021 | return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs) |
e811c8ce RD |
14022 | |
14023 | def GetDone(*args, **kwargs): | |
a95a7133 | 14024 | """GetDone(self) -> bool""" |
54f9ee45 | 14025 | return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs) |
e811c8ce RD |
14026 | |
14027 | def SetDone(*args, **kwargs): | |
a95a7133 | 14028 | """SetDone(self, bool d)""" |
54f9ee45 | 14029 | return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs) |
e811c8ce RD |
14030 | |
14031 | def GetRelationship(*args, **kwargs): | |
a95a7133 | 14032 | """GetRelationship(self) -> int""" |
54f9ee45 | 14033 | return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs) |
e811c8ce RD |
14034 | |
14035 | def SetRelationship(*args, **kwargs): | |
a95a7133 | 14036 | """SetRelationship(self, int r)""" |
54f9ee45 | 14037 | return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs) |
e811c8ce RD |
14038 | |
14039 | def ResetIfWin(*args, **kwargs): | |
15afbcd0 | 14040 | """ |
a95a7133 | 14041 | ResetIfWin(self, Window otherW) -> bool |
15afbcd0 RD |
14042 | |
14043 | Reset constraint if it mentions otherWin | |
14044 | """ | |
54f9ee45 | 14045 | return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs) |
e811c8ce RD |
14046 | |
14047 | def SatisfyConstraint(*args, **kwargs): | |
15afbcd0 | 14048 | """ |
a95a7133 | 14049 | SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool |
15afbcd0 RD |
14050 | |
14051 | Try to satisfy constraint | |
14052 | """ | |
54f9ee45 | 14053 | return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs) |
e811c8ce RD |
14054 | |
14055 | def GetEdge(*args, **kwargs): | |
15afbcd0 | 14056 | """ |
a95a7133 | 14057 | GetEdge(self, int which, Window thisWin, Window other) -> int |
15afbcd0 RD |
14058 | |
14059 | Get the value of this edge or dimension, or if this | |
14060 | is not determinable, -1. | |
14061 | """ | |
54f9ee45 | 14062 | return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs) |
e811c8ce | 14063 | |
97ab0f6a RD |
14064 | Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`") |
14065 | Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`") | |
14066 | MyEdge = property(GetMyEdge,doc="See `GetMyEdge`") | |
14067 | OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`") | |
14068 | OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`") | |
14069 | Percent = property(GetPercent,doc="See `GetPercent`") | |
14070 | Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`") | |
14071 | Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`") | |
2131d850 | 14072 | _core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint) |
d14a1e28 RD |
14073 | |
14074 | class LayoutConstraints(Object): | |
15afbcd0 | 14075 | """ |
41e2b43e RD |
14076 | **Note:** constraints are now deprecated and you should use sizers |
14077 | instead. | |
15afbcd0 | 14078 | |
41e2b43e RD |
14079 | Objects of this class can be associated with a window to define its |
14080 | layout constraints, with respect to siblings or its parent. | |
15afbcd0 RD |
14081 | |
14082 | The class consists of the following eight constraints of class | |
14083 | wx.IndividualLayoutConstraint, some or all of which should be accessed | |
14084 | directly to set the appropriate constraints. | |
14085 | ||
14086 | * left: represents the left hand edge of the window | |
14087 | * right: represents the right hand edge of the window | |
14088 | * top: represents the top edge of the window | |
14089 | * bottom: represents the bottom edge of the window | |
14090 | * width: represents the width of the window | |
14091 | * height: represents the height of the window | |
14092 | * centreX: represents the horizontal centre point of the window | |
14093 | * centreY: represents the vertical centre point of the window | |
14094 | ||
41e2b43e RD |
14095 | Most constraints are initially set to have the relationship |
14096 | wxUnconstrained, which means that their values should be calculated by | |
14097 | looking at known constraints. The exceptions are width and height, | |
14098 | which are set to wxAsIs to ensure that if the user does not specify a | |
14099 | constraint, the existing width and height will be used, to be | |
14100 | compatible with panel items which often have take a default size. If | |
14101 | the constraint is ``wx.AsIs``, the dimension will not be changed. | |
14102 | ||
14103 | :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints` | |
15afbcd0 RD |
14104 | |
14105 | """ | |
0085ce49 RD |
14106 | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') |
14107 | __repr__ = _swig_repr | |
54f9ee45 RD |
14108 | left = property(_core_.LayoutConstraints_left_get) |
14109 | top = property(_core_.LayoutConstraints_top_get) | |
14110 | right = property(_core_.LayoutConstraints_right_get) | |
14111 | bottom = property(_core_.LayoutConstraints_bottom_get) | |
14112 | width = property(_core_.LayoutConstraints_width_get) | |
14113 | height = property(_core_.LayoutConstraints_height_get) | |
14114 | centreX = property(_core_.LayoutConstraints_centreX_get) | |
14115 | centreY = property(_core_.LayoutConstraints_centreY_get) | |
0085ce49 | 14116 | def __init__(self, *args, **kwargs): |
a95a7133 | 14117 | """__init__(self) -> LayoutConstraints""" |
0085ce49 RD |
14118 | _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs)) |
14119 | __swig_destroy__ = _core_.delete_LayoutConstraints | |
14120 | __del__ = lambda self : None; | |
e811c8ce | 14121 | def SatisfyConstraints(*args, **kwargs): |
6c3b4aae | 14122 | """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)""" |
54f9ee45 | 14123 | return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs) |
e811c8ce RD |
14124 | |
14125 | def AreSatisfied(*args, **kwargs): | |
a95a7133 | 14126 | """AreSatisfied(self) -> bool""" |
54f9ee45 | 14127 | return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs) |
e811c8ce | 14128 | |
2131d850 | 14129 | _core_.LayoutConstraints_swigregister(LayoutConstraints) |
d14a1e28 RD |
14130 | |
14131 | #---------------------------------------------------------------------------- | |
14132 | ||
322913ce | 14133 | # Use Python's bool constants if available, make some if not |
d14a1e28 RD |
14134 | try: |
14135 | True | |
14136 | except NameError: | |
322913ce RD |
14137 | __builtins__.True = 1==1 |
14138 | __builtins__.False = 1==0 | |
4f89f6a3 RD |
14139 | def bool(value): return not not value |
14140 | __builtins__.bool = bool | |
d14a1e28 | 14141 | |
d14a1e28 RD |
14142 | |
14143 | ||
14144 | # workarounds for bad wxRTTI names | |
14145 | __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' | |
14146 | __wxPyPtrTypeMap['wxSlider95'] = 'wxSlider' | |
14147 | __wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar' | |
14148 | ||
14149 | ||
14150 | #---------------------------------------------------------------------------- | |
14151 | # Load version numbers from __version__... Ensure that major and minor | |
7bc1e663 | 14152 | # versions are the same for both wxPython and wxWidgets. |
d14a1e28 RD |
14153 | |
14154 | from __version__ import * | |
14155 | __version__ = VERSION_STRING | |
14156 | ||
7bc1e663 RD |
14157 | assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch" |
14158 | assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch" | |
54f9ee45 | 14159 | if RELEASE_VERSION != _core_.RELEASE_VERSION: |
d14a1e28 | 14160 | import warnings |
7bc1e663 | 14161 | warnings.warn("wxPython/wxWidgets release number mismatch") |
d14a1e28 | 14162 | |
f9bf356b RD |
14163 | |
14164 | def version(): | |
14165 | """Returns a string containing version and port info""" | |
14166 | ctype = wx.USE_UNICODE and 'unicode' or 'ansi' | |
14167 | if wx.Platform == '__WXMSW__': | |
14168 | port = 'msw' | |
14169 | elif wx.Platform == '__WXMAC__': | |
14170 | port = 'mac' | |
14171 | elif wx.Platform == '__WXGTK__': | |
14172 | port = 'gtk' | |
14173 | if 'gtk2' in wx.PlatformInfo: | |
14174 | port = 'gtk2' | |
14175 | else: | |
14176 | port = '?' | |
14177 | ||
14178 | return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype) | |
14179 | ||
14180 | ||
d14a1e28 RD |
14181 | #---------------------------------------------------------------------------- |
14182 | ||
70b7a5fe RD |
14183 | # Set wxPython's default string<-->unicode conversion encoding from |
14184 | # the locale, but only if Python's default hasn't been changed. (We | |
14185 | # assume that if the user has customized it already then that is the | |
14186 | # encoding we need to use as well.) | |
14187 | # | |
14188 | # The encoding selected here is used when string or unicode objects | |
14189 | # need to be converted in order to pass them to wxWidgets. Please be | |
14190 | # aware that the default encoding within the same locale may be | |
14191 | # slightly different on different platforms. For example, please see | |
e505d15e RD |
14192 | # http://www.alanwood.net/demos/charsetdiffs.html for differences |
14193 | # between the common latin/roman encodings. | |
396fb509 RD |
14194 | |
14195 | default = _sys.getdefaultencoding() | |
14196 | if default == 'ascii': | |
14197 | import locale | |
14198 | import codecs | |
14199 | try: | |
474e2ff2 RD |
14200 | if hasattr(locale, 'getpreferredencoding'): |
14201 | default = locale.getpreferredencoding() | |
14202 | else: | |
14203 | default = locale.getdefaultlocale()[1] | |
396fb509 | 14204 | codecs.lookup(default) |
70b7a5fe | 14205 | except (ValueError, LookupError, TypeError): |
396fb509 RD |
14206 | default = _sys.getdefaultencoding() |
14207 | del locale | |
14208 | del codecs | |
5cbf236d RD |
14209 | if default: |
14210 | wx.SetDefaultPyEncoding(default) | |
14211 | del default | |
5cbf236d RD |
14212 | |
14213 | #---------------------------------------------------------------------------- | |
14214 | ||
d14a1e28 RD |
14215 | class PyDeadObjectError(AttributeError): |
14216 | pass | |
14217 | ||
d14a1e28 RD |
14218 | class _wxPyDeadObject(object): |
14219 | """ | |
14220 | Instances of wx objects that are OOR capable will have their __class__ | |
14221 | changed to this class when the C++ object is deleted. This should help | |
14222 | prevent crashes due to referencing a bogus C++ pointer. | |
14223 | """ | |
14224 | reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" | |
14225 | attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." | |
14226 | ||
3a04f143 | 14227 | def __repr__(self): |
d14a1e28 RD |
14228 | if not hasattr(self, "_name"): |
14229 | self._name = "[unknown]" | |
14230 | return self.reprStr % self._name | |
14231 | ||
3a04f143 | 14232 | def __getattr__(self, *args): |
d14a1e28 RD |
14233 | if not hasattr(self, "_name"): |
14234 | self._name = "[unknown]" | |
3a04f143 RD |
14235 | raise PyDeadObjectError(self.attrStr % self._name) |
14236 | ||
14237 | def __nonzero__(self): | |
14238 | return 0 | |
14239 | ||
14240 | ||
14241 | ||
14242 | class PyUnbornObjectError(AttributeError): | |
14243 | pass | |
14244 | ||
14245 | class _wxPyUnbornObject(object): | |
14246 | """ | |
54f9ee45 | 14247 | Some stock objects are created when the wx._core module is |
3a04f143 RD |
14248 | imported, but their C++ instance is not created until the wx.App |
14249 | object is created and initialized. These object instances will | |
14250 | temporarily have their __class__ changed to this class so an | |
14251 | exception will be raised if they are used before the C++ instance | |
14252 | is ready. | |
14253 | """ | |
14254 | ||
14255 | reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)" | |
14256 | attrStr = "The C++ part of this object has not been initialized, attribute access not allowed." | |
14257 | ||
14258 | def __repr__(self): | |
14259 | #if not hasattr(self, "_name"): | |
14260 | # self._name = "[unknown]" | |
14261 | return self.reprStr #% self._name | |
14262 | ||
14263 | def __getattr__(self, *args): | |
14264 | #if not hasattr(self, "_name"): | |
14265 | # self._name = "[unknown]" | |
14266 | raise PyUnbornObjectError(self.attrStr) # % self._name ) | |
d14a1e28 RD |
14267 | |
14268 | def __nonzero__(self): | |
14269 | return 0 | |
14270 | ||
14271 | ||
14272 | #---------------------------------------------------------------------------- | |
d14a1e28 RD |
14273 | |
14274 | def CallAfter(callable, *args, **kw): | |
14275 | """ | |
14276 | Call the specified function after the current and pending event | |
14277 | handlers have been completed. This is also good for making GUI | |
61863841 RD |
14278 | method calls from non-GUI threads. Any extra positional or |
14279 | keyword args are passed on to the callable when it is called. | |
14280 | ||
846c181b | 14281 | :see: `wx.CallLater` |
d14a1e28 RD |
14282 | """ |
14283 | app = wx.GetApp() | |
dfbb5885 | 14284 | assert app is not None, 'No wx.App created yet' |
d14a1e28 | 14285 | |
148275d3 RD |
14286 | if not hasattr(app, "_CallAfterId"): |
14287 | app._CallAfterId = wx.NewEventType() | |
14288 | app.Connect(-1, -1, app._CallAfterId, | |
14289 | lambda event: event.callable(*event.args, **event.kw) ) | |
d14a1e28 | 14290 | evt = wx.PyEvent() |
148275d3 | 14291 | evt.SetEventType(app._CallAfterId) |
d14a1e28 RD |
14292 | evt.callable = callable |
14293 | evt.args = args | |
14294 | evt.kw = kw | |
14295 | wx.PostEvent(app, evt) | |
14296 | ||
d14a1e28 RD |
14297 | #---------------------------------------------------------------------------- |
14298 | ||
14299 | ||
846c181b | 14300 | class CallLater: |
d14a1e28 | 14301 | """ |
8ac8dba0 | 14302 | A convenience class for `wx.Timer`, that calls the given callable |
d14a1e28 RD |
14303 | object once after the given amount of milliseconds, passing any |
14304 | positional or keyword args. The return value of the callable is | |
61863841 | 14305 | availbale after it has been run with the `GetResult` method. |
d14a1e28 RD |
14306 | |
14307 | If you don't need to get the return value or restart the timer | |
14308 | then there is no need to hold a reference to this object. It will | |
14309 | hold a reference to itself while the timer is running (the timer | |
14310 | has a reference to self.Notify) but the cycle will be broken when | |
846c181b | 14311 | the timer completes, automatically cleaning up the wx.CallLater |
d14a1e28 | 14312 | object. |
61863841 RD |
14313 | |
14314 | :see: `wx.CallAfter` | |
d14a1e28 RD |
14315 | """ |
14316 | def __init__(self, millis, callable, *args, **kwargs): | |
14317 | self.millis = millis | |
14318 | self.callable = callable | |
14319 | self.SetArgs(*args, **kwargs) | |
14320 | self.runCount = 0 | |
4276dc52 | 14321 | self.running = False |
d14a1e28 RD |
14322 | self.hasRun = False |
14323 | self.result = None | |
14324 | self.timer = None | |
14325 | self.Start() | |
14326 | ||
14327 | def __del__(self): | |
14328 | self.Stop() | |
14329 | ||
14330 | ||
14331 | def Start(self, millis=None, *args, **kwargs): | |
14332 | """ | |
14333 | (Re)start the timer | |
14334 | """ | |
14335 | self.hasRun = False | |
14336 | if millis is not None: | |
14337 | self.millis = millis | |
14338 | if args or kwargs: | |
14339 | self.SetArgs(*args, **kwargs) | |
14340 | self.Stop() | |
14341 | self.timer = wx.PyTimer(self.Notify) | |
14342 | self.timer.Start(self.millis, wx.TIMER_ONE_SHOT) | |
4276dc52 | 14343 | self.running = True |
d14a1e28 RD |
14344 | Restart = Start |
14345 | ||
14346 | ||
14347 | def Stop(self): | |
14348 | """ | |
14349 | Stop and destroy the timer. | |
14350 | """ | |
14351 | if self.timer is not None: | |
14352 | self.timer.Stop() | |
14353 | self.timer = None | |
14354 | ||
14355 | ||
14356 | def GetInterval(self): | |
14357 | if self.timer is not None: | |
14358 | return self.timer.GetInterval() | |
14359 | else: | |
14360 | return 0 | |
14361 | ||
14362 | ||
14363 | def IsRunning(self): | |
14364 | return self.timer is not None and self.timer.IsRunning() | |
14365 | ||
14366 | ||
14367 | def SetArgs(self, *args, **kwargs): | |
14368 | """ | |
14369 | (Re)set the args passed to the callable object. This is | |
14370 | useful in conjunction with Restart if you want to schedule a | |
14371 | new call to the same callable object but with different | |
14372 | parameters. | |
14373 | """ | |
14374 | self.args = args | |
14375 | self.kwargs = kwargs | |
14376 | ||
14377 | ||
14378 | def HasRun(self): | |
14379 | return self.hasRun | |
14380 | ||
14381 | def GetResult(self): | |
14382 | return self.result | |
14383 | ||
14384 | def Notify(self): | |
14385 | """ | |
14386 | The timer has expired so call the callable. | |
14387 | """ | |
14388 | if self.callable and getattr(self.callable, 'im_self', True): | |
14389 | self.runCount += 1 | |
4276dc52 | 14390 | self.running = False |
d14a1e28 RD |
14391 | self.result = self.callable(*self.args, **self.kwargs) |
14392 | self.hasRun = True | |
4276dc52 RD |
14393 | if not self.running: |
14394 | # if it wasn't restarted, then cleanup | |
14395 | wx.CallAfter(self.Stop) | |
d14a1e28 | 14396 | |
97ab0f6a RD |
14397 | Interval = property(GetInterval) |
14398 | Result = property(GetResult) | |
d14a1e28 | 14399 | |
a95a7133 | 14400 | |
846c181b | 14401 | class FutureCall(CallLater): |
b39fe951 | 14402 | """A compatibility alias for `CallLater`.""" |
846c181b | 14403 | |
a95a7133 RD |
14404 | #---------------------------------------------------------------------------- |
14405 | # Control which items in this module should be documented by epydoc. | |
14406 | # We allow only classes and functions, which will help reduce the size | |
14407 | # of the docs by filtering out the zillions of constants, EVT objects, | |
14408 | # and etc that don't make much sense by themselves, but are instead | |
14409 | # documented (or will be) as part of the classes/functions/methods | |
14410 | # where they should be used. | |
14411 | ||
66c033b4 RD |
14412 | class __DocFilter: |
14413 | """ | |
14414 | A filter for epydoc that only allows non-Ptr classes and | |
34e0a3bb | 14415 | functions, in order to reduce the clutter in the API docs. |
66c033b4 RD |
14416 | """ |
14417 | def __init__(self, globals): | |
14418 | self._globals = globals | |
14419 | ||
14420 | def __call__(self, name): | |
14421 | import types | |
14422 | obj = self._globals.get(name, None) | |
34e0a3bb RD |
14423 | |
14424 | # only document classes and function | |
66c033b4 RD |
14425 | if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]: |
14426 | return False | |
34e0a3bb RD |
14427 | |
14428 | # skip other things that are private or will be documented as part of somethign else | |
0085ce49 | 14429 | if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') : |
66c033b4 | 14430 | return False |
34e0a3bb RD |
14431 | |
14432 | # skip functions that are duplicates of static functions in a class | |
14433 | if name.find('_') != -1: | |
14434 | cls = self._globals.get(name.split('_')[0], None) | |
14435 | methname = name.split('_')[1] | |
14436 | if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType: | |
14437 | return False | |
14438 | ||
66c033b4 | 14439 | return True |
a95a7133 | 14440 | |
d14a1e28 RD |
14441 | #---------------------------------------------------------------------------- |
14442 | #---------------------------------------------------------------------------- | |
14443 | ||
14444 | # Import other modules in this package that should show up in the | |
14445 | # "core" wx namespace | |
54f9ee45 RD |
14446 | from _gdi import * |
14447 | from _windows import * | |
14448 | from _controls import * | |
14449 | from _misc import * | |
d14a1e28 RD |
14450 | |
14451 | #---------------------------------------------------------------------------- | |
14452 | #---------------------------------------------------------------------------- | |
14453 | ||
14454 | ||
32fe5131 | 14455 |